From 1bc6d49273746760e9ae1d075ea56abaf489a168 Mon Sep 17 00:00:00 2001 From: Owl Bot Date: Wed, 25 Sep 2024 13:00:22 +0000 Subject: [PATCH 1/2] feat: created new boolean fields in conversation dataset for zone isolation and zone separation compliance status feat: add ALAW encoding value to Audio encoding enum PiperOrigin-RevId: 678636701 Source-Link: https://github.com/googleapis/googleapis/commit/0ede901c455762b9d55ea3cf386f50663d0650ba Source-Link: https://github.com/googleapis/googleapis-gen/commit/39c42782febc92124134995b2e7d78be762bcc22 Copy-Tag: eyJwIjoiRGlhbG9nZmxvdy8uT3dsQm90LnlhbWwiLCJoIjoiMzljNDI3ODJmZWJjOTIxMjQxMzQ5OTViMmU3ZDc4YmU3NjJiY2MyMiJ9 --- .../Google/Cloud/Dialogflow/V2/Agent.php | Bin 0 -> 5894 bytes .../Cloud/Dialogflow/V2/AnswerRecord.php | Bin 0 -> 5068 bytes .../Cloud/Dialogflow/V2/AudioConfig.php | Bin 0 -> 3946 bytes .../Google/Cloud/Dialogflow/V2/Context.php | 70 + .../Cloud/Dialogflow/V2/Conversation.php | Bin 0 -> 9333 bytes .../Dialogflow/V2/ConversationDataset.php | Bin 0 -> 5294 bytes .../Cloud/Dialogflow/V2/ConversationEvent.php | Bin 0 -> 1358 bytes .../Cloud/Dialogflow/V2/ConversationModel.php | Bin 0 -> 9285 bytes .../Dialogflow/V2/ConversationProfile.php | Bin 0 -> 12254 bytes .../Google/Cloud/Dialogflow/V2/Document.php | Bin 0 -> 7758 bytes .../Cloud/Dialogflow/V2/EncryptionSpec.php | 48 + .../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 + .../Google/Cloud/Dialogflow/V2/Generator.php | Bin 0 -> 5854 bytes .../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 -> 14108 bytes .../Google/Cloud/Dialogflow/V2/Session.php | Bin 0 -> 7761 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 | 331 +++ .../AnswerRelevance.php | 64 + .../DocumentCorrectness.php | 64 + .../DocumentEfficiency.php | 64 + .../KnowledgeAssistFeedback.php | 132 ++ .../KnowledgeSearchFeedback.php | 132 ++ .../SummarizationFeedback.php | 192 ++ .../Dialogflow/V2/AgentAssistantRecord.php | 141 ++ .../Dialogflow/V2/AnalyzeContentRequest.php | 470 +++++ .../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 | 125 ++ .../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 | 750 +++++++ .../V2/CompleteConversationRequest.php | 92 + .../Google/Cloud/Dialogflow/V2/Context.php | 261 +++ .../Cloud/Dialogflow/V2/Conversation.php | 380 ++++ .../V2/Conversation/ConversationStage.php | 69 + .../V2/Conversation/LifecycleState.php | 64 + .../Dialogflow/V2/ConversationContext.php | 67 + .../Dialogflow/V2/ConversationDataset.php | 412 ++++ .../Cloud/Dialogflow/V2/ConversationEvent.php | 200 ++ .../Dialogflow/V2/ConversationEvent/Type.php | 96 + .../Cloud/Dialogflow/V2/ConversationInfo.php | 75 + .../Cloud/Dialogflow/V2/ConversationModel.php | 442 ++++ .../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/CreateGeneratorRequest.php | 209 ++ .../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/DeleteGeneratorRequest.php | 86 + .../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 +++ .../Dialogflow/V2/DialogflowAssistAnswer.php | 150 ++ .../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 + .../Cloud/Dialogflow/V2/EncryptionSpec.php | 126 ++ .../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 | 221 ++ .../Dialogflow/V2/ExportAgentRequest.php | 153 ++ .../Dialogflow/V2/ExportAgentResponse.php | 112 + .../Dialogflow/V2/ExportDocumentRequest.php | 194 ++ .../Dialogflow/V2/ExportOperationMetadata.php | 77 + .../Google/Cloud/Dialogflow/V2/FaqAnswer.php | 269 +++ .../Cloud/Dialogflow/V2/FewShotExample.php | 207 ++ .../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/GenerateStatelessSuggestionRequest.php | 235 +++ .../GenerateStatelessSuggestionResponse.php | 78 + .../V2/GenerateStatelessSummaryRequest.php | 222 ++ .../MinimalConversation.php | 125 ++ .../V2/GenerateStatelessSummaryResponse.php | 166 ++ .../Summary.php | 150 ++ .../Google/Cloud/Dialogflow/V2/Generator.php | 317 +++ .../Dialogflow/V2/GeneratorSuggestion.php | 75 + .../Cloud/Dialogflow/V2/GetAgentRequest.php | 87 + .../Cloud/Dialogflow/V2/GetContextRequest.php | 107 + .../V2/GetConversationDatasetRequest.php | 92 + .../GetConversationModelEvaluationRequest.php | 91 + .../V2/GetConversationModelRequest.php | 86 + .../V2/GetConversationProfileRequest.php | 92 + .../Dialogflow/V2/GetConversationRequest.php | 92 + .../Dialogflow/V2/GetDocumentRequest.php | 92 + .../V2/GetEncryptionSpecRequest.php | 81 + .../Dialogflow/V2/GetEntityTypeRequest.php | 158 ++ .../V2/GetEnvironmentHistoryRequest.php | 160 ++ .../Dialogflow/V2/GetEnvironmentRequest.php | 88 + .../Dialogflow/V2/GetFulfillmentRequest.php | 87 + .../Dialogflow/V2/GetGeneratorRequest.php | 86 + .../Cloud/Dialogflow/V2/GetIntentRequest.php | 192 ++ .../Dialogflow/V2/GetKnowledgeBaseRequest.php | 92 + .../Dialogflow/V2/GetParticipantRequest.php | 92 + .../V2/GetSessionEntityTypeRequest.php | 112 + .../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 | 236 +++ .../SuggestionFeatureConfig.php | 466 +++++ .../SuggestionQueryConfig.php | 374 ++++ .../ContextFilterSettings.php | 143 ++ .../DialogflowQuerySource.php | 127 ++ .../HumanAgentSideConfig.php | 79 + .../DocumentQuerySource.php | 83 + .../KnowledgeBaseQuerySource.php | 83 + .../SuggestionQueryConfig/Sections.php | 85 + .../Sections/SectionType.php | 103 + .../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 + .../Dialogflow/V2/InferenceParameter.php | 277 +++ .../V2/InitializeEncryptionSpecMetadata.php | 77 + .../V2/InitializeEncryptionSpecRequest.php | 105 + .../V2/InitializeEncryptionSpecResponse.php | 33 + .../Cloud/Dialogflow/V2/InputAudioConfig.php | 614 ++++++ .../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 + .../Cloud/Dialogflow/V2/IntentSuggestion.php | 153 ++ .../Google/Cloud/Dialogflow/V2/IntentView.php | 56 + .../Dialogflow/V2/KnowledgeAssistAnswer.php | 171 ++ .../KnowledgeAssistAnswer/KnowledgeAnswer.php | 146 ++ .../KnowledgeAnswer/FaqSource.php | 70 + .../KnowledgeAnswer/GenerativeSource.php | 74 + .../GenerativeSource/Snippet.php | 138 ++ .../KnowledgeAssistAnswer/SuggestedQuery.php | 70 + .../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 | 213 ++ .../V2/ListConversationsResponse.php | 110 + .../Dialogflow/V2/ListDocumentsRequest.php | 254 +++ .../Dialogflow/V2/ListDocumentsResponse.php | 106 + .../Dialogflow/V2/ListEntityTypesRequest.php | 230 +++ .../Dialogflow/V2/ListEntityTypesResponse.php | 110 + .../Dialogflow/V2/ListEnvironmentsRequest.php | 170 ++ .../V2/ListEnvironmentsResponse.php | 110 + .../Dialogflow/V2/ListGeneratorsRequest.php | 158 ++ .../Dialogflow/V2/ListGeneratorsResponse.php | 105 + .../Dialogflow/V2/ListIntentsRequest.php | 308 +++ .../Dialogflow/V2/ListIntentsResponse.php | 110 + .../V2/ListKnowledgeBasesRequest.php | 265 +++ .../V2/ListKnowledgeBasesResponse.php | 106 + .../Dialogflow/V2/ListMessagesRequest.php | 222 ++ .../Dialogflow/V2/ListMessagesResponse.php | 114 ++ .../Dialogflow/V2/ListParticipantsRequest.php | 164 ++ .../V2/ListParticipantsResponse.php | 110 + .../V2/ListSessionEntityTypesRequest.php | 179 ++ .../V2/ListSessionEntityTypesResponse.php | 110 + .../Dialogflow/V2/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 + .../Cloud/Dialogflow/V2/MessageEntry.php | 187 ++ .../Cloud/Dialogflow/V2/MessageEntry/Role.php | 72 + .../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 | 93 + .../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 | 461 +++++ .../Cloud/Dialogflow/V2/QueryResult.php | 847 ++++++++ .../Dialogflow/V2/ReloadDocumentRequest.php | 225 ++ .../Dialogflow/V2/RestoreAgentRequest.php | 165 ++ .../Dialogflow/V2/SearchAgentsRequest.php | 159 ++ .../Dialogflow/V2/SearchAgentsResponse.php | 110 + .../Dialogflow/V2/SearchKnowledgeAnswer.php | 181 ++ .../V2/SearchKnowledgeAnswer/AnswerSource.php | 138 ++ .../V2/SearchKnowledgeAnswer/AnswerType.php | 71 + .../Dialogflow/V2/SearchKnowledgeRequest.php | 308 +++ .../Dialogflow/V2/SearchKnowledgeResponse.php | 106 + .../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 | 432 ++++ .../Cloud/Dialogflow/V2/SpeechWordInfo.php | 225 ++ .../Cloud/Dialogflow/V2/SsmlVoiceGender.php | 70 + .../V2/StreamingAnalyzeContentRequest.php | 693 +++++++ .../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 | 232 +++ .../V2/SuggestConversationSummaryResponse.php | 170 ++ .../Summary.php | 188 ++ .../V2/SuggestFaqAnswersRequest.php | 224 ++ .../V2/SuggestFaqAnswersResponse.php | 168 ++ .../V2/SuggestKnowledgeAssistRequest.php | 214 ++ .../V2/SuggestKnowledgeAssistResponse.php | 170 ++ .../V2/SuggestSmartRepliesRequest.php | 232 +++ .../V2/SuggestSmartRepliesResponse.php | 176 ++ .../Cloud/Dialogflow/V2/SuggestionFeature.php | 69 + .../Dialogflow/V2/SuggestionFeature/Type.php | 85 + .../Cloud/Dialogflow/V2/SuggestionInput.php | 87 + .../Cloud/Dialogflow/V2/SuggestionResult.php | 213 ++ .../Dialogflow/V2/SummarizationContext.php | 185 ++ .../Dialogflow/V2/SummarizationSection.php | 139 ++ .../V2/SummarizationSection/Type.php | 109 + .../V2/SummarizationSectionList.php | 67 + .../Cloud/Dialogflow/V2/SummarySuggestion.php | 67 + .../V2/SummarySuggestion/SummarySection.php | 104 + .../Dialogflow/V2/SynthesizeSpeechConfig.php | 269 +++ .../Cloud/Dialogflow/V2/TelephonyDtmf.php | 160 ++ .../Dialogflow/V2/TelephonyDtmfEvents.php | 67 + .../Google/Cloud/Dialogflow/V2/TextInput.php | 118 ++ .../Dialogflow/V2/TextToSpeechSettings.php | 197 ++ .../Cloud/Dialogflow/V2/TrainAgentRequest.php | 87 + .../Cloud/Dialogflow/V2/TriggerEvent.php | 63 + ...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/UpdateGeneratorRequest.php | 141 ++ .../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 | 70 + .../samples/V2/AgentsClient/export_agent.php | 105 + .../v2/samples/V2/AgentsClient/get_agent.php | 72 + .../samples/V2/AgentsClient/get_location.php | 57 + .../V2/AgentsClient/get_validation_result.php | 73 + .../samples/V2/AgentsClient/import_agent.php | 107 + .../V2/AgentsClient/list_locations.php | 62 + .../samples/V2/AgentsClient/restore_agent.php | 105 + .../samples/V2/AgentsClient/search_agents.php | 83 + .../v2/samples/V2/AgentsClient/set_agent.php | 102 + .../samples/V2/AgentsClient/train_agent.php | 94 + .../V2/AnswerRecordsClient/get_location.php | 57 + .../list_answer_records.php | 79 + .../V2/AnswerRecordsClient/list_locations.php | 62 + .../update_answer_record.php | 65 + .../V2/ContextsClient/create_context.php | 99 + .../V2/ContextsClient/delete_all_contexts.php | 74 + .../V2/ContextsClient/delete_context.php | 74 + .../samples/V2/ContextsClient/get_context.php | 76 + .../V2/ContextsClient/get_location.php | 57 + .../V2/ContextsClient/list_contexts.php | 81 + .../V2/ContextsClient/list_locations.php | 62 + .../V2/ContextsClient/update_context.php | 88 + .../create_conversation_dataset.php | 99 + .../delete_conversation_dataset.php | 95 + .../get_conversation_dataset.php | 77 + .../get_location.php | 57 + .../import_conversation_data.php | 103 + .../list_conversation_datasets.php | 78 + .../list_locations.php | 62 + .../create_conversation_model.php | 112 + .../create_conversation_model_evaluation.php | 91 + .../delete_conversation_model.php | 89 + .../deploy_conversation_model.php | 92 + .../get_conversation_model.php | 71 + .../get_conversation_model_evaluation.php | 72 + .../ConversationModelsClient/get_location.php | 57 + .../list_conversation_model_evaluations.php | 76 + .../list_conversation_models.php | 76 + .../list_locations.php | 62 + .../undeploy_conversation_model.php | 92 + .../clear_suggestion_feature_config.php | 110 + .../create_conversation_profile.php | 84 + .../delete_conversation_profile.php | 74 + .../get_conversation_profile.php | 76 + .../get_location.php | 57 + .../list_conversation_profiles.php | 77 + .../list_locations.php | 62 + .../set_suggestion_feature_config.php | 111 + .../update_conversation_profile.php | 80 + .../complete_conversation.php | 74 + .../create_conversation.php | 106 + .../generate_stateless_suggestion.php | 73 + .../generate_stateless_summary.php | 99 + .../ConversationsClient/get_conversation.php | 73 + .../V2/ConversationsClient/get_location.php | 57 + .../list_conversations.php | 77 + .../V2/ConversationsClient/list_locations.php | 62 + .../V2/ConversationsClient/list_messages.php | 82 + .../ConversationsClient/search_knowledge.php | 92 + .../suggest_conversation_summary.php | 75 + .../V2/DocumentsClient/create_document.php | 116 ++ .../V2/DocumentsClient/delete_document.php | 91 + .../V2/DocumentsClient/export_document.php | 94 + .../V2/DocumentsClient/get_document.php | 73 + .../V2/DocumentsClient/get_location.php | 57 + .../V2/DocumentsClient/import_documents.php | 114 ++ .../V2/DocumentsClient/list_documents.php | 78 + .../V2/DocumentsClient/list_locations.php | 62 + .../V2/DocumentsClient/reload_document.php | 99 + .../V2/DocumentsClient/update_document.php | 104 + .../get_encryption_spec.php | 71 + .../get_location.php | 57 + .../initialize_encryption_spec.php | 93 + .../list_locations.php | 62 + .../batch_create_entities.php | 125 ++ .../batch_delete_entities.php | 100 + .../batch_delete_entity_types.php | 101 + .../batch_update_entities.php | 128 ++ .../batch_update_entity_types.php | 97 + .../EntityTypesClient/create_entity_type.php | 88 + .../EntityTypesClient/delete_entity_type.php | 74 + .../V2/EntityTypesClient/get_entity_type.php | 72 + .../V2/EntityTypesClient/get_location.php | 57 + .../EntityTypesClient/list_entity_types.php | 77 + .../V2/EntityTypesClient/list_locations.php | 62 + .../EntityTypesClient/update_entity_type.php | 80 + .../EnvironmentsClient/create_environment.php | 80 + .../EnvironmentsClient/delete_environment.php | 76 + .../V2/EnvironmentsClient/get_environment.php | 78 + .../get_environment_history.php | 83 + .../V2/EnvironmentsClient/get_location.php | 57 + .../EnvironmentsClient/list_environments.php | 80 + .../V2/EnvironmentsClient/list_locations.php | 62 + .../EnvironmentsClient/update_environment.php | 73 + .../V2/FulfillmentsClient/get_fulfillment.php | 72 + .../V2/FulfillmentsClient/get_location.php | 57 + .../V2/FulfillmentsClient/list_locations.php | 62 + .../FulfillmentsClient/update_fulfillment.php | 81 + .../V2/GeneratorsClient/create_generator.php | 74 + .../V2/GeneratorsClient/delete_generator.php | 70 + .../V2/GeneratorsClient/get_generator.php | 72 + .../V2/GeneratorsClient/get_location.php | 57 + .../V2/GeneratorsClient/list_generators.php | 77 + .../V2/GeneratorsClient/list_locations.php | 62 + .../V2/GeneratorsClient/update_generator.php | 59 + .../V2/IntentsClient/batch_delete_intents.php | 101 + .../V2/IntentsClient/batch_update_intents.php | 97 + .../V2/IntentsClient/create_intent.php | 81 + .../V2/IntentsClient/delete_intent.php | 75 + .../samples/V2/IntentsClient/get_intent.php | 72 + .../samples/V2/IntentsClient/get_location.php | 57 + .../samples/V2/IntentsClient/list_intents.php | 85 + .../V2/IntentsClient/list_locations.php | 62 + .../V2/IntentsClient/update_intent.php | 76 + .../create_knowledge_base.php | 80 + .../delete_knowledge_base.php | 71 + .../get_knowledge_base.php | 73 + .../V2/KnowledgeBasesClient/get_location.php | 57 + .../list_knowledge_bases.php | 77 + .../KnowledgeBasesClient/list_locations.php | 62 + .../update_knowledge_base.php | 73 + .../V2/ParticipantsClient/analyze_content.php | 82 + .../ParticipantsClient/create_participant.php | 75 + .../V2/ParticipantsClient/get_location.php | 57 + .../V2/ParticipantsClient/get_participant.php | 77 + .../V2/ParticipantsClient/list_locations.php | 62 + .../ParticipantsClient/list_participants.php | 78 + .../streaming_analyze_content.php | 97 + .../ParticipantsClient/suggest_articles.php | 78 + .../suggest_faq_answers.php | 78 + .../suggest_knowledge_assist.php | 77 + .../suggest_smart_replies.php | 78 + .../ParticipantsClient/update_participant.php | 62 + .../create_session_entity_type.php | 141 ++ .../delete_session_entity_type.php | 83 + .../SessionEntityTypesClient/get_location.php | 57 + .../get_session_entity_type.php | 85 + .../list_locations.php | 62 + .../list_session_entity_types.php | 85 + .../update_session_entity_type.php | 127 ++ .../V2/SessionsClient/detect_intent.php | 104 + .../V2/SessionsClient/get_location.php | 57 + .../V2/SessionsClient/list_locations.php | 62 + .../streaming_detect_intent.php | 109 + .../V2/VersionsClient/create_version.php | 79 + .../V2/VersionsClient/delete_version.php | 74 + .../V2/VersionsClient/get_location.php | 57 + .../samples/V2/VersionsClient/get_version.php | 76 + .../V2/VersionsClient/list_locations.php | 62 + .../V2/VersionsClient/list_versions.php | 80 + .../V2/VersionsClient/update_version.php | 66 + .../Dialogflow/v2/src/V2/AgentsClient.php | 34 + .../v2/src/V2/AnswerRecordsClient.php | 34 + .../v2/src/V2/Client/AgentsClient.php | 705 +++++++ .../v2/src/V2/Client/AnswerRecordsClient.php | 718 +++++++ .../v2/src/V2/Client/ContextsClient.php | 630 ++++++ .../V2/Client/ConversationDatasetsClient.php | 505 +++++ .../V2/Client/ConversationModelsClient.php | 795 ++++++++ .../V2/Client/ConversationProfilesClient.php | 882 ++++++++ .../v2/src/V2/Client/ConversationsClient.php | 1013 +++++++++ .../v2/src/V2/Client/DocumentsClient.php | 689 +++++++ .../V2/Client/EncryptionSpecServiceClient.php | 365 ++++ .../v2/src/V2/Client/EntityTypesClient.php | 752 +++++++ .../v2/src/V2/Client/EnvironmentsClient.php | 639 ++++++ .../v2/src/V2/Client/FulfillmentsClient.php | 356 ++++ .../v2/src/V2/Client/GeneratorsClient.php | 428 ++++ .../v2/src/V2/Client/IntentsClient.php | 839 ++++++++ .../v2/src/V2/Client/KnowledgeBasesClient.php | 479 +++++ .../v2/src/V2/Client/ParticipantsClient.php | 1057 ++++++++++ .../V2/Client/SessionEntityTypesClient.php | 631 ++++++ .../v2/src/V2/Client/SessionsClient.php | 656 ++++++ .../v2/src/V2/Client/VersionsClient.php | 500 +++++ .../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/EncryptionSpecServiceClient.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 | 1167 +++++++++++ .../src/V2/Gapic/AnswerRecordsGapicClient.php | 1147 +++++++++++ .../v2/src/V2/Gapic/ContextsGapicClient.php | 983 +++++++++ .../Gapic/ConversationDatasetsGapicClient.php | 822 ++++++++ .../Gapic/ConversationModelsGapicClient.php | 1332 ++++++++++++ .../Gapic/ConversationProfilesGapicClient.php | 1426 +++++++++++++ .../src/V2/Gapic/ConversationsGapicClient.php | 1753 ++++++++++++++++ .../v2/src/V2/Gapic/DocumentsGapicClient.php | 1275 ++++++++++++ .../EncryptionSpecServiceGapicClient.php | 521 +++++ .../src/V2/Gapic/EntityTypesGapicClient.php | 1352 ++++++++++++ .../src/V2/Gapic/EnvironmentsGapicClient.php | 1060 ++++++++++ .../src/V2/Gapic/FulfillmentsGapicClient.php | 516 +++++ .../v2/src/V2/Gapic/GeneratorsGapicClient.php | 668 ++++++ .../v2/src/V2/Gapic/IntentsGapicClient.php | 1447 +++++++++++++ .../V2/Gapic/KnowledgeBasesGapicClient.php | 781 +++++++ .../src/V2/Gapic/ParticipantsGapicClient.php | 1809 +++++++++++++++++ .../Gapic/SessionEntityTypesGapicClient.php | 964 +++++++++ .../v2/src/V2/Gapic/SessionsGapicClient.php | 1051 ++++++++++ .../v2/src/V2/Gapic/VersionsGapicClient.php | 788 +++++++ .../Dialogflow/v2/src/V2/GeneratorsClient.php | 34 + .../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 | 940 +++++++++ .../V2/resources/agents_client_config.json | 89 + .../V2/resources/agents_descriptor_config.php | 214 ++ .../resources/agents_rest_client_config.php | 270 +++ .../answer_records_client_config.json | 54 + .../answer_records_descriptor_config.php | 118 ++ .../answer_records_rest_client_config.php | 149 ++ .../V2/resources/contexts_client_config.json | 74 + .../resources/contexts_descriptor_config.php | 155 ++ .../resources/contexts_rest_client_config.php | 265 +++ .../conversation_datasets_client_config.json | 69 + ...onversation_datasets_descriptor_config.php | 155 ++ ...nversation_datasets_rest_client_config.php | 182 ++ .../conversation_models_client_config.json | 89 + .../conversation_models_descriptor_config.php | 233 +++ ...conversation_models_rest_client_config.php | 260 +++ .../conversation_profiles_client_config.json | 79 + ...onversation_profiles_descriptor_config.php | 190 ++ ...nversation_profiles_rest_client_config.php | 240 +++ .../conversations_client_config.json | 89 + .../conversations_descriptor_config.php | 220 ++ .../conversations_rest_client_config.php | 280 +++ .../V2/resources/documents_client_config.json | 84 + .../resources/documents_descriptor_config.php | 217 ++ .../documents_rest_client_config.php | 280 +++ ...encryption_spec_service_client_config.json | 54 + ...ryption_spec_service_descriptor_config.php | 97 + ...yption_spec_service_rest_client_config.php | 130 ++ .../resources/entity_types_client_config.json | 94 + .../entity_types_descriptor_config.php | 234 +++ .../entity_types_rest_client_config.php | 291 +++ .../resources/environments_client_config.json | 74 + .../environments_descriptor_config.php | 165 ++ .../environments_rest_client_config.php | 225 ++ .../resources/fulfillments_client_config.json | 54 + .../fulfillments_descriptor_config.php | 92 + .../fulfillments_rest_client_config.php | 149 ++ .../resources/generators_client_config.json | 69 + .../generators_descriptor_config.php | 135 ++ .../generators_rest_client_config.php | 177 ++ .../V2/resources/intents_client_config.json | 79 + .../resources/intents_descriptor_config.php | 187 ++ .../resources/intents_rest_client_config.php | 242 +++ .../knowledge_bases_client_config.json | 69 + .../knowledge_bases_descriptor_config.php | 138 ++ .../knowledge_bases_rest_client_config.php | 218 ++ .../resources/participants_client_config.json | 114 ++ .../participants_descriptor_config.php | 212 ++ .../participants_rest_client_config.php | 280 +++ .../session_entity_types_client_config.json | 69 + ...session_entity_types_descriptor_config.php | 143 ++ ...ession_entity_types_rest_client_config.php | 240 +++ .../V2/resources/sessions_client_config.json | 74 + .../resources/sessions_descriptor_config.php | 98 + .../resources/sessions_rest_client_config.php | 135 ++ .../V2/resources/versions_client_config.json | 69 + .../resources/versions_descriptor_config.php | 139 ++ .../resources/versions_rest_client_config.php | 202 ++ .../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 | 825 ++++++++ .../Client/ConversationModelsClientTest.php | 1203 +++++++++++ .../Client/ConversationProfilesClientTest.php | 943 +++++++++ .../V2/Client/ConversationsClientTest.php | 881 ++++++++ .../Unit/V2/Client/DocumentsClientTest.php | 1243 +++++++++++ .../EncryptionSpecServiceClientTest.php | 418 ++++ .../Unit/V2/Client/EntityTypesClientTest.php | 1263 ++++++++++++ .../Unit/V2/Client/EnvironmentsClientTest.php | 670 ++++++ .../Unit/V2/Client/FulfillmentsClientTest.php | 371 ++++ .../Unit/V2/Client/GeneratorsClientTest.php | 568 ++++++ .../Unit/V2/Client/IntentsClientTest.php | 918 +++++++++ .../V2/Client/KnowledgeBasesClientTest.php | 586 ++++++ .../Unit/V2/Client/ParticipantsClientTest.php | 953 +++++++++ .../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 | 708 +++++++ .../Unit/V2/ConversationModelsClientTest.php | 1072 ++++++++++ .../V2/ConversationProfilesClientTest.php | 808 ++++++++ .../tests/Unit/V2/ConversationsClientTest.php | 793 ++++++++ .../v2/tests/Unit/V2/DocumentsClientTest.php | 1109 ++++++++++ .../V2/EncryptionSpecServiceClientTest.php | 371 ++++ .../tests/Unit/V2/EntityTypesClientTest.php | 1129 ++++++++++ .../tests/Unit/V2/EnvironmentsClientTest.php | 587 ++++++ .../tests/Unit/V2/FulfillmentsClientTest.php | 320 +++ .../v2/tests/Unit/V2/GeneratorsClientTest.php | 500 +++++ .../v2/tests/Unit/V2/IntentsClientTest.php | 805 ++++++++ .../Unit/V2/KnowledgeBasesClientTest.php | 514 +++++ .../tests/Unit/V2/ParticipantsClientTest.php | 869 ++++++++ .../Unit/V2/SessionEntityTypesClientTest.php | 519 +++++ .../v2/tests/Unit/V2/SessionsClientTest.php | 365 ++++ .../v2/tests/Unit/V2/VersionsClientTest.php | 511 +++++ 702 files changed, 144343 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/EncryptionSpec.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/GPBMetadata/Google/Cloud/Dialogflow/V2/EntityType.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/GPBMetadata/Google/Cloud/Dialogflow/V2/Environment.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/GPBMetadata/Google/Cloud/Dialogflow/V2/Fulfillment.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/GPBMetadata/Google/Cloud/Dialogflow/V2/Gcs.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/GPBMetadata/Google/Cloud/Dialogflow/V2/Generator.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/GPBMetadata/Google/Cloud/Dialogflow/V2/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/KnowledgeAssistFeedback.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/AgentAssistantFeedback/KnowledgeSearchFeedback.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/AgentAssistantFeedback/SummarizationFeedback.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/AgentAssistantRecord.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/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/ConversationContext.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/ConversationDataset.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/ConversationEvent.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/ConversationEvent/Type.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/ConversationInfo.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/ConversationModel.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/ConversationModel/ModelType.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/ConversationModel/State.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/ConversationModelEvaluation.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/ConversationPhoneNumber.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/ConversationProfile.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/CreateContextRequest.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/CreateConversationDatasetOperationMetadata.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/CreateConversationDatasetRequest.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/CreateConversationModelEvaluationOperationMetadata.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/CreateConversationModelEvaluationOperationMetadata/State.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/CreateConversationModelEvaluationRequest.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/CreateConversationModelOperationMetadata.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/CreateConversationModelOperationMetadata/State.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/CreateConversationModelRequest.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/CreateConversationProfileRequest.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/CreateConversationRequest.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/CreateDocumentRequest.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/CreateEntityTypeRequest.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/CreateEnvironmentRequest.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/CreateGeneratorRequest.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/CreateIntentRequest.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/CreateKnowledgeBaseRequest.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/CreateParticipantRequest.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/CreateSessionEntityTypeRequest.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/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/DeleteGeneratorRequest.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/DeleteIntentRequest.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/DeleteKnowledgeBaseRequest.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/DeleteSessionEntityTypeRequest.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/DeleteVersionRequest.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/DeployConversationModelOperationMetadata.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/DeployConversationModelRequest.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/DetectIntentRequest.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/DetectIntentResponse.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/DialogflowAssistAnswer.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/Document.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/Document/KnowledgeType.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/Document/ReloadStatus.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/Document/State.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/DtmfParameters.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/EncryptionSpec.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/EntityType.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/EntityType/AutoExpansionMode.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/EntityType/Entity.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/EntityType/Kind.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/EntityTypeBatch.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/Environment.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/Environment/State.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/EnvironmentHistory.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/EnvironmentHistory/Entry.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/EvaluationConfig.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/EvaluationConfig/SmartComposeConfig.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/EvaluationConfig/SmartReplyConfig.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/EventInput.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/ExportAgentRequest.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/ExportAgentResponse.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/ExportDocumentRequest.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/ExportOperationMetadata.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/FaqAnswer.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/FewShotExample.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/Fulfillment.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/Fulfillment/Feature.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/Fulfillment/Feature/Type.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/Fulfillment/GenericWebService.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/GcsDestination.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/GcsSources.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/GenerateStatelessSuggestionRequest.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/GenerateStatelessSuggestionResponse.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/GenerateStatelessSummaryRequest.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/GenerateStatelessSummaryRequest/MinimalConversation.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/GenerateStatelessSummaryResponse.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/GenerateStatelessSummaryResponse/Summary.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/Generator.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/GeneratorSuggestion.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/GetAgentRequest.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/GetContextRequest.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/GetConversationDatasetRequest.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/GetConversationModelEvaluationRequest.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/GetConversationModelRequest.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/GetConversationProfileRequest.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/GetConversationRequest.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/GetDocumentRequest.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/GetEncryptionSpecRequest.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/GetEntityTypeRequest.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/GetEnvironmentHistoryRequest.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/GetEnvironmentRequest.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/GetFulfillmentRequest.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/GetGeneratorRequest.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/GetIntentRequest.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/GetKnowledgeBaseRequest.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/GetParticipantRequest.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/GetSessionEntityTypeRequest.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/GetValidationResultRequest.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/GetVersionRequest.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/HumanAgentAssistantConfig.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/HumanAgentAssistantConfig/ConversationModelConfig.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/HumanAgentAssistantConfig/ConversationProcessConfig.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/HumanAgentAssistantConfig/MessageAnalysisConfig.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/HumanAgentAssistantConfig/SuggestionConfig.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/HumanAgentAssistantConfig/SuggestionFeatureConfig.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/HumanAgentAssistantConfig/SuggestionQueryConfig.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/HumanAgentAssistantConfig/SuggestionQueryConfig/ContextFilterSettings.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/HumanAgentAssistantConfig/SuggestionQueryConfig/DialogflowQuerySource.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/HumanAgentAssistantConfig/SuggestionQueryConfig/DialogflowQuerySource/HumanAgentSideConfig.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/HumanAgentAssistantConfig/SuggestionQueryConfig/DocumentQuerySource.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/HumanAgentAssistantConfig/SuggestionQueryConfig/KnowledgeBaseQuerySource.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/HumanAgentAssistantConfig/SuggestionQueryConfig/Sections.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/HumanAgentAssistantConfig/SuggestionQueryConfig/Sections/SectionType.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/HumanAgentAssistantConfig/SuggestionTriggerSettings.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/HumanAgentAssistantEvent.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/HumanAgentHandoffConfig.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/HumanAgentHandoffConfig/LivePersonConfig.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/HumanAgentHandoffConfig/SalesforceLiveAgentConfig.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/ImportAgentRequest.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/ImportConversationDataOperationMetadata.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/ImportConversationDataOperationResponse.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/ImportConversationDataRequest.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/ImportDocumentTemplate.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/ImportDocumentsRequest.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/ImportDocumentsResponse.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/InferenceParameter.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/InitializeEncryptionSpecMetadata.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/InitializeEncryptionSpecRequest.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/InitializeEncryptionSpecResponse.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/InputAudioConfig.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/InputConfig.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/InputDataset.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/InputTextConfig.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/Intent.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/Intent/FollowupIntentInfo.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/Intent/Message.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/Intent/Message/BasicCard.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/Intent/Message/BasicCard/Button.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/Intent/Message/BasicCard/Button/OpenUriAction.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/Intent/Message/BrowseCarouselCard.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/Intent/Message/BrowseCarouselCard/BrowseCarouselCardItem.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/Intent/Message/BrowseCarouselCard/BrowseCarouselCardItem/OpenUrlAction.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/Intent/Message/BrowseCarouselCard/BrowseCarouselCardItem/OpenUrlAction/UrlTypeHint.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/Intent/Message/BrowseCarouselCard/ImageDisplayOptions.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/Intent/Message/Card.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/Intent/Message/Card/Button.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/Intent/Message/CarouselSelect.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/Intent/Message/CarouselSelect/Item.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/Intent/Message/ColumnProperties.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/Intent/Message/ColumnProperties/HorizontalAlignment.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/Intent/Message/Image.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/Intent/Message/LinkOutSuggestion.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/Intent/Message/ListSelect.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/Intent/Message/ListSelect/Item.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/Intent/Message/MediaContent.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/Intent/Message/MediaContent/ResponseMediaObject.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/Intent/Message/MediaContent/ResponseMediaType.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/Intent/Message/Platform.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/Intent/Message/QuickReplies.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/Intent/Message/SelectItemInfo.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/Intent/Message/SimpleResponse.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/Intent/Message/SimpleResponses.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/Intent/Message/Suggestion.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/Intent/Message/Suggestions.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/Intent/Message/TableCard.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/Intent/Message/TableCardCell.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/Intent/Message/TableCardRow.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/Intent/Message/Text.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/Intent/Parameter.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/Intent/TrainingPhrase.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/Intent/TrainingPhrase/Part.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/Intent/TrainingPhrase/Type.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/Intent/WebhookState.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/IntentBatch.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/IntentSuggestion.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/IntentView.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/KnowledgeAssistAnswer.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/KnowledgeAssistAnswer/KnowledgeAnswer.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/KnowledgeAssistAnswer/KnowledgeAnswer/FaqSource.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/KnowledgeAssistAnswer/KnowledgeAnswer/GenerativeSource.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/KnowledgeAssistAnswer/KnowledgeAnswer/GenerativeSource/Snippet.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/KnowledgeAssistAnswer/SuggestedQuery.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/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/ListGeneratorsRequest.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/ListGeneratorsResponse.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/ListIntentsRequest.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/ListIntentsResponse.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/ListKnowledgeBasesRequest.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/ListKnowledgeBasesResponse.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/ListMessagesRequest.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/ListMessagesResponse.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/ListParticipantsRequest.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/ListParticipantsResponse.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/ListSessionEntityTypesRequest.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/ListSessionEntityTypesResponse.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/ListVersionsRequest.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/ListVersionsResponse.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/LoggingConfig.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/Message.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/MessageAnnotation.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/MessageEntry.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/MessageEntry/Role.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/NotificationConfig.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/NotificationConfig/MessageFormat.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/OriginalDetectIntentRequest.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/OutputAudio.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/OutputAudioConfig.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/OutputAudioEncoding.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/Participant.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/Participant/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/SearchKnowledgeAnswer.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/SearchKnowledgeAnswer/AnswerSource.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/SearchKnowledgeAnswer/AnswerType.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/SearchKnowledgeRequest.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/SearchKnowledgeResponse.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/Sentiment.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/SentimentAnalysisRequestConfig.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/SentimentAnalysisResult.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/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/SuggestKnowledgeAssistRequest.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/SuggestKnowledgeAssistResponse.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/SuggestSmartRepliesRequest.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/SuggestSmartRepliesResponse.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/SuggestionFeature.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/SuggestionFeature/Type.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/SuggestionInput.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/SuggestionResult.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/SummarizationContext.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/SummarizationSection.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/SummarizationSection/Type.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/SummarizationSectionList.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/SummarySuggestion.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/SummarySuggestion/SummarySection.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/SynthesizeSpeechConfig.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/TelephonyDtmf.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/TelephonyDtmfEvents.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/TextInput.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/TextToSpeechSettings.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/TrainAgentRequest.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/TriggerEvent.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/UndeployConversationModelOperationMetadata.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/UndeployConversationModelRequest.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/UpdateAnswerRecordRequest.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/UpdateContextRequest.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/UpdateConversationProfileRequest.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/UpdateDocumentRequest.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/UpdateEntityTypeRequest.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/UpdateEnvironmentRequest.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/UpdateFulfillmentRequest.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/UpdateGeneratorRequest.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/UpdateIntentRequest.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/UpdateKnowledgeBaseRequest.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/UpdateParticipantRequest.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/UpdateSessionEntityTypeRequest.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/UpdateVersionRequest.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/ValidationError.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/ValidationError/Severity.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/ValidationResult.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/Version.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/Version/VersionStatus.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/VoiceSelectionParams.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/WebhookRequest.php create mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/WebhookResponse.php create mode 100644 owl-bot-staging/Dialogflow/v2/samples/V2/AgentsClient/delete_agent.php create mode 100644 owl-bot-staging/Dialogflow/v2/samples/V2/AgentsClient/export_agent.php create mode 100644 owl-bot-staging/Dialogflow/v2/samples/V2/AgentsClient/get_agent.php create mode 100644 owl-bot-staging/Dialogflow/v2/samples/V2/AgentsClient/get_location.php create mode 100644 owl-bot-staging/Dialogflow/v2/samples/V2/AgentsClient/get_validation_result.php create mode 100644 owl-bot-staging/Dialogflow/v2/samples/V2/AgentsClient/import_agent.php create mode 100644 owl-bot-staging/Dialogflow/v2/samples/V2/AgentsClient/list_locations.php create mode 100644 owl-bot-staging/Dialogflow/v2/samples/V2/AgentsClient/restore_agent.php create mode 100644 owl-bot-staging/Dialogflow/v2/samples/V2/AgentsClient/search_agents.php create mode 100644 owl-bot-staging/Dialogflow/v2/samples/V2/AgentsClient/set_agent.php create mode 100644 owl-bot-staging/Dialogflow/v2/samples/V2/AgentsClient/train_agent.php create mode 100644 owl-bot-staging/Dialogflow/v2/samples/V2/AnswerRecordsClient/get_location.php create mode 100644 owl-bot-staging/Dialogflow/v2/samples/V2/AnswerRecordsClient/list_answer_records.php create mode 100644 owl-bot-staging/Dialogflow/v2/samples/V2/AnswerRecordsClient/list_locations.php create mode 100644 owl-bot-staging/Dialogflow/v2/samples/V2/AnswerRecordsClient/update_answer_record.php create mode 100644 owl-bot-staging/Dialogflow/v2/samples/V2/ContextsClient/create_context.php create mode 100644 owl-bot-staging/Dialogflow/v2/samples/V2/ContextsClient/delete_all_contexts.php create mode 100644 owl-bot-staging/Dialogflow/v2/samples/V2/ContextsClient/delete_context.php create mode 100644 owl-bot-staging/Dialogflow/v2/samples/V2/ContextsClient/get_context.php create mode 100644 owl-bot-staging/Dialogflow/v2/samples/V2/ContextsClient/get_location.php create mode 100644 owl-bot-staging/Dialogflow/v2/samples/V2/ContextsClient/list_contexts.php create mode 100644 owl-bot-staging/Dialogflow/v2/samples/V2/ContextsClient/list_locations.php create mode 100644 owl-bot-staging/Dialogflow/v2/samples/V2/ContextsClient/update_context.php create mode 100644 owl-bot-staging/Dialogflow/v2/samples/V2/ConversationDatasetsClient/create_conversation_dataset.php create mode 100644 owl-bot-staging/Dialogflow/v2/samples/V2/ConversationDatasetsClient/delete_conversation_dataset.php create mode 100644 owl-bot-staging/Dialogflow/v2/samples/V2/ConversationDatasetsClient/get_conversation_dataset.php create mode 100644 owl-bot-staging/Dialogflow/v2/samples/V2/ConversationDatasetsClient/get_location.php create mode 100644 owl-bot-staging/Dialogflow/v2/samples/V2/ConversationDatasetsClient/import_conversation_data.php create mode 100644 owl-bot-staging/Dialogflow/v2/samples/V2/ConversationDatasetsClient/list_conversation_datasets.php create mode 100644 owl-bot-staging/Dialogflow/v2/samples/V2/ConversationDatasetsClient/list_locations.php create mode 100644 owl-bot-staging/Dialogflow/v2/samples/V2/ConversationModelsClient/create_conversation_model.php create mode 100644 owl-bot-staging/Dialogflow/v2/samples/V2/ConversationModelsClient/create_conversation_model_evaluation.php create mode 100644 owl-bot-staging/Dialogflow/v2/samples/V2/ConversationModelsClient/delete_conversation_model.php create mode 100644 owl-bot-staging/Dialogflow/v2/samples/V2/ConversationModelsClient/deploy_conversation_model.php create mode 100644 owl-bot-staging/Dialogflow/v2/samples/V2/ConversationModelsClient/get_conversation_model.php create mode 100644 owl-bot-staging/Dialogflow/v2/samples/V2/ConversationModelsClient/get_conversation_model_evaluation.php create mode 100644 owl-bot-staging/Dialogflow/v2/samples/V2/ConversationModelsClient/get_location.php create mode 100644 owl-bot-staging/Dialogflow/v2/samples/V2/ConversationModelsClient/list_conversation_model_evaluations.php create mode 100644 owl-bot-staging/Dialogflow/v2/samples/V2/ConversationModelsClient/list_conversation_models.php create mode 100644 owl-bot-staging/Dialogflow/v2/samples/V2/ConversationModelsClient/list_locations.php create mode 100644 owl-bot-staging/Dialogflow/v2/samples/V2/ConversationModelsClient/undeploy_conversation_model.php create mode 100644 owl-bot-staging/Dialogflow/v2/samples/V2/ConversationProfilesClient/clear_suggestion_feature_config.php create mode 100644 owl-bot-staging/Dialogflow/v2/samples/V2/ConversationProfilesClient/create_conversation_profile.php create mode 100644 owl-bot-staging/Dialogflow/v2/samples/V2/ConversationProfilesClient/delete_conversation_profile.php create mode 100644 owl-bot-staging/Dialogflow/v2/samples/V2/ConversationProfilesClient/get_conversation_profile.php create mode 100644 owl-bot-staging/Dialogflow/v2/samples/V2/ConversationProfilesClient/get_location.php create mode 100644 owl-bot-staging/Dialogflow/v2/samples/V2/ConversationProfilesClient/list_conversation_profiles.php create mode 100644 owl-bot-staging/Dialogflow/v2/samples/V2/ConversationProfilesClient/list_locations.php create mode 100644 owl-bot-staging/Dialogflow/v2/samples/V2/ConversationProfilesClient/set_suggestion_feature_config.php create mode 100644 owl-bot-staging/Dialogflow/v2/samples/V2/ConversationProfilesClient/update_conversation_profile.php create mode 100644 owl-bot-staging/Dialogflow/v2/samples/V2/ConversationsClient/complete_conversation.php create mode 100644 owl-bot-staging/Dialogflow/v2/samples/V2/ConversationsClient/create_conversation.php create mode 100644 owl-bot-staging/Dialogflow/v2/samples/V2/ConversationsClient/generate_stateless_suggestion.php create mode 100644 owl-bot-staging/Dialogflow/v2/samples/V2/ConversationsClient/generate_stateless_summary.php create mode 100644 owl-bot-staging/Dialogflow/v2/samples/V2/ConversationsClient/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/search_knowledge.php create mode 100644 owl-bot-staging/Dialogflow/v2/samples/V2/ConversationsClient/suggest_conversation_summary.php create mode 100644 owl-bot-staging/Dialogflow/v2/samples/V2/DocumentsClient/create_document.php create mode 100644 owl-bot-staging/Dialogflow/v2/samples/V2/DocumentsClient/delete_document.php create mode 100644 owl-bot-staging/Dialogflow/v2/samples/V2/DocumentsClient/export_document.php create mode 100644 owl-bot-staging/Dialogflow/v2/samples/V2/DocumentsClient/get_document.php create mode 100644 owl-bot-staging/Dialogflow/v2/samples/V2/DocumentsClient/get_location.php create mode 100644 owl-bot-staging/Dialogflow/v2/samples/V2/DocumentsClient/import_documents.php create mode 100644 owl-bot-staging/Dialogflow/v2/samples/V2/DocumentsClient/list_documents.php create mode 100644 owl-bot-staging/Dialogflow/v2/samples/V2/DocumentsClient/list_locations.php create mode 100644 owl-bot-staging/Dialogflow/v2/samples/V2/DocumentsClient/reload_document.php create mode 100644 owl-bot-staging/Dialogflow/v2/samples/V2/DocumentsClient/update_document.php create mode 100644 owl-bot-staging/Dialogflow/v2/samples/V2/EncryptionSpecServiceClient/get_encryption_spec.php create mode 100644 owl-bot-staging/Dialogflow/v2/samples/V2/EncryptionSpecServiceClient/get_location.php create mode 100644 owl-bot-staging/Dialogflow/v2/samples/V2/EncryptionSpecServiceClient/initialize_encryption_spec.php create mode 100644 owl-bot-staging/Dialogflow/v2/samples/V2/EncryptionSpecServiceClient/list_locations.php create mode 100644 owl-bot-staging/Dialogflow/v2/samples/V2/EntityTypesClient/batch_create_entities.php create mode 100644 owl-bot-staging/Dialogflow/v2/samples/V2/EntityTypesClient/batch_delete_entities.php create mode 100644 owl-bot-staging/Dialogflow/v2/samples/V2/EntityTypesClient/batch_delete_entity_types.php create mode 100644 owl-bot-staging/Dialogflow/v2/samples/V2/EntityTypesClient/batch_update_entities.php create mode 100644 owl-bot-staging/Dialogflow/v2/samples/V2/EntityTypesClient/batch_update_entity_types.php create mode 100644 owl-bot-staging/Dialogflow/v2/samples/V2/EntityTypesClient/create_entity_type.php create mode 100644 owl-bot-staging/Dialogflow/v2/samples/V2/EntityTypesClient/delete_entity_type.php create mode 100644 owl-bot-staging/Dialogflow/v2/samples/V2/EntityTypesClient/get_entity_type.php create mode 100644 owl-bot-staging/Dialogflow/v2/samples/V2/EntityTypesClient/get_location.php create mode 100644 owl-bot-staging/Dialogflow/v2/samples/V2/EntityTypesClient/list_entity_types.php create mode 100644 owl-bot-staging/Dialogflow/v2/samples/V2/EntityTypesClient/list_locations.php create mode 100644 owl-bot-staging/Dialogflow/v2/samples/V2/EntityTypesClient/update_entity_type.php create mode 100644 owl-bot-staging/Dialogflow/v2/samples/V2/EnvironmentsClient/create_environment.php create mode 100644 owl-bot-staging/Dialogflow/v2/samples/V2/EnvironmentsClient/delete_environment.php create mode 100644 owl-bot-staging/Dialogflow/v2/samples/V2/EnvironmentsClient/get_environment.php create mode 100644 owl-bot-staging/Dialogflow/v2/samples/V2/EnvironmentsClient/get_environment_history.php create mode 100644 owl-bot-staging/Dialogflow/v2/samples/V2/EnvironmentsClient/get_location.php create mode 100644 owl-bot-staging/Dialogflow/v2/samples/V2/EnvironmentsClient/list_environments.php create mode 100644 owl-bot-staging/Dialogflow/v2/samples/V2/EnvironmentsClient/list_locations.php create mode 100644 owl-bot-staging/Dialogflow/v2/samples/V2/EnvironmentsClient/update_environment.php create mode 100644 owl-bot-staging/Dialogflow/v2/samples/V2/FulfillmentsClient/get_fulfillment.php create mode 100644 owl-bot-staging/Dialogflow/v2/samples/V2/FulfillmentsClient/get_location.php create mode 100644 owl-bot-staging/Dialogflow/v2/samples/V2/FulfillmentsClient/list_locations.php create mode 100644 owl-bot-staging/Dialogflow/v2/samples/V2/FulfillmentsClient/update_fulfillment.php create mode 100644 owl-bot-staging/Dialogflow/v2/samples/V2/GeneratorsClient/create_generator.php create mode 100644 owl-bot-staging/Dialogflow/v2/samples/V2/GeneratorsClient/delete_generator.php create mode 100644 owl-bot-staging/Dialogflow/v2/samples/V2/GeneratorsClient/get_generator.php create mode 100644 owl-bot-staging/Dialogflow/v2/samples/V2/GeneratorsClient/get_location.php create mode 100644 owl-bot-staging/Dialogflow/v2/samples/V2/GeneratorsClient/list_generators.php create mode 100644 owl-bot-staging/Dialogflow/v2/samples/V2/GeneratorsClient/list_locations.php create mode 100644 owl-bot-staging/Dialogflow/v2/samples/V2/GeneratorsClient/update_generator.php create mode 100644 owl-bot-staging/Dialogflow/v2/samples/V2/IntentsClient/batch_delete_intents.php create mode 100644 owl-bot-staging/Dialogflow/v2/samples/V2/IntentsClient/batch_update_intents.php create mode 100644 owl-bot-staging/Dialogflow/v2/samples/V2/IntentsClient/create_intent.php create mode 100644 owl-bot-staging/Dialogflow/v2/samples/V2/IntentsClient/delete_intent.php create mode 100644 owl-bot-staging/Dialogflow/v2/samples/V2/IntentsClient/get_intent.php create mode 100644 owl-bot-staging/Dialogflow/v2/samples/V2/IntentsClient/get_location.php create mode 100644 owl-bot-staging/Dialogflow/v2/samples/V2/IntentsClient/list_intents.php create mode 100644 owl-bot-staging/Dialogflow/v2/samples/V2/IntentsClient/list_locations.php create mode 100644 owl-bot-staging/Dialogflow/v2/samples/V2/IntentsClient/update_intent.php create mode 100644 owl-bot-staging/Dialogflow/v2/samples/V2/KnowledgeBasesClient/create_knowledge_base.php create mode 100644 owl-bot-staging/Dialogflow/v2/samples/V2/KnowledgeBasesClient/delete_knowledge_base.php create mode 100644 owl-bot-staging/Dialogflow/v2/samples/V2/KnowledgeBasesClient/get_knowledge_base.php create mode 100644 owl-bot-staging/Dialogflow/v2/samples/V2/KnowledgeBasesClient/get_location.php create mode 100644 owl-bot-staging/Dialogflow/v2/samples/V2/KnowledgeBasesClient/list_knowledge_bases.php create mode 100644 owl-bot-staging/Dialogflow/v2/samples/V2/KnowledgeBasesClient/list_locations.php create mode 100644 owl-bot-staging/Dialogflow/v2/samples/V2/KnowledgeBasesClient/update_knowledge_base.php create mode 100644 owl-bot-staging/Dialogflow/v2/samples/V2/ParticipantsClient/analyze_content.php create mode 100644 owl-bot-staging/Dialogflow/v2/samples/V2/ParticipantsClient/create_participant.php create mode 100644 owl-bot-staging/Dialogflow/v2/samples/V2/ParticipantsClient/get_location.php create mode 100644 owl-bot-staging/Dialogflow/v2/samples/V2/ParticipantsClient/get_participant.php create mode 100644 owl-bot-staging/Dialogflow/v2/samples/V2/ParticipantsClient/list_locations.php create mode 100644 owl-bot-staging/Dialogflow/v2/samples/V2/ParticipantsClient/list_participants.php create mode 100644 owl-bot-staging/Dialogflow/v2/samples/V2/ParticipantsClient/streaming_analyze_content.php create mode 100644 owl-bot-staging/Dialogflow/v2/samples/V2/ParticipantsClient/suggest_articles.php create mode 100644 owl-bot-staging/Dialogflow/v2/samples/V2/ParticipantsClient/suggest_faq_answers.php create mode 100644 owl-bot-staging/Dialogflow/v2/samples/V2/ParticipantsClient/suggest_knowledge_assist.php create mode 100644 owl-bot-staging/Dialogflow/v2/samples/V2/ParticipantsClient/suggest_smart_replies.php create mode 100644 owl-bot-staging/Dialogflow/v2/samples/V2/ParticipantsClient/update_participant.php create mode 100644 owl-bot-staging/Dialogflow/v2/samples/V2/SessionEntityTypesClient/create_session_entity_type.php create mode 100644 owl-bot-staging/Dialogflow/v2/samples/V2/SessionEntityTypesClient/delete_session_entity_type.php create mode 100644 owl-bot-staging/Dialogflow/v2/samples/V2/SessionEntityTypesClient/get_location.php create mode 100644 owl-bot-staging/Dialogflow/v2/samples/V2/SessionEntityTypesClient/get_session_entity_type.php create mode 100644 owl-bot-staging/Dialogflow/v2/samples/V2/SessionEntityTypesClient/list_locations.php create mode 100644 owl-bot-staging/Dialogflow/v2/samples/V2/SessionEntityTypesClient/list_session_entity_types.php create mode 100644 owl-bot-staging/Dialogflow/v2/samples/V2/SessionEntityTypesClient/update_session_entity_type.php create mode 100644 owl-bot-staging/Dialogflow/v2/samples/V2/SessionsClient/detect_intent.php create mode 100644 owl-bot-staging/Dialogflow/v2/samples/V2/SessionsClient/get_location.php create mode 100644 owl-bot-staging/Dialogflow/v2/samples/V2/SessionsClient/list_locations.php create mode 100644 owl-bot-staging/Dialogflow/v2/samples/V2/SessionsClient/streaming_detect_intent.php create mode 100644 owl-bot-staging/Dialogflow/v2/samples/V2/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/ContextsClient.php create mode 100644 owl-bot-staging/Dialogflow/v2/src/V2/Client/ConversationDatasetsClient.php create mode 100644 owl-bot-staging/Dialogflow/v2/src/V2/Client/ConversationModelsClient.php create mode 100644 owl-bot-staging/Dialogflow/v2/src/V2/Client/ConversationProfilesClient.php create mode 100644 owl-bot-staging/Dialogflow/v2/src/V2/Client/ConversationsClient.php create mode 100644 owl-bot-staging/Dialogflow/v2/src/V2/Client/DocumentsClient.php create mode 100644 owl-bot-staging/Dialogflow/v2/src/V2/Client/EncryptionSpecServiceClient.php create mode 100644 owl-bot-staging/Dialogflow/v2/src/V2/Client/EntityTypesClient.php create mode 100644 owl-bot-staging/Dialogflow/v2/src/V2/Client/EnvironmentsClient.php create mode 100644 owl-bot-staging/Dialogflow/v2/src/V2/Client/FulfillmentsClient.php create mode 100644 owl-bot-staging/Dialogflow/v2/src/V2/Client/GeneratorsClient.php create mode 100644 owl-bot-staging/Dialogflow/v2/src/V2/Client/IntentsClient.php create mode 100644 owl-bot-staging/Dialogflow/v2/src/V2/Client/KnowledgeBasesClient.php create mode 100644 owl-bot-staging/Dialogflow/v2/src/V2/Client/ParticipantsClient.php create mode 100644 owl-bot-staging/Dialogflow/v2/src/V2/Client/SessionEntityTypesClient.php create mode 100644 owl-bot-staging/Dialogflow/v2/src/V2/Client/SessionsClient.php create mode 100644 owl-bot-staging/Dialogflow/v2/src/V2/Client/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/EncryptionSpecServiceClient.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/EncryptionSpecServiceGapicClient.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/GeneratorsGapicClient.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/GeneratorsClient.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/encryption_spec_service_client_config.json create mode 100644 owl-bot-staging/Dialogflow/v2/src/V2/resources/encryption_spec_service_descriptor_config.php create mode 100644 owl-bot-staging/Dialogflow/v2/src/V2/resources/encryption_spec_service_rest_client_config.php create mode 100644 owl-bot-staging/Dialogflow/v2/src/V2/resources/entity_types_client_config.json create mode 100644 owl-bot-staging/Dialogflow/v2/src/V2/resources/entity_types_descriptor_config.php create mode 100644 owl-bot-staging/Dialogflow/v2/src/V2/resources/entity_types_rest_client_config.php create mode 100644 owl-bot-staging/Dialogflow/v2/src/V2/resources/environments_client_config.json create mode 100644 owl-bot-staging/Dialogflow/v2/src/V2/resources/environments_descriptor_config.php create mode 100644 owl-bot-staging/Dialogflow/v2/src/V2/resources/environments_rest_client_config.php create mode 100644 owl-bot-staging/Dialogflow/v2/src/V2/resources/fulfillments_client_config.json create mode 100644 owl-bot-staging/Dialogflow/v2/src/V2/resources/fulfillments_descriptor_config.php create mode 100644 owl-bot-staging/Dialogflow/v2/src/V2/resources/fulfillments_rest_client_config.php create mode 100644 owl-bot-staging/Dialogflow/v2/src/V2/resources/generators_client_config.json create mode 100644 owl-bot-staging/Dialogflow/v2/src/V2/resources/generators_descriptor_config.php create mode 100644 owl-bot-staging/Dialogflow/v2/src/V2/resources/generators_rest_client_config.php create mode 100644 owl-bot-staging/Dialogflow/v2/src/V2/resources/intents_client_config.json create mode 100644 owl-bot-staging/Dialogflow/v2/src/V2/resources/intents_descriptor_config.php create mode 100644 owl-bot-staging/Dialogflow/v2/src/V2/resources/intents_rest_client_config.php create mode 100644 owl-bot-staging/Dialogflow/v2/src/V2/resources/knowledge_bases_client_config.json create mode 100644 owl-bot-staging/Dialogflow/v2/src/V2/resources/knowledge_bases_descriptor_config.php create mode 100644 owl-bot-staging/Dialogflow/v2/src/V2/resources/knowledge_bases_rest_client_config.php create mode 100644 owl-bot-staging/Dialogflow/v2/src/V2/resources/participants_client_config.json create mode 100644 owl-bot-staging/Dialogflow/v2/src/V2/resources/participants_descriptor_config.php create mode 100644 owl-bot-staging/Dialogflow/v2/src/V2/resources/participants_rest_client_config.php create mode 100644 owl-bot-staging/Dialogflow/v2/src/V2/resources/session_entity_types_client_config.json create mode 100644 owl-bot-staging/Dialogflow/v2/src/V2/resources/session_entity_types_descriptor_config.php create mode 100644 owl-bot-staging/Dialogflow/v2/src/V2/resources/session_entity_types_rest_client_config.php create mode 100644 owl-bot-staging/Dialogflow/v2/src/V2/resources/sessions_client_config.json create mode 100644 owl-bot-staging/Dialogflow/v2/src/V2/resources/sessions_descriptor_config.php create mode 100644 owl-bot-staging/Dialogflow/v2/src/V2/resources/sessions_rest_client_config.php create mode 100644 owl-bot-staging/Dialogflow/v2/src/V2/resources/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/EncryptionSpecServiceClientTest.php create mode 100644 owl-bot-staging/Dialogflow/v2/tests/Unit/V2/Client/EntityTypesClientTest.php create mode 100644 owl-bot-staging/Dialogflow/v2/tests/Unit/V2/Client/EnvironmentsClientTest.php create mode 100644 owl-bot-staging/Dialogflow/v2/tests/Unit/V2/Client/FulfillmentsClientTest.php create mode 100644 owl-bot-staging/Dialogflow/v2/tests/Unit/V2/Client/GeneratorsClientTest.php create mode 100644 owl-bot-staging/Dialogflow/v2/tests/Unit/V2/Client/IntentsClientTest.php create mode 100644 owl-bot-staging/Dialogflow/v2/tests/Unit/V2/Client/KnowledgeBasesClientTest.php create mode 100644 owl-bot-staging/Dialogflow/v2/tests/Unit/V2/Client/ParticipantsClientTest.php create mode 100644 owl-bot-staging/Dialogflow/v2/tests/Unit/V2/Client/SessionEntityTypesClientTest.php create mode 100644 owl-bot-staging/Dialogflow/v2/tests/Unit/V2/Client/SessionsClientTest.php create mode 100644 owl-bot-staging/Dialogflow/v2/tests/Unit/V2/Client/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/EncryptionSpecServiceClientTest.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/GeneratorsClientTest.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..578e828cb08634edc5277219828dd6558d9d2496 GIT binary patch literal 5894 zcmb_gOLN=S6*eeKv9D}PzVd^nlLm(ESbhkMnMV^kP6rezi5)#S6r&ldoT4CjNg@FO z1h|x6<1RYwFUTh8CNrJMCd+IxlVz4!W!hb)i!QRtE~|9fEOPF}gCGTwlp}9U;huBu zch3FJcOUQk&gnSls<=ul;%byM#l~Zic8KV>Hnnxz6dS!(i@2h0cOAndt}KehEpcSc=(*V4>- zk$AdmIMjA4V4Baj35|-!zAWAhre)!bmbmC+%;)!kyf0F>N8+=KqDyGcweE4;EWoqq zS3RLxieuCj%d%M&Y|G2%`#JSP9OSrc8c@%}`K%bkY!*mI+cRwUaIRGn5M^SJ30$b} zzzPFjAX|vnGY3M{ zKOkSu+NF1mfTK#Y8BuZtnszZF5u?-%^!0W0%4FS&Grpb7yISsdwY-BTikFSS6Dt-0>n&$F^m(h%)xloI=APS2o3$Oi0 zN&Qb*LbrKBVX|G#0!?&fKPVK?lR;p!K$Q21PVpsls%dzRsXbPiTBcJx)D(om5<1@` zEe(=aP0eceAdITpO_HAK+gwL!uje?n3wl0i<)x2{Q-BIW3HSm!NsTU1pV$^jPxsx^ zXto)M9JEM!CL9s)MTE3HP-|E1xkmbh{=j8)hFDs|Br2$W8(J)V0tQd`^Q<7$)u`T4 zyA0<^7&w!=9i*N_ESXnQ-e5i(;8K`Q3k)x$#Ww<@W$3(nRoa1qc5JhmMi4a>PB#k$ zRriSNG5BZre0Rpr2V%P8`}lF*M#rf^-1Hm|@XGiAHL&Kc(hfQqp~o3?VMD1cuc;eb z#gh8o=60pDTwW=ciu1?td2}{5w)UV_M1DDR_}W4bcb z5q?vpp)Xluc-g1HuV?<50xu*P)WUP zXpFxFnLMjl!n0y+Io@d?X;x1_5a7pJg%5d6IFvHO;k9c7)6OW=vW5YTK)Q?VRs zaKialjv0oDT?p+X&E{8yed};*+&bJk#5(+2K&Rr`iL)V!B-C-s5caE+JNV)w8H2>y z#n+N~6A&x!@r`9ShhI&$OIj1(2mdS})R%3%Gzx3qE==vE&^&fIkfZyb^r`TTl11nJ zQ-^<;hr5ByR}Ehn{_Nku22=lIK+OY5N!gZ@7jEso9?){1Wm58?7ycxLW@GX{nvyZY z2@CKQ6krX7MM@&fK+It8nW!>3mFIP?Bgg^vXE8+e@< zQQHFIhnWhys8odAcYPTN)RR4IwC(tdFaU#7NPh;WaWDSIe+A(msZ??0^HgS)zY5FC q>{VDUMz6y1POdS-x7gQiL~mPn{O8oz>+69puiVmqA$^9PA@mE12)-o% 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..bf8f8f4ac09d90b7c24b91c990b1ec9ce487c408 GIT binary patch literal 5068 zcmbtY&2JmW70*(UEIxf%6MslVTW=UAkqu|*(kW2TwbLcJwAsouL&-MmvRJH^Lu#w# z?s|7AMKN^gztEyR^wa>o6v&~+BL6{-=`E)mdJ2$3Z$*m&eKWJWTz;6A99_hnnfH5d z-p6m=%+EgZ_C0tRP;NZj zm9=Vp_iYpn+<|Y>lH7CMo=pp;?G8GHj%CpnGIzoT$y0LSRl zz%xuL-)oj1(9q}@q0zp_QQ8%T(yk^b?Z?I20H$pOfvj@076*eDAmg7m*t0ED4niZu ze^;$Qw;U@(Y3ozm(jB>L*a1a=$+g{qV}_RN$V}j&W74f_vcP0(uX--J;Eo)d)nr~l zkF@JfNPWk!+f^EvzU76k-^8V*Qjdm-FWJb}wMZ?4v%2z@u(4E{F!GKZ`U9HQF3Ua* z2flNg+syz@l3(p9PE$RrtvZg&yx=-PsWjZv5aMNm72Bdtcs7}uMeRz_@u zMWehqwUJX&qTMun47lYPXR$m9A~*km5geS}^h9>o!t4!=zBgT#C(Z|Vttd^@PAAEV z8kW&k5=R!*_u+q6Ksj6ekepbr@Oo2*^`;yabC)A5!?Um+SzJZY<*uYAx-5A5UKG7( z!DecKAB8BIx)DuHD{yZZhiG+72fWy^VhTcCAH6+hOR^%2T`Csj|CNE|bgh$Rc$1OF zh9pZ{S#lrNB3|iI+SxPAgN+PMEETUuuAJr?MF7?!iSpbxYKA<4OGXc!q$9gn7*zZv zsA}U)4tR4WAd^&MLBUE4cJBTgrN2nus(+T?y;O9B6EQG>f|Obq+22ic#c!w?289>V zuak&61uTw7I~L}h5N(Qt?V6(g3oqiIuYf5p!h%4|eSE-YZ6 zal0Y{Wd)u0A9ahIc7GRPp=;SloIFt3^8AMMjVh5#koD02dVplTF^3+XXa1AOWdJ@N zx(C$Zp~&)y{2^>ku`%$F^C1gqagaub%LApx@R zDv-Pf=O;G)HvF*iu+`EkyA5q;N8i>SYuoyx#!geK)N6IEdY&1-gq@KdEjurfi?H5Q zTf232d;4iJoIx8`YLC)GbLDkd8*^j+zW|riseU2`oKJEMBWqya62-QBcCSYvZ_x-z zRG$SGI<7hBGhR$363@uhV(m55R3o^QXN9UByp^b;-7X&J)G?2F{8x+G_t2yzU_wzJ zE(L>r-|($ZIYkarRuKLD*U+_-28FmXY-uNl0#TwU+8n*+Xu)4>@Vsf~&@#(b*)b>v1qxr@ZN42#KECjSK9 zno|7aD&SqR^5}uqNH~*I>nN$NK(^i(QtA?%i$5~?r$A!hVXc#Q;7Wq4)oS%hU29aH zj#-RcU2nv*%w*Iv{LJKkpMeXb>?@iuvICpE+qJQ#2fZFPMtIrM1szA{)3uq2#;z=O z)IzYl!A=po7U&w!V-!)R@6JN08P7$OVuWA8#<0zdI@uWS951|?2lDW$EplfBoHdAI zgT>G1VMWXdcLd}+3DzgtG4kOo<0qC!Jyh-|XOt2>U;f~0HR?=%`;UMAF4Jz4ciFSU z3(>9KNt)#AV~y~$Tja;n7Z&2yIVg+^k-uetOtyh!rtOpK<1L@MFU|j5`dZx-VTkT0 zH&U%4-}xV;;w`?Rk!1?IHKn{TcB#02Qi^Ft+yb68iyxf=CFP=5A?7~$Qr#S;XB6f5 z7W9?+bUzHepj0Rv9UYBL7K}l-FJ6^Cz^*Rrx_`hClCU08G ilyBjQU#I`wRa_(e%lG^wrWlBzWHXJ{JG$RCmu zX-w(ZA*G>1BdcWDrbEXghkjSOESJp4vZ*no?#Lb&xn}^^oRYvZheWD(DlHP4mKmBC zb?)S%%A8y%sgsMd@@s&hV+MgFGiO!q3w{6ze_k|j?4cBdW{7{!?ZB{IJ49pqdrat! zG%}rlp#8G$C~}9POrRL>0Brz82Yvs zQon<$CnsYPrbx1xqvK>*=FT2TM{$fNCrd%TkwQNrH&>S=pM;U`zUFZ=2UqFW#R|-1 z&%UVH#IY)5VqV(RKRLP1>e|U|rd^V3|N#IN&(EYbFE`|Mm;1^6!PXu{VDN{IEkq}j*GHz zz*G-Ccz8zbA?Xo^@RrvxeRCR!_u&rf#C+QmMyrquf~jMSk#WT5yO=M3z7_^l=iafh z(IhT{e`Mgp-a8i$lK|68p~oXYL^fdh=I;vctj1uz`(j0VM{S=tFU=pp$cqXvebDUI^mvzG( zQC`}KE$;UHJDIo=e%2f|#Sa$y7c1!FU;-~O93WyQfQ^Lw~fX4<_xNCV7 zI~nV;hl8&t=iQD!1HE{uOth(^t&SLrr%XzFa1`8d}`j)<*slqU96+^+lnA?SmsU{ z28-NR8k(WDtD4ei*B4;<7zzvWCI%{ZjbFS%m_C9B3({Ist|DRuc(@>F^_%iJV)r44 z3lh1-K-`B9mgkN03Ih5FK3WiI^}3;T`aQ(=7(QJP;;yP+8|MxE)HqdTMeQ1uZ*&!* zUyfF0F>SxNoR!twiSryJ=Bj#Xv@}I+8fS91A-DAffH0qaPcO~xPr zcG)~`L|c)&3SyGXsO?j^T}94qy!c}V?)Bz-y!Z?r_j)Z{O>0zDqpr4D0`pWozyn}O zr6u!aale*jHI+-V;$zrfmbTTt-j$me&mXezU_}$fqI;(G^-do%T*sA9;OT0$o0P#2 zRx7nSUm{4iE`?&_)h~_TR60Fm%ON~j?ImT#hWHd7t=5UDxXHM`T7lDItMacbJi+(b zn*LuAZe05Ky}gt9_HBH(o86x2v^1tSA8vSO#<$z`ecBtmzB%|$CiB;9R;m3xdr;@E zwjzJE6|Y}y#k2B{avvV?D~ywbhhBpsMqA<>7GL3+{abc;mwrgTu1XFa@>>qh%|5S6 z{K&u={(tqOJb9iLv4U literal 0 HcmV?d00001 diff --git a/owl-bot-staging/Dialogflow/v2/proto/src/GPBMetadata/Google/Cloud/Dialogflow/V2/Context.php b/owl-bot-staging/Dialogflow/v2/proto/src/GPBMetadata/Google/Cloud/Dialogflow/V2/Context.php new file mode 100644 index 000000000000..e24ba7316fec --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/proto/src/GPBMetadata/Google/Cloud/Dialogflow/V2/Context.php @@ -0,0 +1,70 @@ +internalAddGeneratedFile( + ' +" +(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"¨ÚAparent‚Ó䓘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‰ + +GetContext-.google.cloud.dialogflow.v2.GetContextRequest#.google.cloud.dialogflow.v2.Context"¦ÚAname‚Ó䓘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/*}½ + CreateContext0.google.cloud.dialogflow.v2.CreateContextRequest#.google.cloud.dialogflow.v2.Context"ÔÚAparent,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â + UpdateContext0.google.cloud.dialogflow.v2.UpdateContextRequest#.google.cloud.dialogflow.v2.Context"ùÚAcontext,update_mask‚Óä“Ü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‚ + DeleteContext0.google.cloud.dialogflow.v2.DeleteContextRequest.google.protobuf.Empty"¦ÚAname‚Ó䓘*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/*}Œ +DeleteAllContexts4.google.cloud.dialogflow.v2.DeleteAllContextsRequest.google.protobuf.Empty"¨ÚAparent‚Ó䓘*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/*}/contextsxÊ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..d1e672c0b266ae41bcb224a7171576859e589ced GIT binary patch literal 9333 zcmcIqO>7%k9p9O>N%K#dw6EDDbzwW5?nhc$d+Tfk>wfLTak9~-P8vH|nvG;8_KP#r zo-s4yq@l_IByM{HaX=h^<4PcLN2|SX;mArH3Wy$n1Be@6s)WSCa^sVMU+ zN`9rNK|EQ+w%D*)sR2?dYyynMuwW zz|`y1Y3OCDEUwPor>9(;IQ@ERs?8T!`RYH(_$!CrjyCEZECaVMVPG_)O3$WvtZC#WsdIZ zdxm8nk93WSu<2XLh>+L{h64I#2LrT!HKG^_-yO%AC^oCQje%%1^y45J#i&3X2YuPU zQLP9q8kktI3GA*ix3izZi+`-U`+ifVf|r&BFL`B zkX5~+XxZZIwV1Pww#&uonV8d#=T~vkHybtMZDY6dZHDiaC56U%KVuglI%XnZc{pF;mOO!W~LB`2tpT5Az=aB6HDZoTI zP;-3%rw6$3o6j`)xt4W?ItUN#&z zsJ`>E^q+*`28L?M!KsQXf0C&rktqQFf7g0M&44!K91LQm#Yu^0_b@-LHsO4PhE4+~ z7E10xr+*OX0W1rBV}!bloAj|;3Mj-%;IO&@lZ&(i7ax|}9kondD#IWD|?rFwep9heG+a-iyy^PvXfbtBfW)E~-lsnDzy!GH0yQUKJfiMA4*5B zmmbsqM1!#!)(gii3ByGKpi89Z+GXg&C1?qzw9CSlrxt64BDD%|4zD~I0VOO!_5p^q zt=ApV-fqM}t8uaij0&ewoE0z)9WMj_H2`WHJi?bB!jR)3#_QckdLd5U(F~IUf2^Zn z$asp*z1b&T6Cu2q=T9bnEW?m5VH8d`^J$ zYD5&Q#KCq1^W=TJlGgQFFsHq?w$@|DWRWqFPQ}R#GF$a#dynT!NX;+8nY#X%!Qe#@ z>wN9>Oni*>Il?58d7(1sY2B{vURH?O4ww7^#}Qz(#_MG<1gSqA0HwDFL|U(h(|SG* z+@sk2pOgBxQm>@0hm%_7NxkthjEP9;-s#A~;RVz2&oZbH0Q1I$neI2Lc0_nBs{e?< zKpd|6msl}xzR?Flmi_)KWE#d=v?YGqr_gHDU*YpY{CMktxK*Ysc(HVbguva9wJ8QXn`NWMu=qayMk8!#qVdV5p{m0||oeNnCjzQrf6hDR6fj>Ih(^@NLKI9s@e zTN4W?f^$dHHh6&<#*M^~V;YSHbp=p)fPm%~U`opuKFqC^iVs)AONSvCSkNBel3@%0 zmkzl#+)r%e&d3B{a4BEJHN=^L^yjE#Fo+!Tu?(d9-cD}Dfzf?l8W=PV~9e$NI(0IsN|V{z{6NPS8nf0f`ugt7ju zhr|YE455$my<@t_7mTl@`4U?Ffa9D~-{W9(;Tf{p-<1?v_XYe2!26g2F(p46fbq~Y z7vGvfhkdJJ-;8z92upr0b5lN%)!ArU4m;DY^Pa*&VqU!$O&LO=WjrQvH%S6o@lHJcm3F@88vWPW!(G>HIGI#xe}7*DT5A!bH{D(D`$J?UjejveX*f?Xtcdp}I9xl6FYgO93>%DIDU-9A#*QynK0gn3N9NHGt*uE9~ z6Iq^L_(V=D@~>}_S^my`zV-D@awEMxi1Vv!&A!$8FyNZ^y-MKo7FLjqa>S=C N{G|5@${`#A{1?<|n^yn; literal 0 HcmV?d00001 diff --git a/owl-bot-staging/Dialogflow/v2/proto/src/GPBMetadata/Google/Cloud/Dialogflow/V2/ConversationDataset.php b/owl-bot-staging/Dialogflow/v2/proto/src/GPBMetadata/Google/Cloud/Dialogflow/V2/ConversationDataset.php new file mode 100644 index 0000000000000000000000000000000000000000..647e421711bd6d09e85f6d461164a14afdbbc307 GIT binary patch literal 5294 zcmcgw&2QX96t6dJXeTYS)341|C4*a$bd}oDLM3pTqWx&oNTpe&p%T?fE5|##adB+p z87EDn<$yR;LP#J^T#(>|xN?BMp+}H7fv+0@^_7sF_E9maZ8oF6q zUVDwH636!ptf7wMbS$hImgBe7mZ@7#r)@dg>Q+fL9D56UM5m@>H(NT@38qT00|2(Z ziHWNl7%kN+?_#R+^~O?QtWo908nxJ1<9=xY0K?J=LDhuOT4)pO0>u7Yf88<-L@3+P zK$lI@G;NbIBj#fk;38`47QxKUplsW>4eli33M;mO=dPg8CYQbJIt-9S6nR(Y7%_Yr z%QnTHty_&6CWdFa)bZ*}RMR?`#>nz7b63Q++??4)bD@u#HsItUqMnbFyCdXb>U;J= z;5RqWjej*#uq(S}qiov_N5Qd)ruAa#naEPCS|+yXcsjRCY_%$QL*FtTZ#>miEUIW^ zCsQh;v1E)90wNLd;cXZuV*J#{h zDfKf#4Qll24O3KPxz&mb@D}6mTwF4|fM&t(2wZzE;=)3xrUZOfdVE*5N`>>nr0$xm zAMi>F*u`yl$Pzb0}J4UrQ01}@8G84v~XTR(%iAi z#BXIueh*A7+pbTUQrqmn>j1DgnjsScxvA3YO6Y1D%nGabdqMLhw+~g0g2_-*{_!w4 zo%BOAM|cVx=FPU}!33NJ$6F?GEq$jMEaf8Saxf33TB4gVV&o^H6$!oxrVJ0WVbSEs z8 z2A1ZB8A`&z(-K;n0kF@S;rKSqzr@TMEbM*i3F}D_z@u09AwBrnt3=KlE9fRj`U@{#QuaoJqQ@Gdx;20dZvnRpKD znK!T4_z`U;TnhSv+ySVDEllx$os#b)aB+Flb-aP3LuZ|Xx^ zxBSHj(Xqo@Scoq^x-)EO1a-is2Jg+>;Un@#pqSaD{s+wEc~H#c!NC5dUyp+`DTE>L zha8yBj00Ye(w8 z<+u0+a5t1&jOSW0G0%$Wb4*JeDDWQ%oJ*ey@a-t*G|19*BD}^OQ1bR(IXF!PQ9gw8 zL6rOqm5eb7OFW*7-3J;BQQ0pa4R)dy(?@%;3qQ|+eAY;S3&Rk|(uyz`T5;LRA^GK< zy|OqK^g%L^`1EAQkPOHlTqy7fBT^i8=M&ZQ5d;p|A)84-kM420E#r(irMMxK{JC4DW))p6LRg%e|c%hjafgEe_2 z)zS#O%eGp0^t3#kdA|R-{Qd@|F40tVdwW~ZGd}$5KHUgk%&xLa7;QV==KMk8y{#(W zNZ?g=hZsWoN`5~M?CGt}->vG>gBxL=jBc3hGSYF9FL%sM*1LQAx$6tbfBu%FZ*#fY zt?zS%rQo?vsq*JKr4~QeDfdh3lL0B-n2jGE=EIk*#6uXrM4Lv+BUm6AK2~)>7l3~O D+B-ww 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..1754064115e48208b0272104f4c7e322121c8e28 GIT binary patch literal 9285 zcmcgyO>7%k9q%|FO~5<0de4fxFOIA^?-OE^JUM6_UD~5i6EL(O|LzlWn z3u!sZ9{^qMBHNS|#IJ6a){!H(WJhkUQdZ3}Vb!eoteOuC_W@8e*|zy|h~+xr2%Z8S z|Czl#O;vc?!NL^&rfN&7t~!{7`UD%d%(rFDMwm-515J{X&3O?Qx`%UZL7Y{gPd$FMf>)?%@P93NHk%i^1^Si(+i^NUQ!VlkrR zGVfSD6qe5O7IJ!)exK@17##bbnlZ?UrrH#B-5@9!x?L;=HU%t_2+Nv^bZ0c06%}c% z655v!RKpsLbPKr=bYdmf483FZbY0au%?*>p?Px~&zQf2>yQXt=a)o`;hKd8%k-KI* zEe)4D@2YNah^>|%3oAH{7Jcs#U)}=$`VzQ%iu{3DMwFvTmkW|EcTmV)bs5U0ij$JK zlqFsEwa`MF_)Xe#9p`SC4{fkq@3>2^yGvT&g1q6oz}r3S5k2H#`T%Nv)XUcy4hT&VzF;)iyQxNTR=H$gicbzla(5c`&0`2$wR6FrFL3 zD>H>`j;X{%V3l&d{|MC>d;q3M<*|`t&yDkAm}Jo-iNQ8k)6Je!VFXO(8 z4mw*hpV)KrnA;RJ`#tX490vzBsB_t1Lk4dUzR!UPiWR&JE^ar(MpfFWZ*Nx1wUt`6 zGJ6Jx$y9l(DmH5M)maW+0AQzHscx=q?Bdl7JP)SXH?llNHv5a?@D(uQZ6?bTY8r&VaL<)p~_&n-V%;ni|?TG7-#zE9)DT>YCKp-5k_S01Mme;#Nc2 z!W!*Ll^tnn#b0vZGodtRQH?X)&fx}~j|3Ln zz-jgsq&Rl|sr%_TuNexfnE9vP$K$>hP0hg+N~p)OKsbiQ7>40}DYT_oaG^_DwI5F8 z7pX5KBEP7@@5jNlh+)+OS?f_NPFfi_xCSmFpA6@g-c~zvlQf`jr=?6F3#)-?NWgNZ ztTP{gOMTge97|Q~xe2Ppoir^%X~l?G-kgDp;F={LO8dR8tV_f|$-(tjBNb4w4`@xG zrE#qI0te719Jn_^00p+g?bCZcAK;F|D)@2?_hXoPL5a6|A5R>giIPgw;4H3_1a0Am z<6t&0j5)Qh1B{)f1AH04uxs7;BAscbu$<=EK~-{rtC?=NDofy1#+=OIhD}-n4c~Ff z{=w+%%Z!gFAbS922gSlNfU<^1culn(sbwg=E*>IS2QD>ly%28#Avu&P?tXY3%y#9+ zxSiNN&B1#2Fb{&t1PS0w_A!7|aGyf|7ty7w;4-U6wuuzAttu|6!b5N_+~MI0IO|Ra zuJ!k@<}buNxRY!@M%F*`xRZkL6fC6oU)+5!IhKs4b-m-ZUI(`oI>lTlyp`tWusm9X zbM!yyO0-}J4!9b4n67zUKS?U7jV~+pV-7d!U?N}{h}&E!vJ?XYg~uI=Z3b?F^NwLk z_@L+(#|+KJFQyqEk&tT`W*yr{@|{S->Ee6CjX^RQj%63YOnB=w;B>0T1RfqHEu`QC zpwXHUzQKWoGMy|VP;a5H_3%VSNKD!ClLXcW1k-4v>}Cq7#Xcf|=8EuHaBUSikws7Z z#qf;GC=j^5hO;+9VtX`~`c@CukV$^2>KLvxU;9J~qu{oOIXigX&3w6k!+H!(Iz za%>ZyKoNW&TvEbLpjg-#Ycgz)1_svS6&*cxq>wW71R&f63l*dx2Sp6_?2W;Q5}BHD zGz!r@!0+fSJmro?Rs?Uvc`#@JDS8^9c`Fv=fck&z)}L@-akxa+!4g=AI+zY5Y*6!j zJz5nDY)kg~pRt+=nHi9Kz^)Gj{4y=&Z^2VeMGCl{YPFl~r!|^o@yD4&1O59CznBkJ zJ63eqxp~(+rIK{HP56#yg6%!Yr82}Ev5&0hE5 z4c!Xne7_3+;GT)gad&!2McXI!YT9#gp3POaqqX+KKmPRxneTGK5_!<@lxlR|EUk%waVb>VI-7V#MN-18Sfu_8Q( zr5ui8hztCA1}wzY;9wSjVj7s~v>u|VEg;gi1KGm&xNvHI$icT`ZH_~$?_Lzw_!U@* zr5%RX03Z094B%r+aGj-{1&<)pf#W-u*iH#P;pVn zK7J<7CtlG0LEPPU9Mdl5^M{9rZgBZe(&V1A&t7G@Lms8H4Xb;5*!DnF=|}iJ4BynJ zgly?bB-1y^D`mek*)i_k@?S)_&0abQy`w^&XRAug`zdrMdynK890TxQTGoX{ 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..5c981767f87ee1a0f8b86c32f444183cc2806bfe GIT binary patch literal 12254 zcmeHNO>7)z8D`gUYQK(u@+FSfo21=rTJlq8w`?dXPSY^^W5>jQ^={fG7!Bju+4Usj znPFzut`j1m!U4enBqSsx4ycF=;>Hcc&!Iw9Z@?`l4jfQ8v^P*BD&FsBW@qi0&3a`d z4)juI=X-y?_kF(ieZHU9Z`hkQoX^Z_rsgP~R?lqgX1q-;V>^~-sg{x1Xf+y|lTocL zTQ@W(m&ue@GRrHqOr^X~JBOmK)pAsAHq*4MrlI9k!)n#@bzL#6X2Y;{^4o>HYMI-b z<0_tRnKEi_pr#zN0AMOxnrkbnmYH8IE@_@pS3G5Xo+(=|QDy7pK-v0Rg=+w+p}20Q z6jHj%b;3i);D2^&!_d`?>!Cq4^P=v`x~Y4pM1O!2yq;+&hO42T{bL&~Q>9L3sKAP; zY8NkMxK29uMccxFT+jI4p;gbq_^dCOp5~Z}v0m0()zNLwa#nHZ>}*r>g2>WeE?yF5 zsXD!pxyXH-o!#f;^^E7Vw6OI|#?ic%V_su^Qw5KLzt$sSC)xVCWSSO@f@Qk1v+X&x zRm2IF3|%w5gUQV4no%!mo65FsIR_J6(*%lob}|AP>r$((TL_DW-t66cl%iF|LFDMR za*z-#T4vK}nWk)1nhqBB08Ql?+DuLp}_4lBXM0LB#57vR&|@M>ShgrvDxj@6)Cy9VX93+XALQn7Wc zQ54<00;OLFeP~b!%Nqj2V!(80fFpn^K3x%?n87_oPoZd(vGgGv#qgOf!|gWa#OU*4 zw9y7u-U@&v20bqZ*`gNZ>jFLE`{}*kHHr`M(XZKoFrWVxqCkxBgA?#vtN_+*W$omr6l=0jHr%=tw*M+QzQ6gq>#>W zx4984vAFu<}jCtXqwS@A4p1eYH2$ zH@U1(d<#xsU(g%6%3HF^K$<$rH0HW#Tn>o|WfF{Gt8Zf2^F4cx>ABQR&mxx)D!vLY znc9wwMa0Fd$l5l|Oq7R1eR)^}aJ?Ya!_U@HwKYxMtXVbfT|d#2Fls1fvqk+=t-6*1 zR5MJD!!U)d{J=7`)EN6|5stf>+H!PnS9Uee!@#(yQTnO)xu;SNWb)(V{g-2mt%Zv+ipqs~f}F?oGzWx6_P03a z5-Z#h&iR%ODGh6IGAeW|BL|Nh>pR(BqW`y93+dv2oMGD4`ZOGBU9``NIqYwE0UzV; zHX&2i49(NJczY;${Z;}_Mz*>yz#uM#U`4H8U`y&8ybxbfBs!j4g%KAkJF;Qf^9<2y zr+v6%gzZ2W?I%6rawOZqwPPkh}zEHB;Fze9Ez*xJV4!+F9m@$VE7f?3ImU zD?r8`#ImW6cFv08R$O~|+fW`xES ztK$X$mU(*KVL5K<2)Z#`d>KplQ|To*AKx41eHro^yzDQpO})7(8@N3))m>T4(3Ra? zQz3N0>$%ep-m&Dv^rI{cb-M8F1WdJ)(dh)={3?g)L~vx= z>Bb2d*;3x67-|_FMGK|WXBfR}=ygmxZs<4h>!xMYS*DZZJ@g#cokzJY9vtIIYrA~$ zb$+Ox;|imu@L&op1>NgD4B@7Zo#>_bLa!ZWxNzIYbh9p!u0tvgOynkvcjB7wABKy0 zM#nC}`h|9yg^R)dvO{aS1}7r0LaxKGk5ymyWv2T@$i}PoHKl)-gvoML_DSCa@+XLZ z4u*zE@vAP!?)G6OBhvd^yA4*+Jg>t%UCVGX>SNS=u_!*9FsHX+G8%W$`xqHb73p)LKQVqMo^xHMt}$mnw^kT<{2n zWwLa;T3cDFtjSgUu{tO84B}DdP-VHcP+O=}Cyo}!d}_lxN%{dyVX`6#!wnc@tc0a! zxcJIb=?ZOi{>|9l)wxd%c^*#D)@A6XCUbs6?cmOY)u7?@HJA}V?OI4-4; zSXwDnY2gNr0%0({z7CU-Jf37A<N_@=tt8^Agg<`z-gDpQ8>K*EVVw*_Zh#n9Y_g}0M3 zGsnrh$|))Dygl-zPHWXbFSW}yxxU$S9wzoWgTNb8R2F*KY;A2I`)8-(w0b1d$W*3d z6(ab@EvKoN`U8GatJg!aBn_i=%{HuEmH_-lCne6+Pr>j;%kwb2_&cqV;&;@Dn=RYI z+ZefyN8!53x-kD*9EVXJCET5E>#COheF8|tq3%rAoCb%~$9WUXp5iioq}puCA@rR zufk~OX)}^qAH1HT-mg29R|dN|8mgh}pAvAqP4fgPCSQUhv=*{Sj}^Kf!v@=aA)I5y z?ExI2|0gG5BBGd`0wS%|7D|g1xq5qkzETxc?Kv2jlitLVHjbrn35UpQmDR;N69ZJw zt>u-s7b|6qNwp%am2OUqb^a<aFcG?~ zk{!$7hofVKnQr+G-Kyr+P=?_j*Xgty#LDOVo!!01MY`wuBy{r9v8iEZvmYnme96!h z=YK35@4!?>T$^rl8}nK3nACK)rUAKQJK9pwcsYN%XMOR|%cfk=ShN2~ek2v6UlkpMz&w^B7v*E=Mi^iIvY*+@XlEj5 z7z*O%k|Fw!iR|04u~4vCG5}|~5gu~G&sJ2jyGiz# z?vF9u<>+)DjETi2{CeLBr@Wh``=dnmPEQF5n+n%1waZ?ECj4Gj>q&nv34eyI^t&HP z)3L`;f0piSdYyYvsM##-{24wZv*LzsiqZvb%|~wr)%4@H?D>M@vlVU{baH{_lsnDp1m*6 zmFWBOT)BND_g3MF^o;{P(OSf+z4wt+J58ZSPI#Wmo`qqBWUs>V5B*<)8;wUBM^T$+ cUA+)Iik;yv!9x$nV;_yPk^FJ@BX|VxAFd_M8~^|S literal 0 HcmV?d00001 diff --git a/owl-bot-staging/Dialogflow/v2/proto/src/GPBMetadata/Google/Cloud/Dialogflow/V2/Document.php b/owl-bot-staging/Dialogflow/v2/proto/src/GPBMetadata/Google/Cloud/Dialogflow/V2/Document.php new file mode 100644 index 0000000000000000000000000000000000000000..b2730819a57abbe45c0449cb982a3f133d08222f GIT binary patch literal 7758 zcmb_hPjK5<8L#Z5b)K6veY9KG3tgejv}x$t;KESc?H?spykS$vb=~~^R!N#Iq0lV2c25zpmV=+9igtFxvp3X9HD1Ogn#yM%h0=` z>uDbRx1hVKZt5P))V~jz+z_`l!zD0zzwP$W?0ULoigdz;*(HmYMc*g2U9c_4{D#Ow zYEm!&h|Zen5y#YwPK~%-N4Gu8X@Y6B+9zHJA$_uVIarpu)3?P%KgMcxUywIM&l!^F z>Z0fnZ|IoUS=`jYUihms0WjItJF;n76a~w4tJP6XBNqovTrqUmn8VFk)rrwtCXciy zy5$^hYKsJPNgd<_I&|vYLu9#bnSEzyn!4HVY}l0LheIjce1KjV*xqjXjKir6u{)ak z_y}{`Iuwhi4ea!DTXwgz33M1902AZ)8#ncU&2q07l6Mt~d@-aOCEq3Vx2x!K>gvWt z-?YRUL21+oN>3`qbAcPp)}c{Q=J_q5_*!IOo6<|&3iuTmoR1hd0f~a4g=jnId z!0PqD${5k1Y=v|Pj9v|lSf7G|FB7`q!65H&;h-Pr0Jb%-;8}zg9^bpbfamYn-7@V6 z!yr28gB;57=7vwBDcT_mf+#G`ENA~N3-~-b+0$Ly&~{Zel;J}e{0f>Gz%r`0Ym-8D z^t_2qJvOZ!gY^3Tpj(&{vx{?;O3BZ1(hik)5T&>I+&1{7L1ge*lI>fNFULg;oIX|a1I%B|*<9flE>LXG( z2`2f<*HT5dd{vN;7v45Ln4J)h-j{|lqw<` z3&Sg0>~zq{Xn=STO;JX$jm=kz+#jb)DJ*p?q2mD>bf@zb%x!@=B|qI_8O_Fm#(9)| zOm=M&i zl}1}#l~>jpb#?O&n5iwLx&B~&O6sC%h7hpk^k!RbkFR(VMF(rjy27SSSN|ydQ~texq)7AeDGzLYdo8FFq35q zEv~4uWK|kncj$W7Kn+_r^$!4nR^%*!2st;pGuWhA_vgyZDw zOR=VX_%416or^n$f(@!<0p)fyhbmoOBoodJ=`K23BL>+|{G<1fccGZ>+3*&(ub83* zLHFh`1%bbg@?0?Li*e}_$}9njqjM<*lbMS9 z3cBD9G{*y)yRO!UeS*H^&=*$K&y#5?Umiuc|8Gc0c^d5tyhR^9AqAbHW!HnVLpRwO z6~LRQa-cK7n=hXMxxb3OKv-nz_Rugw4M_3H;fpELokjUb98w>h^Ro@#)_BF>byV<| zBR$qNBGUp!hGdw(&`7m_0}a zD!+#J4qjg_{y2kXV<$KMYEr;4(}2vyM8!Wg!*6)fZ-r0gK&1TeFaLNi^O1ln^up?%4N+~+{IW7pIrc1?*B;EK0`C7-V2B{_~+ ztQa5OUh+vgJ}U{SxQFVJPt9=;Xx@?1qBNdyBGRKWe7ISuCp$_Fe#GgWik$2;#eR(3;m?5garK?NGjZFLJM-RQc4nT! zeI;^p$-A`QEDpCB4!dxSHjDB3>Gxpdt0vuIdob=R4fLTG{0o5Imx5fFB|{&#O$q%c z&~j3qkMX8Fo?9~MeLej7;2ioYK7B5qKk!oU&+>yuo@cw&a(QQGCr}CDjUilOKk`3r zzCo`)wk>CH=&h1lrF z)$mKHy>&hM$7h1@%S@)W`m0Q_&OWV{R_LeIQZ1ZNx?kBk&Q6W1m%?v8SNso>k?)uE UCR*=K_;$%G{cntWXb++P19bpRNdN!< literal 0 HcmV?d00001 diff --git a/owl-bot-staging/Dialogflow/v2/proto/src/GPBMetadata/Google/Cloud/Dialogflow/V2/EncryptionSpec.php b/owl-bot-staging/Dialogflow/v2/proto/src/GPBMetadata/Google/Cloud/Dialogflow/V2/EncryptionSpec.php new file mode 100644 index 000000000000..5b0a502d93fc --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/proto/src/GPBMetadata/Google/Cloud/Dialogflow/V2/EncryptionSpec.php @@ -0,0 +1,48 @@ +internalAddGeneratedFile( + ' +‘ +0google/cloud/dialogflow/v2/encryption_spec.protogoogle.cloud.dialogflow.v2google/api/client.protogoogle/api/field_behavior.protogoogle/api/resource.proto#google/longrunning/operations.proto"Z +GetEncryptionSpecRequest> +name ( B0àAúA* +(dialogflow.googleapis.com/EncryptionSpec"à +EncryptionSpec +name ( BàA +kms_key ( BàA:‡êAƒ +(dialogflow.googleapis.com/EncryptionSpec6projects/{project}/locations/{location}/encryptionSpec*encryptionSpecs2encryptionSpec"k +InitializeEncryptionSpecRequestH +encryption_spec ( 2*.google.cloud.dialogflow.v2.EncryptionSpecBàA"" + InitializeEncryptionSpecResponse"u + InitializeEncryptionSpecMetadataQ +request ( 2;.google.cloud.dialogflow.v2.InitializeEncryptionSpecRequestBàA2õ +EncryptionSpecService¶ +GetEncryptionSpec4.google.cloud.dialogflow.v2.GetEncryptionSpecRequest*.google.cloud.dialogflow.v2.EncryptionSpec"?ÚAname‚Óä“20/v2/{name=projects/*/locations/*/encryptionSpec}¨ +InitializeEncryptionSpec;.google.cloud.dialogflow.v2.InitializeEncryptionSpecRequest.google.longrunning.Operation"¯ÊAD + InitializeEncryptionSpecResponse InitializeEncryptionSpecMetadataÚAencryption_spec‚Óä“P"K/v2/{encryption_spec.name=projects/*/locations/*/encryptionSpec}:initialize:*xÊAdialogflow.googleapis.comÒAYhttps://www.googleapis.com/auth/cloud-platform,https://www.googleapis.com/auth/dialogflowBœ +com.google.cloud.dialogflow.v2BEncryptionSpecProtoPZ>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/EntityType.php b/owl-bot-staging/Dialogflow/v2/proto/src/GPBMetadata/Google/Cloud/Dialogflow/V2/EntityType.php new file mode 100644 index 0000000000000000000000000000000000000000..9f17127dc61814f08934636a2046f174e848dcb4 GIT binary patch literal 7509 zcmds6O>7&-70%K>u}5~KjBWievAtOviLAB)25UK`783dg?K!qUfP-W_FjuU6NY; zTv}f&&c65Nz3+YRz1i7Ue`4?0=$gDtOyX!BX~?yX?ClWQb}Y}TTZUX~H=D$f>(;KV z8^p=Ta-k%zmp0{MVP*3~GJVLi+~$YqJ?>0YPm zb!?Jhh7mHgUEM-H4SQ$zrb%8Ka`$JC5Ufw*-?w>`@#gJ?eAB3_6iU75Y%Z%fVTO?j64n9s+Y zyd!%~n~1y1vO~PKW8P+dQv==bugU<(R9mm8rfE?WEYr>BdolG)3{zY*bV$*`be42t zG#1E?_CU9sgQ?ylK4%g;xoVj$r)`?L*{YOm%G84e8Ria!p!svGxH#qp7Jee zwho0$Nxu8FYTFoHUX8X~j4tVN0 z8f${nPlA_cm{j@}I?a_ZMyDQVM%%}ZM|laIaXY4Ec6QzA6nMhHQ+|q0QY7$2H1WpD zdZD_tzELhNt}Lw-3lmR34$iREHMKk;;q&M$`?b2Vu{n{#<7kZiyjNT<{=7VKLU{{4 z9fJX1Ls!+U%~BOa)b)*((t35RR47LFxr&|{BvdFasava?6H@*U(m&PTOX#{#2t3VD z18xS!T(*~5oC5~_lGHsn``G`ho7Gy72Y;l|F$B+GA((GnygWe1uJWgiEB?rTT^ zFDF-Z*X#M?-Xm|fiR+AU|Y`Vg?V7_zt!h)vZ&JNyrG$`HbhdbQ-X#iAmK@L z)~4$&Oixw^r#Nw@5Mt||b)T4w(JbwfVxy^;ldcUTh=7;p1Y}(BmD2Y4WVFRoXxs#P zR)uYupNfetE)xNj0F=B~<^d!L6FmYFewEjk2FN4-o0dmb$juc0vkAeM&2`0!ec z`Au7wpP4^_-&;1Es|NTT*_n36qwXw_=tVTvW*b*&%Vsnh%cX<72VFfAPE~e@>yx3z}EoiDGd~)pQkI5|UW0(XFa&N9R@b`V+W>rsD#-Y3L@eu(70* zhD8AeV@an2h9@0Ipg+YDyC3um7tqr&7nNV2E5mR*jsjP@eqN$UKc>7~>5qxMaESBj zGYO?xd_rx*aNVb}6ZR8vTGJVMm}#AgCt9fP?*sP*TL163ALS`!aDo=`VGy*ynPUqY z%E~VScH|KcHzPAqLgU5orIa!1Xp=AZ-3%J*S#GZ7w z>F^p?el6{({$XQJy~s};^L@vM_rCeZN2vzBLErQrbAdbI8EB55m%8GCY5QgT(h%X` zbmV3SDPkb~`M%kYe>f_pKG6V$gy#?C0|=bGH|(jHHjfcO)5o!p#fY5gNFVYgpU1G3v*#lmE(&8V0l+b&V{^q0@^Mpha*Ox75o6L%aN4<&F*7K zd2PtNAJpRb`~%~hw>&zE^v{&lA!cH{jm*$tCVQX@6CfGr{R;nYp!4XC74*;~{!hSk zp$8-by(}Sa~KU(=K!Jev!bnjI8^09M1>BO2O*@G4cNAKc2) z_Fdlif7U}23OdB+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*eFCq+*}KmFs+FB45T zL%&S-xvDO7ci0)e9e4Wni`=Ii7lJ>e4pjP|n{|R6`q^vNuK_T;_WBg2DARh|ZBlNHkljJ|KRW*JIR3ANJO_b#hec_yhY^R%nNA;w%@6X6jNEZy4y8h0NcbD!MM&o3 z>k=~e>vGy37c!&l{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^%;JNB{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..a5475852da0faf1b79da7c4cc42e562b13ea5571 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=HrgOmFLGas`T|=9j#)3RrX~GwxZu70yW;JUru|Zf@+dd) zCpr{{>L8w}`XTc~5$DMASK*a*Go!MlOsRP0KL|>kPR2-jGYe`~y8AoI15U|V7-!RS z0internalAddGeneratedFile( + ' +ž +$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/Generator.php b/owl-bot-staging/Dialogflow/v2/proto/src/GPBMetadata/Google/Cloud/Dialogflow/V2/Generator.php new file mode 100644 index 0000000000000000000000000000000000000000..a1a6f9d89f77600952f433bb04b027cea171eec7 GIT binary patch literal 5854 zcmcIo&2!sm8L#Yo)K5|;Rns)}&VttMve|5F7wF190I22QCc5!0d$sGo1JbIB^4RJup3R;>d~N#PhzdB+HKDI(+03S$e)d ze$Vs1kH2ak+HgnOA|`P(k94GiQ^`9dlI>WY)wT@jpx^BhM`~L~wr&t7BT1#Iv{!9P zN~zL(2U%UK@3cu?>RDFLAlbHI^*h;)t{GOZYgi}Q<6O4KrCUyhi3KpVBjVaxn@C%= z!Y=W&j^=6mTTH@!kxJMvg%b9k<{kmG4b61}J1qxZf`or||G?1OlIv+6{=2KYs&48Y zvg)6qFPl0OSetP`VCAcxwqZaJ4@trNdsrZzH+ zJ$kMj+1}~&3PV}b@FK+BP9`Et%wnr$$uLv?S6ESS=BQj46cwE~Kk18^_7{@*1iPT49%~jE`WU&jhQq z-2Ku@1*H|#dnQC07VGp6W3aeOTo?18n4WVgehp?E%i!gb%-s+8$Mkn5%9p7l6HniD znDH>6%z^}em4a)AX7>6t+ij~uB1sj|?l$W;mA2yA40HUv-66_xyK68*HHs^+T(9mZ zYHP1iQ;L;xMJX*`5tm?LyR|Ftsq&Vx*IX9F8?Yp|n$=yosg(SeF>w*DDtjfh)lllo z@$|RgM$s~liQ}>tqX z#(MjTSb{mL@7aBCZJx=Q=yeE&jef6(LjY4oEsUieKyuh{aRK7b$tlNK@fyq?Yet{r zS|T6&SSX0FteY9I6nu9=%`FYY^Bk-(z2Ezr-mVAiv2^*PI}&lih)uvx459C7?mSOF2SV?=Es z35#k(PvI)ep+zV-e6rKOi^0mch>OdSnDERZxOYgGZNZiq#fWW$jZ>RLLo)Z3%O*F| zL}sQU{c8bc=r0Nm%};8h;BXBRjY_j6H!IaWga&{)xyYVlViKUPG^#r-_B$@V1-I&o z+^FuUfOR-VKan5RIA%@9TMcVNY@ z*kQ1z?aBv1`WG{h2wMsR6J1T_UdvZs%W-iH7CQdng(_gfn5+E;+#E)Q0KTrVMxGuf z{ZJzq;L?P!#rqFe0KWnKDU_KMm-B7QjV!@691{o@j!KT{vN(&zC36$UMUyiql%7i& znTl7LgKwCMaXL%=9e~Z!#8h1Q@BUr>&QuGb_ypGoy2ZNLm;TdP*09?ASeJbnJf00s z)JPdFW@j6bB`r5tg9{0m_cNLPtpL|KlAI0@SNtX{^TeNyj>gB6QglvGCV0c=D-Crl z^%#=Fudy!Y{R!-E&6JM4WmEceP?NEApKjgka>8;V7S})wEe1bpIhOlD0wDCp6~7mQrIE9cn41*v5n}(ekecp*lm3bDN`9N4u@zW4ojExe)E;g z(2)7~K;%BsliLLzMtf}IO#G_=$>GD1_~l8d8m0|wotWKG7Jl|hlUK5TE@q}b^-Z5T zJoAhw}H!d6hKcRUe2fNAUjSvUsP1!5$ zSMtq4k3I(I5X5gkQyCrSflLsV#QXn<>(p-b^XH>CHUN9n7(^`S88)+Uy>`9*x|l QUU-wrDEW=&8Jq$98internalAddGeneratedFile( + ' + +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..72082f6ab81031b4d51a3b497e54e2caee6a8994 GIT binary patch literal 12742 zcmds8OKcm*8SYZ=pE6C4WSd&&!O%(U7!KLcc{p*l@8PBx<%wrbdE zMianLwpFXC)Yar-Ik%+RN<*=g>LOcSoukXE^WO66t?U(mx~^DOvcSl|eMsWJX1k_q z^`vDhHvadlX33hN*|<*o5T&@9Tvv2U#ihM-*V{(j)=VQw7nF>;dj5qZr%C5N+cZ(? zt4WukGF1dBp-Oje8H!$=SFL(WYuaY3j8kW4H&okGAN}V13(mHboVK1k&v~4k?P2n2 z(r&fY;O@y}OSRiA;|k-O5_sT!s`gQr)YPhyVVG14reV#_`ZD<>_FFioYiO2mYZf$B zZ{*ZXWk)kx;g+tb4patavJV)lb0*s1gAiO7O=F|gHVn55t0RYvX-)`Ew zgG=o#Wm;QOtgS<=T}6!4_mP)@^~Gz{zbG`NM#Dqm0($Ft4?7e|=io>0LiOB$eo90> zG0hx0?K^aOCo7(Ih$u}B9iF0yJGc0BU|^j>MXotmaVE?JCbS$tI78>1p?(ph&aLju zJnPKVebZ)4&$P~@GtMLyb9*)Qf z7^V>|AtZ(K6S<+kO9GjJ$%bY%b!As(LlJiWQ>G~ceD zw$ps0^liRwl`iA^oP_aa3;j^DcN0TMXM}&9fGCDT41jt~sc$8Qab(;Z+16#`O{wW> zBQfQVJPkzGc2rr}Kx4|AiqSCF*AvtJgeTy*YBVs&BGeQXKNBbY(IiZ1Mzd|pj-i;` zR$?qUd9x*@Jd*A`Pc|24VTeoH8w~0AHl@W;cy4l*c633Bh zEPH8is_C+`mXm)TW?H6c%j>3&slDA~a6r5;l*e6#50SHQ1{Fe))OY3yI+MHu)7_(* zv2G>^6aAF|m|Sq!;OZ>kV#?-__@4;GI>A9EgI-DsFl_HO)dY3SSoYNcw(2C8uHb6A zSA@I`BPc4udWf-o2wI2&o6~vZA zM@?f4kUg0k+!GkVdPt$XdA@+Lscoq(8BwAc7z6z1kh%iHR4y_N@yeZYUS3;XE$8P7 z3x)iA{2L?+WBGTarE)PJ7f2k&D|!4ZRr2wO7#SDDhXPC>bKD8K)IHrV9unkkN737A zkUJ5Mx$xy^(%ZiQbeihN{gF6oK$nT3<;oyn#!(jDvbnHel&a9 zWyZ~^XDw0Jt3+cWMP*W_eE;CW6 z{i4~ILr~1o#g05n5VhJH7Wo?7i1r|0k4$!s7q6=AH_wrwm~Fe%X*FpT$6Cek^!oRunK7DoA> z0mXT#gci=GWwY|w=S;i_vCbfayvC@~W!sdkrmEIAot%pq*s`{DuF7D&&rIYCC2qm- zPLdYZJ-yLTU;>A6xK669eh|Mu1QT9N3ulrTEf5tOJ3z880-1MH7fr*5NL|bn>kln`=5%F6P^=DY5)R})cAi~6SpBU$F9!~V+4)P?#8#KiktP8^H zcJJUC!Lp8t;JHLZ{3HV4XNx|92xJ*SVyk$%pm8BwO7|(J3rK=7PJ&@0;7NbNP(vqS z_8VsB1j=`~B*l{xCE}hHBECev(6pjPEwLsa_KJe_>0@yS@wa$B!GIM=m}JFOA~*cC z5Mb@33B_Cy!o<%^!B2JOY_1h_V(Ewhr1YogFPEa$`;!O3lHE4vE=u z^(;KSl3y*CmRIxg65dKka-Y-d1dK>)^Mz7e5WgA)(pyuKdZ!0gLYS(TTDtcu7Q5PT zk{4?3>D6rV^9Hp`EPL~4o3dhXo}Y_LoG{D4;zz@9Y9Eg7_vT9;SZhb)rT=zLBGq{! zC0_1ku>88?F2UyDI<~LWmV+zWtQEfy+(hnj#S*#hRC+(eVMHS9t;n0${$%MOmNmY9 z^`zHYIz{+(+?Cleg@@F@cbLs*)>euf?$-;;m9CCW3;_EzvNTsIl$Nn+a~z`d@43=) zCBIyWM^Za5)dw=EBvJ}iD7feG&b=7WG0A|2^J5Usq-dz3hZ z$MO?+soCB(Wb9Jlje$*@Dg3k%rYN0bG|CL%TZl}sXk-mSx823Gz-#PK36K;;10K1M2~XB%op?MiA(5l zV=#21a3elUU2^pXHgV%41pO41kdKejFK-ocsGTwNvJ*TmtjeWjd9hSl#J=u0M#$s* zvwU4zUM#IuR^!p!1dMI-O9t^aklv;{d7`(I?_Y^M>N0@&c*=&!;Qba2ZMXBe>nN_g zTEQ-JmpW$PWan^xS;`eL=m^-De7^6Hj9Qgfi=~RZP$)7~L}q^`{9F350Lj4ZCclTn zi%lzyZyqxIYJt3f;er)%nfuPC2N`x%=DcmNGWRh^qoX_^*ZNG=%{sq!&fIrD?zcYm zsQ`qYi}=pgiu!&VPizD)9Pyrkx*~Jb+f+jr?MVtHJxwPEY+U zyeedT%R8ES&q;01KiU~?;cO0lY&|t8WeeY3u;S0Tggi~}#PECD+)|A|zD?C(szW^9 z&Lx+y5zjbrT{87(F34#(ZqW8jU?&czUt_FWR2?0KFPYxyGhj!vq6;Z>QTC`O?LExkU_QE#OE5K$2i0yF4+*{0rxBRR zDRzA`sJO=x6XK5F*C=(?H)h(yliUKm%crqS=3|Lg}VlWvLE_D;ce)>H^P)hw&aBLO?!eg-6Wj{jlPTQc4lFC7} zz%0r{JyfW@@FoDKK|?<|1E=x4L94M_h5YTVDq&mvw+sK$=gGFicmtNqP#uMI|_LSQ_u~%B|%T!t9 zdl8rn=23DWNP;uNi1{%B>6n8bzWJWyymh(A|L!BXo*E2QvrgW=dnFYfUG8G?F)AXM zE)G^iaAp`q{2moC-B02@2_M$d^wFt^i-B~^eC@;RMFwgyo>HWWoyo_~@P!{f9<8xf7V;5k< z4E~}4Il~&k-=bN&68z%}LHJc9GQaSfh`7jp)R3N|KWa$Ndp~MO-^$iTnJ-*A=RMKB X$bSqF`0c>HzZ+mP`TPC{@BrX{jj0+$ literal 0 HcmV?d00001 diff --git a/owl-bot-staging/Dialogflow/v2/proto/src/GPBMetadata/Google/Cloud/Dialogflow/V2/KnowledgeBase.php b/owl-bot-staging/Dialogflow/v2/proto/src/GPBMetadata/Google/Cloud/Dialogflow/V2/KnowledgeBase.php new file mode 100644 index 000000000000..fff5b5a3ad57 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/proto/src/GPBMetadata/Google/Cloud/Dialogflow/V2/KnowledgeBase.php @@ -0,0 +1,66 @@ +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"žÚAparent‚Óä“Ž&/v2/{parent=projects/*}/knowledgeBasesZ42/v2/{parent=projects/*/locations/*}/knowledgeBasesZ.,/v2/{parent=projects/*/agent}/knowledgeBases‘ +GetKnowledgeBase3.google.cloud.dialogflow.v2.GetKnowledgeBaseRequest).google.cloud.dialogflow.v2.KnowledgeBase"œÚAname‚Óä“Ž&/v2/{name=projects/*/knowledgeBases/*}Z42/v2/{name=projects/*/locations/*/knowledgeBases/*}Z.,/v2/{name=projects/*/agent/knowledgeBases/*}Ø +CreateKnowledgeBase6.google.cloud.dialogflow.v2.CreateKnowledgeBaseRequest).google.cloud.dialogflow.v2.KnowledgeBase"ÝÚAparent,knowledge_base‚Ó䓾"&/v2/{parent=projects/*}/knowledgeBases:knowledge_baseZD"2/v2/{parent=projects/*/locations/*}/knowledgeBases:knowledge_baseZ>",/v2/{parent=projects/*/agent}/knowledgeBases:knowledge_base„ +DeleteKnowledgeBase6.google.cloud.dialogflow.v2.DeleteKnowledgeBaseRequest.google.protobuf.Empty"œÚAname‚Óä“Ž*&/v2/{name=projects/*/knowledgeBases/*}Z4*2/v2/{name=projects/*/locations/*/knowledgeBases/*}Z.*,/v2/{name=projects/*/agent/knowledgeBases/*}Š +UpdateKnowledgeBase6.google.cloud.dialogflow.v2.UpdateKnowledgeBaseRequest).google.cloud.dialogflow.v2.KnowledgeBase"ÚAknowledge_base,update_mask‚Óä“ë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_basexÊ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..7e7cb3ba934f786165f8d6715b73f7fcc83a0a22 GIT binary patch literal 14108 zcmd^GO>7&-70yzYB|XZLJdR|Vi4$h+*s>#&DU<%uagx=K6(zQ%NU~EqO4$`Tk~gMy zncbxv#n7cd5CjQO6zQP_dMZ#9D0=9nw;qBvJv42Aw#lJL(ZWE2qUfoIq6l*8o1a}S zm&=hTJ3xW@B$G35X5RbW_kL#h#8dU_bvTxrr8adG^&NFW!9YawVHFY zuvskBP1m<7R^7DyJQoaLn;X=tn-!XyU6{N`eY0x%=E^LWu`LTC*xS&o^@cid;!LAmVN>CjubGA=i+pMijQ?KG$b>DFpaA>KtPW@1k?33|R za#<$MTFZ@#J(fysn>?5E-3E=Wp3Aw^Z@BhZzHcUAJN#=UL1#wYS}|RPSWeMVEx!#86@Kdn)|3MRb-49Pfzd_76JO}x?S*uN{K!Gr$4E4z<+SmE$)4MWMxKIw zu2Z9#6n->RoXCrvBxyY#k(6J=IZQw=IRQsJt6p|##c`{ay{t{Dvb>^tB2AA&zIM%8cy*t{kfj;ba7_4 z8=Vd$1px!W$>hw~zPrU$kbMe{Do2qt^xU9ZLTlsz^lqB9hS1nRDfKl?Ux0l~ALL#b zS)9KxQ@(s@X<=q+?)==$^vFGA7}C#NzGz%38?!T)mPa&l2!@Tz%kvkF<(X;uVTuew z|IDT7^5vzO#gU%UpS6D)A8GJ#1opx(h)qUiF{M$IPb-;_ki;r@;Ia`E=BN` znfq~Mr;FJDhJkP9L#Ace>LEoK@TgrCa|Uqj9p`A|5)fo-rl7JJMrZCI>EfAS!30{& zOSLvby4b@q5ZnXXwe6!sv$o|~%#YY+9#hF%3T7E{5(eQ$&F4}}?;%9r)!?Dd5Dlz6 znEG5;<*EV?}K}LYZ-NUk7u>M00GE>~H5szA=uQV`Tl5?;h0mQH< z81u|+BlWqla+2)QF^yJeGLB6bS5B&Q9@z!cb4p)^(OK$8J`Of_wuQ`tt?iOC^fxs) ze8KXfg1tcUogRA(2I>sG9%j?ri+kBoG;$b#f9^Xss2y=(-Gxm1Uc5Ro4n-Rbq78yt zz(Y$g{@=9{anWHLqfI%oGPA>g{tjCHavf_3nxNd6<(T=qSd?3iF-C*SFSAh36_Moq zVL~YE{kwfI%Khy%IwgoOFw0~snpz>bOS==SE_|jA%dR(k$zl(y0J)5#=h)z9?m=6m z=_X?lFxC|A5Rjg0*C>F=VJ6}?r z%;3}F^73$?@~YSmUm!!cq{D%vFxH52fDiyz5Ee_M(l~fvvJZN>jr0i^n)Wx=BHPUZ zF)I~X$Kw&R2_@p25RhZ5hd}J>41f(N&kO)`1X2b%hxKXp=I~zPB zM8ZH|adDg)(#1k>;G|e*1QQK5Z;_z^9j;F@yu`vWm4u5j30Z~*t~WMJyDWAPK`0go z816ju5=J@7+_;HR5hKa-a372NJiSd2*|!IgQ!va8#*r$JA<%kSb<9@l>!0<)1Be@H zZeXq+H#OoHquyQNnQ0hoaZVBYlse?z9q~;h9NY?LE6fkDWS6*5Iwu#xI19-Wr=W~v zvS4Xq*JLpYY3@~mcR0ufpV2Vy2k|j?4PNu$r!&E)%xIEVl#pJgHCn&!*jvnGoH#uc z6DKHED5Z-^9mENx13?M;z8eH}fbXdzL1BqVZF99odD&-IvHrsXS3r>SRlmp&Cg8Xn zhY)AoIMj0zJ+PS3PmaQ<99^ZW7$OkQ$YpCz<`DaOvLE&f)HJ#9JH7B=N9;?QTV$c7 z;;gfFAOY1Gqj9pQuz_k)*J5VRXZ@PGw zsB^EXl3W9kcM=W_kt;)iAPRS`q|Bj=afJn2LXH9NSIhb_52|hd2ZCT%Ms+=JFjl zMZm9nPSM}OdZbMe(kCZjm{$NuAg1lzWL+Rp1)Nf8Uh31}Gssx7Hjuj$j;Ozpf{fhF zdGi$^;{VhzuWN85K^4+8B}lKCuf)uvtS3T!c4?A-Ymk-uSlU21u$0fbo8Cey4VTsW zJi(P&v4FGkJS^AXNe6i{8Df(scIj=&Q2ez9_a&ZNS^yo>KX zaL*TXiWear4PV${5W!hSR%Kf&G7*UslRDOe<;f+lI0p59q~K6eP+NepD(1-*R_N_aj)Zyy05hFau-+`aRpK*C`fJ zJy`J!uv(QHzDn^(yjPpT1ie4#@?%QPO0BOdRVd=5z%2GW#r?nx>*teEIAC(VM^m%= z2yp?CEx>`+aXWSNZ)-5nB&s3UFQm#dwjP2-)f77_ub!BRcypTIEOBKiTGCh##E+?L zzJ|+xK}Xzzk&s6v0WiN31-P(f(m5yN8Wx@SM?N>k;Y8jTxrDV53Nw)FxqNp~oiu?=@B6g>L*n>6-R}otv z$Do(GuH#A$BY~^ng+jOg-h5u_zYigF`1lB~ff%c`bbB_r{-Sa8#bZ%@0H?uG3A-|3(e?Fl6d3 z#kV{SuPl*{K*OE8Tg_`&P5+68El1%9ZO4>()eCUAjZGpUH(gX#lrgD->qR!(UD@}q zUKmXjMy|qe{Dcgc>EhEWR3*yFOI^?^k1WK5v6yI?#B(P}7me;$Xs#=Y-?m7@gLd{f z48`_>5uckc(&W$nr3Z%N0+DW{mqs|q1Yk@plODk|&)xCn^GM%I{JkJX9|sO%yPrKf zv^Md6k$=pgmM$*d`AYHu6N(NN%pT==p!jb~j>j1``wI<5;L)$kJI<FsNi zM5rM?Poadk4Dx0QM&kGNL|M$lM+c`@!m53eh!*&E;bTKS%xKX?m-q;E(LPV1jaH12 zU!l9Sy&_P%OWW{38@qRx4^RV#BYrXwd1$~@@-wX%!aZ=NeB9=km4$6-uW&kU=T`rD zv3McypN;|*YEud)w^K0GdKszqrPi^5{)#G+icgVP`a5cJEUHP~?dI2cF%?H%K1dbo z&&D;8p45F^ok|za9KdVxDhXsQ& zPrqkedsHL8O@(!UA*)rQw57~ig2BO7loZr9M*`sYF*5n3rY{CoP)D0Mqzf{Q!&=5G z$-jdwGV@mSZ*~yeg=KeGgnWp6B#+vxd)0i@HayVh-imAe4>66ttLe)f4!#2eB^|bT zDyCDaf2)J&JJe~*GUTt=VU}u&7W+hfBP?p3=!8JCd+jRdAH{V0p4Q}yJ4b7Dt4zD= z`sx>>-Pl6pljb#Ov((^~KKZ(mUpkbPyn4>6X|2OlNeh3}ILW`S=~p|bU=P@hosFsZ zWu11Ae}@2WUn~3S`^J%uE!saBSFihi-76IeH*emQN)Ml#bghGwoksKbu<6u01JQHNkHZ@Y(yi6a8fdZV&5%<~sG&v(f*2 zrfEM)rKZpSG?ks@zY@#y+xYx+*c{GZDX#A4O|ZvKhCf)D5I?Mn{0@u#sKTlw{057U M6u*_)hHZfV0`14o9smFU 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..a6bd1d5295af542a893637e00e93b2b369c096dc GIT binary patch literal 7761 zcmds6&2!t<5jQEz7FV<^Kgltz$PP?9wfseTn8ZzJJ253vvQmGjlIqwQPB0MoNTP-S z1P_oRYjo*<(DvNvOmFR>(_?4y7oOMS3NVt3zu z{&x4_!6#nVgR9yCb*OIyw56?WX+f82p6>>(>Dt;_*ltr_Gu?I1vZ-IvwEA=H+4EJc zQD0oWf~?F9eUnzTj_Y=8S~hJrY?WJv+LF_>O%ghaREEi|BwHc{nwYpEqhg#r=wEuKX^Jx(J&V8Xb7qAn5 zY9{!r=2^{}GVt5wf9xo*caZ~T~J!tcK(brVLD1wW9 z1iq>Y_2`azBo5pIqy|rY-4wa6$kQxALZ0A?vUxp4GWT7q{`)C}3d?n*#$?q4jE$0i zS#b%JN4zYzR7$GnQHO}1OV6xh;wg&hy%LznF7-6>w(pr`4yYkh4+@Hn>r%Ewp2#P~ ze`R5!P6KKNvP_rhmmy^VslsVxM^aWT-#n`eEcE7SJQc{CF z3h}pe&+v_PR>-1&(aNooBu~nd(hoWP5+_Gpd`2F@s1#v2UKkXHgoN)MC}ELP&kmug zriF%4aj$> ztJ|(AU|ShI5veTd3Ni1A(;*+gh^l0UmJMOHU5&_+T%+0=c?-tSp)}xl!C`<2V@Jpj zU^1bI8HSFFPE8(F1HDE?X5h4EY}u~SDoAf#h*XPnMYae+;R@rRv5x=g298l%3`aI! zR;0qT0tk;+BN<8Ntwcga? zA-}7LIU$&xWRWr%rQD48R-00j05Fjbg0Fzv3w+lFn6JhOb-QmCzayfn~kj#ndO z8YWEx544%iY&X!`mTg;3r*K|8Ex>p?wE1r$cZFR%*>mJEO!hy)wT7XI3}KU((#^CW z$c9vUDp`23MrkW&Z4*!{I@r0;l9CP#6`*6c4t6 zpo=As-V(ibPZ0AcC`-@~?5!QgWw@>3rq*_`E>jJ80T&YiL-dGqg7>{N?Gk{3vlhP| zf@#DgYOG_3cXugF-2aE^U>e35+GbNd3~=D!nJuw@He1LHYIeL54uJpv@$A5BDo-xK zdFmKzsCBGZKz#7OaXr{VG(pT!aHHxS)L_pC>hi;cT=z(u_IuvnNboLQW zpp@O`5{@?`I15g-g7r3s>0J)tp<;#nLC&}j1;M`C6_WYPLCicHd&(vbL}aJLtQ23q z59b_LS4Q%K5sXEZn81YeT*OhH?-Abw`XrSP8>_hY;+ufzOXI?ekKmHrNA<2@ zw{;w&7~Pfa57?cM{?V4NFuCGO7*(U4 zux%O&Pa7*MwS|Vh`f916|LEDuQe$p$ez8#>KY;@-tS;A{t;{ViF0GDd$lGwC@vN>t zpVwCwpDjE=^3~M_63jKmv&Aap;sKtVQ&YdZ#Sm8mQ+sD^enF8F*9OHdKyQfW%={`| zE-La~VfSb)uQmown)^=T#iUM}hsz1`mzb~AqIM0Y#TNL6>b-qIk0(B%)kyIRxR4-+ zH%T%FlLHw?E2$e$EV6h9a`6{}yBafHUwR~q{>iQ5#A*d0ZYG_ z_1IG8^N(dGj;=xR#hYVv z(u>NswLfJKb4PnCPW)~4X=iVaMK!WRRt6I9%A@VRZ#ydaw|Nch^eUhy^ihJ)UdC@n zA5+xo9!)}@cC36PUDr?3Ev1*Spw*XKy8DrrA!z?Y#q_ zf?y%ivGiL`+%`bhe^=vVE@!H>oUR*o77QI{v%Nj_Ai@k6HI-H>n$41mv}PV{%G;`8 zMKfJRZVMebNKRkWdW~>&?|uzw28(Tz?2cjTY`i4nExxVOHuJYtw@Gr%rr#4wluxsM z744c{17E%gZjM7Fm}FL>LqD-cKXE&goOTgqQ>FB@Ys=V|yxjMoWf!pCa4YC8IN!Ix za?9jCnsXoV_)a|>=6UjhyV_wrWsQXFbh}WVbodWhENz-pwj%Y-DR4GGcz70^u;t@i zOo+`+S(e&F^|sMO=i+q9YneMD3xk&>F@P_!mMXhIC5pqG6u_&F z6BXfe2_Z3iIx{~En8DZ*Pn$lFO})PhxZ>; zii;~tE5*W@SKt+Jk-N&XITM3d!Da4}2M;Tid&Lrcb|#+vJ@G8}YXZF0*Dx$av{$f5 zMPCY}1r}+YK12$^(w_USE6E!)Bc9IF2bigIS8@`yYj2)@%RV^z--Yc^7^H8jmZ7)l za>vO3)Rj6IS@b*mr5nv%mE%q`6sC{Tp7(aFt?b95fxnCmroM=Qi}zGa0tLgX=%Wt8 z1TKP8rfkuyx{SF&8S`Im9!9GE6qqn+wdJ(*QW%6JrbMlol=}W2sMK z;8Ivz*rbOOf_K5B+c5nj0;XY(Bv)X!G?3SI^n}#=qOsXOk@^5!SVqD0c-hGvQWG~f zk(iPCg>H4xLUfJ_gyng8AvGw2H#qrnsxd-~0&y`d`kn^<(4?bRc;F#EZS5V)C%g$x zcN~{>Tj<^3lb(=LLOJ7==%24no23+Rsem*zB+%p6G4pH^z(A%j{4D{d_?-;j@#5y3 zzarnp?TBP{98*S|)X(vQoXhF`zyJL_{#_j2vmk7c%w;q8U&7(Pva>5!Ract?g9c^x_B9ajFV|erkYPPffsjHuxypZu9SANnKsuiW}3AtugB($3C~n|A*f zvfLq??AmkQ)MU~!toGcf|ta_U*_pUYQ@AVC% z|MHavNyovSH?wi8|HJcG>}fn+So$HJTz0Np#YOwdRV?^duHvIiv6t;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..3ac2a0b00de5ff9bc546227023da5affd2751375 GIT binary patch literal 3769 zcmbtX&u<$=6lU!V#w$Oc1I=3Y++cETyq!Cqa!Yto3^AELra^ zyR%74WC;+W7fv9!apB0nfy4oc3*2(bffFZ=2ytL`W_G>)5!VU1c(e1~oAZVTB=Vf#LI zbxhY*VOnUJW=n^Xs+(>@YG{gXwwk(mBps%tLufmiX^12!0EW_rj-{wj$d}fiK%_Jj zq*U|7zq;Z1S2KZsbvLyNfT}BwBka;R;1~$_&vNU!rV0*H5dL|fIW^7D5O&l)!8q20 zrlLC#`wrSRT|-4UA;EJf8Y)aK2sEZ=`@k|W?lr;BsN|Ibm!VoP5VQ?NuV$d5+M0z- zyM#^C=@vvm0lhcL1-7jhPHPHDnqxXWkmQiPr@NTCAqQ|=&E`9#V+BMsZ?B~Sm@3eix?0|y>ei})1>RfCa}Zx z)SJG;kZOx8Y5%uE97&wS2Vk15(zpCQ5Z}#~D}~}#t+Fj|?^J3#Ta{9FqmV0PGc&L7 zH^5Y3t5zx(^W|)%GQ;tc;Bq-DXP(YPcmO7Ha$ytOMbqDLf68BT;C_gA3JFv0h2R$HZ=#a?VU3G z*u@gzAAt!=vGKNy(}hzx@{c^vkAYwgOjP zv%M)e79M?&e;Zt7NFAI-6gR^B7`)H~eJr*#?3F^Ech z#evxk(yFX>e#HM#x<}v&Lre-c9$>F^BZ(I{ogE8*df`AiK}=7c=ZMK;F}fsV%^M6X zr9m+U6PadG1hW~a!+}IDTItlkli(@?9-s}6ZYc&;=pu|QuvV+^q8It)eG)KzD`+LVmcxK zt;CpwrG2UFttBqNT;R@s83EHhY8(x@$Mjr~zsHboF|11=u@c;$aw(DYA2Sg9dF%VI zEOr6}d)ZWar0Yn^gE0KhnERe-FuD*urhXyjd;wskk)yjv&W?Reyhu5IDa5^%MM`bI zbaZsY(hWZCii`H?MQYj771T8C_R`DDyIZY)%Yl3N zgy0up$dP9K8XJ!#uRtYk?=dxErzY=s(K5rAIGh?DOWi%J`fB)}zd7!QNFinternalAddGeneratedFile( + ' +Ó +(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..7009219c3e5b --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/AgentAssistantFeedback.php @@ -0,0 +1,331 @@ +google.cloud.dialogflow.v2.AgentAssistantFeedback + */ +class AgentAssistantFeedback extends \Google\Protobuf\Internal\Message +{ + /** + * Optional. Whether or not the suggested answer is relevant. + * For example: + * * Query: "Can I change my mailing address?" + * * Suggested document says: "Items must be returned/exchanged within 60 + * days of the purchase date." + * * [answer_relevance][google.cloud.dialogflow.v2.AgentAssistantFeedback.answer_relevance]: [AnswerRelevance.IRRELEVANT][google.cloud.dialogflow.v2.AgentAssistantFeedback.AnswerRelevance.IRRELEVANT] + * + * Generated from protobuf field .google.cloud.dialogflow.v2.AgentAssistantFeedback.AnswerRelevance answer_relevance = 1 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $answer_relevance = 0; + /** + * Optional. Whether or not the information in the document is correct. + * For example: + * * Query: "Can I return the package in 2 days once received?" + * * Suggested document says: "Items must be returned/exchanged within 60 + * days of the purchase date." + * * Ground truth: "No return or exchange is allowed." + * * [document_correctness]: INCORRECT + * + * Generated from protobuf field .google.cloud.dialogflow.v2.AgentAssistantFeedback.DocumentCorrectness document_correctness = 2 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $document_correctness = 0; + /** + * Optional. Whether or not the suggested document is efficient. For example, + * if the document is poorly written, hard to understand, hard to use or + * too long to find useful information, + * [document_efficiency][google.cloud.dialogflow.v2.AgentAssistantFeedback.document_efficiency] + * is + * [DocumentEfficiency.INEFFICIENT][google.cloud.dialogflow.v2.AgentAssistantFeedback.DocumentEfficiency.INEFFICIENT]. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.AgentAssistantFeedback.DocumentEfficiency document_efficiency = 3 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $document_efficiency = 0; + /** + * Optional. Feedback for conversation summarization. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.AgentAssistantFeedback.SummarizationFeedback summarization_feedback = 4 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $summarization_feedback = null; + /** + * Optional. Feedback for knowledge search. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.AgentAssistantFeedback.KnowledgeSearchFeedback knowledge_search_feedback = 5 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $knowledge_search_feedback = null; + /** + * Optional. Feedback for knowledge assist. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.AgentAssistantFeedback.KnowledgeAssistFeedback knowledge_assist_feedback = 6 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $knowledge_assist_feedback = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type int $answer_relevance + * Optional. Whether or not the suggested answer is relevant. + * For example: + * * Query: "Can I change my mailing address?" + * * Suggested document says: "Items must be returned/exchanged within 60 + * days of the purchase date." + * * [answer_relevance][google.cloud.dialogflow.v2.AgentAssistantFeedback.answer_relevance]: [AnswerRelevance.IRRELEVANT][google.cloud.dialogflow.v2.AgentAssistantFeedback.AnswerRelevance.IRRELEVANT] + * @type int $document_correctness + * Optional. Whether or not the information in the document is correct. + * For example: + * * Query: "Can I return the package in 2 days once received?" + * * Suggested document says: "Items must be returned/exchanged within 60 + * days of the purchase date." + * * Ground truth: "No return or exchange is allowed." + * * [document_correctness]: INCORRECT + * @type int $document_efficiency + * Optional. Whether or not the suggested document is efficient. For example, + * if the document is poorly written, hard to understand, hard to use or + * too long to find useful information, + * [document_efficiency][google.cloud.dialogflow.v2.AgentAssistantFeedback.document_efficiency] + * is + * [DocumentEfficiency.INEFFICIENT][google.cloud.dialogflow.v2.AgentAssistantFeedback.DocumentEfficiency.INEFFICIENT]. + * @type \Google\Cloud\Dialogflow\V2\AgentAssistantFeedback\SummarizationFeedback $summarization_feedback + * Optional. Feedback for conversation summarization. + * @type \Google\Cloud\Dialogflow\V2\AgentAssistantFeedback\KnowledgeSearchFeedback $knowledge_search_feedback + * Optional. Feedback for knowledge search. + * @type \Google\Cloud\Dialogflow\V2\AgentAssistantFeedback\KnowledgeAssistFeedback $knowledge_assist_feedback + * Optional. Feedback for knowledge assist. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\AnswerRecord::initOnce(); + parent::__construct($data); + } + + /** + * Optional. Whether or not the suggested answer is relevant. + * For example: + * * Query: "Can I change my mailing address?" + * * Suggested document says: "Items must be returned/exchanged within 60 + * days of the purchase date." + * * [answer_relevance][google.cloud.dialogflow.v2.AgentAssistantFeedback.answer_relevance]: [AnswerRelevance.IRRELEVANT][google.cloud.dialogflow.v2.AgentAssistantFeedback.AnswerRelevance.IRRELEVANT] + * + * Generated from protobuf field .google.cloud.dialogflow.v2.AgentAssistantFeedback.AnswerRelevance answer_relevance = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @return int + */ + public function getAnswerRelevance() + { + return $this->answer_relevance; + } + + /** + * Optional. Whether or not the suggested answer is relevant. + * For example: + * * Query: "Can I change my mailing address?" + * * Suggested document says: "Items must be returned/exchanged within 60 + * days of the purchase date." + * * [answer_relevance][google.cloud.dialogflow.v2.AgentAssistantFeedback.answer_relevance]: [AnswerRelevance.IRRELEVANT][google.cloud.dialogflow.v2.AgentAssistantFeedback.AnswerRelevance.IRRELEVANT] + * + * Generated from protobuf field .google.cloud.dialogflow.v2.AgentAssistantFeedback.AnswerRelevance answer_relevance = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @param int $var + * @return $this + */ + public function setAnswerRelevance($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\Dialogflow\V2\AgentAssistantFeedback\AnswerRelevance::class); + $this->answer_relevance = $var; + + return $this; + } + + /** + * Optional. Whether or not the information in the document is correct. + * For example: + * * Query: "Can I return the package in 2 days once received?" + * * Suggested document says: "Items must be returned/exchanged within 60 + * days of the purchase date." + * * Ground truth: "No return or exchange is allowed." + * * [document_correctness]: 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; + } + + /** + * Optional. Feedback for knowledge search. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.AgentAssistantFeedback.KnowledgeSearchFeedback knowledge_search_feedback = 5 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Cloud\Dialogflow\V2\AgentAssistantFeedback\KnowledgeSearchFeedback|null + */ + public function getKnowledgeSearchFeedback() + { + return $this->knowledge_search_feedback; + } + + public function hasKnowledgeSearchFeedback() + { + return isset($this->knowledge_search_feedback); + } + + public function clearKnowledgeSearchFeedback() + { + unset($this->knowledge_search_feedback); + } + + /** + * Optional. Feedback for knowledge search. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.AgentAssistantFeedback.KnowledgeSearchFeedback knowledge_search_feedback = 5 [(.google.api.field_behavior) = OPTIONAL]; + * @param \Google\Cloud\Dialogflow\V2\AgentAssistantFeedback\KnowledgeSearchFeedback $var + * @return $this + */ + public function setKnowledgeSearchFeedback($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Dialogflow\V2\AgentAssistantFeedback\KnowledgeSearchFeedback::class); + $this->knowledge_search_feedback = $var; + + return $this; + } + + /** + * Optional. Feedback for knowledge assist. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.AgentAssistantFeedback.KnowledgeAssistFeedback knowledge_assist_feedback = 6 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Cloud\Dialogflow\V2\AgentAssistantFeedback\KnowledgeAssistFeedback|null + */ + public function getKnowledgeAssistFeedback() + { + return $this->knowledge_assist_feedback; + } + + public function hasKnowledgeAssistFeedback() + { + return isset($this->knowledge_assist_feedback); + } + + public function clearKnowledgeAssistFeedback() + { + unset($this->knowledge_assist_feedback); + } + + /** + * Optional. Feedback for knowledge assist. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.AgentAssistantFeedback.KnowledgeAssistFeedback knowledge_assist_feedback = 6 [(.google.api.field_behavior) = OPTIONAL]; + * @param \Google\Cloud\Dialogflow\V2\AgentAssistantFeedback\KnowledgeAssistFeedback $var + * @return $this + */ + public function setKnowledgeAssistFeedback($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Dialogflow\V2\AgentAssistantFeedback\KnowledgeAssistFeedback::class); + $this->knowledge_assist_feedback = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/AgentAssistantFeedback/AnswerRelevance.php b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/AgentAssistantFeedback/AnswerRelevance.php new file mode 100644 index 000000000000..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/KnowledgeAssistFeedback.php b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/AgentAssistantFeedback/KnowledgeAssistFeedback.php new file mode 100644 index 000000000000..8b97472caaac --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/AgentAssistantFeedback/KnowledgeAssistFeedback.php @@ -0,0 +1,132 @@ +google.cloud.dialogflow.v2.AgentAssistantFeedback.KnowledgeAssistFeedback + */ +class KnowledgeAssistFeedback extends \Google\Protobuf\Internal\Message +{ + /** + * Whether the suggested answer was copied by the human agent. + * If the value is set to be true, + * [AnswerFeedback.clicked][google.cloud.dialogflow.v2.AnswerFeedback.clicked] + * will be updated to be true. + * + * Generated from protobuf field bool answer_copied = 1; + */ + protected $answer_copied = false; + /** + * The URIs clicked by the human agent. The value is appended for each + * UpdateAnswerRecordRequest. + * If the value is not empty, + * [AnswerFeedback.clicked][google.cloud.dialogflow.v2.AnswerFeedback.clicked] + * will be updated to be true. + * + * Generated from protobuf field repeated string clicked_uris = 2; + */ + private $clicked_uris; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type bool $answer_copied + * Whether the suggested answer was copied by the human agent. + * If the value is set to be true, + * [AnswerFeedback.clicked][google.cloud.dialogflow.v2.AnswerFeedback.clicked] + * will be updated to be true. + * @type array|\Google\Protobuf\Internal\RepeatedField $clicked_uris + * The URIs clicked by the human agent. The value is appended for each + * UpdateAnswerRecordRequest. + * If the value is not empty, + * [AnswerFeedback.clicked][google.cloud.dialogflow.v2.AnswerFeedback.clicked] + * will be updated to be true. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\AnswerRecord::initOnce(); + parent::__construct($data); + } + + /** + * Whether the suggested answer was copied by the human agent. + * If the value is set to be true, + * [AnswerFeedback.clicked][google.cloud.dialogflow.v2.AnswerFeedback.clicked] + * will be updated to be true. + * + * Generated from protobuf field bool answer_copied = 1; + * @return bool + */ + public function getAnswerCopied() + { + return $this->answer_copied; + } + + /** + * Whether the suggested answer was copied by the human agent. + * If the value is set to be true, + * [AnswerFeedback.clicked][google.cloud.dialogflow.v2.AnswerFeedback.clicked] + * will be updated to be true. + * + * Generated from protobuf field bool answer_copied = 1; + * @param bool $var + * @return $this + */ + public function setAnswerCopied($var) + { + GPBUtil::checkBool($var); + $this->answer_copied = $var; + + return $this; + } + + /** + * The URIs clicked by the human agent. The value is appended for each + * UpdateAnswerRecordRequest. + * If the value is not empty, + * [AnswerFeedback.clicked][google.cloud.dialogflow.v2.AnswerFeedback.clicked] + * will be updated to be true. + * + * Generated from protobuf field repeated string clicked_uris = 2; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getClickedUris() + { + return $this->clicked_uris; + } + + /** + * The URIs clicked by the human agent. The value is appended for each + * UpdateAnswerRecordRequest. + * If the value is not empty, + * [AnswerFeedback.clicked][google.cloud.dialogflow.v2.AnswerFeedback.clicked] + * will be updated to be true. + * + * Generated from protobuf field repeated string clicked_uris = 2; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setClickedUris($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->clicked_uris = $arr; + + return $this; + } + +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(KnowledgeAssistFeedback::class, \Google\Cloud\Dialogflow\V2\AgentAssistantFeedback_KnowledgeAssistFeedback::class); + diff --git a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/AgentAssistantFeedback/KnowledgeSearchFeedback.php b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/AgentAssistantFeedback/KnowledgeSearchFeedback.php new file mode 100644 index 000000000000..4cf5a6398861 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/AgentAssistantFeedback/KnowledgeSearchFeedback.php @@ -0,0 +1,132 @@ +google.cloud.dialogflow.v2.AgentAssistantFeedback.KnowledgeSearchFeedback + */ +class KnowledgeSearchFeedback extends \Google\Protobuf\Internal\Message +{ + /** + * Whether the answer was copied by the human agent or not. + * If the value is set to be true, + * [AnswerFeedback.clicked][google.cloud.dialogflow.v2.AnswerFeedback.clicked] + * will be updated to be true. + * + * Generated from protobuf field bool answer_copied = 1; + */ + protected $answer_copied = false; + /** + * The URIs clicked by the human agent. The value is appended for each + * [UpdateAnswerRecordRequest][google.cloud.dialogflow.v2.UpdateAnswerRecordRequest]. + * If the value is not empty, + * [AnswerFeedback.clicked][google.cloud.dialogflow.v2.AnswerFeedback.clicked] + * will be updated to be true. + * + * Generated from protobuf field repeated string clicked_uris = 2; + */ + private $clicked_uris; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type bool $answer_copied + * Whether the answer was copied by the human agent or not. + * If the value is set to be true, + * [AnswerFeedback.clicked][google.cloud.dialogflow.v2.AnswerFeedback.clicked] + * will be updated to be true. + * @type array|\Google\Protobuf\Internal\RepeatedField $clicked_uris + * The URIs clicked by the human agent. The value is appended for each + * [UpdateAnswerRecordRequest][google.cloud.dialogflow.v2.UpdateAnswerRecordRequest]. + * If the value is not empty, + * [AnswerFeedback.clicked][google.cloud.dialogflow.v2.AnswerFeedback.clicked] + * will be updated to be true. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\AnswerRecord::initOnce(); + parent::__construct($data); + } + + /** + * Whether the answer was copied by the human agent or not. + * If the value is set to be true, + * [AnswerFeedback.clicked][google.cloud.dialogflow.v2.AnswerFeedback.clicked] + * will be updated to be true. + * + * Generated from protobuf field bool answer_copied = 1; + * @return bool + */ + public function getAnswerCopied() + { + return $this->answer_copied; + } + + /** + * Whether the answer was copied by the human agent or not. + * If the value is set to be true, + * [AnswerFeedback.clicked][google.cloud.dialogflow.v2.AnswerFeedback.clicked] + * will be updated to be true. + * + * Generated from protobuf field bool answer_copied = 1; + * @param bool $var + * @return $this + */ + public function setAnswerCopied($var) + { + GPBUtil::checkBool($var); + $this->answer_copied = $var; + + return $this; + } + + /** + * The URIs clicked by the human agent. The value is appended for each + * [UpdateAnswerRecordRequest][google.cloud.dialogflow.v2.UpdateAnswerRecordRequest]. + * If the value is not empty, + * [AnswerFeedback.clicked][google.cloud.dialogflow.v2.AnswerFeedback.clicked] + * will be updated to be true. + * + * Generated from protobuf field repeated string clicked_uris = 2; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getClickedUris() + { + return $this->clicked_uris; + } + + /** + * The URIs clicked by the human agent. The value is appended for each + * [UpdateAnswerRecordRequest][google.cloud.dialogflow.v2.UpdateAnswerRecordRequest]. + * If the value is not empty, + * [AnswerFeedback.clicked][google.cloud.dialogflow.v2.AnswerFeedback.clicked] + * will be updated to be true. + * + * Generated from protobuf field repeated string clicked_uris = 2; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setClickedUris($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->clicked_uris = $arr; + + return $this; + } + +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(KnowledgeSearchFeedback::class, \Google\Cloud\Dialogflow\V2\AgentAssistantFeedback_KnowledgeSearchFeedback::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..0b3045f5bb34 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/AgentAssistantFeedback/SummarizationFeedback.php @@ -0,0 +1,192 @@ +google.cloud.dialogflow.v2.AgentAssistantFeedback.SummarizationFeedback + */ +class SummarizationFeedback extends \Google\Protobuf\Internal\Message +{ + /** + * Timestamp when composing of the summary starts. + * + * Generated from protobuf field .google.protobuf.Timestamp start_time = 1; + */ + protected $start_time = null; + /** + * Timestamp when the summary was submitted. + * + * Generated from protobuf field .google.protobuf.Timestamp submit_time = 2; + */ + protected $submit_time = null; + /** + * Text of actual submitted summary. + * + * Generated from protobuf field string summary_text = 3; + */ + protected $summary_text = ''; + /** + * Optional. Actual text sections of submitted summary. + * + * Generated from protobuf field map text_sections = 4 [(.google.api.field_behavior) = OPTIONAL]; + */ + private $text_sections; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Protobuf\Timestamp $start_time + * Timestamp when composing of the summary starts. + * @type \Google\Protobuf\Timestamp $submit_time + * Timestamp when the summary was submitted. + * @type string $summary_text + * Text of actual submitted summary. + * @type array|\Google\Protobuf\Internal\MapField $text_sections + * Optional. Actual text sections of submitted summary. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\AnswerRecord::initOnce(); + parent::__construct($data); + } + + /** + * Timestamp when composing of the summary starts. + * + * Generated from protobuf field .google.protobuf.Timestamp start_time = 1; + * @return \Google\Protobuf\Timestamp|null + */ + public function getStartTime() + { + return $this->start_time; + } + + public function hasStartTime() + { + return isset($this->start_time); + } + + public function clearStartTime() + { + unset($this->start_time); + } + + /** + * Timestamp when composing of the summary starts. + * + * Generated from protobuf field .google.protobuf.Timestamp start_time = 1; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setStartTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->start_time = $var; + + return $this; + } + + /** + * Timestamp when the summary was submitted. + * + * Generated from protobuf field .google.protobuf.Timestamp submit_time = 2; + * @return \Google\Protobuf\Timestamp|null + */ + public function getSubmitTime() + { + return $this->submit_time; + } + + public function hasSubmitTime() + { + return isset($this->submit_time); + } + + public function clearSubmitTime() + { + unset($this->submit_time); + } + + /** + * Timestamp when the summary was submitted. + * + * Generated from protobuf field .google.protobuf.Timestamp submit_time = 2; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setSubmitTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->submit_time = $var; + + return $this; + } + + /** + * Text of actual submitted summary. + * + * Generated from protobuf field string summary_text = 3; + * @return string + */ + public function getSummaryText() + { + return $this->summary_text; + } + + /** + * Text of actual submitted summary. + * + * Generated from protobuf field string summary_text = 3; + * @param string $var + * @return $this + */ + public function setSummaryText($var) + { + GPBUtil::checkString($var, True); + $this->summary_text = $var; + + return $this; + } + + /** + * Optional. Actual text sections of submitted summary. + * + * Generated from protobuf field map text_sections = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Protobuf\Internal\MapField + */ + public function getTextSections() + { + return $this->text_sections; + } + + /** + * Optional. Actual text sections of submitted summary. + * + * Generated from protobuf field map text_sections = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @param array|\Google\Protobuf\Internal\MapField $var + * @return $this + */ + public function setTextSections($var) + { + $arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::STRING, \Google\Protobuf\Internal\GPBType::STRING); + $this->text_sections = $arr; + + return $this; + } + +} + +// 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..d36c7985c540 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/AgentAssistantRecord.php @@ -0,0 +1,141 @@ +google.cloud.dialogflow.v2.AgentAssistantRecord + */ +class AgentAssistantRecord extends \Google\Protobuf\Internal\Message +{ + protected $answer; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\Dialogflow\V2\ArticleAnswer $article_suggestion_answer + * Output only. The article suggestion answer. + * @type \Google\Cloud\Dialogflow\V2\FaqAnswer $faq_answer + * Output only. The FAQ answer. + * @type \Google\Cloud\Dialogflow\V2\DialogflowAssistAnswer $dialogflow_assist_answer + * Output only. Dialogflow assist answer. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\AnswerRecord::initOnce(); + parent::__construct($data); + } + + /** + * Output only. The article suggestion answer. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.ArticleAnswer article_suggestion_answer = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Cloud\Dialogflow\V2\ArticleAnswer|null + */ + public function getArticleSuggestionAnswer() + { + return $this->readOneof(5); + } + + public function hasArticleSuggestionAnswer() + { + return $this->hasOneof(5); + } + + /** + * Output only. The article suggestion answer. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.ArticleAnswer article_suggestion_answer = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Cloud\Dialogflow\V2\ArticleAnswer $var + * @return $this + */ + public function setArticleSuggestionAnswer($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Dialogflow\V2\ArticleAnswer::class); + $this->writeOneof(5, $var); + + return $this; + } + + /** + * Output only. The FAQ answer. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.FaqAnswer faq_answer = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Cloud\Dialogflow\V2\FaqAnswer|null + */ + public function getFaqAnswer() + { + return $this->readOneof(6); + } + + public function hasFaqAnswer() + { + return $this->hasOneof(6); + } + + /** + * Output only. The FAQ answer. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.FaqAnswer faq_answer = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Cloud\Dialogflow\V2\FaqAnswer $var + * @return $this + */ + public function setFaqAnswer($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Dialogflow\V2\FaqAnswer::class); + $this->writeOneof(6, $var); + + return $this; + } + + /** + * Output only. Dialogflow assist answer. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.DialogflowAssistAnswer dialogflow_assist_answer = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Cloud\Dialogflow\V2\DialogflowAssistAnswer|null + */ + public function getDialogflowAssistAnswer() + { + return $this->readOneof(7); + } + + public function hasDialogflowAssistAnswer() + { + return $this->hasOneof(7); + } + + /** + * Output only. Dialogflow assist answer. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.DialogflowAssistAnswer dialogflow_assist_answer = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Cloud\Dialogflow\V2\DialogflowAssistAnswer $var + * @return $this + */ + public function setDialogflowAssistAnswer($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Dialogflow\V2\DialogflowAssistAnswer::class); + $this->writeOneof(7, $var); + + return $this; + } + + /** + * @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..3e131721f33d --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/AnalyzeContentRequest.php @@ -0,0 +1,470 @@ +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\SuggestionInput $suggestion_input + * An input representing the selection of a suggestion. + * @type \Google\Cloud\Dialogflow\V2\OutputAudioConfig $reply_audio_config + * Speech synthesis configuration. + * The speech synthesis settings for a virtual agent that may be configured + * for the associated conversation profile are not used when calling + * AnalyzeContent. If this configuration is not supplied, speech synthesis + * is disabled. + * @type \Google\Cloud\Dialogflow\V2\QueryParameters $query_params + * Parameters for a Dialogflow virtual-agent query. + * @type \Google\Cloud\Dialogflow\V2\AssistQueryParameters $assist_query_params + * Parameters for a human assist query. + * @type \Google\Protobuf\Struct $cx_parameters + * Additional parameters to be put into Dialogflow CX session parameters. To + * remove a parameter from the session, clients should explicitly set the + * parameter value to null. + * Note: this field should only be used if you are connecting to a Dialogflow + * CX agent. + * @type string $request_id + * A unique identifier for this request. Restricted to 36 ASCII characters. + * A random UUID is recommended. + * This request is only idempotent if a `request_id` is provided. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\Participant::initOnce(); + parent::__construct($data); + } + + /** + * Required. The name of the participant this text comes from. + * Format: `projects//locations//conversations//participants/`. + * + * Generated from protobuf field string participant = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getParticipant() + { + return $this->participant; + } + + /** + * Required. The name of the participant this text comes from. + * Format: `projects//locations//conversations//participants/`. + * + * Generated from protobuf field string participant = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setParticipant($var) + { + GPBUtil::checkString($var, True); + $this->participant = $var; + + return $this; + } + + /** + * The natural language text to be processed. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.TextInput text_input = 6; + * @return \Google\Cloud\Dialogflow\V2\TextInput|null + */ + public function getTextInput() + { + return $this->readOneof(6); + } + + public function hasTextInput() + { + return $this->hasOneof(6); + } + + /** + * The natural language text to be processed. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.TextInput text_input = 6; + * @param \Google\Cloud\Dialogflow\V2\TextInput $var + * @return $this + */ + public function setTextInput($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Dialogflow\V2\TextInput::class); + $this->writeOneof(6, $var); + + return $this; + } + + /** + * An input event to send to Dialogflow. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.EventInput event_input = 8; + * @return \Google\Cloud\Dialogflow\V2\EventInput|null + */ + public function getEventInput() + { + return $this->readOneof(8); + } + + public function hasEventInput() + { + return $this->hasOneof(8); + } + + /** + * An input event to send to Dialogflow. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.EventInput event_input = 8; + * @param \Google\Cloud\Dialogflow\V2\EventInput $var + * @return $this + */ + public function setEventInput($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Dialogflow\V2\EventInput::class); + $this->writeOneof(8, $var); + + return $this; + } + + /** + * An input representing the selection of a suggestion. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.SuggestionInput suggestion_input = 12; + * @return \Google\Cloud\Dialogflow\V2\SuggestionInput|null + */ + public function getSuggestionInput() + { + return $this->readOneof(12); + } + + public function hasSuggestionInput() + { + return $this->hasOneof(12); + } + + /** + * An input representing the selection of a suggestion. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.SuggestionInput suggestion_input = 12; + * @param \Google\Cloud\Dialogflow\V2\SuggestionInput $var + * @return $this + */ + public function setSuggestionInput($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Dialogflow\V2\SuggestionInput::class); + $this->writeOneof(12, $var); + + return $this; + } + + /** + * Speech synthesis configuration. + * The speech synthesis settings for a virtual agent that may be configured + * for the associated conversation profile are not used when calling + * AnalyzeContent. If this configuration is not supplied, speech synthesis + * is disabled. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.OutputAudioConfig reply_audio_config = 5; + * @return \Google\Cloud\Dialogflow\V2\OutputAudioConfig|null + */ + public function getReplyAudioConfig() + { + return $this->reply_audio_config; + } + + public function hasReplyAudioConfig() + { + return isset($this->reply_audio_config); + } + + public function clearReplyAudioConfig() + { + unset($this->reply_audio_config); + } + + /** + * Speech synthesis configuration. + * The speech synthesis settings for a virtual agent that may be configured + * for the associated conversation profile are not used when calling + * AnalyzeContent. If this configuration is not supplied, speech synthesis + * is disabled. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.OutputAudioConfig reply_audio_config = 5; + * @param \Google\Cloud\Dialogflow\V2\OutputAudioConfig $var + * @return $this + */ + public function setReplyAudioConfig($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Dialogflow\V2\OutputAudioConfig::class); + $this->reply_audio_config = $var; + + return $this; + } + + /** + * Parameters for a Dialogflow virtual-agent query. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.QueryParameters query_params = 9; + * @return \Google\Cloud\Dialogflow\V2\QueryParameters|null + */ + public function getQueryParams() + { + return $this->query_params; + } + + public function hasQueryParams() + { + return isset($this->query_params); + } + + public function clearQueryParams() + { + unset($this->query_params); + } + + /** + * Parameters for a Dialogflow virtual-agent query. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.QueryParameters query_params = 9; + * @param \Google\Cloud\Dialogflow\V2\QueryParameters $var + * @return $this + */ + public function setQueryParams($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Dialogflow\V2\QueryParameters::class); + $this->query_params = $var; + + return $this; + } + + /** + * Parameters for a human assist query. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.AssistQueryParameters assist_query_params = 14; + * @return \Google\Cloud\Dialogflow\V2\AssistQueryParameters|null + */ + public function getAssistQueryParams() + { + return $this->assist_query_params; + } + + public function hasAssistQueryParams() + { + return isset($this->assist_query_params); + } + + public function clearAssistQueryParams() + { + unset($this->assist_query_params); + } + + /** + * Parameters for a human assist query. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.AssistQueryParameters assist_query_params = 14; + * @param \Google\Cloud\Dialogflow\V2\AssistQueryParameters $var + * @return $this + */ + public function setAssistQueryParams($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Dialogflow\V2\AssistQueryParameters::class); + $this->assist_query_params = $var; + + return $this; + } + + /** + * Additional parameters to be put into Dialogflow CX session parameters. To + * remove a parameter from the session, clients should explicitly set the + * parameter value to null. + * Note: this field should only be used if you are connecting to a Dialogflow + * CX agent. + * + * Generated from protobuf field .google.protobuf.Struct cx_parameters = 18; + * @return \Google\Protobuf\Struct|null + */ + public function getCxParameters() + { + return $this->cx_parameters; + } + + public function hasCxParameters() + { + return isset($this->cx_parameters); + } + + public function clearCxParameters() + { + unset($this->cx_parameters); + } + + /** + * Additional parameters to be put into Dialogflow CX session parameters. To + * remove a parameter from the session, clients should explicitly set the + * parameter value to null. + * Note: this field should only be used if you are connecting to a Dialogflow + * CX agent. + * + * Generated from protobuf field .google.protobuf.Struct cx_parameters = 18; + * @param \Google\Protobuf\Struct $var + * @return $this + */ + public function setCxParameters($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Struct::class); + $this->cx_parameters = $var; + + return $this; + } + + /** + * A unique identifier for this request. Restricted to 36 ASCII characters. + * A random UUID is recommended. + * This request is only idempotent if a `request_id` is provided. + * + * Generated from protobuf field string request_id = 11; + * @return string + */ + public function getRequestId() + { + return $this->request_id; + } + + /** + * A unique identifier for this request. Restricted to 36 ASCII characters. + * A random UUID is recommended. + * This request is only idempotent if a `request_id` is provided. + * + * Generated from protobuf field string request_id = 11; + * @param string $var + * @return $this + */ + public function setRequestId($var) + { + GPBUtil::checkString($var, True); + $this->request_id = $var; + + return $this; + } + + /** + * @return string + */ + public function getInput() + { + return $this->whichOneof("input"); + } + +} + diff --git a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/AnalyzeContentResponse.php b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/AnalyzeContentResponse.php new file mode 100644 index 000000000000..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..e630d149e731 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/AudioEncoding.php @@ -0,0 +1,125 @@ +google.cloud.dialogflow.v2.AudioEncoding + */ +class AudioEncoding +{ + /** + * Not specified. + * + * Generated from protobuf enum AUDIO_ENCODING_UNSPECIFIED = 0; + */ + const AUDIO_ENCODING_UNSPECIFIED = 0; + /** + * Uncompressed 16-bit signed little-endian samples (Linear PCM). + * + * Generated from protobuf enum AUDIO_ENCODING_LINEAR_16 = 1; + */ + const AUDIO_ENCODING_LINEAR_16 = 1; + /** + * [`FLAC`](https://xiph.org/flac/documentation.html) (Free Lossless Audio + * Codec) is the recommended encoding because it is lossless (therefore + * recognition is not compromised) and requires only about half the + * bandwidth of `LINEAR16`. `FLAC` stream encoding supports 16-bit and + * 24-bit samples, however, not all fields in `STREAMINFO` are supported. + * + * Generated from protobuf enum AUDIO_ENCODING_FLAC = 2; + */ + const AUDIO_ENCODING_FLAC = 2; + /** + * 8-bit samples that compand 14-bit audio samples using G.711 PCMU/mu-law. + * + * Generated from protobuf enum AUDIO_ENCODING_MULAW = 3; + */ + const AUDIO_ENCODING_MULAW = 3; + /** + * Adaptive Multi-Rate Narrowband codec. `sample_rate_hertz` must be 8000. + * + * Generated from protobuf enum AUDIO_ENCODING_AMR = 4; + */ + const AUDIO_ENCODING_AMR = 4; + /** + * Adaptive Multi-Rate Wideband codec. `sample_rate_hertz` must be 16000. + * + * Generated from protobuf enum AUDIO_ENCODING_AMR_WB = 5; + */ + const AUDIO_ENCODING_AMR_WB = 5; + /** + * Opus encoded audio frames in Ogg container + * ([OggOpus](https://wiki.xiph.org/OggOpus)). + * `sample_rate_hertz` must be 16000. + * + * Generated from protobuf enum AUDIO_ENCODING_OGG_OPUS = 6; + */ + const AUDIO_ENCODING_OGG_OPUS = 6; + /** + * Although the use of lossy encodings is not recommended, if a very low + * bitrate encoding is required, `OGG_OPUS` is highly preferred over + * Speex encoding. The [Speex](https://speex.org/) encoding supported by + * Dialogflow API has a header byte in each block, as in MIME type + * `audio/x-speex-with-header-byte`. + * It is a variant of the RTP Speex encoding defined in + * [RFC 5574](https://tools.ietf.org/html/rfc5574). + * The stream is a sequence of blocks, one block per RTP packet. Each block + * starts with a byte containing the length of the block, in bytes, followed + * by one or more frames of Speex data, padded to an integral number of + * bytes (octets) as specified in RFC 5574. In other words, each RTP header + * is replaced with a single byte containing the block length. Only Speex + * wideband is supported. `sample_rate_hertz` must be 16000. + * + * Generated from protobuf enum AUDIO_ENCODING_SPEEX_WITH_HEADER_BYTE = 7; + */ + const AUDIO_ENCODING_SPEEX_WITH_HEADER_BYTE = 7; + /** + * 8-bit samples that compand 13-bit audio samples using G.711 PCMU/a-law. + * + * Generated from protobuf enum AUDIO_ENCODING_ALAW = 8; + */ + const AUDIO_ENCODING_ALAW = 8; + + private static $valueToName = [ + self::AUDIO_ENCODING_UNSPECIFIED => 'AUDIO_ENCODING_UNSPECIFIED', + self::AUDIO_ENCODING_LINEAR_16 => 'AUDIO_ENCODING_LINEAR_16', + self::AUDIO_ENCODING_FLAC => 'AUDIO_ENCODING_FLAC', + self::AUDIO_ENCODING_MULAW => 'AUDIO_ENCODING_MULAW', + self::AUDIO_ENCODING_AMR => 'AUDIO_ENCODING_AMR', + self::AUDIO_ENCODING_AMR_WB => 'AUDIO_ENCODING_AMR_WB', + self::AUDIO_ENCODING_OGG_OPUS => 'AUDIO_ENCODING_OGG_OPUS', + self::AUDIO_ENCODING_SPEEX_WITH_HEADER_BYTE => 'AUDIO_ENCODING_SPEEX_WITH_HEADER_BYTE', + self::AUDIO_ENCODING_ALAW => 'AUDIO_ENCODING_ALAW', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + diff --git a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/AutomatedAgentConfig.php b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/AutomatedAgentConfig.php new file mode 100644 index 000000000000..9c86f69649d9 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/AutomatedAgentConfig.php @@ -0,0 +1,175 @@ +google.cloud.dialogflow.v2.AutomatedAgentConfig + */ +class AutomatedAgentConfig extends \Google\Protobuf\Internal\Message +{ + /** + * Required. ID of the Dialogflow agent environment to use. + * This project needs to either be the same project as the conversation or you + * need to grant `service-@gcp-sa-dialogflow.iam.gserviceaccount.com` the `Dialogflow API + * Service Agent` role in this project. + * - For ES agents, use format: `projects//locations//agent/environments/`. If environment is not + * specified, the default `draft` environment is used. Refer to + * [DetectIntentRequest](/dialogflow/docs/reference/rpc/google.cloud.dialogflow.v2#google.cloud.dialogflow.v2.DetectIntentRequest) + * for more details. + * - For CX agents, use format `projects//locations//agents//environments/`. If environment is not specified, the default `draft` environment + * is used. + * + * Generated from protobuf field string agent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $agent = ''; + /** + * Optional. Configure lifetime of the Dialogflow session. + * By default, a Dialogflow CX session remains active and its data is stored + * for 30 minutes after the last request is sent for the session. + * This value should be no longer than 1 day. + * + * Generated from protobuf field .google.protobuf.Duration session_ttl = 3 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $session_ttl = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $agent + * Required. ID of the Dialogflow agent environment to use. + * This project needs to either be the same project as the conversation or you + * need to grant `service-@gcp-sa-dialogflow.iam.gserviceaccount.com` the `Dialogflow API + * Service Agent` role in this project. + * - For ES agents, use format: `projects//locations//agent/environments/`. If environment is not + * specified, the default `draft` environment is used. Refer to + * [DetectIntentRequest](/dialogflow/docs/reference/rpc/google.cloud.dialogflow.v2#google.cloud.dialogflow.v2.DetectIntentRequest) + * for more details. + * - For CX agents, use format `projects//locations//agents//environments/`. If environment is not specified, the default `draft` environment + * is used. + * @type \Google\Protobuf\Duration $session_ttl + * Optional. Configure lifetime of the Dialogflow session. + * By default, a Dialogflow CX session remains active and its data is stored + * for 30 minutes after the last request is sent for the session. + * This value should be no longer than 1 day. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\ConversationProfile::initOnce(); + parent::__construct($data); + } + + /** + * Required. ID of the Dialogflow agent environment to use. + * This project needs to either be the same project as the conversation or you + * need to grant `service-@gcp-sa-dialogflow.iam.gserviceaccount.com` the `Dialogflow API + * Service Agent` role in this project. + * - For ES agents, use format: `projects//locations//agent/environments/`. If environment is not + * specified, the default `draft` environment is used. Refer to + * [DetectIntentRequest](/dialogflow/docs/reference/rpc/google.cloud.dialogflow.v2#google.cloud.dialogflow.v2.DetectIntentRequest) + * for more details. + * - For CX agents, use format `projects//locations//agents//environments/`. If environment is not specified, the default `draft` environment + * is used. + * + * Generated from protobuf field string agent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getAgent() + { + return $this->agent; + } + + /** + * Required. ID of the Dialogflow agent environment to use. + * This project needs to either be the same project as the conversation or you + * need to grant `service-@gcp-sa-dialogflow.iam.gserviceaccount.com` the `Dialogflow API + * Service Agent` role in this project. + * - For ES agents, use format: `projects//locations//agent/environments/`. If environment is not + * specified, the default `draft` environment is used. Refer to + * [DetectIntentRequest](/dialogflow/docs/reference/rpc/google.cloud.dialogflow.v2#google.cloud.dialogflow.v2.DetectIntentRequest) + * for more details. + * - For CX agents, use format `projects//locations//agents//environments/`. If environment is not specified, the default `draft` environment + * is used. + * + * Generated from protobuf field string agent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setAgent($var) + { + GPBUtil::checkString($var, True); + $this->agent = $var; + + return $this; + } + + /** + * Optional. Configure lifetime of the Dialogflow session. + * By default, a Dialogflow CX session remains active and its data is stored + * for 30 minutes after the last request is sent for the session. + * This value should be no longer than 1 day. + * + * Generated from protobuf field .google.protobuf.Duration session_ttl = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Protobuf\Duration|null + */ + public function getSessionTtl() + { + return $this->session_ttl; + } + + public function hasSessionTtl() + { + return isset($this->session_ttl); + } + + public function clearSessionTtl() + { + unset($this->session_ttl); + } + + /** + * Optional. Configure lifetime of the Dialogflow session. + * By default, a Dialogflow CX session remains active and its data is stored + * for 30 minutes after the last request is sent for the session. + * This value should be no longer than 1 day. + * + * Generated from protobuf field .google.protobuf.Duration session_ttl = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @param \Google\Protobuf\Duration $var + * @return $this + */ + public function setSessionTtl($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Duration::class); + $this->session_ttl = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/AutomatedAgentReply.php b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/AutomatedAgentReply.php new file mode 100644 index 000000000000..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..739ec5a13846 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/CloudConversationDebuggingInfo.php @@ -0,0 +1,750 @@ +google.cloud.dialogflow.v2.CloudConversationDebuggingInfo + */ +class CloudConversationDebuggingInfo extends \Google\Protobuf\Internal\Message +{ + /** + * Number of input audio data chunks in streaming requests. + * + * Generated from protobuf field int32 audio_data_chunks = 1; + */ + protected $audio_data_chunks = 0; + /** + * Time offset of the end of speech utterance relative to the + * beginning of the first audio chunk. + * + * Generated from protobuf field .google.protobuf.Duration result_end_time_offset = 2; + */ + protected $result_end_time_offset = null; + /** + * Duration of first audio chunk. + * + * Generated from protobuf field .google.protobuf.Duration first_audio_duration = 3; + */ + protected $first_audio_duration = null; + /** + * Whether client used single utterance mode. + * + * Generated from protobuf field bool single_utterance = 5; + */ + protected $single_utterance = false; + /** + * Time offsets of the speech partial results relative to the beginning of + * the stream. + * + * Generated from protobuf field repeated .google.protobuf.Duration speech_partial_results_end_times = 6; + */ + private $speech_partial_results_end_times; + /** + * Time offsets of the speech final results (is_final=true) relative to the + * beginning of the stream. + * + * Generated from protobuf field repeated .google.protobuf.Duration speech_final_results_end_times = 7; + */ + private $speech_final_results_end_times; + /** + * Total number of partial responses. + * + * Generated from protobuf field int32 partial_responses = 8; + */ + protected $partial_responses = 0; + /** + * Time offset of Speaker ID stream close time relative to the Speech stream + * close time in milliseconds. Only meaningful for conversations involving + * passive verification. + * + * Generated from protobuf field int32 speaker_id_passive_latency_ms_offset = 9; + */ + protected $speaker_id_passive_latency_ms_offset = 0; + /** + * Whether a barge-in event is triggered in this request. + * + * Generated from protobuf field bool bargein_event_triggered = 10; + */ + protected $bargein_event_triggered = false; + /** + * Whether speech uses single utterance mode. + * + * Generated from protobuf field bool speech_single_utterance = 11; + */ + protected $speech_single_utterance = false; + /** + * Time offsets of the DTMF partial results relative to the beginning of + * the stream. + * + * Generated from protobuf field repeated .google.protobuf.Duration dtmf_partial_results_times = 12; + */ + private $dtmf_partial_results_times; + /** + * Time offsets of the DTMF final results relative to the beginning of + * the stream. + * + * Generated from protobuf field repeated .google.protobuf.Duration dtmf_final_results_times = 13; + */ + private $dtmf_final_results_times; + /** + * Time offset of the end-of-single-utterance signal relative to the + * beginning of the stream. + * + * Generated from protobuf field .google.protobuf.Duration single_utterance_end_time_offset = 14; + */ + protected $single_utterance_end_time_offset = null; + /** + * No speech timeout settings for the stream. + * + * Generated from protobuf field .google.protobuf.Duration no_speech_timeout = 15; + */ + protected $no_speech_timeout = null; + /** + * Speech endpointing timeout settings for the stream. + * + * Generated from protobuf field .google.protobuf.Duration endpointing_timeout = 19; + */ + protected $endpointing_timeout = null; + /** + * Whether the streaming terminates with an injected text query. + * + * Generated from protobuf field bool is_input_text = 16; + */ + protected $is_input_text = false; + /** + * Client half close time in terms of input audio duration. + * + * Generated from protobuf field .google.protobuf.Duration client_half_close_time_offset = 17; + */ + protected $client_half_close_time_offset = null; + /** + * Client half close time in terms of API streaming duration. + * + * Generated from protobuf field .google.protobuf.Duration client_half_close_streaming_time_offset = 18; + */ + protected $client_half_close_streaming_time_offset = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type int $audio_data_chunks + * Number of input audio data chunks in streaming requests. + * @type \Google\Protobuf\Duration $result_end_time_offset + * Time offset of the end of speech utterance relative to the + * beginning of the first audio chunk. + * @type \Google\Protobuf\Duration $first_audio_duration + * Duration of first audio chunk. + * @type bool $single_utterance + * Whether client used single utterance mode. + * @type 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 for the stream. + * @type \Google\Protobuf\Duration $endpointing_timeout + * Speech endpointing timeout settings for the stream. + * @type bool $is_input_text + * Whether the streaming terminates with an injected text query. + * @type \Google\Protobuf\Duration $client_half_close_time_offset + * Client half close time in terms of input audio duration. + * @type \Google\Protobuf\Duration $client_half_close_streaming_time_offset + * Client half close time in terms of API streaming duration. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\Session::initOnce(); + parent::__construct($data); + } + + /** + * Number of input audio data chunks in streaming requests. + * + * Generated from protobuf field int32 audio_data_chunks = 1; + * @return int + */ + public function getAudioDataChunks() + { + return $this->audio_data_chunks; + } + + /** + * Number of input audio data chunks in streaming requests. + * + * Generated from protobuf field int32 audio_data_chunks = 1; + * @param int $var + * @return $this + */ + public function setAudioDataChunks($var) + { + GPBUtil::checkInt32($var); + $this->audio_data_chunks = $var; + + return $this; + } + + /** + * Time offset of the end of speech utterance relative to the + * beginning of the first audio chunk. + * + * Generated from protobuf field .google.protobuf.Duration result_end_time_offset = 2; + * @return \Google\Protobuf\Duration|null + */ + public function getResultEndTimeOffset() + { + return $this->result_end_time_offset; + } + + public function hasResultEndTimeOffset() + { + return isset($this->result_end_time_offset); + } + + public function clearResultEndTimeOffset() + { + unset($this->result_end_time_offset); + } + + /** + * Time offset of the end of speech utterance relative to the + * beginning of the first audio chunk. + * + * Generated from protobuf field .google.protobuf.Duration result_end_time_offset = 2; + * @param \Google\Protobuf\Duration $var + * @return $this + */ + public function setResultEndTimeOffset($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Duration::class); + $this->result_end_time_offset = $var; + + return $this; + } + + /** + * Duration of first audio chunk. + * + * Generated from protobuf field .google.protobuf.Duration first_audio_duration = 3; + * @return \Google\Protobuf\Duration|null + */ + public function getFirstAudioDuration() + { + return $this->first_audio_duration; + } + + public function hasFirstAudioDuration() + { + return isset($this->first_audio_duration); + } + + public function clearFirstAudioDuration() + { + unset($this->first_audio_duration); + } + + /** + * Duration of first audio chunk. + * + * Generated from protobuf field .google.protobuf.Duration first_audio_duration = 3; + * @param \Google\Protobuf\Duration $var + * @return $this + */ + public function setFirstAudioDuration($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Duration::class); + $this->first_audio_duration = $var; + + return $this; + } + + /** + * Whether client used single utterance mode. + * + * Generated from protobuf field bool single_utterance = 5; + * @return bool + */ + public function getSingleUtterance() + { + return $this->single_utterance; + } + + /** + * Whether client used single utterance mode. + * + * Generated from protobuf field bool single_utterance = 5; + * @param bool $var + * @return $this + */ + public function setSingleUtterance($var) + { + GPBUtil::checkBool($var); + $this->single_utterance = $var; + + return $this; + } + + /** + * Time offsets of the speech partial results relative to the beginning of + * the stream. + * + * Generated from protobuf field repeated .google.protobuf.Duration speech_partial_results_end_times = 6; + * @return \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 for the stream. + * + * Generated from protobuf field .google.protobuf.Duration no_speech_timeout = 15; + * @return \Google\Protobuf\Duration|null + */ + public function getNoSpeechTimeout() + { + return $this->no_speech_timeout; + } + + public function hasNoSpeechTimeout() + { + return isset($this->no_speech_timeout); + } + + public function clearNoSpeechTimeout() + { + unset($this->no_speech_timeout); + } + + /** + * No speech timeout settings for the stream. + * + * Generated from protobuf field .google.protobuf.Duration no_speech_timeout = 15; + * @param \Google\Protobuf\Duration $var + * @return $this + */ + public function setNoSpeechTimeout($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Duration::class); + $this->no_speech_timeout = $var; + + return $this; + } + + /** + * Speech endpointing timeout settings for the stream. + * + * Generated from protobuf field .google.protobuf.Duration endpointing_timeout = 19; + * @return \Google\Protobuf\Duration|null + */ + public function getEndpointingTimeout() + { + return $this->endpointing_timeout; + } + + public function hasEndpointingTimeout() + { + return isset($this->endpointing_timeout); + } + + public function clearEndpointingTimeout() + { + unset($this->endpointing_timeout); + } + + /** + * Speech endpointing timeout settings for the stream. + * + * Generated from protobuf field .google.protobuf.Duration endpointing_timeout = 19; + * @param \Google\Protobuf\Duration $var + * @return $this + */ + public function setEndpointingTimeout($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Duration::class); + $this->endpointing_timeout = $var; + + return $this; + } + + /** + * Whether the streaming terminates with an injected text query. + * + * Generated from protobuf field bool is_input_text = 16; + * @return bool + */ + public function getIsInputText() + { + return $this->is_input_text; + } + + /** + * Whether the streaming terminates with an injected text query. + * + * Generated from protobuf field bool is_input_text = 16; + * @param bool $var + * @return $this + */ + public function setIsInputText($var) + { + GPBUtil::checkBool($var); + $this->is_input_text = $var; + + return $this; + } + + /** + * Client half close time in terms of input audio duration. + * + * Generated from protobuf field .google.protobuf.Duration client_half_close_time_offset = 17; + * @return \Google\Protobuf\Duration|null + */ + public function getClientHalfCloseTimeOffset() + { + return $this->client_half_close_time_offset; + } + + public function hasClientHalfCloseTimeOffset() + { + return isset($this->client_half_close_time_offset); + } + + public function clearClientHalfCloseTimeOffset() + { + unset($this->client_half_close_time_offset); + } + + /** + * Client half close time in terms of input audio duration. + * + * Generated from protobuf field .google.protobuf.Duration client_half_close_time_offset = 17; + * @param \Google\Protobuf\Duration $var + * @return $this + */ + public function setClientHalfCloseTimeOffset($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Duration::class); + $this->client_half_close_time_offset = $var; + + return $this; + } + + /** + * Client half close time in terms of API streaming duration. + * + * Generated from protobuf field .google.protobuf.Duration client_half_close_streaming_time_offset = 18; + * @return \Google\Protobuf\Duration|null + */ + public function getClientHalfCloseStreamingTimeOffset() + { + return $this->client_half_close_streaming_time_offset; + } + + public function hasClientHalfCloseStreamingTimeOffset() + { + return isset($this->client_half_close_streaming_time_offset); + } + + public function clearClientHalfCloseStreamingTimeOffset() + { + unset($this->client_half_close_streaming_time_offset); + } + + /** + * Client half close time in terms of API streaming duration. + * + * Generated from protobuf field .google.protobuf.Duration client_half_close_streaming_time_offset = 18; + * @param \Google\Protobuf\Duration $var + * @return $this + */ + public function setClientHalfCloseStreamingTimeOffset($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Duration::class); + $this->client_half_close_streaming_time_offset = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/CompleteConversationRequest.php b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/CompleteConversationRequest.php new file mode 100644 index 000000000000..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..917ef8d54609 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/Context.php @@ -0,0 +1,261 @@ +google.cloud.dialogflow.v2.Context + */ +class Context extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The unique identifier of the context. Format: + * `projects//agent/sessions//contexts/`, + * or `projects//agent/environments//users//sessions//contexts/`. + * The `Context ID` is always converted to lowercase, may only contain + * characters in `a-zA-Z0-9_-%` and may be at most 250 bytes long. + * If `Environment ID` is not specified, we assume default 'draft' + * environment. If `User ID` is not specified, we assume default '-' user. + * The following context names are reserved for internal use by Dialogflow. + * You should not use these contexts or create contexts with these names: + * * `__system_counters__` + * * `*_id_dialog_context` + * * `*_dialog_params_size` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $name = ''; + /** + * Optional. The number of conversational query requests after which the + * context expires. The default is `0`. If set to `0`, the context expires + * immediately. Contexts expire automatically after 20 minutes if there + * are no matching queries. + * + * Generated from protobuf field int32 lifespan_count = 2 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $lifespan_count = 0; + /** + * Optional. The collection of parameters associated with this context. + * Depending on your protocol or client library language, this is a + * map, associative array, symbol table, dictionary, or JSON object + * composed of a collection of (MapKey, MapValue) pairs: + * * MapKey type: string + * * MapKey value: parameter name + * * MapValue type: If parameter's entity type is a composite entity then use + * map, otherwise, depending on the parameter value type, it could be one of + * string, number, boolean, null, list or map. + * * MapValue value: If parameter's entity type is a composite entity then use + * map from composite entity property names to property values, otherwise, + * use parameter value. + * + * Generated from protobuf field .google.protobuf.Struct parameters = 3 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $parameters = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. The unique identifier of the context. Format: + * `projects//agent/sessions//contexts/`, + * or `projects//agent/environments//users//sessions//contexts/`. + * The `Context ID` is always converted to lowercase, may only contain + * characters in `a-zA-Z0-9_-%` and may be at most 250 bytes long. + * If `Environment ID` is not specified, we assume default 'draft' + * environment. If `User ID` is not specified, we assume default '-' user. + * The following context names are reserved for internal use by Dialogflow. + * You should not use these contexts or create contexts with these names: + * * `__system_counters__` + * * `*_id_dialog_context` + * * `*_dialog_params_size` + * @type int $lifespan_count + * Optional. The number of conversational query requests after which the + * context expires. The default is `0`. If set to `0`, the context expires + * immediately. Contexts expire automatically after 20 minutes if there + * are no matching queries. + * @type \Google\Protobuf\Struct $parameters + * Optional. The collection of parameters associated with this context. + * Depending on your protocol or client library language, this is a + * map, associative array, symbol table, dictionary, or JSON object + * composed of a collection of (MapKey, MapValue) pairs: + * * MapKey type: string + * * MapKey value: parameter name + * * MapValue type: If parameter's entity type is a composite entity then use + * map, otherwise, depending on the parameter value type, it could be one of + * string, number, boolean, null, list or map. + * * MapValue value: If parameter's entity type is a composite entity then use + * map from composite entity property names to property values, otherwise, + * use parameter value. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\Context::initOnce(); + parent::__construct($data); + } + + /** + * Required. The unique identifier of the context. Format: + * `projects//agent/sessions//contexts/`, + * or `projects//agent/environments//users//sessions//contexts/`. + * The `Context ID` is always converted to lowercase, may only contain + * characters in `a-zA-Z0-9_-%` and may be at most 250 bytes long. + * If `Environment ID` is not specified, we assume default 'draft' + * environment. If `User ID` is not specified, we assume default '-' user. + * The following context names are reserved for internal use by Dialogflow. + * You should not use these contexts or create contexts with these names: + * * `__system_counters__` + * * `*_id_dialog_context` + * * `*_dialog_params_size` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Required. The unique identifier of the context. Format: + * `projects//agent/sessions//contexts/`, + * or `projects//agent/environments//users//sessions//contexts/`. + * The `Context ID` is always converted to lowercase, may only contain + * characters in `a-zA-Z0-9_-%` and may be at most 250 bytes long. + * If `Environment ID` is not specified, we assume default 'draft' + * environment. If `User ID` is not specified, we assume default '-' user. + * The following context names are reserved for internal use by Dialogflow. + * You should not use these contexts or create contexts with these names: + * * `__system_counters__` + * * `*_id_dialog_context` + * * `*_dialog_params_size` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + + /** + * Optional. The number of conversational query requests after which the + * context expires. The default is `0`. If set to `0`, the context expires + * immediately. Contexts expire automatically after 20 minutes if there + * are no matching queries. + * + * Generated from protobuf field int32 lifespan_count = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @return int + */ + public function getLifespanCount() + { + return $this->lifespan_count; + } + + /** + * Optional. The number of conversational query requests after which the + * context expires. The default is `0`. If set to `0`, the context expires + * immediately. Contexts expire automatically after 20 minutes if there + * are no matching queries. + * + * Generated from protobuf field int32 lifespan_count = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @param int $var + * @return $this + */ + public function setLifespanCount($var) + { + GPBUtil::checkInt32($var); + $this->lifespan_count = $var; + + return $this; + } + + /** + * Optional. The collection of parameters associated with this context. + * Depending on your protocol or client library language, this is a + * map, associative array, symbol table, dictionary, or JSON object + * composed of a collection of (MapKey, MapValue) pairs: + * * MapKey type: string + * * MapKey value: parameter name + * * MapValue type: If parameter's entity type is a composite entity then use + * map, otherwise, depending on the parameter value type, it could be one of + * string, number, boolean, null, list or map. + * * MapValue value: If parameter's entity type is a composite entity then use + * map from composite entity property names to property values, otherwise, + * use parameter value. + * + * Generated from protobuf field .google.protobuf.Struct parameters = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Protobuf\Struct|null + */ + public function getParameters() + { + return $this->parameters; + } + + public function hasParameters() + { + return isset($this->parameters); + } + + public function clearParameters() + { + unset($this->parameters); + } + + /** + * Optional. The collection of parameters associated with this context. + * Depending on your protocol or client library language, this is a + * map, associative array, symbol table, dictionary, or JSON object + * composed of a collection of (MapKey, MapValue) pairs: + * * MapKey type: string + * * MapKey value: parameter name + * * MapValue type: If parameter's entity type is a composite entity then use + * map, otherwise, depending on the parameter value type, it could be one of + * string, number, boolean, null, list or map. + * * MapValue value: If parameter's entity type is a composite entity then use + * map from composite entity property names to property values, otherwise, + * use parameter value. + * + * Generated from protobuf field .google.protobuf.Struct parameters = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @param \Google\Protobuf\Struct $var + * @return $this + */ + public function setParameters($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Struct::class); + $this->parameters = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/Conversation.php b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/Conversation.php new file mode 100644 index 000000000000..25fc57fa85e9 --- /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. Identifier. The unique identifier of this conversation. + * Format: `projects//locations//conversations/`. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.field_behavior) = IDENTIFIER]; + */ + protected $name = ''; + /** + * Output only. The current state of the Conversation. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.Conversation.LifecycleState lifecycle_state = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $lifecycle_state = 0; + /** + * Required. The Conversation Profile to be used to configure this + * Conversation. This field cannot be updated. + * Format: `projects//locations//conversationProfiles/`. + * + * Generated from protobuf field string conversation_profile = 3 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $conversation_profile = ''; + /** + * Output only. It will not be empty if the conversation is to be connected + * over telephony. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.ConversationPhoneNumber phone_number = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $phone_number = null; + /** + * Output only. The time the conversation was started. + * + * Generated from protobuf field .google.protobuf.Timestamp start_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $start_time = null; + /** + * Output only. The time the conversation was finished. + * + * Generated from protobuf field .google.protobuf.Timestamp end_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $end_time = null; + /** + * Optional. The stage of a conversation. It indicates whether the virtual + * agent or a human agent is handling the conversation. + * If the conversation is created with the conversation profile that has + * Dialogflow config set, defaults to + * [ConversationStage.VIRTUAL_AGENT_STAGE][google.cloud.dialogflow.v2.Conversation.ConversationStage.VIRTUAL_AGENT_STAGE]; + * Otherwise, defaults to + * [ConversationStage.HUMAN_ASSIST_STAGE][google.cloud.dialogflow.v2.Conversation.ConversationStage.HUMAN_ASSIST_STAGE]. + * If the conversation is created with the conversation profile that has + * Dialogflow config set but explicitly sets conversation_stage to + * [ConversationStage.HUMAN_ASSIST_STAGE][google.cloud.dialogflow.v2.Conversation.ConversationStage.HUMAN_ASSIST_STAGE], + * it skips + * [ConversationStage.VIRTUAL_AGENT_STAGE][google.cloud.dialogflow.v2.Conversation.ConversationStage.VIRTUAL_AGENT_STAGE] + * stage and directly goes to + * [ConversationStage.HUMAN_ASSIST_STAGE][google.cloud.dialogflow.v2.Conversation.ConversationStage.HUMAN_ASSIST_STAGE]. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.Conversation.ConversationStage conversation_stage = 7 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $conversation_stage = 0; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Output only. Identifier. The unique identifier of this conversation. + * Format: `projects//locations//conversations/`. + * @type int $lifecycle_state + * Output only. The current state of the Conversation. + * @type string $conversation_profile + * Required. The Conversation Profile to be used to configure this + * Conversation. This field cannot be updated. + * Format: `projects//locations//conversationProfiles/`. + * @type \Google\Cloud\Dialogflow\V2\ConversationPhoneNumber $phone_number + * Output only. It will not be empty if the conversation is to be connected + * over telephony. + * @type \Google\Protobuf\Timestamp $start_time + * Output only. The time the conversation was started. + * @type \Google\Protobuf\Timestamp $end_time + * Output only. The time the conversation was finished. + * @type int $conversation_stage + * Optional. The stage of a conversation. It indicates whether the virtual + * agent or a human agent is handling the conversation. + * If the conversation is created with the conversation profile that has + * Dialogflow config set, defaults to + * [ConversationStage.VIRTUAL_AGENT_STAGE][google.cloud.dialogflow.v2.Conversation.ConversationStage.VIRTUAL_AGENT_STAGE]; + * Otherwise, defaults to + * [ConversationStage.HUMAN_ASSIST_STAGE][google.cloud.dialogflow.v2.Conversation.ConversationStage.HUMAN_ASSIST_STAGE]. + * If the conversation is created with the conversation profile that has + * Dialogflow config set but explicitly sets conversation_stage to + * [ConversationStage.HUMAN_ASSIST_STAGE][google.cloud.dialogflow.v2.Conversation.ConversationStage.HUMAN_ASSIST_STAGE], + * it skips + * [ConversationStage.VIRTUAL_AGENT_STAGE][google.cloud.dialogflow.v2.Conversation.ConversationStage.VIRTUAL_AGENT_STAGE] + * stage and directly goes to + * [ConversationStage.HUMAN_ASSIST_STAGE][google.cloud.dialogflow.v2.Conversation.ConversationStage.HUMAN_ASSIST_STAGE]. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\Conversation::initOnce(); + parent::__construct($data); + } + + /** + * Output only. Identifier. The unique identifier of this conversation. + * Format: `projects//locations//conversations/`. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.field_behavior) = IDENTIFIER]; + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Output only. Identifier. The unique identifier of this conversation. + * Format: `projects//locations//conversations/`. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.field_behavior) = IDENTIFIER]; + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + + /** + * Output only. The current state of the Conversation. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.Conversation.LifecycleState lifecycle_state = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return int + */ + public function getLifecycleState() + { + return $this->lifecycle_state; + } + + /** + * Output only. The current state of the Conversation. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.Conversation.LifecycleState lifecycle_state = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param int $var + * @return $this + */ + public function setLifecycleState($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\Dialogflow\V2\Conversation\LifecycleState::class); + $this->lifecycle_state = $var; + + return $this; + } + + /** + * Required. The Conversation Profile to be used to configure this + * Conversation. This field cannot be updated. + * Format: `projects//locations//conversationProfiles/`. + * + * Generated from protobuf field string conversation_profile = 3 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getConversationProfile() + { + return $this->conversation_profile; + } + + /** + * Required. The Conversation Profile to be used to configure this + * Conversation. This field cannot be updated. + * Format: `projects//locations//conversationProfiles/`. + * + * Generated from protobuf field string conversation_profile = 3 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setConversationProfile($var) + { + GPBUtil::checkString($var, True); + $this->conversation_profile = $var; + + return $this; + } + + /** + * Output only. It will not be empty if the conversation is to be connected + * over telephony. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.ConversationPhoneNumber phone_number = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Cloud\Dialogflow\V2\ConversationPhoneNumber|null + */ + public function getPhoneNumber() + { + return $this->phone_number; + } + + public function hasPhoneNumber() + { + return isset($this->phone_number); + } + + public function clearPhoneNumber() + { + unset($this->phone_number); + } + + /** + * Output only. It will not be empty if the conversation is to be connected + * over telephony. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.ConversationPhoneNumber phone_number = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Cloud\Dialogflow\V2\ConversationPhoneNumber $var + * @return $this + */ + public function setPhoneNumber($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Dialogflow\V2\ConversationPhoneNumber::class); + $this->phone_number = $var; + + return $this; + } + + /** + * Output only. The time the conversation was started. + * + * Generated from protobuf field .google.protobuf.Timestamp start_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Protobuf\Timestamp|null + */ + public function getStartTime() + { + return $this->start_time; + } + + public function hasStartTime() + { + return isset($this->start_time); + } + + public function clearStartTime() + { + unset($this->start_time); + } + + /** + * Output only. The time the conversation was started. + * + * Generated from protobuf field .google.protobuf.Timestamp start_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setStartTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->start_time = $var; + + return $this; + } + + /** + * Output only. The time the conversation was finished. + * + * Generated from protobuf field .google.protobuf.Timestamp end_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Protobuf\Timestamp|null + */ + public function getEndTime() + { + return $this->end_time; + } + + public function hasEndTime() + { + return isset($this->end_time); + } + + public function clearEndTime() + { + unset($this->end_time); + } + + /** + * Output only. The time the conversation was finished. + * + * Generated from protobuf field .google.protobuf.Timestamp end_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setEndTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->end_time = $var; + + return $this; + } + + /** + * Optional. The stage of a conversation. It indicates whether the virtual + * agent or a human agent is handling the conversation. + * If the conversation is created with the conversation profile that has + * Dialogflow config set, defaults to + * [ConversationStage.VIRTUAL_AGENT_STAGE][google.cloud.dialogflow.v2.Conversation.ConversationStage.VIRTUAL_AGENT_STAGE]; + * Otherwise, defaults to + * [ConversationStage.HUMAN_ASSIST_STAGE][google.cloud.dialogflow.v2.Conversation.ConversationStage.HUMAN_ASSIST_STAGE]. + * If the conversation is created with the conversation profile that has + * Dialogflow config set but explicitly sets conversation_stage to + * [ConversationStage.HUMAN_ASSIST_STAGE][google.cloud.dialogflow.v2.Conversation.ConversationStage.HUMAN_ASSIST_STAGE], + * it skips + * [ConversationStage.VIRTUAL_AGENT_STAGE][google.cloud.dialogflow.v2.Conversation.ConversationStage.VIRTUAL_AGENT_STAGE] + * stage and directly goes to + * [ConversationStage.HUMAN_ASSIST_STAGE][google.cloud.dialogflow.v2.Conversation.ConversationStage.HUMAN_ASSIST_STAGE]. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.Conversation.ConversationStage conversation_stage = 7 [(.google.api.field_behavior) = OPTIONAL]; + * @return int + */ + public function getConversationStage() + { + return $this->conversation_stage; + } + + /** + * Optional. The stage of a conversation. It indicates whether the virtual + * agent or a human agent is handling the conversation. + * If the conversation is created with the conversation profile that has + * Dialogflow config set, defaults to + * [ConversationStage.VIRTUAL_AGENT_STAGE][google.cloud.dialogflow.v2.Conversation.ConversationStage.VIRTUAL_AGENT_STAGE]; + * Otherwise, defaults to + * [ConversationStage.HUMAN_ASSIST_STAGE][google.cloud.dialogflow.v2.Conversation.ConversationStage.HUMAN_ASSIST_STAGE]. + * If the conversation is created with the conversation profile that has + * Dialogflow config set but explicitly sets conversation_stage to + * [ConversationStage.HUMAN_ASSIST_STAGE][google.cloud.dialogflow.v2.Conversation.ConversationStage.HUMAN_ASSIST_STAGE], + * it skips + * [ConversationStage.VIRTUAL_AGENT_STAGE][google.cloud.dialogflow.v2.Conversation.ConversationStage.VIRTUAL_AGENT_STAGE] + * stage and directly goes to + * [ConversationStage.HUMAN_ASSIST_STAGE][google.cloud.dialogflow.v2.Conversation.ConversationStage.HUMAN_ASSIST_STAGE]. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.Conversation.ConversationStage conversation_stage = 7 [(.google.api.field_behavior) = OPTIONAL]; + * @param int $var + * @return $this + */ + public function setConversationStage($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\Dialogflow\V2\Conversation\ConversationStage::class); + $this->conversation_stage = $var; + + return $this; + } + +} + 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/ConversationContext.php b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/ConversationContext.php new file mode 100644 index 000000000000..30ebd3778f77 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/ConversationContext.php @@ -0,0 +1,67 @@ +google.cloud.dialogflow.v2.ConversationContext + */ +class ConversationContext extends \Google\Protobuf\Internal\Message +{ + /** + * Optional. List of message transcripts in the conversation. + * + * Generated from protobuf field repeated .google.cloud.dialogflow.v2.MessageEntry message_entries = 1 [(.google.api.field_behavior) = OPTIONAL]; + */ + private $message_entries; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array<\Google\Cloud\Dialogflow\V2\MessageEntry>|\Google\Protobuf\Internal\RepeatedField $message_entries + * Optional. List of message transcripts in the conversation. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\Generator::initOnce(); + parent::__construct($data); + } + + /** + * Optional. List of message transcripts in the conversation. + * + * Generated from protobuf field repeated .google.cloud.dialogflow.v2.MessageEntry message_entries = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getMessageEntries() + { + return $this->message_entries; + } + + /** + * Optional. List of message transcripts in the conversation. + * + * Generated from protobuf field repeated .google.cloud.dialogflow.v2.MessageEntry message_entries = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @param array<\Google\Cloud\Dialogflow\V2\MessageEntry>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setMessageEntries($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Dialogflow\V2\MessageEntry::class); + $this->message_entries = $arr; + + return $this; + } + +} + diff --git a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/ConversationDataset.php b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/ConversationDataset.php new file mode 100644 index 000000000000..f0bcdc331c95 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/ConversationDataset.php @@ -0,0 +1,412 @@ +google.cloud.dialogflow.v2.ConversationDataset + */ +class ConversationDataset extends \Google\Protobuf\Internal\Message +{ + /** + * Output only. ConversationDataset resource name. Format: + * `projects//locations//conversationDatasets/` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $name = ''; + /** + * Required. The display name of the dataset. Maximum of 64 bytes. + * + * Generated from protobuf field string display_name = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $display_name = ''; + /** + * Optional. The description of the dataset. Maximum of 10000 bytes. + * + * Generated from protobuf field string description = 3 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $description = ''; + /** + * Output only. Creation time of this dataset. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $create_time = null; + /** + * Output only. Input configurations set during conversation data import. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.InputConfig input_config = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $input_config = null; + /** + * Output only. Metadata set during conversation data import. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.ConversationInfo conversation_info = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $conversation_info = null; + /** + * Output only. The number of conversations this conversation dataset + * contains. + * + * Generated from protobuf field int64 conversation_count = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $conversation_count = 0; + /** + * Output only. A read only boolean field reflecting Zone Isolation status of + * the dataset. + * + * Generated from protobuf field optional bool satisfies_pzi = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $satisfies_pzi = null; + /** + * Output only. A read only boolean field reflecting Zone Separation status of + * the dataset. + * + * Generated from protobuf field optional bool satisfies_pzs = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $satisfies_pzs = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Output only. ConversationDataset resource name. Format: + * `projects//locations//conversationDatasets/` + * @type string $display_name + * Required. The display name of the dataset. Maximum of 64 bytes. + * @type string $description + * Optional. The description of the dataset. Maximum of 10000 bytes. + * @type \Google\Protobuf\Timestamp $create_time + * Output only. Creation time of this dataset. + * @type \Google\Cloud\Dialogflow\V2\InputConfig $input_config + * Output only. Input configurations set during conversation data import. + * @type \Google\Cloud\Dialogflow\V2\ConversationInfo $conversation_info + * Output only. Metadata set during conversation data import. + * @type int|string $conversation_count + * Output only. The number of conversations this conversation dataset + * contains. + * @type bool $satisfies_pzi + * Output only. A read only boolean field reflecting Zone Isolation status of + * the dataset. + * @type bool $satisfies_pzs + * Output only. A read only boolean field reflecting Zone Separation status of + * the dataset. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\ConversationDataset::initOnce(); + parent::__construct($data); + } + + /** + * Output only. ConversationDataset resource name. Format: + * `projects//locations//conversationDatasets/` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Output only. ConversationDataset resource name. Format: + * `projects//locations//conversationDatasets/` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + + /** + * Required. The display name of the dataset. Maximum of 64 bytes. + * + * Generated from protobuf field string display_name = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getDisplayName() + { + return $this->display_name; + } + + /** + * Required. The display name of the dataset. Maximum of 64 bytes. + * + * Generated from protobuf field string display_name = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setDisplayName($var) + { + GPBUtil::checkString($var, True); + $this->display_name = $var; + + return $this; + } + + /** + * Optional. The description of the dataset. Maximum of 10000 bytes. + * + * Generated from protobuf field string description = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getDescription() + { + return $this->description; + } + + /** + * Optional. The description of the dataset. Maximum of 10000 bytes. + * + * Generated from protobuf field string description = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setDescription($var) + { + GPBUtil::checkString($var, True); + $this->description = $var; + + return $this; + } + + /** + * Output only. Creation time of this dataset. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Protobuf\Timestamp|null + */ + public function getCreateTime() + { + return $this->create_time; + } + + public function hasCreateTime() + { + return isset($this->create_time); + } + + public function clearCreateTime() + { + unset($this->create_time); + } + + /** + * Output only. Creation time of this dataset. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setCreateTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->create_time = $var; + + return $this; + } + + /** + * Output only. Input configurations set during conversation data import. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.InputConfig input_config = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Cloud\Dialogflow\V2\InputConfig|null + */ + public function getInputConfig() + { + return $this->input_config; + } + + public function hasInputConfig() + { + return isset($this->input_config); + } + + public function clearInputConfig() + { + unset($this->input_config); + } + + /** + * Output only. Input configurations set during conversation data import. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.InputConfig input_config = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Cloud\Dialogflow\V2\InputConfig $var + * @return $this + */ + public function setInputConfig($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Dialogflow\V2\InputConfig::class); + $this->input_config = $var; + + return $this; + } + + /** + * Output only. Metadata set during conversation data import. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.ConversationInfo conversation_info = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Cloud\Dialogflow\V2\ConversationInfo|null + */ + public function getConversationInfo() + { + return $this->conversation_info; + } + + public function hasConversationInfo() + { + return isset($this->conversation_info); + } + + public function clearConversationInfo() + { + unset($this->conversation_info); + } + + /** + * Output only. Metadata set during conversation data import. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.ConversationInfo conversation_info = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Cloud\Dialogflow\V2\ConversationInfo $var + * @return $this + */ + public function setConversationInfo($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Dialogflow\V2\ConversationInfo::class); + $this->conversation_info = $var; + + return $this; + } + + /** + * Output only. The number of conversations this conversation dataset + * contains. + * + * Generated from protobuf field int64 conversation_count = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return int|string + */ + public function getConversationCount() + { + return $this->conversation_count; + } + + /** + * Output only. The number of conversations this conversation dataset + * contains. + * + * Generated from protobuf field int64 conversation_count = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param int|string $var + * @return $this + */ + public function setConversationCount($var) + { + GPBUtil::checkInt64($var); + $this->conversation_count = $var; + + return $this; + } + + /** + * Output only. A read only boolean field reflecting Zone Isolation status of + * the dataset. + * + * Generated from protobuf field optional bool satisfies_pzi = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return bool + */ + public function getSatisfiesPzi() + { + return isset($this->satisfies_pzi) ? $this->satisfies_pzi : false; + } + + public function hasSatisfiesPzi() + { + return isset($this->satisfies_pzi); + } + + public function clearSatisfiesPzi() + { + unset($this->satisfies_pzi); + } + + /** + * Output only. A read only boolean field reflecting Zone Isolation status of + * the dataset. + * + * Generated from protobuf field optional bool satisfies_pzi = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param bool $var + * @return $this + */ + public function setSatisfiesPzi($var) + { + GPBUtil::checkBool($var); + $this->satisfies_pzi = $var; + + return $this; + } + + /** + * Output only. A read only boolean field reflecting Zone Separation status of + * the dataset. + * + * Generated from protobuf field optional bool satisfies_pzs = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return bool + */ + public function getSatisfiesPzs() + { + return isset($this->satisfies_pzs) ? $this->satisfies_pzs : false; + } + + public function hasSatisfiesPzs() + { + return isset($this->satisfies_pzs); + } + + public function clearSatisfiesPzs() + { + unset($this->satisfies_pzs); + } + + /** + * Output only. A read only boolean field reflecting Zone Separation status of + * the dataset. + * + * Generated from protobuf field optional bool satisfies_pzs = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param bool $var + * @return $this + */ + public function setSatisfiesPzs($var) + { + GPBUtil::checkBool($var); + $this->satisfies_pzs = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/ConversationEvent.php b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/ConversationEvent.php new file mode 100644 index 000000000000..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..fa2896f524ae --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/ConversationModel.php @@ -0,0 +1,442 @@ +google.cloud.dialogflow.v2.ConversationModel + */ +class ConversationModel extends \Google\Protobuf\Internal\Message +{ + /** + * ConversationModel resource name. Format: + * `projects//conversationModels/` + * + * Generated from protobuf field string name = 1; + */ + protected $name = ''; + /** + * Required. The display name of the model. At most 64 bytes long. + * + * Generated from protobuf field string display_name = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $display_name = ''; + /** + * Output only. Creation time of this model. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $create_time = null; + /** + * Required. Datasets used to create model. + * + * Generated from protobuf field repeated .google.cloud.dialogflow.v2.InputDataset datasets = 4 [(.google.api.field_behavior) = REQUIRED]; + */ + private $datasets; + /** + * Output only. State of the model. A model can only serve prediction requests + * after it gets deployed. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.ConversationModel.State state = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $state = 0; + /** + * Language code for the conversation model. If not specified, the language + * is en-US. Language at ConversationModel should be set for all non en-us + * languages. + * This should be a [BCP-47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt) + * language tag. Example: "en-US". + * + * Generated from protobuf field string language_code = 19; + */ + protected $language_code = ''; + /** + * Output only. A read only boolean field reflecting Zone Separation + * status of the model. + * + * Generated from protobuf field optional bool satisfies_pzs = 25 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $satisfies_pzs = null; + /** + * Output only. A read only boolean field reflecting Zone Isolation status + * of the model. + * + * Generated from protobuf field optional bool satisfies_pzi = 26 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $satisfies_pzi = null; + protected $model_metadata; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * ConversationModel resource name. Format: + * `projects//conversationModels/` + * @type string $display_name + * Required. The display name of the model. At most 64 bytes long. + * @type \Google\Protobuf\Timestamp $create_time + * Output only. Creation time of this model. + * @type 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. + * @type bool $satisfies_pzs + * Output only. A read only boolean field reflecting Zone Separation + * status of the model. + * @type bool $satisfies_pzi + * Output only. A read only boolean field reflecting Zone Isolation status + * of the model. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\ConversationModel::initOnce(); + parent::__construct($data); + } + + /** + * ConversationModel resource name. Format: + * `projects//conversationModels/` + * + * Generated from protobuf field string name = 1; + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * ConversationModel resource name. Format: + * `projects//conversationModels/` + * + * Generated from protobuf field string name = 1; + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + + /** + * Required. The display name of the model. At most 64 bytes long. + * + * Generated from protobuf field string display_name = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getDisplayName() + { + return $this->display_name; + } + + /** + * Required. The display name of the model. At most 64 bytes long. + * + * Generated from protobuf field string display_name = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setDisplayName($var) + { + GPBUtil::checkString($var, True); + $this->display_name = $var; + + return $this; + } + + /** + * Output only. Creation time of this model. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Protobuf\Timestamp|null + */ + public function getCreateTime() + { + return $this->create_time; + } + + public function hasCreateTime() + { + return isset($this->create_time); + } + + public function clearCreateTime() + { + unset($this->create_time); + } + + /** + * Output only. Creation time of this model. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setCreateTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->create_time = $var; + + return $this; + } + + /** + * Required. Datasets used to create model. + * + * Generated from protobuf field repeated .google.cloud.dialogflow.v2.InputDataset datasets = 4 [(.google.api.field_behavior) = REQUIRED]; + * @return \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; + } + + /** + * Output only. A read only boolean field reflecting Zone Separation + * status of the model. + * + * Generated from protobuf field optional bool satisfies_pzs = 25 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return bool + */ + public function getSatisfiesPzs() + { + return isset($this->satisfies_pzs) ? $this->satisfies_pzs : false; + } + + public function hasSatisfiesPzs() + { + return isset($this->satisfies_pzs); + } + + public function clearSatisfiesPzs() + { + unset($this->satisfies_pzs); + } + + /** + * Output only. A read only boolean field reflecting Zone Separation + * status of the model. + * + * Generated from protobuf field optional bool satisfies_pzs = 25 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param bool $var + * @return $this + */ + public function setSatisfiesPzs($var) + { + GPBUtil::checkBool($var); + $this->satisfies_pzs = $var; + + return $this; + } + + /** + * Output only. A read only boolean field reflecting Zone Isolation status + * of the model. + * + * Generated from protobuf field optional bool satisfies_pzi = 26 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return bool + */ + public function getSatisfiesPzi() + { + return isset($this->satisfies_pzi) ? $this->satisfies_pzi : false; + } + + public function hasSatisfiesPzi() + { + return isset($this->satisfies_pzi); + } + + public function clearSatisfiesPzi() + { + unset($this->satisfies_pzi); + } + + /** + * Output only. A read only boolean field reflecting Zone Isolation status + * of the model. + * + * Generated from protobuf field optional bool satisfies_pzi = 26 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param bool $var + * @return $this + */ + public function setSatisfiesPzi($var) + { + GPBUtil::checkBool($var); + $this->satisfies_pzi = $var; + + return $this; + } + + /** + * @return string + */ + public function getModelMetadata() + { + return $this->whichOneof("model_metadata"); + } + +} + diff --git a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/ConversationModel/ModelType.php b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/ConversationModel/ModelType.php new file mode 100644 index 000000000000..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..1a4146837421 --- /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/CreateGeneratorRequest.php b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/CreateGeneratorRequest.php new file mode 100644 index 000000000000..8e51638cc57d --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/CreateGeneratorRequest.php @@ -0,0 +1,209 @@ +google.cloud.dialogflow.v2.CreateGeneratorRequest + */ +class CreateGeneratorRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The project/location to create generator for. Format: + * `projects//locations/` + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $parent = ''; + /** + * Required. The generator to create. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.Generator generator = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $generator = null; + /** + * Optional. The ID to use for the generator, which will become the final + * component of the generator's resource name. + * The generator ID must be compliant with the regression fomula + * `[a-zA-Z][a-zA-Z0-9_-]*` with the characters length in range of [3,64]. + * If the field is not provided, an Id will be auto-generated. + * If the field is provided, the caller is 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 generator_id = 3 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $generator_id = ''; + + /** + * @param string $parent Required. The project/location to create generator for. Format: + * `projects//locations/` + * Please see {@see GeneratorsClient::projectName()} for help formatting this field. + * @param \Google\Cloud\Dialogflow\V2\Generator $generator Required. The generator to create. + * @param string $generatorId Optional. The ID to use for the generator, which will become the final + * component of the generator's resource name. + * + * The generator ID must be compliant with the regression fomula + * `[a-zA-Z][a-zA-Z0-9_-]*` with the characters length in range of [3,64]. + * If the field is not provided, an Id will be auto-generated. + * If the field is provided, the caller is 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. + * + * @return \Google\Cloud\Dialogflow\V2\CreateGeneratorRequest + * + * @experimental + */ + public static function build(string $parent, \Google\Cloud\Dialogflow\V2\Generator $generator, string $generatorId): self + { + return (new self()) + ->setParent($parent) + ->setGenerator($generator) + ->setGeneratorId($generatorId); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $parent + * Required. The project/location to create generator for. Format: + * `projects//locations/` + * @type \Google\Cloud\Dialogflow\V2\Generator $generator + * Required. The generator to create. + * @type string $generator_id + * Optional. The ID to use for the generator, which will become the final + * component of the generator's resource name. + * The generator ID must be compliant with the regression fomula + * `[a-zA-Z][a-zA-Z0-9_-]*` with the characters length in range of [3,64]. + * If the field is not provided, an Id will be auto-generated. + * If the field is provided, the caller is 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\Generator::initOnce(); + parent::__construct($data); + } + + /** + * Required. The project/location to create generator for. Format: + * `projects//locations/` + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getParent() + { + return $this->parent; + } + + /** + * Required. The project/location to create generator for. Format: + * `projects//locations/` + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setParent($var) + { + GPBUtil::checkString($var, True); + $this->parent = $var; + + return $this; + } + + /** + * Required. The generator to create. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.Generator generator = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\Dialogflow\V2\Generator|null + */ + public function getGenerator() + { + return $this->generator; + } + + public function hasGenerator() + { + return isset($this->generator); + } + + public function clearGenerator() + { + unset($this->generator); + } + + /** + * Required. The generator to create. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.Generator generator = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\Dialogflow\V2\Generator $var + * @return $this + */ + public function setGenerator($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Dialogflow\V2\Generator::class); + $this->generator = $var; + + return $this; + } + + /** + * Optional. The ID to use for the generator, which will become the final + * component of the generator's resource name. + * The generator ID must be compliant with the regression fomula + * `[a-zA-Z][a-zA-Z0-9_-]*` with the characters length in range of [3,64]. + * If the field is not provided, an Id will be auto-generated. + * If the field is provided, the caller is 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 generator_id = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getGeneratorId() + { + return $this->generator_id; + } + + /** + * Optional. The ID to use for the generator, which will become the final + * component of the generator's resource name. + * The generator ID must be compliant with the regression fomula + * `[a-zA-Z][a-zA-Z0-9_-]*` with the characters length in range of [3,64]. + * If the field is not provided, an Id will be auto-generated. + * If the field is provided, the caller is 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 generator_id = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setGeneratorId($var) + { + GPBUtil::checkString($var, True); + $this->generator_id = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/CreateIntentRequest.php b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/CreateIntentRequest.php new file mode 100644 index 000000000000..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/DeleteGeneratorRequest.php b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/DeleteGeneratorRequest.php new file mode 100644 index 000000000000..8cd00db55700 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/DeleteGeneratorRequest.php @@ -0,0 +1,86 @@ +google.cloud.dialogflow.v2.DeleteGeneratorRequest + */ +class DeleteGeneratorRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The generator resource name to delete. Format: + * `projects//locations//generators/` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $name = ''; + + /** + * @param string $name Required. The generator resource name to delete. Format: + * `projects//locations//generators/` + * Please see {@see GeneratorsClient::generatorName()} for help formatting this field. + * + * @return \Google\Cloud\Dialogflow\V2\DeleteGeneratorRequest + * + * @experimental + */ + public static function build(string $name): self + { + return (new self()) + ->setName($name); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. The generator resource name to delete. Format: + * `projects//locations//generators/` + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\Generator::initOnce(); + parent::__construct($data); + } + + /** + * Required. The generator resource name to delete. Format: + * `projects//locations//generators/` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Required. The generator resource name to delete. Format: + * `projects//locations//generators/` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/DeleteIntentRequest.php b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/DeleteIntentRequest.php new file mode 100644 index 000000000000..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..8461a6598877 --- /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/DialogflowAssistAnswer.php b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/DialogflowAssistAnswer.php new file mode 100644 index 000000000000..65b84a8bf228 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/DialogflowAssistAnswer.php @@ -0,0 +1,150 @@ +google.cloud.dialogflow.v2.DialogflowAssistAnswer + */ +class DialogflowAssistAnswer extends \Google\Protobuf\Internal\Message +{ + /** + * The name of answer record, in the format of + * "projects//locations//answerRecords/" + * + * Generated from protobuf field string answer_record = 2; + */ + protected $answer_record = ''; + protected $result; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\Dialogflow\V2\QueryResult $query_result + * Result from v2 agent. + * @type \Google\Cloud\Dialogflow\V2\IntentSuggestion $intent_suggestion + * An intent suggestion generated from conversation. + * @type string $answer_record + * The name of answer record, in the format of + * "projects//locations//answerRecords/" + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\Participant::initOnce(); + parent::__construct($data); + } + + /** + * Result from v2 agent. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.QueryResult query_result = 1; + * @return \Google\Cloud\Dialogflow\V2\QueryResult|null + */ + public function getQueryResult() + { + return $this->readOneof(1); + } + + public function hasQueryResult() + { + return $this->hasOneof(1); + } + + /** + * Result from v2 agent. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.QueryResult query_result = 1; + * @param \Google\Cloud\Dialogflow\V2\QueryResult $var + * @return $this + */ + public function setQueryResult($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Dialogflow\V2\QueryResult::class); + $this->writeOneof(1, $var); + + return $this; + } + + /** + * An intent suggestion generated from conversation. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.IntentSuggestion intent_suggestion = 5; + * @return \Google\Cloud\Dialogflow\V2\IntentSuggestion|null + */ + public function getIntentSuggestion() + { + return $this->readOneof(5); + } + + public function hasIntentSuggestion() + { + return $this->hasOneof(5); + } + + /** + * An intent suggestion generated from conversation. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.IntentSuggestion intent_suggestion = 5; + * @param \Google\Cloud\Dialogflow\V2\IntentSuggestion $var + * @return $this + */ + public function setIntentSuggestion($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Dialogflow\V2\IntentSuggestion::class); + $this->writeOneof(5, $var); + + return $this; + } + + /** + * The name of answer record, in the format of + * "projects//locations//answerRecords/" + * + * Generated from protobuf field string answer_record = 2; + * @return string + */ + public function getAnswerRecord() + { + return $this->answer_record; + } + + /** + * The name of answer record, in the format of + * "projects//locations//answerRecords/" + * + * Generated from protobuf field string answer_record = 2; + * @param string $var + * @return $this + */ + public function setAnswerRecord($var) + { + GPBUtil::checkString($var, True); + $this->answer_record = $var; + + return $this; + } + + /** + * @return string + */ + public function getResult() + { + return $this->whichOneof("result"); + } + +} + diff --git a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/Document.php b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/Document.php new file mode 100644 index 000000000000..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/EncryptionSpec.php b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/EncryptionSpec.php new file mode 100644 index 000000000000..cf409b8ff23a --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/EncryptionSpec.php @@ -0,0 +1,126 @@ +google.cloud.dialogflow.v2.EncryptionSpec + */ +class EncryptionSpec extends \Google\Protobuf\Internal\Message +{ + /** + * Immutable. The resource name of the encryption key specification resource. + * Format: + * projects/{project}/locations/{location}/encryptionSpec + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = IMMUTABLE]; + */ + protected $name = ''; + /** + * Required. The name of customer-managed encryption key that is used to + * secure a resource and its sub-resources. If empty, the resource is secured + * by the default Google encryption key. Only the key in the same location as + * this resource is allowed to be used for encryption. Format: + * `projects/{project}/locations/{location}/keyRings/{keyRing}/cryptoKeys/{key}` + * + * Generated from protobuf field string kms_key = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $kms_key = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Immutable. The resource name of the encryption key specification resource. + * Format: + * projects/{project}/locations/{location}/encryptionSpec + * @type string $kms_key + * Required. The name of customer-managed encryption key that is used to + * secure a resource and its sub-resources. If empty, the resource is secured + * by the default Google encryption key. Only the key in the same location as + * this resource is allowed to be used for encryption. Format: + * `projects/{project}/locations/{location}/keyRings/{keyRing}/cryptoKeys/{key}` + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\EncryptionSpec::initOnce(); + parent::__construct($data); + } + + /** + * Immutable. The resource name of the encryption key specification resource. + * Format: + * projects/{project}/locations/{location}/encryptionSpec + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = IMMUTABLE]; + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Immutable. The resource name of the encryption key specification resource. + * Format: + * projects/{project}/locations/{location}/encryptionSpec + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = IMMUTABLE]; + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + + /** + * Required. The name of customer-managed encryption key that is used to + * secure a resource and its sub-resources. If empty, the resource is secured + * by the default Google encryption key. Only the key in the same location as + * this resource is allowed to be used for encryption. Format: + * `projects/{project}/locations/{location}/keyRings/{keyRing}/cryptoKeys/{key}` + * + * Generated from protobuf field string kms_key = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getKmsKey() + { + return $this->kms_key; + } + + /** + * Required. The name of customer-managed encryption key that is used to + * secure a resource and its sub-resources. If empty, the resource is secured + * by the default Google encryption key. Only the key in the same location as + * this resource is allowed to be used for encryption. Format: + * `projects/{project}/locations/{location}/keyRings/{keyRing}/cryptoKeys/{key}` + * + * Generated from protobuf field string kms_key = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setKmsKey($var) + { + GPBUtil::checkString($var, True); + $this->kms_key = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/EntityType.php b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/EntityType.php new file mode 100644 index 000000000000..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..015785c67f65 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/EventInput.php @@ -0,0 +1,221 @@ +` can trigger a personalized welcome response. + * The parameter `name` may be used by the agent in the response: + * `"Hello #welcome_event.name! What can I do for you today?"`. + * + * Generated from protobuf message google.cloud.dialogflow.v2.EventInput + */ +class EventInput extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The unique identifier of the event. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $name = ''; + /** + * The collection of parameters associated with the event. + * Depending on your protocol or client library language, this is a + * map, associative array, symbol table, dictionary, or JSON object + * composed of a collection of (MapKey, MapValue) pairs: + * * MapKey type: string + * * MapKey value: parameter name + * * MapValue type: If parameter's entity type is a composite entity then use + * map, otherwise, depending on the parameter value type, it could be one of + * string, number, boolean, null, list or map. + * * MapValue value: If parameter's entity type is a composite entity then use + * map from composite entity property names to property values, otherwise, + * use parameter value. + * + * Generated from protobuf field .google.protobuf.Struct parameters = 2; + */ + protected $parameters = null; + /** + * Required. The language of this query. See [Language + * Support](https://cloud.google.com/dialogflow/docs/reference/language) + * for a list of the currently supported language codes. Note that queries in + * the same session do not necessarily need to specify the same language. + * This field is ignored when used in the context of a + * [WebhookResponse.followup_event_input][google.cloud.dialogflow.v2.WebhookResponse.followup_event_input] + * field, because the language was already defined in the originating detect + * intent request. + * + * Generated from protobuf field string language_code = 3 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $language_code = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. The unique identifier of the event. + * @type \Google\Protobuf\Struct $parameters + * The collection of parameters associated with the event. + * Depending on your protocol or client library language, this is a + * map, associative array, symbol table, dictionary, or JSON object + * composed of a collection of (MapKey, MapValue) pairs: + * * MapKey type: string + * * MapKey value: parameter name + * * MapValue type: If parameter's entity type is a composite entity then use + * map, otherwise, depending on the parameter value type, it could be one of + * string, number, boolean, null, list or map. + * * MapValue value: If parameter's entity type is a composite entity then use + * map from composite entity property names to property values, otherwise, + * use parameter value. + * @type string $language_code + * Required. The language of this query. See [Language + * Support](https://cloud.google.com/dialogflow/docs/reference/language) + * for a list of the currently supported language codes. Note that queries in + * the same session do not necessarily need to specify the same language. + * This field is ignored when used in the context of a + * [WebhookResponse.followup_event_input][google.cloud.dialogflow.v2.WebhookResponse.followup_event_input] + * field, because the language was already defined in the originating detect + * intent request. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\Session::initOnce(); + parent::__construct($data); + } + + /** + * Required. The unique identifier of the event. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Required. The unique identifier of the event. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + + /** + * The collection of parameters associated with the event. + * Depending on your protocol or client library language, this is a + * map, associative array, symbol table, dictionary, or JSON object + * composed of a collection of (MapKey, MapValue) pairs: + * * MapKey type: string + * * MapKey value: parameter name + * * MapValue type: If parameter's entity type is a composite entity then use + * map, otherwise, depending on the parameter value type, it could be one of + * string, number, boolean, null, list or map. + * * MapValue value: If parameter's entity type is a composite entity then use + * map from composite entity property names to property values, otherwise, + * use parameter value. + * + * Generated from protobuf field .google.protobuf.Struct parameters = 2; + * @return \Google\Protobuf\Struct|null + */ + public function getParameters() + { + return $this->parameters; + } + + public function hasParameters() + { + return isset($this->parameters); + } + + public function clearParameters() + { + unset($this->parameters); + } + + /** + * The collection of parameters associated with the event. + * Depending on your protocol or client library language, this is a + * map, associative array, symbol table, dictionary, or JSON object + * composed of a collection of (MapKey, MapValue) pairs: + * * MapKey type: string + * * MapKey value: parameter name + * * MapValue type: If parameter's entity type is a composite entity then use + * map, otherwise, depending on the parameter value type, it could be one of + * string, number, boolean, null, list or map. + * * MapValue value: If parameter's entity type is a composite entity then use + * map from composite entity property names to property values, otherwise, + * use parameter value. + * + * Generated from protobuf field .google.protobuf.Struct parameters = 2; + * @param \Google\Protobuf\Struct $var + * @return $this + */ + public function setParameters($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Struct::class); + $this->parameters = $var; + + return $this; + } + + /** + * Required. The language of this query. See [Language + * Support](https://cloud.google.com/dialogflow/docs/reference/language) + * for a list of the currently supported language codes. Note that queries in + * the same session do not necessarily need to specify the same language. + * This field is ignored when used in the context of a + * [WebhookResponse.followup_event_input][google.cloud.dialogflow.v2.WebhookResponse.followup_event_input] + * field, because the language was already defined in the originating detect + * intent request. + * + * Generated from protobuf field string language_code = 3 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getLanguageCode() + { + return $this->language_code; + } + + /** + * Required. The language of this query. See [Language + * Support](https://cloud.google.com/dialogflow/docs/reference/language) + * for a list of the currently supported language codes. Note that queries in + * the same session do not necessarily need to specify the same language. + * This field is ignored when used in the context of a + * [WebhookResponse.followup_event_input][google.cloud.dialogflow.v2.WebhookResponse.followup_event_input] + * field, because the language was already defined in the originating detect + * intent request. + * + * Generated from protobuf field string language_code = 3 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setLanguageCode($var) + { + GPBUtil::checkString($var, True); + $this->language_code = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/ExportAgentRequest.php b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/ExportAgentRequest.php new file mode 100644 index 000000000000..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/FewShotExample.php b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/FewShotExample.php new file mode 100644 index 000000000000..52ef044b9d7b --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/FewShotExample.php @@ -0,0 +1,207 @@ +google.cloud.dialogflow.v2.FewShotExample + */ +class FewShotExample extends \Google\Protobuf\Internal\Message +{ + /** + * Optional. Conversation transcripts. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.ConversationContext conversation_context = 3 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $conversation_context = null; + /** + * Optional. Key is the placeholder field name in input, value is the value of + * the placeholder. E.g. instruction contains "@price", and ingested data has + * <"price", "10"> + * + * Generated from protobuf field map extra_info = 4 [(.google.api.field_behavior) = OPTIONAL]; + */ + private $extra_info; + /** + * Required. Example output of the model. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.GeneratorSuggestion output = 7 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $output = null; + protected $instruction_list; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\Dialogflow\V2\ConversationContext $conversation_context + * Optional. Conversation transcripts. + * @type array|\Google\Protobuf\Internal\MapField $extra_info + * Optional. Key is the placeholder field name in input, value is the value of + * the placeholder. E.g. instruction contains "@price", and ingested data has + * <"price", "10"> + * @type \Google\Cloud\Dialogflow\V2\SummarizationSectionList $summarization_section_list + * Summarization sections. + * @type \Google\Cloud\Dialogflow\V2\GeneratorSuggestion $output + * Required. Example output of the model. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\Generator::initOnce(); + parent::__construct($data); + } + + /** + * Optional. Conversation transcripts. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.ConversationContext conversation_context = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Cloud\Dialogflow\V2\ConversationContext|null + */ + public function getConversationContext() + { + return $this->conversation_context; + } + + public function hasConversationContext() + { + return isset($this->conversation_context); + } + + public function clearConversationContext() + { + unset($this->conversation_context); + } + + /** + * Optional. Conversation transcripts. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.ConversationContext conversation_context = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @param \Google\Cloud\Dialogflow\V2\ConversationContext $var + * @return $this + */ + public function setConversationContext($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Dialogflow\V2\ConversationContext::class); + $this->conversation_context = $var; + + return $this; + } + + /** + * Optional. Key is the placeholder field name in input, value is the value of + * the placeholder. E.g. instruction contains "@price", and ingested data has + * <"price", "10"> + * + * Generated from protobuf field map extra_info = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Protobuf\Internal\MapField + */ + public function getExtraInfo() + { + return $this->extra_info; + } + + /** + * Optional. Key is the placeholder field name in input, value is the value of + * the placeholder. E.g. instruction contains "@price", and ingested data has + * <"price", "10"> + * + * Generated from protobuf field map extra_info = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @param array|\Google\Protobuf\Internal\MapField $var + * @return $this + */ + public function setExtraInfo($var) + { + $arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::STRING, \Google\Protobuf\Internal\GPBType::STRING); + $this->extra_info = $arr; + + return $this; + } + + /** + * Summarization sections. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.SummarizationSectionList summarization_section_list = 6; + * @return \Google\Cloud\Dialogflow\V2\SummarizationSectionList|null + */ + public function getSummarizationSectionList() + { + return $this->readOneof(6); + } + + public function hasSummarizationSectionList() + { + return $this->hasOneof(6); + } + + /** + * Summarization sections. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.SummarizationSectionList summarization_section_list = 6; + * @param \Google\Cloud\Dialogflow\V2\SummarizationSectionList $var + * @return $this + */ + public function setSummarizationSectionList($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Dialogflow\V2\SummarizationSectionList::class); + $this->writeOneof(6, $var); + + return $this; + } + + /** + * Required. Example output of the model. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.GeneratorSuggestion output = 7 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\Dialogflow\V2\GeneratorSuggestion|null + */ + public function getOutput() + { + return $this->output; + } + + public function hasOutput() + { + return isset($this->output); + } + + public function clearOutput() + { + unset($this->output); + } + + /** + * Required. Example output of the model. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.GeneratorSuggestion output = 7 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\Dialogflow\V2\GeneratorSuggestion $var + * @return $this + */ + public function setOutput($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Dialogflow\V2\GeneratorSuggestion::class); + $this->output = $var; + + return $this; + } + + /** + * @return string + */ + public function getInstructionList() + { + return $this->whichOneof("instruction_list"); + } + +} + diff --git a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/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..db741ca11ad4 --- /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..f4a6871fa81f --- /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/GenerateStatelessSuggestionRequest.php b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/GenerateStatelessSuggestionRequest.php new file mode 100644 index 000000000000..03058fb6bbf4 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/GenerateStatelessSuggestionRequest.php @@ -0,0 +1,235 @@ +google.cloud.dialogflow.v2.GenerateStatelessSuggestionRequest + */ +class GenerateStatelessSuggestionRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The parent resource to charge for the Suggestion's generation. + * Format: `projects//locations/`. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $parent = ''; + /** + * Optional. Context of the conversation, including transcripts. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.ConversationContext conversation_context = 5 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $conversation_context = null; + /** + * Optional. A list of trigger events. Generator will be triggered only if + * it's trigger event is included here. + * + * Generated from protobuf field repeated .google.cloud.dialogflow.v2.TriggerEvent trigger_events = 6 [(.google.api.field_behavior) = OPTIONAL]; + */ + private $trigger_events; + protected $generator_resource; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $parent + * Required. The parent resource to charge for the Suggestion's generation. + * Format: `projects//locations/`. + * @type \Google\Cloud\Dialogflow\V2\Generator $generator + * Uncreated generator. It should be a complete generator that includes all + * information about the generator. + * @type string $generator_name + * The resource name of the existing created generator. Format: + * `projects//locations//generators/` + * @type \Google\Cloud\Dialogflow\V2\ConversationContext $conversation_context + * Optional. Context of the conversation, including transcripts. + * @type array|\Google\Protobuf\Internal\RepeatedField $trigger_events + * Optional. A list of trigger events. Generator will be triggered only if + * it's trigger event is included here. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\Conversation::initOnce(); + parent::__construct($data); + } + + /** + * Required. The parent resource to charge for the Suggestion's generation. + * Format: `projects//locations/`. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getParent() + { + return $this->parent; + } + + /** + * Required. The parent resource to charge for the Suggestion's generation. + * Format: `projects//locations/`. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setParent($var) + { + GPBUtil::checkString($var, True); + $this->parent = $var; + + return $this; + } + + /** + * Uncreated generator. It should be a complete generator that includes all + * information about the generator. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.Generator generator = 2; + * @return \Google\Cloud\Dialogflow\V2\Generator|null + */ + public function getGenerator() + { + return $this->readOneof(2); + } + + public function hasGenerator() + { + return $this->hasOneof(2); + } + + /** + * Uncreated generator. It should be a complete generator that includes all + * information about the generator. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.Generator generator = 2; + * @param \Google\Cloud\Dialogflow\V2\Generator $var + * @return $this + */ + public function setGenerator($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Dialogflow\V2\Generator::class); + $this->writeOneof(2, $var); + + return $this; + } + + /** + * The resource name of the existing created generator. Format: + * `projects//locations//generators/` + * + * Generated from protobuf field string generator_name = 3; + * @return string + */ + public function getGeneratorName() + { + return $this->readOneof(3); + } + + public function hasGeneratorName() + { + return $this->hasOneof(3); + } + + /** + * The resource name of the existing created generator. Format: + * `projects//locations//generators/` + * + * Generated from protobuf field string generator_name = 3; + * @param string $var + * @return $this + */ + public function setGeneratorName($var) + { + GPBUtil::checkString($var, True); + $this->writeOneof(3, $var); + + return $this; + } + + /** + * Optional. Context of the conversation, including transcripts. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.ConversationContext conversation_context = 5 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Cloud\Dialogflow\V2\ConversationContext|null + */ + public function getConversationContext() + { + return $this->conversation_context; + } + + public function hasConversationContext() + { + return isset($this->conversation_context); + } + + public function clearConversationContext() + { + unset($this->conversation_context); + } + + /** + * Optional. Context of the conversation, including transcripts. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.ConversationContext conversation_context = 5 [(.google.api.field_behavior) = OPTIONAL]; + * @param \Google\Cloud\Dialogflow\V2\ConversationContext $var + * @return $this + */ + public function setConversationContext($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Dialogflow\V2\ConversationContext::class); + $this->conversation_context = $var; + + return $this; + } + + /** + * Optional. A list of trigger events. Generator will be triggered only if + * it's trigger event is included here. + * + * Generated from protobuf field repeated .google.cloud.dialogflow.v2.TriggerEvent trigger_events = 6 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getTriggerEvents() + { + return $this->trigger_events; + } + + /** + * Optional. A list of trigger events. Generator will be triggered only if + * it's trigger event is included here. + * + * Generated from protobuf field repeated .google.cloud.dialogflow.v2.TriggerEvent trigger_events = 6 [(.google.api.field_behavior) = OPTIONAL]; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setTriggerEvents($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::ENUM, \Google\Cloud\Dialogflow\V2\TriggerEvent::class); + $this->trigger_events = $arr; + + return $this; + } + + /** + * @return string + */ + public function getGeneratorResource() + { + return $this->whichOneof("generator_resource"); + } + +} + diff --git a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/GenerateStatelessSuggestionResponse.php b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/GenerateStatelessSuggestionResponse.php new file mode 100644 index 000000000000..304f86b0165d --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/GenerateStatelessSuggestionResponse.php @@ -0,0 +1,78 @@ +google.cloud.dialogflow.v2.GenerateStatelessSuggestionResponse + */ +class GenerateStatelessSuggestionResponse extends \Google\Protobuf\Internal\Message +{ + /** + * Required. Generated suggestion for a conversation. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.GeneratorSuggestion generator_suggestion = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $generator_suggestion = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\Dialogflow\V2\GeneratorSuggestion $generator_suggestion + * Required. Generated suggestion for a conversation. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\Conversation::initOnce(); + parent::__construct($data); + } + + /** + * Required. Generated suggestion for a conversation. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.GeneratorSuggestion generator_suggestion = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\Dialogflow\V2\GeneratorSuggestion|null + */ + public function getGeneratorSuggestion() + { + return $this->generator_suggestion; + } + + public function hasGeneratorSuggestion() + { + return isset($this->generator_suggestion); + } + + public function clearGeneratorSuggestion() + { + unset($this->generator_suggestion); + } + + /** + * Required. Generated suggestion for a conversation. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.GeneratorSuggestion generator_suggestion = 1 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\Dialogflow\V2\GeneratorSuggestion $var + * @return $this + */ + public function setGeneratorSuggestion($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Dialogflow\V2\GeneratorSuggestion::class); + $this->generator_suggestion = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/GenerateStatelessSummaryRequest.php b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/GenerateStatelessSummaryRequest.php new file mode 100644 index 000000000000..444878d8939e --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/GenerateStatelessSummaryRequest.php @@ -0,0 +1,222 @@ +google.cloud.dialogflow.v2.GenerateStatelessSummaryRequest + */ +class GenerateStatelessSummaryRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The conversation to suggest a summary for. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.GenerateStatelessSummaryRequest.MinimalConversation stateless_conversation = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $stateless_conversation = null; + /** + * Required. A ConversationProfile containing information required for Summary + * generation. + * Required fields: {language_code, security_settings} + * Optional fields: {agent_assistant_config} + * + * Generated from protobuf field .google.cloud.dialogflow.v2.ConversationProfile conversation_profile = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $conversation_profile = null; + /** + * Optional. The name of the latest conversation message used as context for + * generating a Summary. If empty, the latest message of the conversation will + * be used. The format is specific to the user and the names of the messages + * provided. + * + * Generated from protobuf field string latest_message = 3 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { + */ + protected $latest_message = ''; + /** + * Optional. Max number of messages prior to and including + * [latest_message] to use as context when compiling the + * suggestion. By default 500 and at most 1000. + * + * Generated from protobuf field int32 max_context_size = 4 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $max_context_size = 0; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\Dialogflow\V2\GenerateStatelessSummaryRequest\MinimalConversation $stateless_conversation + * Required. The conversation to suggest a summary for. + * @type \Google\Cloud\Dialogflow\V2\ConversationProfile $conversation_profile + * Required. A ConversationProfile containing information required for Summary + * generation. + * Required fields: {language_code, security_settings} + * Optional fields: {agent_assistant_config} + * @type string $latest_message + * Optional. The name of the latest conversation message used as context for + * generating a Summary. If empty, the latest message of the conversation will + * be used. The format is specific to the user and the names of the messages + * provided. + * @type int $max_context_size + * Optional. Max number of messages prior to and including + * [latest_message] to use as context when compiling the + * suggestion. By default 500 and at most 1000. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\Conversation::initOnce(); + parent::__construct($data); + } + + /** + * Required. The conversation to suggest a summary for. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.GenerateStatelessSummaryRequest.MinimalConversation stateless_conversation = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\Dialogflow\V2\GenerateStatelessSummaryRequest\MinimalConversation|null + */ + public function getStatelessConversation() + { + return $this->stateless_conversation; + } + + public function hasStatelessConversation() + { + return isset($this->stateless_conversation); + } + + public function clearStatelessConversation() + { + unset($this->stateless_conversation); + } + + /** + * Required. The conversation to suggest a summary for. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.GenerateStatelessSummaryRequest.MinimalConversation stateless_conversation = 1 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\Dialogflow\V2\GenerateStatelessSummaryRequest\MinimalConversation $var + * @return $this + */ + public function setStatelessConversation($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Dialogflow\V2\GenerateStatelessSummaryRequest\MinimalConversation::class); + $this->stateless_conversation = $var; + + return $this; + } + + /** + * Required. A ConversationProfile containing information required for Summary + * generation. + * Required fields: {language_code, security_settings} + * Optional fields: {agent_assistant_config} + * + * Generated from protobuf field .google.cloud.dialogflow.v2.ConversationProfile conversation_profile = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\Dialogflow\V2\ConversationProfile|null + */ + public function getConversationProfile() + { + return $this->conversation_profile; + } + + public function hasConversationProfile() + { + return isset($this->conversation_profile); + } + + public function clearConversationProfile() + { + unset($this->conversation_profile); + } + + /** + * Required. A ConversationProfile containing information required for Summary + * generation. + * Required fields: {language_code, security_settings} + * Optional fields: {agent_assistant_config} + * + * Generated from protobuf field .google.cloud.dialogflow.v2.ConversationProfile conversation_profile = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\Dialogflow\V2\ConversationProfile $var + * @return $this + */ + public function setConversationProfile($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Dialogflow\V2\ConversationProfile::class); + $this->conversation_profile = $var; + + return $this; + } + + /** + * Optional. The name of the latest conversation message used as context for + * generating a Summary. If empty, the latest message of the conversation will + * be used. The format is specific to the user and the names of the messages + * provided. + * + * Generated from protobuf field string latest_message = 3 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { + * @return string + */ + public function getLatestMessage() + { + return $this->latest_message; + } + + /** + * Optional. The name of the latest conversation message used as context for + * generating a Summary. If empty, the latest message of the conversation will + * be used. The format is specific to the user and the names of the messages + * provided. + * + * Generated from protobuf field string latest_message = 3 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setLatestMessage($var) + { + GPBUtil::checkString($var, True); + $this->latest_message = $var; + + return $this; + } + + /** + * Optional. Max number of messages prior to and including + * [latest_message] to use as context when compiling the + * suggestion. By default 500 and at most 1000. + * + * Generated from protobuf field int32 max_context_size = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @return int + */ + public function getMaxContextSize() + { + return $this->max_context_size; + } + + /** + * Optional. Max number of messages prior to and including + * [latest_message] to use as context when compiling the + * suggestion. By default 500 and at most 1000. + * + * Generated from protobuf field int32 max_context_size = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @param int $var + * @return $this + */ + public function setMaxContextSize($var) + { + GPBUtil::checkInt32($var); + $this->max_context_size = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/GenerateStatelessSummaryRequest/MinimalConversation.php b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/GenerateStatelessSummaryRequest/MinimalConversation.php new file mode 100644 index 000000000000..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..17d7ddc9e7ef --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/GenerateStatelessSummaryResponse/Summary.php @@ -0,0 +1,150 @@ +google.cloud.dialogflow.v2.GenerateStatelessSummaryResponse.Summary + */ +class Summary extends \Google\Protobuf\Internal\Message +{ + /** + * The summary content that is concatenated into one string. + * + * Generated from protobuf field string text = 1; + */ + protected $text = ''; + /** + * The summary content that is divided into sections. The key is the + * section's name and the value is the section's content. There is no + * specific format for the key or value. + * + * Generated from protobuf field map text_sections = 2; + */ + private $text_sections; + /** + * The baseline model version used to generate this summary. It is empty if + * a baseline model was not used to generate this summary. + * + * Generated from protobuf field string baseline_model_version = 4; + */ + protected $baseline_model_version = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $text + * The summary content that is concatenated into one string. + * @type array|\Google\Protobuf\Internal\MapField $text_sections + * The summary content that is divided into sections. The key is the + * section's name and the value is the section's content. There is no + * specific format for the key or value. + * @type string $baseline_model_version + * The baseline model version used to generate this summary. It is empty if + * a baseline model was not used to generate this summary. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\Conversation::initOnce(); + parent::__construct($data); + } + + /** + * The summary content that is concatenated into one string. + * + * Generated from protobuf field string text = 1; + * @return string + */ + public function getText() + { + return $this->text; + } + + /** + * The summary content that is concatenated into one string. + * + * Generated from protobuf field string text = 1; + * @param string $var + * @return $this + */ + public function setText($var) + { + GPBUtil::checkString($var, True); + $this->text = $var; + + return $this; + } + + /** + * The summary content that is divided into sections. The key is the + * section's name and the value is the section's content. There is no + * specific format for the key or value. + * + * Generated from protobuf field map text_sections = 2; + * @return \Google\Protobuf\Internal\MapField + */ + public function getTextSections() + { + return $this->text_sections; + } + + /** + * The summary content that is divided into sections. The key is the + * section's name and the value is the section's content. There is no + * specific format for the key or value. + * + * Generated from protobuf field map text_sections = 2; + * @param array|\Google\Protobuf\Internal\MapField $var + * @return $this + */ + public function setTextSections($var) + { + $arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::STRING, \Google\Protobuf\Internal\GPBType::STRING); + $this->text_sections = $arr; + + return $this; + } + + /** + * The baseline model version used to generate this summary. It is empty if + * a baseline model was not used to generate this summary. + * + * Generated from protobuf field string baseline_model_version = 4; + * @return string + */ + public function getBaselineModelVersion() + { + return $this->baseline_model_version; + } + + /** + * The baseline model version used to generate this summary. It is empty if + * a baseline model was not used to generate this summary. + * + * Generated from protobuf field string baseline_model_version = 4; + * @param string $var + * @return $this + */ + public function setBaselineModelVersion($var) + { + GPBUtil::checkString($var, True); + $this->baseline_model_version = $var; + + return $this; + } + +} + +// 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/Generator.php b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/Generator.php new file mode 100644 index 000000000000..ccfa4554f07a --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/Generator.php @@ -0,0 +1,317 @@ +google.cloud.dialogflow.v2.Generator + */ +class Generator extends \Google\Protobuf\Internal\Message +{ + /** + * Output only. Identifier. The resource name of the generator. Format: + * `projects//locations//generators/` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = IDENTIFIER, (.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $name = ''; + /** + * Optional. Human readable description of the generator. + * + * Generated from protobuf field string description = 2 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $description = ''; + /** + * Optional. Inference parameters for this generator. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.InferenceParameter inference_parameter = 4 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $inference_parameter = null; + /** + * Optional. The trigger event of the generator. It defines when the generator + * is triggered in a conversation. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.TriggerEvent trigger_event = 5 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $trigger_event = 0; + /** + * Output only. Creation time of this generator. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $create_time = null; + /** + * Output only. Update time of this generator. + * + * Generated from protobuf field .google.protobuf.Timestamp update_time = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $update_time = null; + protected $context; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Output only. Identifier. The resource name of the generator. Format: + * `projects//locations//generators/` + * @type string $description + * Optional. Human readable description of the generator. + * @type \Google\Cloud\Dialogflow\V2\SummarizationContext $summarization_context + * Input of prebuilt Summarization feature. + * @type \Google\Cloud\Dialogflow\V2\InferenceParameter $inference_parameter + * Optional. Inference parameters for this generator. + * @type int $trigger_event + * Optional. The trigger event of the generator. It defines when the generator + * is triggered in a conversation. + * @type \Google\Protobuf\Timestamp $create_time + * Output only. Creation time of this generator. + * @type \Google\Protobuf\Timestamp $update_time + * Output only. Update time of this generator. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\Generator::initOnce(); + parent::__construct($data); + } + + /** + * Output only. Identifier. The resource name of the generator. Format: + * `projects//locations//generators/` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = IDENTIFIER, (.google.api.field_behavior) = OUTPUT_ONLY]; + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Output only. Identifier. The resource name of the generator. Format: + * `projects//locations//generators/` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = IDENTIFIER, (.google.api.field_behavior) = OUTPUT_ONLY]; + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + + /** + * Optional. Human readable description of the generator. + * + * Generated from protobuf field string description = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getDescription() + { + return $this->description; + } + + /** + * Optional. Human readable description of the generator. + * + * Generated from protobuf field string description = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setDescription($var) + { + GPBUtil::checkString($var, True); + $this->description = $var; + + return $this; + } + + /** + * Input of prebuilt Summarization feature. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.SummarizationContext summarization_context = 13; + * @return \Google\Cloud\Dialogflow\V2\SummarizationContext|null + */ + public function getSummarizationContext() + { + return $this->readOneof(13); + } + + public function hasSummarizationContext() + { + return $this->hasOneof(13); + } + + /** + * Input of prebuilt Summarization feature. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.SummarizationContext summarization_context = 13; + * @param \Google\Cloud\Dialogflow\V2\SummarizationContext $var + * @return $this + */ + public function setSummarizationContext($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Dialogflow\V2\SummarizationContext::class); + $this->writeOneof(13, $var); + + return $this; + } + + /** + * Optional. Inference parameters for this generator. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.InferenceParameter inference_parameter = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Cloud\Dialogflow\V2\InferenceParameter|null + */ + public function getInferenceParameter() + { + return $this->inference_parameter; + } + + public function hasInferenceParameter() + { + return isset($this->inference_parameter); + } + + public function clearInferenceParameter() + { + unset($this->inference_parameter); + } + + /** + * Optional. Inference parameters for this generator. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.InferenceParameter inference_parameter = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @param \Google\Cloud\Dialogflow\V2\InferenceParameter $var + * @return $this + */ + public function setInferenceParameter($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Dialogflow\V2\InferenceParameter::class); + $this->inference_parameter = $var; + + return $this; + } + + /** + * Optional. The trigger event of the generator. It defines when the generator + * is triggered in a conversation. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.TriggerEvent trigger_event = 5 [(.google.api.field_behavior) = OPTIONAL]; + * @return int + */ + public function getTriggerEvent() + { + return $this->trigger_event; + } + + /** + * Optional. The trigger event of the generator. It defines when the generator + * is triggered in a conversation. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.TriggerEvent trigger_event = 5 [(.google.api.field_behavior) = OPTIONAL]; + * @param int $var + * @return $this + */ + public function setTriggerEvent($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\Dialogflow\V2\TriggerEvent::class); + $this->trigger_event = $var; + + return $this; + } + + /** + * Output only. Creation time of this generator. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Protobuf\Timestamp|null + */ + public function getCreateTime() + { + return $this->create_time; + } + + public function hasCreateTime() + { + return isset($this->create_time); + } + + public function clearCreateTime() + { + unset($this->create_time); + } + + /** + * Output only. Creation time of this generator. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setCreateTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->create_time = $var; + + return $this; + } + + /** + * Output only. Update time of this generator. + * + * Generated from protobuf field .google.protobuf.Timestamp update_time = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Protobuf\Timestamp|null + */ + public function getUpdateTime() + { + return $this->update_time; + } + + public function hasUpdateTime() + { + return isset($this->update_time); + } + + public function clearUpdateTime() + { + unset($this->update_time); + } + + /** + * Output only. Update time of this generator. + * + * Generated from protobuf field .google.protobuf.Timestamp update_time = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setUpdateTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->update_time = $var; + + return $this; + } + + /** + * @return string + */ + public function getContext() + { + return $this->whichOneof("context"); + } + +} + diff --git a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/GeneratorSuggestion.php b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/GeneratorSuggestion.php new file mode 100644 index 000000000000..87774c2b0e4c --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/GeneratorSuggestion.php @@ -0,0 +1,75 @@ +google.cloud.dialogflow.v2.GeneratorSuggestion + */ +class GeneratorSuggestion extends \Google\Protobuf\Internal\Message +{ + protected $suggestion; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\Dialogflow\V2\SummarySuggestion $summary_suggestion + * Optional. Suggested summary. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\Generator::initOnce(); + parent::__construct($data); + } + + /** + * Optional. Suggested summary. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.SummarySuggestion summary_suggestion = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Cloud\Dialogflow\V2\SummarySuggestion|null + */ + public function getSummarySuggestion() + { + return $this->readOneof(2); + } + + public function hasSummarySuggestion() + { + return $this->hasOneof(2); + } + + /** + * Optional. Suggested summary. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.SummarySuggestion summary_suggestion = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @param \Google\Cloud\Dialogflow\V2\SummarySuggestion $var + * @return $this + */ + public function setSummarySuggestion($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Dialogflow\V2\SummarySuggestion::class); + $this->writeOneof(2, $var); + + return $this; + } + + /** + * @return string + */ + public function getSuggestion() + { + return $this->whichOneof("suggestion"); + } + +} + 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/GetEncryptionSpecRequest.php b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/GetEncryptionSpecRequest.php new file mode 100644 index 000000000000..df230e6800c5 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/GetEncryptionSpecRequest.php @@ -0,0 +1,81 @@ +google.cloud.dialogflow.v2.GetEncryptionSpecRequest + */ +class GetEncryptionSpecRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The name of the encryption spec resource to get. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $name = ''; + + /** + * @param string $name Required. The name of the encryption spec resource to get. Please see + * {@see EncryptionSpecServiceClient::encryptionSpecName()} for help formatting this field. + * + * @return \Google\Cloud\Dialogflow\V2\GetEncryptionSpecRequest + * + * @experimental + */ + public static function build(string $name): self + { + return (new self()) + ->setName($name); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. The name of the encryption spec resource to get. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\EncryptionSpec::initOnce(); + parent::__construct($data); + } + + /** + * Required. The name of the encryption spec resource to get. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Required. The name of the encryption spec resource to get. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/GetEntityTypeRequest.php b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/GetEntityTypeRequest.php new file mode 100644 index 000000000000..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/GetGeneratorRequest.php b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/GetGeneratorRequest.php new file mode 100644 index 000000000000..4afab4140d9b --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/GetGeneratorRequest.php @@ -0,0 +1,86 @@ +google.cloud.dialogflow.v2.GetGeneratorRequest + */ +class GetGeneratorRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The generator resource name to retrieve. Format: + * `projects//locations/`/generators/` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $name = ''; + + /** + * @param string $name Required. The generator resource name to retrieve. Format: + * `projects//locations/`/generators/` + * Please see {@see GeneratorsClient::generatorName()} for help formatting this field. + * + * @return \Google\Cloud\Dialogflow\V2\GetGeneratorRequest + * + * @experimental + */ + public static function build(string $name): self + { + return (new self()) + ->setName($name); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. The generator resource name to retrieve. Format: + * `projects//locations/`/generators/` + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\Generator::initOnce(); + parent::__construct($data); + } + + /** + * Required. The generator resource name to retrieve. Format: + * `projects//locations/`/generators/` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Required. The generator resource name to retrieve. Format: + * `projects//locations/`/generators/` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/GetIntentRequest.php b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/GetIntentRequest.php new file mode 100644 index 000000000000..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..09dd830b6145 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/HumanAgentAssistantConfig/SuggestionConfig.php @@ -0,0 +1,236 @@ +google.cloud.dialogflow.v2.HumanAgentAssistantConfig.SuggestionConfig + */ +class SuggestionConfig extends \Google\Protobuf\Internal\Message +{ + /** + * Configuration of different suggestion features. One feature can have only + * one config. + * + * Generated from protobuf field repeated .google.cloud.dialogflow.v2.HumanAgentAssistantConfig.SuggestionFeatureConfig feature_configs = 2; + */ + private $feature_configs; + /** + * If `group_suggestion_responses` is false, and there are multiple + * `feature_configs` in `event based suggestion` or + * StreamingAnalyzeContent, we will try to deliver suggestions to customers + * as soon as we get new suggestion. Different type of suggestions based on + * the same context will be in separate Pub/Sub event or + * `StreamingAnalyzeContentResponse`. + * If `group_suggestion_responses` set to true. All the suggestions to the + * same participant based on the same context will be grouped into a single + * Pub/Sub event or StreamingAnalyzeContentResponse. + * + * Generated from protobuf field bool group_suggestion_responses = 3; + */ + protected $group_suggestion_responses = false; + /** + * Optional. List of various generator resource names used in the + * conversation profile. + * + * Generated from protobuf field repeated string generators = 4 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { + */ + private $generators; + /** + * Optional. When disable_high_latency_features_sync_delivery is true and + * using the AnalyzeContent API, we will not deliver the responses from high + * latency features in the API response. The + * human_agent_assistant_config.notification_config must be configured and + * enable_event_based_suggestion must be set to true to receive the + * responses from high latency features in Pub/Sub. High latency feature(s): + * KNOWLEDGE_ASSIST + * + * Generated from protobuf field bool disable_high_latency_features_sync_delivery = 5 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $disable_high_latency_features_sync_delivery = false; + + /** + * 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. + * @type array|\Google\Protobuf\Internal\RepeatedField $generators + * Optional. List of various generator resource names used in the + * conversation profile. + * @type bool $disable_high_latency_features_sync_delivery + * Optional. When disable_high_latency_features_sync_delivery is true and + * using the AnalyzeContent API, we will not deliver the responses from high + * latency features in the API response. The + * human_agent_assistant_config.notification_config must be configured and + * enable_event_based_suggestion must be set to true to receive the + * responses from high latency features in Pub/Sub. High latency feature(s): + * KNOWLEDGE_ASSIST + * } + */ + 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; + } + + /** + * Optional. List of various generator resource names used in the + * conversation profile. + * + * Generated from protobuf field repeated string generators = 4 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getGenerators() + { + return $this->generators; + } + + /** + * Optional. List of various generator resource names used in the + * conversation profile. + * + * Generated from protobuf field repeated string generators = 4 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setGenerators($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->generators = $arr; + + return $this; + } + + /** + * Optional. When disable_high_latency_features_sync_delivery is true and + * using the AnalyzeContent API, we will not deliver the responses from high + * latency features in the API response. The + * human_agent_assistant_config.notification_config must be configured and + * enable_event_based_suggestion must be set to true to receive the + * responses from high latency features in Pub/Sub. High latency feature(s): + * KNOWLEDGE_ASSIST + * + * Generated from protobuf field bool disable_high_latency_features_sync_delivery = 5 [(.google.api.field_behavior) = OPTIONAL]; + * @return bool + */ + public function getDisableHighLatencyFeaturesSyncDelivery() + { + return $this->disable_high_latency_features_sync_delivery; + } + + /** + * Optional. When disable_high_latency_features_sync_delivery is true and + * using the AnalyzeContent API, we will not deliver the responses from high + * latency features in the API response. The + * human_agent_assistant_config.notification_config must be configured and + * enable_event_based_suggestion must be set to true to receive the + * responses from high latency features in Pub/Sub. High latency feature(s): + * KNOWLEDGE_ASSIST + * + * Generated from protobuf field bool disable_high_latency_features_sync_delivery = 5 [(.google.api.field_behavior) = OPTIONAL]; + * @param bool $var + * @return $this + */ + public function setDisableHighLatencyFeaturesSyncDelivery($var) + { + GPBUtil::checkBool($var); + $this->disable_high_latency_features_sync_delivery = $var; + + return $this; + } + +} + +// 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..166f22dd13f6 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/HumanAgentAssistantConfig/SuggestionFeatureConfig.php @@ -0,0 +1,466 @@ +google.cloud.dialogflow.v2.HumanAgentAssistantConfig.SuggestionFeatureConfig + */ +class SuggestionFeatureConfig extends \Google\Protobuf\Internal\Message +{ + /** + * The suggestion feature. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.SuggestionFeature suggestion_feature = 5; + */ + protected $suggestion_feature = null; + /** + * Automatically iterates all participants and tries to compile + * suggestions. + * Supported features: ARTICLE_SUGGESTION, FAQ, DIALOGFLOW_ASSIST, + * KNOWLEDGE_ASSIST. + * + * Generated from protobuf field bool enable_event_based_suggestion = 3; + */ + protected $enable_event_based_suggestion = false; + /** + * Optional. Disable the logging of search queries sent by human agents. It + * can prevent those queries from being stored at answer records. + * Supported features: KNOWLEDGE_SEARCH. + * + * Generated from protobuf field bool disable_agent_query_logging = 14 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $disable_agent_query_logging = false; + /** + * Optional. Enable query suggestion even if we can't find its answer. + * By default, queries are suggested only if we find its answer. + * Supported features: KNOWLEDGE_ASSIST + * + * Generated from protobuf field bool enable_query_suggestion_when_no_answer = 15 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $enable_query_suggestion_when_no_answer = false; + /** + * Optional. Enable including conversation context during query answer + * generation. Supported features: KNOWLEDGE_SEARCH. + * + * Generated from protobuf field bool enable_conversation_augmented_query = 16 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $enable_conversation_augmented_query = false; + /** + * Optional. Enable query suggestion only. + * Supported features: KNOWLEDGE_ASSIST + * + * Generated from protobuf field bool enable_query_suggestion_only = 17 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $enable_query_suggestion_only = false; + /** + * Settings of suggestion trigger. + * Currently, only ARTICLE_SUGGESTION and FAQ will use this field. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.HumanAgentAssistantConfig.SuggestionTriggerSettings suggestion_trigger_settings = 10; + */ + protected $suggestion_trigger_settings = null; + /** + * Configs of query. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.HumanAgentAssistantConfig.SuggestionQueryConfig query_config = 6; + */ + protected $query_config = null; + /** + * Configs of custom conversation model. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.HumanAgentAssistantConfig.ConversationModelConfig conversation_model_config = 7; + */ + protected $conversation_model_config = null; + /** + * Configs for processing conversation. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.HumanAgentAssistantConfig.ConversationProcessConfig conversation_process_config = 8; + */ + protected $conversation_process_config = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\Dialogflow\V2\SuggestionFeature $suggestion_feature + * The suggestion feature. + * @type bool $enable_event_based_suggestion + * Automatically iterates all participants and tries to compile + * suggestions. + * Supported features: ARTICLE_SUGGESTION, FAQ, DIALOGFLOW_ASSIST, + * KNOWLEDGE_ASSIST. + * @type bool $disable_agent_query_logging + * Optional. Disable the logging of search queries sent by human agents. It + * can prevent those queries from being stored at answer records. + * Supported features: KNOWLEDGE_SEARCH. + * @type bool $enable_query_suggestion_when_no_answer + * Optional. Enable query suggestion even if we can't find its answer. + * By default, queries are suggested only if we find its answer. + * Supported features: KNOWLEDGE_ASSIST + * @type bool $enable_conversation_augmented_query + * Optional. Enable including conversation context during query answer + * generation. Supported features: KNOWLEDGE_SEARCH. + * @type bool $enable_query_suggestion_only + * Optional. Enable query suggestion only. + * Supported features: KNOWLEDGE_ASSIST + * @type \Google\Cloud\Dialogflow\V2\HumanAgentAssistantConfig\SuggestionTriggerSettings $suggestion_trigger_settings + * Settings of suggestion trigger. + * Currently, only ARTICLE_SUGGESTION and FAQ will use this field. + * @type \Google\Cloud\Dialogflow\V2\HumanAgentAssistantConfig\SuggestionQueryConfig $query_config + * Configs of query. + * @type \Google\Cloud\Dialogflow\V2\HumanAgentAssistantConfig\ConversationModelConfig $conversation_model_config + * Configs of custom conversation model. + * @type \Google\Cloud\Dialogflow\V2\HumanAgentAssistantConfig\ConversationProcessConfig $conversation_process_config + * Configs for processing conversation. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\ConversationProfile::initOnce(); + parent::__construct($data); + } + + /** + * The suggestion feature. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.SuggestionFeature suggestion_feature = 5; + * @return \Google\Cloud\Dialogflow\V2\SuggestionFeature|null + */ + public function getSuggestionFeature() + { + return $this->suggestion_feature; + } + + public function hasSuggestionFeature() + { + return isset($this->suggestion_feature); + } + + public function clearSuggestionFeature() + { + unset($this->suggestion_feature); + } + + /** + * The suggestion feature. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.SuggestionFeature suggestion_feature = 5; + * @param \Google\Cloud\Dialogflow\V2\SuggestionFeature $var + * @return $this + */ + public function setSuggestionFeature($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Dialogflow\V2\SuggestionFeature::class); + $this->suggestion_feature = $var; + + return $this; + } + + /** + * Automatically iterates all participants and tries to compile + * suggestions. + * Supported features: ARTICLE_SUGGESTION, FAQ, DIALOGFLOW_ASSIST, + * KNOWLEDGE_ASSIST. + * + * Generated from protobuf field bool enable_event_based_suggestion = 3; + * @return bool + */ + public function getEnableEventBasedSuggestion() + { + return $this->enable_event_based_suggestion; + } + + /** + * Automatically iterates all participants and tries to compile + * suggestions. + * Supported features: ARTICLE_SUGGESTION, FAQ, DIALOGFLOW_ASSIST, + * KNOWLEDGE_ASSIST. + * + * Generated from protobuf field bool enable_event_based_suggestion = 3; + * @param bool $var + * @return $this + */ + public function setEnableEventBasedSuggestion($var) + { + GPBUtil::checkBool($var); + $this->enable_event_based_suggestion = $var; + + return $this; + } + + /** + * Optional. Disable the logging of search queries sent by human agents. It + * can prevent those queries from being stored at answer records. + * Supported features: KNOWLEDGE_SEARCH. + * + * Generated from protobuf field bool disable_agent_query_logging = 14 [(.google.api.field_behavior) = OPTIONAL]; + * @return bool + */ + public function getDisableAgentQueryLogging() + { + return $this->disable_agent_query_logging; + } + + /** + * Optional. Disable the logging of search queries sent by human agents. It + * can prevent those queries from being stored at answer records. + * Supported features: KNOWLEDGE_SEARCH. + * + * Generated from protobuf field bool disable_agent_query_logging = 14 [(.google.api.field_behavior) = OPTIONAL]; + * @param bool $var + * @return $this + */ + public function setDisableAgentQueryLogging($var) + { + GPBUtil::checkBool($var); + $this->disable_agent_query_logging = $var; + + return $this; + } + + /** + * Optional. Enable query suggestion even if we can't find its answer. + * By default, queries are suggested only if we find its answer. + * Supported features: KNOWLEDGE_ASSIST + * + * Generated from protobuf field bool enable_query_suggestion_when_no_answer = 15 [(.google.api.field_behavior) = OPTIONAL]; + * @return bool + */ + public function getEnableQuerySuggestionWhenNoAnswer() + { + return $this->enable_query_suggestion_when_no_answer; + } + + /** + * Optional. Enable query suggestion even if we can't find its answer. + * By default, queries are suggested only if we find its answer. + * Supported features: KNOWLEDGE_ASSIST + * + * Generated from protobuf field bool enable_query_suggestion_when_no_answer = 15 [(.google.api.field_behavior) = OPTIONAL]; + * @param bool $var + * @return $this + */ + public function setEnableQuerySuggestionWhenNoAnswer($var) + { + GPBUtil::checkBool($var); + $this->enable_query_suggestion_when_no_answer = $var; + + return $this; + } + + /** + * Optional. Enable including conversation context during query answer + * generation. Supported features: KNOWLEDGE_SEARCH. + * + * Generated from protobuf field bool enable_conversation_augmented_query = 16 [(.google.api.field_behavior) = OPTIONAL]; + * @return bool + */ + public function getEnableConversationAugmentedQuery() + { + return $this->enable_conversation_augmented_query; + } + + /** + * Optional. Enable including conversation context during query answer + * generation. Supported features: KNOWLEDGE_SEARCH. + * + * Generated from protobuf field bool enable_conversation_augmented_query = 16 [(.google.api.field_behavior) = OPTIONAL]; + * @param bool $var + * @return $this + */ + public function setEnableConversationAugmentedQuery($var) + { + GPBUtil::checkBool($var); + $this->enable_conversation_augmented_query = $var; + + return $this; + } + + /** + * Optional. Enable query suggestion only. + * Supported features: KNOWLEDGE_ASSIST + * + * Generated from protobuf field bool enable_query_suggestion_only = 17 [(.google.api.field_behavior) = OPTIONAL]; + * @return bool + */ + public function getEnableQuerySuggestionOnly() + { + return $this->enable_query_suggestion_only; + } + + /** + * Optional. Enable query suggestion only. + * Supported features: KNOWLEDGE_ASSIST + * + * Generated from protobuf field bool enable_query_suggestion_only = 17 [(.google.api.field_behavior) = OPTIONAL]; + * @param bool $var + * @return $this + */ + public function setEnableQuerySuggestionOnly($var) + { + GPBUtil::checkBool($var); + $this->enable_query_suggestion_only = $var; + + return $this; + } + + /** + * 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..c17f9878b001 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/HumanAgentAssistantConfig/SuggestionQueryConfig.php @@ -0,0 +1,374 @@ +google.cloud.dialogflow.v2.HumanAgentAssistantConfig.SuggestionQueryConfig + */ +class SuggestionQueryConfig extends \Google\Protobuf\Internal\Message +{ + /** + * Maximum number of results to return. Currently, if unset, defaults to 10. + * And the max number is 20. + * + * Generated from protobuf field int32 max_results = 4; + */ + protected $max_results = 0; + /** + * Confidence threshold of query result. + * Agent Assist gives each suggestion a score in the range [0.0, 1.0], based + * on the relevance between the suggestion and the current conversation + * context. A score of 0.0 has no relevance, while a score of 1.0 has high + * relevance. Only suggestions with a score greater than or equal to the + * value of this field are included in the results. + * For a baseline model (the default), the recommended value is in the range + * [0.05, 0.1]. + * For a custom model, there is no recommended value. Tune this value by + * starting from a very low value and slowly increasing until you have + * desired results. + * If this field is not set, it defaults to 0.0, which means that all + * suggestions are returned. + * Supported features: ARTICLE_SUGGESTION, FAQ, SMART_REPLY, SMART_COMPOSE, + * KNOWLEDGE_SEARCH, KNOWLEDGE_ASSIST, ENTITY_EXTRACTION. + * + * Generated from protobuf field float confidence_threshold = 5; + */ + protected $confidence_threshold = 0.0; + /** + * Determines how recent conversation context is filtered when generating + * suggestions. If unspecified, no messages will be dropped. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.HumanAgentAssistantConfig.SuggestionQueryConfig.ContextFilterSettings context_filter_settings = 7; + */ + protected $context_filter_settings = null; + /** + * Optional. The customized sections chosen to return when requesting a + * summary of a conversation. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.HumanAgentAssistantConfig.SuggestionQueryConfig.Sections sections = 8 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $sections = null; + protected $query_source; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\Dialogflow\V2\HumanAgentAssistantConfig\SuggestionQueryConfig\KnowledgeBaseQuerySource $knowledge_base_query_source + * Query from knowledgebase. It is used by: + * ARTICLE_SUGGESTION, FAQ. + * @type \Google\Cloud\Dialogflow\V2\HumanAgentAssistantConfig\SuggestionQueryConfig\DocumentQuerySource $document_query_source + * Query from knowledge base document. It is used by: + * SMART_REPLY, SMART_COMPOSE. + * @type \Google\Cloud\Dialogflow\V2\HumanAgentAssistantConfig\SuggestionQueryConfig\DialogflowQuerySource $dialogflow_query_source + * Query from Dialogflow agent. It is used by DIALOGFLOW_ASSIST. + * @type int $max_results + * Maximum number of results to return. Currently, if unset, defaults to 10. + * And the max number is 20. + * @type float $confidence_threshold + * Confidence threshold of query result. + * Agent Assist gives each suggestion a score in the range [0.0, 1.0], based + * on the relevance between the suggestion and the current conversation + * context. A score of 0.0 has no relevance, while a score of 1.0 has high + * relevance. Only suggestions with a score greater than or equal to the + * value of this field are included in the results. + * For a baseline model (the default), the recommended value is in the range + * [0.05, 0.1]. + * For a custom model, there is no recommended value. Tune this value by + * starting from a very low value and slowly increasing until you have + * desired results. + * If this field is not set, it defaults to 0.0, which means that all + * suggestions are returned. + * Supported features: ARTICLE_SUGGESTION, FAQ, SMART_REPLY, SMART_COMPOSE, + * KNOWLEDGE_SEARCH, KNOWLEDGE_ASSIST, ENTITY_EXTRACTION. + * @type \Google\Cloud\Dialogflow\V2\HumanAgentAssistantConfig\SuggestionQueryConfig\ContextFilterSettings $context_filter_settings + * Determines how recent conversation context is filtered when generating + * suggestions. If unspecified, no messages will be dropped. + * @type \Google\Cloud\Dialogflow\V2\HumanAgentAssistantConfig\SuggestionQueryConfig\Sections $sections + * Optional. The customized sections chosen to return when requesting a + * summary of a conversation. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\ConversationProfile::initOnce(); + parent::__construct($data); + } + + /** + * Query from knowledgebase. It is used by: + * ARTICLE_SUGGESTION, FAQ. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.HumanAgentAssistantConfig.SuggestionQueryConfig.KnowledgeBaseQuerySource knowledge_base_query_source = 1; + * @return \Google\Cloud\Dialogflow\V2\HumanAgentAssistantConfig\SuggestionQueryConfig\KnowledgeBaseQuerySource|null + */ + public function getKnowledgeBaseQuerySource() + { + return $this->readOneof(1); + } + + public function hasKnowledgeBaseQuerySource() + { + return $this->hasOneof(1); + } + + /** + * Query from knowledgebase. It is used by: + * ARTICLE_SUGGESTION, FAQ. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.HumanAgentAssistantConfig.SuggestionQueryConfig.KnowledgeBaseQuerySource knowledge_base_query_source = 1; + * @param \Google\Cloud\Dialogflow\V2\HumanAgentAssistantConfig\SuggestionQueryConfig\KnowledgeBaseQuerySource $var + * @return $this + */ + public function setKnowledgeBaseQuerySource($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Dialogflow\V2\HumanAgentAssistantConfig\SuggestionQueryConfig\KnowledgeBaseQuerySource::class); + $this->writeOneof(1, $var); + + return $this; + } + + /** + * Query from knowledge base document. It is used by: + * SMART_REPLY, SMART_COMPOSE. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.HumanAgentAssistantConfig.SuggestionQueryConfig.DocumentQuerySource document_query_source = 2; + * @return \Google\Cloud\Dialogflow\V2\HumanAgentAssistantConfig\SuggestionQueryConfig\DocumentQuerySource|null + */ + public function getDocumentQuerySource() + { + return $this->readOneof(2); + } + + public function hasDocumentQuerySource() + { + return $this->hasOneof(2); + } + + /** + * Query from knowledge base document. It is used by: + * SMART_REPLY, SMART_COMPOSE. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.HumanAgentAssistantConfig.SuggestionQueryConfig.DocumentQuerySource document_query_source = 2; + * @param \Google\Cloud\Dialogflow\V2\HumanAgentAssistantConfig\SuggestionQueryConfig\DocumentQuerySource $var + * @return $this + */ + public function setDocumentQuerySource($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Dialogflow\V2\HumanAgentAssistantConfig\SuggestionQueryConfig\DocumentQuerySource::class); + $this->writeOneof(2, $var); + + return $this; + } + + /** + * Query from Dialogflow agent. It is used by DIALOGFLOW_ASSIST. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.HumanAgentAssistantConfig.SuggestionQueryConfig.DialogflowQuerySource dialogflow_query_source = 3; + * @return \Google\Cloud\Dialogflow\V2\HumanAgentAssistantConfig\SuggestionQueryConfig\DialogflowQuerySource|null + */ + public function getDialogflowQuerySource() + { + return $this->readOneof(3); + } + + public function hasDialogflowQuerySource() + { + return $this->hasOneof(3); + } + + /** + * Query from Dialogflow agent. It is used by DIALOGFLOW_ASSIST. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.HumanAgentAssistantConfig.SuggestionQueryConfig.DialogflowQuerySource dialogflow_query_source = 3; + * @param \Google\Cloud\Dialogflow\V2\HumanAgentAssistantConfig\SuggestionQueryConfig\DialogflowQuerySource $var + * @return $this + */ + public function setDialogflowQuerySource($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Dialogflow\V2\HumanAgentAssistantConfig\SuggestionQueryConfig\DialogflowQuerySource::class); + $this->writeOneof(3, $var); + + return $this; + } + + /** + * Maximum number of results to return. Currently, if unset, defaults to 10. + * And the max number is 20. + * + * Generated from protobuf field int32 max_results = 4; + * @return int + */ + public function getMaxResults() + { + return $this->max_results; + } + + /** + * Maximum number of results to return. Currently, if unset, defaults to 10. + * And the max number is 20. + * + * Generated from protobuf field int32 max_results = 4; + * @param int $var + * @return $this + */ + public function setMaxResults($var) + { + GPBUtil::checkInt32($var); + $this->max_results = $var; + + return $this; + } + + /** + * Confidence threshold of query result. + * Agent Assist gives each suggestion a score in the range [0.0, 1.0], based + * on the relevance between the suggestion and the current conversation + * context. A score of 0.0 has no relevance, while a score of 1.0 has high + * relevance. Only suggestions with a score greater than or equal to the + * value of this field are included in the results. + * For a baseline model (the default), the recommended value is in the range + * [0.05, 0.1]. + * For a custom model, there is no recommended value. Tune this value by + * starting from a very low value and slowly increasing until you have + * desired results. + * If this field is not set, it defaults to 0.0, which means that all + * suggestions are returned. + * Supported features: ARTICLE_SUGGESTION, FAQ, SMART_REPLY, SMART_COMPOSE, + * KNOWLEDGE_SEARCH, KNOWLEDGE_ASSIST, ENTITY_EXTRACTION. + * + * Generated from protobuf field float confidence_threshold = 5; + * @return float + */ + public function getConfidenceThreshold() + { + return $this->confidence_threshold; + } + + /** + * Confidence threshold of query result. + * Agent Assist gives each suggestion a score in the range [0.0, 1.0], based + * on the relevance between the suggestion and the current conversation + * context. A score of 0.0 has no relevance, while a score of 1.0 has high + * relevance. Only suggestions with a score greater than or equal to the + * value of this field are included in the results. + * For a baseline model (the default), the recommended value is in the range + * [0.05, 0.1]. + * For a custom model, there is no recommended value. Tune this value by + * starting from a very low value and slowly increasing until you have + * desired results. + * If this field is not set, it defaults to 0.0, which means that all + * suggestions are returned. + * Supported features: ARTICLE_SUGGESTION, FAQ, SMART_REPLY, SMART_COMPOSE, + * KNOWLEDGE_SEARCH, KNOWLEDGE_ASSIST, ENTITY_EXTRACTION. + * + * Generated from protobuf field float confidence_threshold = 5; + * @param float $var + * @return $this + */ + public function setConfidenceThreshold($var) + { + GPBUtil::checkFloat($var); + $this->confidence_threshold = $var; + + return $this; + } + + /** + * Determines how recent conversation context is filtered when generating + * suggestions. If unspecified, no messages will be dropped. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.HumanAgentAssistantConfig.SuggestionQueryConfig.ContextFilterSettings context_filter_settings = 7; + * @return \Google\Cloud\Dialogflow\V2\HumanAgentAssistantConfig\SuggestionQueryConfig\ContextFilterSettings|null + */ + public function getContextFilterSettings() + { + return $this->context_filter_settings; + } + + public function hasContextFilterSettings() + { + return isset($this->context_filter_settings); + } + + public function clearContextFilterSettings() + { + unset($this->context_filter_settings); + } + + /** + * Determines how recent conversation context is filtered when generating + * suggestions. If unspecified, no messages will be dropped. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.HumanAgentAssistantConfig.SuggestionQueryConfig.ContextFilterSettings context_filter_settings = 7; + * @param \Google\Cloud\Dialogflow\V2\HumanAgentAssistantConfig\SuggestionQueryConfig\ContextFilterSettings $var + * @return $this + */ + public function setContextFilterSettings($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Dialogflow\V2\HumanAgentAssistantConfig\SuggestionQueryConfig\ContextFilterSettings::class); + $this->context_filter_settings = $var; + + return $this; + } + + /** + * Optional. The customized sections chosen to return when requesting a + * summary of a conversation. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.HumanAgentAssistantConfig.SuggestionQueryConfig.Sections sections = 8 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Cloud\Dialogflow\V2\HumanAgentAssistantConfig\SuggestionQueryConfig\Sections|null + */ + public function getSections() + { + return $this->sections; + } + + public function hasSections() + { + return isset($this->sections); + } + + public function clearSections() + { + unset($this->sections); + } + + /** + * Optional. The customized sections chosen to return when requesting a + * summary of a conversation. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.HumanAgentAssistantConfig.SuggestionQueryConfig.Sections sections = 8 [(.google.api.field_behavior) = OPTIONAL]; + * @param \Google\Cloud\Dialogflow\V2\HumanAgentAssistantConfig\SuggestionQueryConfig\Sections $var + * @return $this + */ + public function setSections($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Dialogflow\V2\HumanAgentAssistantConfig\SuggestionQueryConfig\Sections::class); + $this->sections = $var; + + return $this; + } + + /** + * @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..e97e539e31db --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/HumanAgentAssistantConfig/SuggestionQueryConfig/DialogflowQuerySource.php @@ -0,0 +1,127 @@ +google.cloud.dialogflow.v2.HumanAgentAssistantConfig.SuggestionQueryConfig.DialogflowQuerySource + */ +class DialogflowQuerySource extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The name of a Dialogflow virtual agent used for end user side + * intent detection and suggestion. Format: `projects//locations//agent`. When multiple agents are allowed in + * the same Dialogflow project. + * + * Generated from protobuf field string agent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $agent = ''; + /** + * Optional. The Dialogflow assist configuration for human agent. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.HumanAgentAssistantConfig.SuggestionQueryConfig.DialogflowQuerySource.HumanAgentSideConfig human_agent_side_config = 3 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $human_agent_side_config = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $agent + * Required. The name of a Dialogflow virtual agent used for end user side + * intent detection and suggestion. Format: `projects//locations//agent`. When multiple agents are allowed in + * the same Dialogflow project. + * @type \Google\Cloud\Dialogflow\V2\HumanAgentAssistantConfig\SuggestionQueryConfig\DialogflowQuerySource\HumanAgentSideConfig $human_agent_side_config + * Optional. The Dialogflow assist configuration for human agent. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\ConversationProfile::initOnce(); + parent::__construct($data); + } + + /** + * Required. The name of a Dialogflow virtual agent used for end user side + * intent detection and suggestion. Format: `projects//locations//agent`. When multiple agents are allowed in + * the same Dialogflow project. + * + * Generated from protobuf field string agent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getAgent() + { + return $this->agent; + } + + /** + * Required. The name of a Dialogflow virtual agent used for end user side + * intent detection and suggestion. Format: `projects//locations//agent`. When multiple agents are allowed in + * the same Dialogflow project. + * + * Generated from protobuf field string agent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setAgent($var) + { + GPBUtil::checkString($var, True); + $this->agent = $var; + + return $this; + } + + /** + * Optional. The Dialogflow assist configuration for human agent. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.HumanAgentAssistantConfig.SuggestionQueryConfig.DialogflowQuerySource.HumanAgentSideConfig human_agent_side_config = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Cloud\Dialogflow\V2\HumanAgentAssistantConfig\SuggestionQueryConfig\DialogflowQuerySource\HumanAgentSideConfig|null + */ + public function getHumanAgentSideConfig() + { + return $this->human_agent_side_config; + } + + public function hasHumanAgentSideConfig() + { + return isset($this->human_agent_side_config); + } + + public function clearHumanAgentSideConfig() + { + unset($this->human_agent_side_config); + } + + /** + * Optional. The Dialogflow assist configuration for human agent. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.HumanAgentAssistantConfig.SuggestionQueryConfig.DialogflowQuerySource.HumanAgentSideConfig human_agent_side_config = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @param \Google\Cloud\Dialogflow\V2\HumanAgentAssistantConfig\SuggestionQueryConfig\DialogflowQuerySource\HumanAgentSideConfig $var + * @return $this + */ + public function setHumanAgentSideConfig($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Dialogflow\V2\HumanAgentAssistantConfig\SuggestionQueryConfig\DialogflowQuerySource\HumanAgentSideConfig::class); + $this->human_agent_side_config = $var; + + return $this; + } + +} + +// 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/DialogflowQuerySource/HumanAgentSideConfig.php b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/HumanAgentAssistantConfig/SuggestionQueryConfig/DialogflowQuerySource/HumanAgentSideConfig.php new file mode 100644 index 000000000000..2d8b90e6a804 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/HumanAgentAssistantConfig/SuggestionQueryConfig/DialogflowQuerySource/HumanAgentSideConfig.php @@ -0,0 +1,79 @@ +google.cloud.dialogflow.v2.HumanAgentAssistantConfig.SuggestionQueryConfig.DialogflowQuerySource.HumanAgentSideConfig + */ +class HumanAgentSideConfig extends \Google\Protobuf\Internal\Message +{ + /** + * Optional. The name of a dialogflow virtual agent used for intent + * detection and suggestion triggered by human agent. + * Format: `projects//locations//agent`. + * + * Generated from protobuf field string agent = 1 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { + */ + protected $agent = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $agent + * Optional. The name of a dialogflow virtual agent used for intent + * detection and suggestion triggered by human agent. + * Format: `projects//locations//agent`. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\ConversationProfile::initOnce(); + parent::__construct($data); + } + + /** + * Optional. The name of a dialogflow virtual agent used for intent + * detection and suggestion triggered by human agent. + * Format: `projects//locations//agent`. + * + * Generated from protobuf field string agent = 1 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { + * @return string + */ + public function getAgent() + { + return $this->agent; + } + + /** + * Optional. The name of a dialogflow virtual agent used for intent + * detection and suggestion triggered by human agent. + * Format: `projects//locations//agent`. + * + * Generated from protobuf field string agent = 1 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setAgent($var) + { + GPBUtil::checkString($var, True); + $this->agent = $var; + + return $this; + } + +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(HumanAgentSideConfig::class, \Google\Cloud\Dialogflow\V2\HumanAgentAssistantConfig_SuggestionQueryConfig_DialogflowQuerySource_HumanAgentSideConfig::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/SuggestionQueryConfig/Sections.php b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/HumanAgentAssistantConfig/SuggestionQueryConfig/Sections.php new file mode 100644 index 000000000000..f118378813fe --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/HumanAgentAssistantConfig/SuggestionQueryConfig/Sections.php @@ -0,0 +1,85 @@ +google.cloud.dialogflow.v2.HumanAgentAssistantConfig.SuggestionQueryConfig.Sections + */ +class Sections extends \Google\Protobuf\Internal\Message +{ + /** + * The selected sections chosen to return when requesting a summary of a + * conversation. A duplicate selected section will be treated as a single + * selected section. If section types are not provided, the default will + * be {SITUATION, ACTION, RESULT}. + * + * Generated from protobuf field repeated .google.cloud.dialogflow.v2.HumanAgentAssistantConfig.SuggestionQueryConfig.Sections.SectionType section_types = 1; + */ + private $section_types; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array|\Google\Protobuf\Internal\RepeatedField $section_types + * The selected sections chosen to return when requesting a summary of a + * conversation. A duplicate selected section will be treated as a single + * selected section. If section types are not provided, the default will + * be {SITUATION, ACTION, RESULT}. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\ConversationProfile::initOnce(); + parent::__construct($data); + } + + /** + * The selected sections chosen to return when requesting a summary of a + * conversation. A duplicate selected section will be treated as a single + * selected section. If section types are not provided, the default will + * be {SITUATION, ACTION, RESULT}. + * + * Generated from protobuf field repeated .google.cloud.dialogflow.v2.HumanAgentAssistantConfig.SuggestionQueryConfig.Sections.SectionType section_types = 1; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getSectionTypes() + { + return $this->section_types; + } + + /** + * The selected sections chosen to return when requesting a summary of a + * conversation. A duplicate selected section will be treated as a single + * selected section. If section types are not provided, the default will + * be {SITUATION, ACTION, RESULT}. + * + * Generated from protobuf field repeated .google.cloud.dialogflow.v2.HumanAgentAssistantConfig.SuggestionQueryConfig.Sections.SectionType section_types = 1; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setSectionTypes($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::ENUM, \Google\Cloud\Dialogflow\V2\HumanAgentAssistantConfig\SuggestionQueryConfig\Sections\SectionType::class); + $this->section_types = $arr; + + return $this; + } + +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(Sections::class, \Google\Cloud\Dialogflow\V2\HumanAgentAssistantConfig_SuggestionQueryConfig_Sections::class); + diff --git a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/HumanAgentAssistantConfig/SuggestionQueryConfig/Sections/SectionType.php b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/HumanAgentAssistantConfig/SuggestionQueryConfig/Sections/SectionType.php new file mode 100644 index 000000000000..c6bfcdda0aa4 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/HumanAgentAssistantConfig/SuggestionQueryConfig/Sections/SectionType.php @@ -0,0 +1,103 @@ +google.cloud.dialogflow.v2.HumanAgentAssistantConfig.SuggestionQueryConfig.Sections.SectionType + */ +class SectionType +{ + /** + * Undefined section type, does not return anything. + * + * Generated from protobuf enum SECTION_TYPE_UNSPECIFIED = 0; + */ + const SECTION_TYPE_UNSPECIFIED = 0; + /** + * What the customer needs help with or has question about. + * Section name: "situation". + * + * Generated from protobuf enum SITUATION = 1; + */ + const SITUATION = 1; + /** + * What the agent does to help the customer. + * Section name: "action". + * + * Generated from protobuf enum ACTION = 2; + */ + const ACTION = 2; + /** + * Result of the customer service. A single word describing the result + * of the conversation. + * Section name: "resolution". + * + * Generated from protobuf enum RESOLUTION = 3; + */ + const RESOLUTION = 3; + /** + * Reason for cancellation if the customer requests for a cancellation. + * "N/A" otherwise. + * Section name: "reason_for_cancellation". + * + * Generated from protobuf enum REASON_FOR_CANCELLATION = 4; + */ + const REASON_FOR_CANCELLATION = 4; + /** + * "Unsatisfied" or "Satisfied" depending on the customer's feelings at + * the end of the conversation. + * Section name: "customer_satisfaction". + * + * Generated from protobuf enum CUSTOMER_SATISFACTION = 5; + */ + const CUSTOMER_SATISFACTION = 5; + /** + * Key entities extracted from the conversation, such as ticket number, + * order number, dollar amount, etc. + * Section names are prefixed by "entities/". + * + * Generated from protobuf enum ENTITIES = 6; + */ + const ENTITIES = 6; + + private static $valueToName = [ + self::SECTION_TYPE_UNSPECIFIED => 'SECTION_TYPE_UNSPECIFIED', + self::SITUATION => 'SITUATION', + self::ACTION => 'ACTION', + self::RESOLUTION => 'RESOLUTION', + self::REASON_FOR_CANCELLATION => 'REASON_FOR_CANCELLATION', + self::CUSTOMER_SATISFACTION => 'CUSTOMER_SATISFACTION', + self::ENTITIES => 'ENTITIES', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(SectionType::class, \Google\Cloud\Dialogflow\V2\HumanAgentAssistantConfig_SuggestionQueryConfig_Sections_SectionType::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..643f3580afc3 --- /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..b10024ebc165 --- /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/InferenceParameter.php b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/InferenceParameter.php new file mode 100644 index 000000000000..20c1554587ba --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/InferenceParameter.php @@ -0,0 +1,277 @@ +google.cloud.dialogflow.v2.InferenceParameter + */ +class InferenceParameter extends \Google\Protobuf\Internal\Message +{ + /** + * Optional. Maximum number of the output tokens for the generator. + * + * Generated from protobuf field optional int32 max_output_tokens = 1 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $max_output_tokens = null; + /** + * Optional. Controls the randomness of LLM predictions. + * Low temperature = less random. High temperature = more random. + * If unset (or 0), uses a default value of 0. + * + * Generated from protobuf field optional double temperature = 2 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $temperature = null; + /** + * Optional. Top-k changes how the model selects tokens for output. A top-k of + * 1 means the selected token is the most probable among all tokens in the + * model's vocabulary (also called greedy decoding), while a top-k of 3 means + * that the next token is selected from among the 3 most probable tokens + * (using temperature). For each token selection step, the top K tokens with + * the highest probabilities are sampled. Then tokens are further filtered + * based on topP with the final token selected using temperature sampling. + * Specify a lower value for less random responses and a higher value for more + * random responses. Acceptable value is [1, 40], default to 40. + * + * Generated from protobuf field optional int32 top_k = 3 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $top_k = null; + /** + * Optional. Top-p changes how the model selects tokens for output. Tokens are + * selected from most K (see topK parameter) probable to least until the sum + * of their probabilities equals the top-p value. For example, if tokens A, B, + * and C have a probability of 0.3, 0.2, and 0.1 and the top-p value is 0.5, + * then the model will select either A or B as the next token (using + * temperature) and doesn't consider C. The default top-p value is 0.95. + * Specify a lower value for less random responses and a higher value for more + * random responses. Acceptable value is [0.0, 1.0], default to 0.95. + * + * Generated from protobuf field optional double top_p = 4 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $top_p = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type int $max_output_tokens + * Optional. Maximum number of the output tokens for the generator. + * @type float $temperature + * Optional. Controls the randomness of LLM predictions. + * Low temperature = less random. High temperature = more random. + * If unset (or 0), uses a default value of 0. + * @type int $top_k + * Optional. Top-k changes how the model selects tokens for output. A top-k of + * 1 means the selected token is the most probable among all tokens in the + * model's vocabulary (also called greedy decoding), while a top-k of 3 means + * that the next token is selected from among the 3 most probable tokens + * (using temperature). For each token selection step, the top K tokens with + * the highest probabilities are sampled. Then tokens are further filtered + * based on topP with the final token selected using temperature sampling. + * Specify a lower value for less random responses and a higher value for more + * random responses. Acceptable value is [1, 40], default to 40. + * @type float $top_p + * Optional. Top-p changes how the model selects tokens for output. Tokens are + * selected from most K (see topK parameter) probable to least until the sum + * of their probabilities equals the top-p value. For example, if tokens A, B, + * and C have a probability of 0.3, 0.2, and 0.1 and the top-p value is 0.5, + * then the model will select either A or B as the next token (using + * temperature) and doesn't consider C. The default top-p value is 0.95. + * Specify a lower value for less random responses and a higher value for more + * random responses. Acceptable value is [0.0, 1.0], default to 0.95. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\Generator::initOnce(); + parent::__construct($data); + } + + /** + * Optional. Maximum number of the output tokens for the generator. + * + * Generated from protobuf field optional int32 max_output_tokens = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @return int + */ + public function getMaxOutputTokens() + { + return isset($this->max_output_tokens) ? $this->max_output_tokens : 0; + } + + public function hasMaxOutputTokens() + { + return isset($this->max_output_tokens); + } + + public function clearMaxOutputTokens() + { + unset($this->max_output_tokens); + } + + /** + * Optional. Maximum number of the output tokens for the generator. + * + * Generated from protobuf field optional int32 max_output_tokens = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @param int $var + * @return $this + */ + public function setMaxOutputTokens($var) + { + GPBUtil::checkInt32($var); + $this->max_output_tokens = $var; + + return $this; + } + + /** + * Optional. Controls the randomness of LLM predictions. + * Low temperature = less random. High temperature = more random. + * If unset (or 0), uses a default value of 0. + * + * Generated from protobuf field optional double temperature = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @return float + */ + public function getTemperature() + { + return isset($this->temperature) ? $this->temperature : 0.0; + } + + public function hasTemperature() + { + return isset($this->temperature); + } + + public function clearTemperature() + { + unset($this->temperature); + } + + /** + * Optional. Controls the randomness of LLM predictions. + * Low temperature = less random. High temperature = more random. + * If unset (or 0), uses a default value of 0. + * + * Generated from protobuf field optional double temperature = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @param float $var + * @return $this + */ + public function setTemperature($var) + { + GPBUtil::checkDouble($var); + $this->temperature = $var; + + return $this; + } + + /** + * Optional. Top-k changes how the model selects tokens for output. A top-k of + * 1 means the selected token is the most probable among all tokens in the + * model's vocabulary (also called greedy decoding), while a top-k of 3 means + * that the next token is selected from among the 3 most probable tokens + * (using temperature). For each token selection step, the top K tokens with + * the highest probabilities are sampled. Then tokens are further filtered + * based on topP with the final token selected using temperature sampling. + * Specify a lower value for less random responses and a higher value for more + * random responses. Acceptable value is [1, 40], default to 40. + * + * Generated from protobuf field optional int32 top_k = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @return int + */ + public function getTopK() + { + return isset($this->top_k) ? $this->top_k : 0; + } + + public function hasTopK() + { + return isset($this->top_k); + } + + public function clearTopK() + { + unset($this->top_k); + } + + /** + * Optional. Top-k changes how the model selects tokens for output. A top-k of + * 1 means the selected token is the most probable among all tokens in the + * model's vocabulary (also called greedy decoding), while a top-k of 3 means + * that the next token is selected from among the 3 most probable tokens + * (using temperature). For each token selection step, the top K tokens with + * the highest probabilities are sampled. Then tokens are further filtered + * based on topP with the final token selected using temperature sampling. + * Specify a lower value for less random responses and a higher value for more + * random responses. Acceptable value is [1, 40], default to 40. + * + * Generated from protobuf field optional int32 top_k = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @param int $var + * @return $this + */ + public function setTopK($var) + { + GPBUtil::checkInt32($var); + $this->top_k = $var; + + return $this; + } + + /** + * Optional. Top-p changes how the model selects tokens for output. Tokens are + * selected from most K (see topK parameter) probable to least until the sum + * of their probabilities equals the top-p value. For example, if tokens A, B, + * and C have a probability of 0.3, 0.2, and 0.1 and the top-p value is 0.5, + * then the model will select either A or B as the next token (using + * temperature) and doesn't consider C. The default top-p value is 0.95. + * Specify a lower value for less random responses and a higher value for more + * random responses. Acceptable value is [0.0, 1.0], default to 0.95. + * + * Generated from protobuf field optional double top_p = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @return float + */ + public function getTopP() + { + return isset($this->top_p) ? $this->top_p : 0.0; + } + + public function hasTopP() + { + return isset($this->top_p); + } + + public function clearTopP() + { + unset($this->top_p); + } + + /** + * Optional. Top-p changes how the model selects tokens for output. Tokens are + * selected from most K (see topK parameter) probable to least until the sum + * of their probabilities equals the top-p value. For example, if tokens A, B, + * and C have a probability of 0.3, 0.2, and 0.1 and the top-p value is 0.5, + * then the model will select either A or B as the next token (using + * temperature) and doesn't consider C. The default top-p value is 0.95. + * Specify a lower value for less random responses and a higher value for more + * random responses. Acceptable value is [0.0, 1.0], default to 0.95. + * + * Generated from protobuf field optional double top_p = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @param float $var + * @return $this + */ + public function setTopP($var) + { + GPBUtil::checkDouble($var); + $this->top_p = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/InitializeEncryptionSpecMetadata.php b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/InitializeEncryptionSpecMetadata.php new file mode 100644 index 000000000000..388d113825e2 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/InitializeEncryptionSpecMetadata.php @@ -0,0 +1,77 @@ +google.cloud.dialogflow.v2.InitializeEncryptionSpecMetadata + */ +class InitializeEncryptionSpecMetadata extends \Google\Protobuf\Internal\Message +{ + /** + * Output only. The original request for initialization. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.InitializeEncryptionSpecRequest request = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $request = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\Dialogflow\V2\InitializeEncryptionSpecRequest $request + * Output only. The original request for initialization. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\EncryptionSpec::initOnce(); + parent::__construct($data); + } + + /** + * Output only. The original request for initialization. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.InitializeEncryptionSpecRequest request = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Cloud\Dialogflow\V2\InitializeEncryptionSpecRequest|null + */ + public function getRequest() + { + return $this->request; + } + + public function hasRequest() + { + return isset($this->request); + } + + public function clearRequest() + { + unset($this->request); + } + + /** + * Output only. The original request for initialization. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.InitializeEncryptionSpecRequest request = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Cloud\Dialogflow\V2\InitializeEncryptionSpecRequest $var + * @return $this + */ + public function setRequest($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Dialogflow\V2\InitializeEncryptionSpecRequest::class); + $this->request = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/InitializeEncryptionSpecRequest.php b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/InitializeEncryptionSpecRequest.php new file mode 100644 index 000000000000..f639eeac970e --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/InitializeEncryptionSpecRequest.php @@ -0,0 +1,105 @@ +google.cloud.dialogflow.v2.InitializeEncryptionSpecRequest + */ +class InitializeEncryptionSpecRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The encryption spec used for CMEK encryption. It is required that + * the kms key is in the same region as the endpoint. The same key will be + * used for all provisioned resources, if encryption is available. If the + * kms_key_name is left empty, no encryption will be enforced. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.EncryptionSpec encryption_spec = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $encryption_spec = null; + + /** + * @param \Google\Cloud\Dialogflow\V2\EncryptionSpec $encryptionSpec Required. The encryption spec used for CMEK encryption. It is required that + * the kms key is in the same region as the endpoint. The same key will be + * used for all provisioned resources, if encryption is available. If the + * kms_key_name is left empty, no encryption will be enforced. + * + * @return \Google\Cloud\Dialogflow\V2\InitializeEncryptionSpecRequest + * + * @experimental + */ + public static function build(\Google\Cloud\Dialogflow\V2\EncryptionSpec $encryptionSpec): self + { + return (new self()) + ->setEncryptionSpec($encryptionSpec); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\Dialogflow\V2\EncryptionSpec $encryption_spec + * Required. The encryption spec used for CMEK encryption. It is required that + * the kms key is in the same region as the endpoint. The same key will be + * used for all provisioned resources, if encryption is available. If the + * kms_key_name is left empty, no encryption will be enforced. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\EncryptionSpec::initOnce(); + parent::__construct($data); + } + + /** + * Required. The encryption spec used for CMEK encryption. It is required that + * the kms key is in the same region as the endpoint. The same key will be + * used for all provisioned resources, if encryption is available. If the + * kms_key_name is left empty, no encryption will be enforced. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.EncryptionSpec encryption_spec = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\Dialogflow\V2\EncryptionSpec|null + */ + public function getEncryptionSpec() + { + return $this->encryption_spec; + } + + public function hasEncryptionSpec() + { + return isset($this->encryption_spec); + } + + public function clearEncryptionSpec() + { + unset($this->encryption_spec); + } + + /** + * Required. The encryption spec used for CMEK encryption. It is required that + * the kms key is in the same region as the endpoint. The same key will be + * used for all provisioned resources, if encryption is available. If the + * kms_key_name is left empty, no encryption will be enforced. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.EncryptionSpec encryption_spec = 1 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\Dialogflow\V2\EncryptionSpec $var + * @return $this + */ + public function setEncryptionSpec($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Dialogflow\V2\EncryptionSpec::class); + $this->encryption_spec = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/InitializeEncryptionSpecResponse.php b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/InitializeEncryptionSpecResponse.php new file mode 100644 index 000000000000..c4ba7c5c5a32 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/InitializeEncryptionSpecResponse.php @@ -0,0 +1,33 @@ +google.cloud.dialogflow.v2.InitializeEncryptionSpecResponse + */ +class InitializeEncryptionSpecResponse extends \Google\Protobuf\Internal\Message +{ + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\EncryptionSpec::initOnce(); + parent::__construct($data); + } + +} + diff --git a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/InputAudioConfig.php b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/InputAudioConfig.php new file mode 100644 index 000000000000..809550788b8f --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/InputAudioConfig.php @@ -0,0 +1,614 @@ +google.cloud.dialogflow.v2.InputAudioConfig + */ +class InputAudioConfig extends \Google\Protobuf\Internal\Message +{ + /** + * Required. Audio encoding of the audio content to process. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.AudioEncoding audio_encoding = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $audio_encoding = 0; + /** + * Required. Sample rate (in Hertz) of the audio content sent in the query. + * Refer to [Cloud Speech API + * documentation](https://cloud.google.com/speech-to-text/docs/basics) for + * more details. + * + * Generated from protobuf field int32 sample_rate_hertz = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $sample_rate_hertz = 0; + /** + * Required. The language of the supplied audio. Dialogflow does not do + * translations. See [Language + * Support](https://cloud.google.com/dialogflow/docs/reference/language) + * for a list of the currently supported language codes. Note that queries in + * the same session do not necessarily need to specify the same language. + * + * Generated from protobuf field string language_code = 3 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $language_code = ''; + /** + * If `true`, Dialogflow returns + * [SpeechWordInfo][google.cloud.dialogflow.v2.SpeechWordInfo] in + * [StreamingRecognitionResult][google.cloud.dialogflow.v2.StreamingRecognitionResult] + * with information about the recognized speech words, e.g. start and end time + * offsets. If false or unspecified, Speech doesn't return any word-level + * information. + * + * Generated from protobuf field bool enable_word_info = 13; + */ + protected $enable_word_info = false; + /** + * A list of strings containing words and phrases that the speech + * recognizer should recognize with higher likelihood. + * See [the Cloud Speech + * documentation](https://cloud.google.com/speech-to-text/docs/basics#phrase-hints) + * for more details. + * This field is deprecated. Please use [`speech_contexts`]() instead. If you + * specify both [`phrase_hints`]() and [`speech_contexts`](), Dialogflow will + * treat the [`phrase_hints`]() as a single additional [`SpeechContext`](). + * + * Generated from protobuf field repeated string phrase_hints = 4 [deprecated = true]; + * @deprecated + */ + private $phrase_hints; + /** + * Context information to assist speech recognition. + * See [the Cloud Speech + * documentation](https://cloud.google.com/speech-to-text/docs/basics#phrase-hints) + * for more details. + * + * Generated from protobuf field repeated .google.cloud.dialogflow.v2.SpeechContext speech_contexts = 11; + */ + private $speech_contexts; + /** + * Optional. Which Speech model to select for the given request. + * For more information, see + * [Speech models](https://cloud.google.com/dialogflow/es/docs/speech-models). + * + * Generated from protobuf field string model = 7; + */ + protected $model = ''; + /** + * Which variant of the [Speech + * model][google.cloud.dialogflow.v2.InputAudioConfig.model] to use. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.SpeechModelVariant model_variant = 10; + */ + protected $model_variant = 0; + /** + * If `false` (default), recognition does not cease until the + * client closes the stream. + * If `true`, the recognizer will detect a single spoken utterance in input + * audio. Recognition ceases when it detects the audio's voice has + * stopped or paused. In this case, once a detected intent is received, the + * client should close the stream and start a new request with a new stream as + * needed. + * Note: This setting is relevant only for streaming methods. + * Note: When specified, InputAudioConfig.single_utterance takes precedence + * over StreamingDetectIntentRequest.single_utterance. + * + * Generated from protobuf field bool single_utterance = 8; + */ + protected $single_utterance = false; + /** + * Only used in + * [Participants.AnalyzeContent][google.cloud.dialogflow.v2.Participants.AnalyzeContent] + * and + * [Participants.StreamingAnalyzeContent][google.cloud.dialogflow.v2.Participants.StreamingAnalyzeContent]. + * If `false` and recognition doesn't return any result, trigger + * `NO_SPEECH_RECOGNIZED` event to Dialogflow agent. + * + * Generated from protobuf field bool disable_no_speech_recognized_event = 14; + */ + protected $disable_no_speech_recognized_event = false; + /** + * Enable automatic punctuation option at the speech backend. + * + * Generated from protobuf field bool enable_automatic_punctuation = 17; + */ + protected $enable_automatic_punctuation = false; + /** + * If `true`, the request will opt out for STT conformer model migration. + * This field will be deprecated once force migration takes place in June + * 2024. Please refer to [Dialogflow ES Speech model + * migration](https://cloud.google.com/dialogflow/es/docs/speech-model-migration). + * + * Generated from protobuf field bool opt_out_conformer_model_migration = 26; + */ + protected $opt_out_conformer_model_migration = false; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type int $audio_encoding + * Required. Audio encoding of the audio content to process. + * @type int $sample_rate_hertz + * Required. Sample rate (in Hertz) of the audio content sent in the query. + * Refer to [Cloud Speech API + * documentation](https://cloud.google.com/speech-to-text/docs/basics) for + * more details. + * @type string $language_code + * Required. The language of the supplied audio. Dialogflow does not do + * translations. See [Language + * Support](https://cloud.google.com/dialogflow/docs/reference/language) + * for a list of the currently supported language codes. Note that queries in + * the same session do not necessarily need to specify the same language. + * @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 + * Optional. Which Speech model to select for the given request. + * For more information, see + * [Speech models](https://cloud.google.com/dialogflow/es/docs/speech-models). + * @type int $model_variant + * Which variant of the [Speech + * model][google.cloud.dialogflow.v2.InputAudioConfig.model] to use. + * @type bool $single_utterance + * If `false` (default), recognition does not cease until the + * client closes the stream. + * If `true`, the recognizer will detect a single spoken utterance in input + * audio. Recognition ceases when it detects the audio's voice has + * stopped or paused. In this case, once a detected intent is received, the + * client should close the stream and start a new request with a new stream as + * needed. + * Note: This setting is relevant only for streaming methods. + * Note: When specified, InputAudioConfig.single_utterance takes precedence + * over StreamingDetectIntentRequest.single_utterance. + * @type bool $disable_no_speech_recognized_event + * Only used in + * [Participants.AnalyzeContent][google.cloud.dialogflow.v2.Participants.AnalyzeContent] + * and + * [Participants.StreamingAnalyzeContent][google.cloud.dialogflow.v2.Participants.StreamingAnalyzeContent]. + * If `false` and recognition doesn't return any result, trigger + * `NO_SPEECH_RECOGNIZED` event to Dialogflow agent. + * @type bool $enable_automatic_punctuation + * Enable automatic punctuation option at the speech backend. + * @type bool $opt_out_conformer_model_migration + * If `true`, the request will opt out for STT conformer model migration. + * This field will be deprecated once force migration takes place in June + * 2024. Please refer to [Dialogflow ES Speech model + * migration](https://cloud.google.com/dialogflow/es/docs/speech-model-migration). + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\AudioConfig::initOnce(); + parent::__construct($data); + } + + /** + * Required. Audio encoding of the audio content to process. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.AudioEncoding audio_encoding = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return int + */ + public function getAudioEncoding() + { + return $this->audio_encoding; + } + + /** + * Required. Audio encoding of the audio content to process. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.AudioEncoding audio_encoding = 1 [(.google.api.field_behavior) = REQUIRED]; + * @param int $var + * @return $this + */ + public function setAudioEncoding($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\Dialogflow\V2\AudioEncoding::class); + $this->audio_encoding = $var; + + return $this; + } + + /** + * Required. Sample rate (in Hertz) of the audio content sent in the query. + * Refer to [Cloud Speech API + * documentation](https://cloud.google.com/speech-to-text/docs/basics) for + * more details. + * + * Generated from protobuf field int32 sample_rate_hertz = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return int + */ + public function getSampleRateHertz() + { + return $this->sample_rate_hertz; + } + + /** + * Required. Sample rate (in Hertz) of the audio content sent in the query. + * Refer to [Cloud Speech API + * documentation](https://cloud.google.com/speech-to-text/docs/basics) for + * more details. + * + * Generated from protobuf field int32 sample_rate_hertz = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param int $var + * @return $this + */ + public function setSampleRateHertz($var) + { + GPBUtil::checkInt32($var); + $this->sample_rate_hertz = $var; + + return $this; + } + + /** + * Required. The language of the supplied audio. Dialogflow does not do + * translations. See [Language + * Support](https://cloud.google.com/dialogflow/docs/reference/language) + * for a list of the currently supported language codes. Note that queries in + * the same session do not necessarily need to specify the same language. + * + * Generated from protobuf field string language_code = 3 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getLanguageCode() + { + return $this->language_code; + } + + /** + * Required. The language of the supplied audio. Dialogflow does not do + * translations. See [Language + * Support](https://cloud.google.com/dialogflow/docs/reference/language) + * for a list of the currently supported language codes. Note that queries in + * the same session do not necessarily need to specify the same language. + * + * Generated from protobuf field string language_code = 3 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setLanguageCode($var) + { + GPBUtil::checkString($var, True); + $this->language_code = $var; + + return $this; + } + + /** + * If `true`, Dialogflow returns + * [SpeechWordInfo][google.cloud.dialogflow.v2.SpeechWordInfo] in + * [StreamingRecognitionResult][google.cloud.dialogflow.v2.StreamingRecognitionResult] + * with information about the recognized speech words, e.g. start and end time + * offsets. If false or unspecified, Speech doesn't return any word-level + * information. + * + * Generated from protobuf field bool enable_word_info = 13; + * @return bool + */ + public function getEnableWordInfo() + { + return $this->enable_word_info; + } + + /** + * If `true`, Dialogflow returns + * [SpeechWordInfo][google.cloud.dialogflow.v2.SpeechWordInfo] in + * [StreamingRecognitionResult][google.cloud.dialogflow.v2.StreamingRecognitionResult] + * with information about the recognized speech words, e.g. start and end time + * offsets. If false or unspecified, Speech doesn't return any word-level + * information. + * + * Generated from protobuf field bool enable_word_info = 13; + * @param bool $var + * @return $this + */ + public function setEnableWordInfo($var) + { + GPBUtil::checkBool($var); + $this->enable_word_info = $var; + + return $this; + } + + /** + * A list of strings containing words and phrases that the speech + * recognizer should recognize with higher likelihood. + * See [the Cloud Speech + * documentation](https://cloud.google.com/speech-to-text/docs/basics#phrase-hints) + * for more details. + * This field is deprecated. Please use [`speech_contexts`]() instead. If you + * specify both [`phrase_hints`]() and [`speech_contexts`](), Dialogflow will + * treat the [`phrase_hints`]() as a single additional [`SpeechContext`](). + * + * Generated from protobuf field repeated string phrase_hints = 4 [deprecated = true]; + * @return \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; + } + + /** + * Optional. Which Speech model to select for the given request. + * For more information, see + * [Speech models](https://cloud.google.com/dialogflow/es/docs/speech-models). + * + * Generated from protobuf field string model = 7; + * @return string + */ + public function getModel() + { + return $this->model; + } + + /** + * Optional. Which Speech model to select for the given request. + * For more information, see + * [Speech models](https://cloud.google.com/dialogflow/es/docs/speech-models). + * + * Generated from protobuf field string model = 7; + * @param string $var + * @return $this + */ + public function setModel($var) + { + GPBUtil::checkString($var, True); + $this->model = $var; + + return $this; + } + + /** + * Which variant of the [Speech + * model][google.cloud.dialogflow.v2.InputAudioConfig.model] to use. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.SpeechModelVariant model_variant = 10; + * @return int + */ + public function getModelVariant() + { + return $this->model_variant; + } + + /** + * Which variant of the [Speech + * model][google.cloud.dialogflow.v2.InputAudioConfig.model] to use. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.SpeechModelVariant model_variant = 10; + * @param int $var + * @return $this + */ + public function setModelVariant($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\Dialogflow\V2\SpeechModelVariant::class); + $this->model_variant = $var; + + return $this; + } + + /** + * If `false` (default), recognition does not cease until the + * client closes the stream. + * If `true`, the recognizer will detect a single spoken utterance in input + * audio. Recognition ceases when it detects the audio's voice has + * stopped or paused. In this case, once a detected intent is received, the + * client should close the stream and start a new request with a new stream as + * needed. + * Note: This setting is relevant only for streaming methods. + * Note: When specified, InputAudioConfig.single_utterance takes precedence + * over StreamingDetectIntentRequest.single_utterance. + * + * Generated from protobuf field bool single_utterance = 8; + * @return bool + */ + public function getSingleUtterance() + { + return $this->single_utterance; + } + + /** + * If `false` (default), recognition does not cease until the + * client closes the stream. + * If `true`, the recognizer will detect a single spoken utterance in input + * audio. Recognition ceases when it detects the audio's voice has + * stopped or paused. In this case, once a detected intent is received, the + * client should close the stream and start a new request with a new stream as + * needed. + * Note: This setting is relevant only for streaming methods. + * Note: When specified, InputAudioConfig.single_utterance takes precedence + * over StreamingDetectIntentRequest.single_utterance. + * + * Generated from protobuf field bool single_utterance = 8; + * @param bool $var + * @return $this + */ + public function setSingleUtterance($var) + { + GPBUtil::checkBool($var); + $this->single_utterance = $var; + + return $this; + } + + /** + * Only used in + * [Participants.AnalyzeContent][google.cloud.dialogflow.v2.Participants.AnalyzeContent] + * and + * [Participants.StreamingAnalyzeContent][google.cloud.dialogflow.v2.Participants.StreamingAnalyzeContent]. + * If `false` and recognition doesn't return any result, trigger + * `NO_SPEECH_RECOGNIZED` event to Dialogflow agent. + * + * Generated from protobuf field bool disable_no_speech_recognized_event = 14; + * @return bool + */ + public function getDisableNoSpeechRecognizedEvent() + { + return $this->disable_no_speech_recognized_event; + } + + /** + * Only used in + * [Participants.AnalyzeContent][google.cloud.dialogflow.v2.Participants.AnalyzeContent] + * and + * [Participants.StreamingAnalyzeContent][google.cloud.dialogflow.v2.Participants.StreamingAnalyzeContent]. + * If `false` and recognition doesn't return any result, trigger + * `NO_SPEECH_RECOGNIZED` event to Dialogflow agent. + * + * Generated from protobuf field bool disable_no_speech_recognized_event = 14; + * @param bool $var + * @return $this + */ + public function setDisableNoSpeechRecognizedEvent($var) + { + GPBUtil::checkBool($var); + $this->disable_no_speech_recognized_event = $var; + + return $this; + } + + /** + * Enable automatic punctuation option at the speech backend. + * + * Generated from protobuf field bool enable_automatic_punctuation = 17; + * @return bool + */ + public function getEnableAutomaticPunctuation() + { + return $this->enable_automatic_punctuation; + } + + /** + * Enable automatic punctuation option at the speech backend. + * + * Generated from protobuf field bool enable_automatic_punctuation = 17; + * @param bool $var + * @return $this + */ + public function setEnableAutomaticPunctuation($var) + { + GPBUtil::checkBool($var); + $this->enable_automatic_punctuation = $var; + + return $this; + } + + /** + * If `true`, the request will opt out for STT conformer model migration. + * This field will be deprecated once force migration takes place in June + * 2024. Please refer to [Dialogflow ES Speech model + * migration](https://cloud.google.com/dialogflow/es/docs/speech-model-migration). + * + * Generated from protobuf field bool opt_out_conformer_model_migration = 26; + * @return bool + */ + public function getOptOutConformerModelMigration() + { + return $this->opt_out_conformer_model_migration; + } + + /** + * If `true`, the request will opt out for STT conformer model migration. + * This field will be deprecated once force migration takes place in June + * 2024. Please refer to [Dialogflow ES Speech model + * migration](https://cloud.google.com/dialogflow/es/docs/speech-model-migration). + * + * Generated from protobuf field bool opt_out_conformer_model_migration = 26; + * @param bool $var + * @return $this + */ + public function setOptOutConformerModelMigration($var) + { + GPBUtil::checkBool($var); + $this->opt_out_conformer_model_migration = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/InputConfig.php b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/InputConfig.php new file mode 100644 index 000000000000..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/IntentSuggestion.php b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/IntentSuggestion.php new file mode 100644 index 000000000000..87f1941fe131 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/IntentSuggestion.php @@ -0,0 +1,153 @@ +google.cloud.dialogflow.v2.IntentSuggestion + */ +class IntentSuggestion extends \Google\Protobuf\Internal\Message +{ + /** + * The display name of the intent. + * + * Generated from protobuf field string display_name = 1; + */ + protected $display_name = ''; + /** + * Human readable description for better understanding an intent like its + * scope, content, result etc. Maximum character limit: 140 characters. + * + * Generated from protobuf field string description = 5; + */ + protected $description = ''; + protected $intent; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $display_name + * The display name of the intent. + * @type string $intent_v2 + * The unique identifier of this + * [intent][google.cloud.dialogflow.v2.Intent]. Format: `projects//locations//agent/intents/`. + * @type string $description + * Human readable description for better understanding an intent like its + * scope, content, result etc. Maximum character limit: 140 characters. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\Participant::initOnce(); + parent::__construct($data); + } + + /** + * The display name of the intent. + * + * Generated from protobuf field string display_name = 1; + * @return string + */ + public function getDisplayName() + { + return $this->display_name; + } + + /** + * The display name of the intent. + * + * Generated from protobuf field string display_name = 1; + * @param string $var + * @return $this + */ + public function setDisplayName($var) + { + GPBUtil::checkString($var, True); + $this->display_name = $var; + + return $this; + } + + /** + * The unique identifier of this + * [intent][google.cloud.dialogflow.v2.Intent]. Format: `projects//locations//agent/intents/`. + * + * Generated from protobuf field string intent_v2 = 2; + * @return string + */ + public function getIntentV2() + { + return $this->readOneof(2); + } + + public function hasIntentV2() + { + return $this->hasOneof(2); + } + + /** + * The unique identifier of this + * [intent][google.cloud.dialogflow.v2.Intent]. Format: `projects//locations//agent/intents/`. + * + * Generated from protobuf field string intent_v2 = 2; + * @param string $var + * @return $this + */ + public function setIntentV2($var) + { + GPBUtil::checkString($var, True); + $this->writeOneof(2, $var); + + return $this; + } + + /** + * Human readable description for better understanding an intent like its + * scope, content, result etc. Maximum character limit: 140 characters. + * + * Generated from protobuf field string description = 5; + * @return string + */ + public function getDescription() + { + return $this->description; + } + + /** + * Human readable description for better understanding an intent like its + * scope, content, result etc. Maximum character limit: 140 characters. + * + * Generated from protobuf field string description = 5; + * @param string $var + * @return $this + */ + public function setDescription($var) + { + GPBUtil::checkString($var, True); + $this->description = $var; + + return $this; + } + + /** + * @return string + */ + public function getIntent() + { + return $this->whichOneof("intent"); + } + +} + diff --git a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/IntentView.php b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/IntentView.php new file mode 100644 index 000000000000..916e50e6b7db --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/IntentView.php @@ -0,0 +1,56 @@ +google.cloud.dialogflow.v2.IntentView + */ +class IntentView +{ + /** + * Training phrases field is not populated in the response. + * + * Generated from protobuf enum INTENT_VIEW_UNSPECIFIED = 0; + */ + const INTENT_VIEW_UNSPECIFIED = 0; + /** + * All fields are populated. + * + * Generated from protobuf enum INTENT_VIEW_FULL = 1; + */ + const INTENT_VIEW_FULL = 1; + + private static $valueToName = [ + self::INTENT_VIEW_UNSPECIFIED => 'INTENT_VIEW_UNSPECIFIED', + self::INTENT_VIEW_FULL => 'INTENT_VIEW_FULL', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + diff --git a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/KnowledgeAssistAnswer.php b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/KnowledgeAssistAnswer.php new file mode 100644 index 000000000000..4b76d0287474 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/KnowledgeAssistAnswer.php @@ -0,0 +1,171 @@ +google.cloud.dialogflow.v2.KnowledgeAssistAnswer + */ +class KnowledgeAssistAnswer extends \Google\Protobuf\Internal\Message +{ + /** + * The query suggested based on the context. Suggestion is made only if it + * is different from the previous suggestion. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.KnowledgeAssistAnswer.SuggestedQuery suggested_query = 1; + */ + protected $suggested_query = null; + /** + * The answer generated for the suggested query. Whether or not an answer is + * generated depends on how confident we are about the generated query. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.KnowledgeAssistAnswer.KnowledgeAnswer suggested_query_answer = 2; + */ + protected $suggested_query_answer = null; + /** + * The name of the answer record. + * Format: `projects//locations//answer + * Records/`. + * + * Generated from protobuf field string answer_record = 3; + */ + protected $answer_record = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\Dialogflow\V2\KnowledgeAssistAnswer\SuggestedQuery $suggested_query + * The query suggested based on the context. Suggestion is made only if it + * is different from the previous suggestion. + * @type \Google\Cloud\Dialogflow\V2\KnowledgeAssistAnswer\KnowledgeAnswer $suggested_query_answer + * The answer generated for the suggested query. Whether or not an answer is + * generated depends on how confident we are about the generated query. + * @type string $answer_record + * The name of the answer record. + * Format: `projects//locations//answer + * Records/`. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\Participant::initOnce(); + parent::__construct($data); + } + + /** + * The query suggested based on the context. Suggestion is made only if it + * is different from the previous suggestion. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.KnowledgeAssistAnswer.SuggestedQuery suggested_query = 1; + * @return \Google\Cloud\Dialogflow\V2\KnowledgeAssistAnswer\SuggestedQuery|null + */ + public function getSuggestedQuery() + { + return $this->suggested_query; + } + + public function hasSuggestedQuery() + { + return isset($this->suggested_query); + } + + public function clearSuggestedQuery() + { + unset($this->suggested_query); + } + + /** + * The query suggested based on the context. Suggestion is made only if it + * is different from the previous suggestion. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.KnowledgeAssistAnswer.SuggestedQuery suggested_query = 1; + * @param \Google\Cloud\Dialogflow\V2\KnowledgeAssistAnswer\SuggestedQuery $var + * @return $this + */ + public function setSuggestedQuery($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Dialogflow\V2\KnowledgeAssistAnswer\SuggestedQuery::class); + $this->suggested_query = $var; + + return $this; + } + + /** + * The answer generated for the suggested query. Whether or not an answer is + * generated depends on how confident we are about the generated query. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.KnowledgeAssistAnswer.KnowledgeAnswer suggested_query_answer = 2; + * @return \Google\Cloud\Dialogflow\V2\KnowledgeAssistAnswer\KnowledgeAnswer|null + */ + public function getSuggestedQueryAnswer() + { + return $this->suggested_query_answer; + } + + public function hasSuggestedQueryAnswer() + { + return isset($this->suggested_query_answer); + } + + public function clearSuggestedQueryAnswer() + { + unset($this->suggested_query_answer); + } + + /** + * The answer generated for the suggested query. Whether or not an answer is + * generated depends on how confident we are about the generated query. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.KnowledgeAssistAnswer.KnowledgeAnswer suggested_query_answer = 2; + * @param \Google\Cloud\Dialogflow\V2\KnowledgeAssistAnswer\KnowledgeAnswer $var + * @return $this + */ + public function setSuggestedQueryAnswer($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Dialogflow\V2\KnowledgeAssistAnswer\KnowledgeAnswer::class); + $this->suggested_query_answer = $var; + + return $this; + } + + /** + * The name of the answer record. + * Format: `projects//locations//answer + * Records/`. + * + * Generated from protobuf field string answer_record = 3; + * @return string + */ + public function getAnswerRecord() + { + return $this->answer_record; + } + + /** + * The name of the answer record. + * Format: `projects//locations//answer + * Records/`. + * + * Generated from protobuf field string answer_record = 3; + * @param string $var + * @return $this + */ + public function setAnswerRecord($var) + { + GPBUtil::checkString($var, True); + $this->answer_record = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/KnowledgeAssistAnswer/KnowledgeAnswer.php b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/KnowledgeAssistAnswer/KnowledgeAnswer.php new file mode 100644 index 000000000000..eb9f85a5aaf8 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/KnowledgeAssistAnswer/KnowledgeAnswer.php @@ -0,0 +1,146 @@ +google.cloud.dialogflow.v2.KnowledgeAssistAnswer.KnowledgeAnswer + */ +class KnowledgeAnswer extends \Google\Protobuf\Internal\Message +{ + /** + * The piece of text from the `source` that answers this suggested query. + * + * Generated from protobuf field string answer_text = 1; + */ + protected $answer_text = ''; + protected $source; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $answer_text + * The piece of text from the `source` that answers this suggested query. + * @type \Google\Cloud\Dialogflow\V2\KnowledgeAssistAnswer\KnowledgeAnswer\FaqSource $faq_source + * Populated if the prediction came from FAQ. + * @type \Google\Cloud\Dialogflow\V2\KnowledgeAssistAnswer\KnowledgeAnswer\GenerativeSource $generative_source + * Populated if the prediction was Generative. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\Participant::initOnce(); + parent::__construct($data); + } + + /** + * The piece of text from the `source` that answers this suggested query. + * + * Generated from protobuf field string answer_text = 1; + * @return string + */ + public function getAnswerText() + { + return $this->answer_text; + } + + /** + * The piece of text from the `source` that answers this suggested query. + * + * Generated from protobuf field string answer_text = 1; + * @param string $var + * @return $this + */ + public function setAnswerText($var) + { + GPBUtil::checkString($var, True); + $this->answer_text = $var; + + return $this; + } + + /** + * Populated if the prediction came from FAQ. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.KnowledgeAssistAnswer.KnowledgeAnswer.FaqSource faq_source = 3; + * @return \Google\Cloud\Dialogflow\V2\KnowledgeAssistAnswer\KnowledgeAnswer\FaqSource|null + */ + public function getFaqSource() + { + return $this->readOneof(3); + } + + public function hasFaqSource() + { + return $this->hasOneof(3); + } + + /** + * Populated if the prediction came from FAQ. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.KnowledgeAssistAnswer.KnowledgeAnswer.FaqSource faq_source = 3; + * @param \Google\Cloud\Dialogflow\V2\KnowledgeAssistAnswer\KnowledgeAnswer\FaqSource $var + * @return $this + */ + public function setFaqSource($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Dialogflow\V2\KnowledgeAssistAnswer\KnowledgeAnswer\FaqSource::class); + $this->writeOneof(3, $var); + + return $this; + } + + /** + * Populated if the prediction was Generative. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.KnowledgeAssistAnswer.KnowledgeAnswer.GenerativeSource generative_source = 4; + * @return \Google\Cloud\Dialogflow\V2\KnowledgeAssistAnswer\KnowledgeAnswer\GenerativeSource|null + */ + public function getGenerativeSource() + { + return $this->readOneof(4); + } + + public function hasGenerativeSource() + { + return $this->hasOneof(4); + } + + /** + * Populated if the prediction was Generative. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.KnowledgeAssistAnswer.KnowledgeAnswer.GenerativeSource generative_source = 4; + * @param \Google\Cloud\Dialogflow\V2\KnowledgeAssistAnswer\KnowledgeAnswer\GenerativeSource $var + * @return $this + */ + public function setGenerativeSource($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Dialogflow\V2\KnowledgeAssistAnswer\KnowledgeAnswer\GenerativeSource::class); + $this->writeOneof(4, $var); + + return $this; + } + + /** + * @return string + */ + public function getSource() + { + return $this->whichOneof("source"); + } + +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(KnowledgeAnswer::class, \Google\Cloud\Dialogflow\V2\KnowledgeAssistAnswer_KnowledgeAnswer::class); + diff --git a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/KnowledgeAssistAnswer/KnowledgeAnswer/FaqSource.php b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/KnowledgeAssistAnswer/KnowledgeAnswer/FaqSource.php new file mode 100644 index 000000000000..474ed7380b54 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/KnowledgeAssistAnswer/KnowledgeAnswer/FaqSource.php @@ -0,0 +1,70 @@ +google.cloud.dialogflow.v2.KnowledgeAssistAnswer.KnowledgeAnswer.FaqSource + */ +class FaqSource extends \Google\Protobuf\Internal\Message +{ + /** + * The corresponding FAQ question. + * + * Generated from protobuf field string question = 2; + */ + protected $question = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $question + * The corresponding FAQ question. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\Participant::initOnce(); + parent::__construct($data); + } + + /** + * The corresponding FAQ question. + * + * Generated from protobuf field string question = 2; + * @return string + */ + public function getQuestion() + { + return $this->question; + } + + /** + * The corresponding FAQ question. + * + * Generated from protobuf field string question = 2; + * @param string $var + * @return $this + */ + public function setQuestion($var) + { + GPBUtil::checkString($var, True); + $this->question = $var; + + return $this; + } + +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(FaqSource::class, \Google\Cloud\Dialogflow\V2\KnowledgeAssistAnswer_KnowledgeAnswer_FaqSource::class); + diff --git a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/KnowledgeAssistAnswer/KnowledgeAnswer/GenerativeSource.php b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/KnowledgeAssistAnswer/KnowledgeAnswer/GenerativeSource.php new file mode 100644 index 000000000000..5a3095710f66 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/KnowledgeAssistAnswer/KnowledgeAnswer/GenerativeSource.php @@ -0,0 +1,74 @@ +google.cloud.dialogflow.v2.KnowledgeAssistAnswer.KnowledgeAnswer.GenerativeSource + */ +class GenerativeSource extends \Google\Protobuf\Internal\Message +{ + /** + * All snippets used for this Generative Prediction, with their source URI + * and data. + * + * Generated from protobuf field repeated .google.cloud.dialogflow.v2.KnowledgeAssistAnswer.KnowledgeAnswer.GenerativeSource.Snippet snippets = 1; + */ + private $snippets; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array<\Google\Cloud\Dialogflow\V2\KnowledgeAssistAnswer\KnowledgeAnswer\GenerativeSource\Snippet>|\Google\Protobuf\Internal\RepeatedField $snippets + * All snippets used for this Generative Prediction, with their source URI + * and data. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\Participant::initOnce(); + parent::__construct($data); + } + + /** + * All snippets used for this Generative Prediction, with their source URI + * and data. + * + * Generated from protobuf field repeated .google.cloud.dialogflow.v2.KnowledgeAssistAnswer.KnowledgeAnswer.GenerativeSource.Snippet snippets = 1; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getSnippets() + { + return $this->snippets; + } + + /** + * All snippets used for this Generative Prediction, with their source URI + * and data. + * + * Generated from protobuf field repeated .google.cloud.dialogflow.v2.KnowledgeAssistAnswer.KnowledgeAnswer.GenerativeSource.Snippet snippets = 1; + * @param array<\Google\Cloud\Dialogflow\V2\KnowledgeAssistAnswer\KnowledgeAnswer\GenerativeSource\Snippet>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setSnippets($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Dialogflow\V2\KnowledgeAssistAnswer\KnowledgeAnswer\GenerativeSource\Snippet::class); + $this->snippets = $arr; + + return $this; + } + +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(GenerativeSource::class, \Google\Cloud\Dialogflow\V2\KnowledgeAssistAnswer_KnowledgeAnswer_GenerativeSource::class); + diff --git a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/KnowledgeAssistAnswer/KnowledgeAnswer/GenerativeSource/Snippet.php b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/KnowledgeAssistAnswer/KnowledgeAnswer/GenerativeSource/Snippet.php new file mode 100644 index 000000000000..81f818028d5d --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/KnowledgeAssistAnswer/KnowledgeAnswer/GenerativeSource/Snippet.php @@ -0,0 +1,138 @@ +google.cloud.dialogflow.v2.KnowledgeAssistAnswer.KnowledgeAnswer.GenerativeSource.Snippet + */ +class Snippet extends \Google\Protobuf\Internal\Message +{ + /** + * URI the data is sourced from. + * + * Generated from protobuf field string uri = 2; + */ + protected $uri = ''; + /** + * Text taken from that URI. + * + * Generated from protobuf field string text = 3; + */ + protected $text = ''; + /** + * Title of the document. + * + * Generated from protobuf field string title = 4; + */ + protected $title = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $uri + * URI the data is sourced from. + * @type string $text + * Text taken from that URI. + * @type string $title + * Title of the document. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\Participant::initOnce(); + parent::__construct($data); + } + + /** + * URI the data is sourced from. + * + * Generated from protobuf field string uri = 2; + * @return string + */ + public function getUri() + { + return $this->uri; + } + + /** + * URI the data is sourced from. + * + * Generated from protobuf field string uri = 2; + * @param string $var + * @return $this + */ + public function setUri($var) + { + GPBUtil::checkString($var, True); + $this->uri = $var; + + return $this; + } + + /** + * Text taken from that URI. + * + * Generated from protobuf field string text = 3; + * @return string + */ + public function getText() + { + return $this->text; + } + + /** + * Text taken from that URI. + * + * Generated from protobuf field string text = 3; + * @param string $var + * @return $this + */ + public function setText($var) + { + GPBUtil::checkString($var, True); + $this->text = $var; + + return $this; + } + + /** + * Title of the document. + * + * Generated from protobuf field string title = 4; + * @return string + */ + public function getTitle() + { + return $this->title; + } + + /** + * Title of the document. + * + * Generated from protobuf field string title = 4; + * @param string $var + * @return $this + */ + public function setTitle($var) + { + GPBUtil::checkString($var, True); + $this->title = $var; + + return $this; + } + +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(Snippet::class, \Google\Cloud\Dialogflow\V2\KnowledgeAssistAnswer_KnowledgeAnswer_GenerativeSource_Snippet::class); + diff --git a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/KnowledgeAssistAnswer/SuggestedQuery.php b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/KnowledgeAssistAnswer/SuggestedQuery.php new file mode 100644 index 000000000000..07a0c9e373c2 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/KnowledgeAssistAnswer/SuggestedQuery.php @@ -0,0 +1,70 @@ +google.cloud.dialogflow.v2.KnowledgeAssistAnswer.SuggestedQuery + */ +class SuggestedQuery extends \Google\Protobuf\Internal\Message +{ + /** + * Suggested query text. + * + * Generated from protobuf field string query_text = 1; + */ + protected $query_text = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $query_text + * Suggested query text. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\Participant::initOnce(); + parent::__construct($data); + } + + /** + * Suggested query text. + * + * Generated from protobuf field string query_text = 1; + * @return string + */ + public function getQueryText() + { + return $this->query_text; + } + + /** + * Suggested query text. + * + * Generated from protobuf field string query_text = 1; + * @param string $var + * @return $this + */ + public function setQueryText($var) + { + GPBUtil::checkString($var, True); + $this->query_text = $var; + + return $this; + } + +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(SuggestedQuery::class, \Google\Cloud\Dialogflow\V2\KnowledgeAssistAnswer_SuggestedQuery::class); + 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..0c1077812614 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/ListConversationsRequest.php @@ -0,0 +1,213 @@ +google.cloud.dialogflow.v2.ListConversationsRequest + */ +class ListConversationsRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The project from which to list all conversation. + * Format: `projects//locations/`. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $parent = ''; + /** + * Optional. The maximum number of items to return in a single page. By + * default 100 and at most 1000. + * + * Generated from protobuf field int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $page_size = 0; + /** + * Optional. The next_page_token value returned from a previous list request. + * + * Generated from protobuf field string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $page_token = ''; + /** + * Optional. A filter expression that filters conversations listed in the + * response. Only `lifecycle_state` can be filtered on in this way. For + * example, the following expression only returns `COMPLETED` conversations: + * `lifecycle_state = "COMPLETED"` + * For more information about filtering, see + * [API Filtering](https://aip.dev/160). + * + * Generated from protobuf field string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $filter = ''; + + /** + * @param string $parent Required. The project from which to list all conversation. + * Format: `projects//locations/`. Please see + * {@see ConversationsClient::projectName()} for help formatting this field. + * + * @return \Google\Cloud\Dialogflow\V2\ListConversationsRequest + * + * @experimental + */ + public static function build(string $parent): self + { + return (new self()) + ->setParent($parent); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $parent + * Required. The project from which to list all conversation. + * Format: `projects//locations/`. + * @type int $page_size + * Optional. The maximum number of items to return in a single page. By + * default 100 and at most 1000. + * @type string $page_token + * Optional. The next_page_token value returned from a previous list request. + * @type string $filter + * Optional. A filter expression that filters conversations listed in the + * response. Only `lifecycle_state` can be filtered on in this way. For + * example, the following expression only returns `COMPLETED` conversations: + * `lifecycle_state = "COMPLETED"` + * For more information about filtering, see + * [API Filtering](https://aip.dev/160). + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\Conversation::initOnce(); + parent::__construct($data); + } + + /** + * Required. The project from which to list all conversation. + * Format: `projects//locations/`. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getParent() + { + return $this->parent; + } + + /** + * Required. The project from which to list all conversation. + * Format: `projects//locations/`. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setParent($var) + { + GPBUtil::checkString($var, True); + $this->parent = $var; + + return $this; + } + + /** + * Optional. The maximum number of items to return in a single page. By + * default 100 and at most 1000. + * + * Generated from protobuf field int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @return int + */ + public function getPageSize() + { + return $this->page_size; + } + + /** + * Optional. The maximum number of items to return in a single page. By + * default 100 and at most 1000. + * + * Generated from protobuf field int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @param int $var + * @return $this + */ + public function setPageSize($var) + { + GPBUtil::checkInt32($var); + $this->page_size = $var; + + return $this; + } + + /** + * Optional. The next_page_token value returned from a previous list request. + * + * Generated from protobuf field string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getPageToken() + { + return $this->page_token; + } + + /** + * Optional. The next_page_token value returned from a previous list request. + * + * Generated from protobuf field string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setPageToken($var) + { + GPBUtil::checkString($var, True); + $this->page_token = $var; + + return $this; + } + + /** + * Optional. A filter expression that filters conversations listed in the + * response. Only `lifecycle_state` can be filtered on in this way. For + * example, the following expression only returns `COMPLETED` conversations: + * `lifecycle_state = "COMPLETED"` + * For more information about filtering, see + * [API Filtering](https://aip.dev/160). + * + * Generated from protobuf field string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getFilter() + { + return $this->filter; + } + + /** + * Optional. A filter expression that filters conversations listed in the + * response. Only `lifecycle_state` can be filtered on in this way. For + * example, the following expression only returns `COMPLETED` conversations: + * `lifecycle_state = "COMPLETED"` + * For more information about filtering, see + * [API Filtering](https://aip.dev/160). + * + * Generated from protobuf field string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setFilter($var) + { + GPBUtil::checkString($var, True); + $this->filter = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/ListConversationsResponse.php b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/ListConversationsResponse.php new file mode 100644 index 000000000000..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/ListGeneratorsRequest.php b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/ListGeneratorsRequest.php new file mode 100644 index 000000000000..84a69731d916 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/ListGeneratorsRequest.php @@ -0,0 +1,158 @@ +google.cloud.dialogflow.v2.ListGeneratorsRequest + */ +class ListGeneratorsRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The project/location to list generators for. Format: + * `projects//locations/` + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $parent = ''; + /** + * Optional. Maximum number of conversation models to return in a single page. + * Default to 10. + * + * Generated from protobuf field int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $page_size = 0; + /** + * Optional. The next_page_token value returned from a previous list request. + * + * Generated from protobuf field string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $page_token = ''; + + /** + * @param string $parent Required. The project/location to list generators for. Format: + * `projects//locations/` + * Please see {@see GeneratorsClient::projectName()} for help formatting this field. + * + * @return \Google\Cloud\Dialogflow\V2\ListGeneratorsRequest + * + * @experimental + */ + public static function build(string $parent): self + { + return (new self()) + ->setParent($parent); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $parent + * Required. The project/location to list generators for. Format: + * `projects//locations/` + * @type int $page_size + * Optional. Maximum number of conversation models to return in a single page. + * Default to 10. + * @type string $page_token + * Optional. The next_page_token value returned from a previous list request. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\Generator::initOnce(); + parent::__construct($data); + } + + /** + * Required. The project/location to list generators for. Format: + * `projects//locations/` + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getParent() + { + return $this->parent; + } + + /** + * Required. The project/location to list generators for. Format: + * `projects//locations/` + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setParent($var) + { + GPBUtil::checkString($var, True); + $this->parent = $var; + + return $this; + } + + /** + * Optional. Maximum number of conversation models to return in a single page. + * Default to 10. + * + * Generated from protobuf field int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @return int + */ + public function getPageSize() + { + return $this->page_size; + } + + /** + * Optional. Maximum number of conversation models to return in a single page. + * Default to 10. + * + * Generated from protobuf field int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @param int $var + * @return $this + */ + public function setPageSize($var) + { + GPBUtil::checkInt32($var); + $this->page_size = $var; + + return $this; + } + + /** + * Optional. The next_page_token value returned from a previous list request. + * + * Generated from protobuf field string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getPageToken() + { + return $this->page_token; + } + + /** + * Optional. The next_page_token value returned from a previous list request. + * + * Generated from protobuf field string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setPageToken($var) + { + GPBUtil::checkString($var, True); + $this->page_token = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/ListGeneratorsResponse.php b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/ListGeneratorsResponse.php new file mode 100644 index 000000000000..e4988973a0e5 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/ListGeneratorsResponse.php @@ -0,0 +1,105 @@ +google.cloud.dialogflow.v2.ListGeneratorsResponse + */ +class ListGeneratorsResponse extends \Google\Protobuf\Internal\Message +{ + /** + * List of generators retrieved. + * + * Generated from protobuf field repeated .google.cloud.dialogflow.v2.Generator generators = 1; + */ + private $generators; + /** + * Token to retrieve the next page of results, or empty if there are no more + * results in the list. + * + * Generated from protobuf field string next_page_token = 2; + */ + protected $next_page_token = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array<\Google\Cloud\Dialogflow\V2\Generator>|\Google\Protobuf\Internal\RepeatedField $generators + * List of generators retrieved. + * @type string $next_page_token + * Token to retrieve the next page of results, or empty if there are no more + * results in the list. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\Generator::initOnce(); + parent::__construct($data); + } + + /** + * List of generators retrieved. + * + * Generated from protobuf field repeated .google.cloud.dialogflow.v2.Generator generators = 1; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getGenerators() + { + return $this->generators; + } + + /** + * List of generators retrieved. + * + * Generated from protobuf field repeated .google.cloud.dialogflow.v2.Generator generators = 1; + * @param array<\Google\Cloud\Dialogflow\V2\Generator>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setGenerators($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Dialogflow\V2\Generator::class); + $this->generators = $arr; + + return $this; + } + + /** + * Token to retrieve the next page of results, or empty if there are no more + * results in the list. + * + * Generated from protobuf field string next_page_token = 2; + * @return string + */ + public function getNextPageToken() + { + return $this->next_page_token; + } + + /** + * Token to retrieve the next page of results, or empty if there are no more + * results in the list. + * + * Generated from protobuf field string next_page_token = 2; + * @param string $var + * @return $this + */ + public function setNextPageToken($var) + { + GPBUtil::checkString($var, True); + $this->next_page_token = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/ListIntentsRequest.php b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/ListIntentsRequest.php new file mode 100644 index 000000000000..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/MessageEntry.php b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/MessageEntry.php new file mode 100644 index 000000000000..53c6cdd6fbae --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/MessageEntry.php @@ -0,0 +1,187 @@ +google.cloud.dialogflow.v2.MessageEntry + */ +class MessageEntry extends \Google\Protobuf\Internal\Message +{ + /** + * Optional. Participant role of the message. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.MessageEntry.Role role = 1 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $role = 0; + /** + * Optional. Transcript content of the message. + * + * Generated from protobuf field string text = 2 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $text = ''; + /** + * Optional. The language of the text. See [Language + * Support](https://cloud.google.com/dialogflow/docs/reference/language) for a + * list of the currently supported language codes. + * + * Generated from protobuf field string language_code = 3 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $language_code = ''; + /** + * Optional. Create time of the message entry. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 4 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $create_time = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type int $role + * Optional. Participant role of the message. + * @type string $text + * Optional. Transcript content of the message. + * @type string $language_code + * Optional. The language of the text. See [Language + * Support](https://cloud.google.com/dialogflow/docs/reference/language) for a + * list of the currently supported language codes. + * @type \Google\Protobuf\Timestamp $create_time + * Optional. Create time of the message entry. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\Generator::initOnce(); + parent::__construct($data); + } + + /** + * Optional. Participant role of the message. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.MessageEntry.Role role = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @return int + */ + public function getRole() + { + return $this->role; + } + + /** + * Optional. Participant role of the message. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.MessageEntry.Role role = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @param int $var + * @return $this + */ + public function setRole($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\Dialogflow\V2\MessageEntry\Role::class); + $this->role = $var; + + return $this; + } + + /** + * Optional. Transcript content of the message. + * + * Generated from protobuf field string text = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getText() + { + return $this->text; + } + + /** + * Optional. Transcript content of the message. + * + * Generated from protobuf field string text = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setText($var) + { + GPBUtil::checkString($var, True); + $this->text = $var; + + return $this; + } + + /** + * Optional. The language of the text. See [Language + * Support](https://cloud.google.com/dialogflow/docs/reference/language) for a + * list of the currently supported language codes. + * + * Generated from protobuf field string language_code = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getLanguageCode() + { + return $this->language_code; + } + + /** + * Optional. The language of the text. See [Language + * Support](https://cloud.google.com/dialogflow/docs/reference/language) for a + * list of the currently supported language codes. + * + * Generated from protobuf field string language_code = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setLanguageCode($var) + { + GPBUtil::checkString($var, True); + $this->language_code = $var; + + return $this; + } + + /** + * Optional. Create time of the message entry. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Protobuf\Timestamp|null + */ + public function getCreateTime() + { + return $this->create_time; + } + + public function hasCreateTime() + { + return isset($this->create_time); + } + + public function clearCreateTime() + { + unset($this->create_time); + } + + /** + * Optional. Create time of the message entry. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setCreateTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->create_time = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/MessageEntry/Role.php b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/MessageEntry/Role.php new file mode 100644 index 000000000000..4a2b311504ab --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/MessageEntry/Role.php @@ -0,0 +1,72 @@ +google.cloud.dialogflow.v2.MessageEntry.Role + */ +class Role +{ + /** + * Participant role not set. + * + * Generated from protobuf enum ROLE_UNSPECIFIED = 0; + */ + const ROLE_UNSPECIFIED = 0; + /** + * Participant is a human agent. + * + * Generated from protobuf enum HUMAN_AGENT = 1; + */ + const HUMAN_AGENT = 1; + /** + * Participant is an automated agent, such as a Dialogflow agent. + * + * Generated from protobuf enum AUTOMATED_AGENT = 2; + */ + const AUTOMATED_AGENT = 2; + /** + * Participant is an end user that has called or chatted with + * Dialogflow services. + * + * Generated from protobuf enum END_USER = 3; + */ + const END_USER = 3; + + private static $valueToName = [ + self::ROLE_UNSPECIFIED => 'ROLE_UNSPECIFIED', + self::HUMAN_AGENT => 'HUMAN_AGENT', + self::AUTOMATED_AGENT => 'AUTOMATED_AGENT', + self::END_USER => 'END_USER', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(Role::class, \Google\Cloud\Dialogflow\V2\MessageEntry_Role::class); + 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..5ddca3f8b2c8 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/OutputAudioEncoding.php @@ -0,0 +1,93 @@ +google.cloud.dialogflow.v2.OutputAudioEncoding + */ +class OutputAudioEncoding +{ + /** + * Not specified. + * + * Generated from protobuf enum OUTPUT_AUDIO_ENCODING_UNSPECIFIED = 0; + */ + const OUTPUT_AUDIO_ENCODING_UNSPECIFIED = 0; + /** + * Uncompressed 16-bit signed little-endian samples (Linear PCM). + * Audio content returned as LINEAR16 also contains a WAV header. + * + * Generated from protobuf enum OUTPUT_AUDIO_ENCODING_LINEAR_16 = 1; + */ + const OUTPUT_AUDIO_ENCODING_LINEAR_16 = 1; + /** + * MP3 audio at 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; + /** + * 8-bit samples that compand 13-bit audio samples using G.711 PCMU/a-law. + * + * Generated from protobuf enum OUTPUT_AUDIO_ENCODING_ALAW = 6; + */ + const OUTPUT_AUDIO_ENCODING_ALAW = 6; + + private static $valueToName = [ + self::OUTPUT_AUDIO_ENCODING_UNSPECIFIED => 'OUTPUT_AUDIO_ENCODING_UNSPECIFIED', + self::OUTPUT_AUDIO_ENCODING_LINEAR_16 => 'OUTPUT_AUDIO_ENCODING_LINEAR_16', + self::OUTPUT_AUDIO_ENCODING_MP3 => 'OUTPUT_AUDIO_ENCODING_MP3', + self::OUTPUT_AUDIO_ENCODING_MP3_64_KBPS => 'OUTPUT_AUDIO_ENCODING_MP3_64_KBPS', + self::OUTPUT_AUDIO_ENCODING_OGG_OPUS => 'OUTPUT_AUDIO_ENCODING_OGG_OPUS', + self::OUTPUT_AUDIO_ENCODING_MULAW => 'OUTPUT_AUDIO_ENCODING_MULAW', + self::OUTPUT_AUDIO_ENCODING_ALAW => 'OUTPUT_AUDIO_ENCODING_ALAW', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + diff --git a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/Participant.php b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/Participant.php new file mode 100644 index 000000000000..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..d3a9a29c1990 --- /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..bed9ba9259cd --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/QueryParameters.php @@ -0,0 +1,461 @@ +google.cloud.dialogflow.v2.QueryParameters + */ +class QueryParameters extends \Google\Protobuf\Internal\Message +{ + /** + * The time zone of this conversational query from the + * [time zone database](https://www.iana.org/time-zones), e.g., + * America/New_York, Europe/Paris. If not provided, the time zone specified in + * agent settings is used. + * + * Generated from protobuf field string time_zone = 1; + */ + protected $time_zone = ''; + /** + * The geo location of this conversational query. + * + * Generated from protobuf field .google.type.LatLng geo_location = 2; + */ + protected $geo_location = null; + /** + * The collection of contexts to be activated before this query is + * executed. + * + * Generated from protobuf field repeated .google.cloud.dialogflow.v2.Context contexts = 3; + */ + private $contexts; + /** + * Specifies whether to delete all contexts in the current session + * before the new ones are activated. + * + * Generated from protobuf field bool reset_contexts = 4; + */ + protected $reset_contexts = false; + /** + * Additional session entity types to replace or extend developer + * entity types with. The entity synonyms apply to all languages and persist + * for the session of this query. + * + * Generated from protobuf field repeated .google.cloud.dialogflow.v2.SessionEntityType session_entity_types = 5; + */ + private $session_entity_types; + /** + * This field can be used to pass custom data to your webhook. + * Arbitrary JSON objects are supported. + * If supplied, the value is used to populate the + * `WebhookRequest.original_detect_intent_request.payload` + * field sent to your webhook. + * + * Generated from protobuf field .google.protobuf.Struct payload = 6; + */ + protected $payload = null; + /** + * Configures the type of sentiment analysis to perform. If not + * provided, sentiment analysis is not performed. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.SentimentAnalysisRequestConfig sentiment_analysis_request_config = 10; + */ + protected $sentiment_analysis_request_config = null; + /** + * This field can be used to pass HTTP headers for a webhook + * call. These headers will be sent to webhook along with the headers that + * have been configured through the Dialogflow web console. The headers + * defined within this field will overwrite the headers configured through the + * Dialogflow console if there is a conflict. Header names are + * case-insensitive. Google's specified headers are not allowed. Including: + * "Host", "Content-Length", "Connection", "From", "User-Agent", + * "Accept-Encoding", "If-Modified-Since", "If-None-Match", "X-Forwarded-For", + * etc. + * + * Generated from protobuf field map webhook_headers = 14; + */ + private $webhook_headers; + /** + * The platform of the virtual agent response messages. + * If not empty, only emits messages from this platform in the response. + * Valid values are the enum names of + * [platform][google.cloud.dialogflow.v2.Intent.Message.platform]. + * + * Generated from protobuf field string platform = 18; + */ + protected $platform = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $time_zone + * The time zone of this conversational query from the + * [time zone database](https://www.iana.org/time-zones), e.g., + * America/New_York, Europe/Paris. If not provided, the time zone specified in + * agent settings is used. + * @type \Google\Type\LatLng $geo_location + * The geo location of this conversational query. + * @type 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. + * @type string $platform + * The platform of the virtual agent response messages. + * If not empty, only emits messages from this platform in the response. + * Valid values are the enum names of + * [platform][google.cloud.dialogflow.v2.Intent.Message.platform]. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\Session::initOnce(); + parent::__construct($data); + } + + /** + * The time zone of this conversational query from the + * [time zone database](https://www.iana.org/time-zones), e.g., + * America/New_York, Europe/Paris. If not provided, the time zone specified in + * agent settings is used. + * + * Generated from protobuf field string time_zone = 1; + * @return string + */ + public function getTimeZone() + { + return $this->time_zone; + } + + /** + * The time zone of this conversational query from the + * [time zone database](https://www.iana.org/time-zones), e.g., + * America/New_York, Europe/Paris. If not provided, the time zone specified in + * agent settings is used. + * + * Generated from protobuf field string time_zone = 1; + * @param string $var + * @return $this + */ + public function setTimeZone($var) + { + GPBUtil::checkString($var, True); + $this->time_zone = $var; + + return $this; + } + + /** + * The geo location of this conversational query. + * + * Generated from protobuf field .google.type.LatLng geo_location = 2; + * @return \Google\Type\LatLng|null + */ + public function getGeoLocation() + { + return $this->geo_location; + } + + public function hasGeoLocation() + { + return isset($this->geo_location); + } + + public function clearGeoLocation() + { + unset($this->geo_location); + } + + /** + * The geo location of this conversational query. + * + * Generated from protobuf field .google.type.LatLng geo_location = 2; + * @param \Google\Type\LatLng $var + * @return $this + */ + public function setGeoLocation($var) + { + GPBUtil::checkMessage($var, \Google\Type\LatLng::class); + $this->geo_location = $var; + + return $this; + } + + /** + * The collection of contexts to be activated before this query is + * executed. + * + * Generated from protobuf field repeated .google.cloud.dialogflow.v2.Context contexts = 3; + * @return \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; + } + + /** + * The platform of the virtual agent response messages. + * If not empty, only emits messages from this platform in the response. + * Valid values are the enum names of + * [platform][google.cloud.dialogflow.v2.Intent.Message.platform]. + * + * Generated from protobuf field string platform = 18; + * @return string + */ + public function getPlatform() + { + return $this->platform; + } + + /** + * The platform of the virtual agent response messages. + * If not empty, only emits messages from this platform in the response. + * Valid values are the enum names of + * [platform][google.cloud.dialogflow.v2.Intent.Message.platform]. + * + * Generated from protobuf field string platform = 18; + * @param string $var + * @return $this + */ + public function setPlatform($var) + { + GPBUtil::checkString($var, True); + $this->platform = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/QueryResult.php b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/QueryResult.php new file mode 100644 index 000000000000..d7ec0fedbd64 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/QueryResult.php @@ -0,0 +1,847 @@ +google.cloud.dialogflow.v2.QueryResult + */ +class QueryResult extends \Google\Protobuf\Internal\Message +{ + /** + * The original conversational query text: + * - If natural language text was provided as input, `query_text` contains + * a copy of the input. + * - If natural language speech audio was provided as input, `query_text` + * contains the speech recognition result. If speech recognizer produced + * multiple alternatives, a particular one is picked. + * - If automatic spell correction is enabled, `query_text` will contain the + * corrected user input. + * + * Generated from protobuf field string query_text = 1; + */ + protected $query_text = ''; + /** + * The language that was triggered during intent detection. + * See [Language + * Support](https://cloud.google.com/dialogflow/docs/reference/language) + * for a list of the currently supported language codes. + * + * Generated from protobuf field string language_code = 15; + */ + protected $language_code = ''; + /** + * The Speech recognition confidence between 0.0 and 1.0. A higher number + * indicates an estimated greater likelihood that the recognized words are + * correct. The default of 0.0 is a sentinel value indicating that confidence + * was not set. + * This field is not guaranteed to be accurate or set. In particular this + * field isn't set for StreamingDetectIntent since the streaming endpoint has + * separate confidence estimates per portion of the audio in + * StreamingRecognitionResult. + * + * Generated from protobuf field float speech_recognition_confidence = 2; + */ + protected $speech_recognition_confidence = 0.0; + /** + * The action name from the matched intent. + * + * Generated from protobuf field string action = 3; + */ + protected $action = ''; + /** + * The collection of extracted parameters. + * Depending on your protocol or client library language, this is a + * map, associative array, symbol table, dictionary, or JSON object + * composed of a collection of (MapKey, MapValue) pairs: + * * MapKey type: string + * * MapKey value: parameter name + * * MapValue type: If parameter's entity type is a composite entity then use + * map, otherwise, depending on the parameter value type, it could be one of + * string, number, boolean, null, list or map. + * * MapValue value: If parameter's entity type is a composite entity then use + * map from composite entity property names to property values, otherwise, + * use parameter value. + * + * Generated from protobuf field .google.protobuf.Struct parameters = 4; + */ + protected $parameters = null; + /** + * This field is set to: + * - `false` if the matched intent has required parameters and not all of + * the required parameter values have been collected. + * - `true` if all required parameter values have been collected, or if the + * matched intent doesn't contain any required parameters. + * + * Generated from protobuf field bool all_required_params_present = 5; + */ + protected $all_required_params_present = false; + /** + * Indicates whether the conversational query triggers a cancellation for slot + * filling. For more information, see the [cancel slot filling + * documentation](https://cloud.google.com/dialogflow/es/docs/intents-actions-parameters#cancel). + * + * Generated from protobuf field bool cancels_slot_filling = 21; + */ + protected $cancels_slot_filling = false; + /** + * The text to be pronounced to the user or shown on the screen. + * Note: This is a legacy field, `fulfillment_messages` should be preferred. + * + * Generated from protobuf field string fulfillment_text = 6; + */ + protected $fulfillment_text = ''; + /** + * The collection of rich messages to present to the user. + * + * Generated from protobuf field repeated .google.cloud.dialogflow.v2.Intent.Message fulfillment_messages = 7; + */ + private $fulfillment_messages; + /** + * If the query was fulfilled by a webhook call, this field is set to the + * value of the `source` field returned in the webhook response. + * + * Generated from protobuf field string webhook_source = 8; + */ + protected $webhook_source = ''; + /** + * If the query was fulfilled by a webhook call, this field is set to the + * value of the `payload` field returned in the webhook response. + * + * Generated from protobuf field .google.protobuf.Struct webhook_payload = 9; + */ + protected $webhook_payload = null; + /** + * The collection of output contexts. If applicable, + * `output_contexts.parameters` contains entries with name + * `.original` containing the original parameter values + * before the query. + * + * Generated from protobuf field repeated .google.cloud.dialogflow.v2.Context output_contexts = 10; + */ + private $output_contexts; + /** + * The intent that matched the conversational query. Some, not + * all fields are filled in this message, including but not limited to: + * `name`, `display_name`, `end_interaction` and `is_fallback`. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.Intent intent = 11; + */ + protected $intent = null; + /** + * The intent detection confidence. Values range from 0.0 + * (completely uncertain) to 1.0 (completely certain). + * This value is for informational purpose only and is only used to + * help match the best intent within the classification threshold. + * This value may change for the same end-user expression at any time due to a + * model retraining or change in implementation. + * If there are `multiple knowledge_answers` messages, this value is set to + * the greatest `knowledgeAnswers.match_confidence` value in the list. + * + * Generated from protobuf field float intent_detection_confidence = 12; + */ + protected $intent_detection_confidence = 0.0; + /** + * Free-form diagnostic information for the associated detect intent request. + * The fields of this data can change without notice, so you should not write + * code that depends on its structure. + * The data may contain: + * - webhook call latency + * - webhook errors + * + * Generated from protobuf field .google.protobuf.Struct diagnostic_info = 14; + */ + protected $diagnostic_info = null; + /** + * The sentiment analysis result, which depends on the + * `sentiment_analysis_request_config` specified in the request. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.SentimentAnalysisResult sentiment_analysis_result = 17; + */ + protected $sentiment_analysis_result = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $query_text + * The original conversational query text: + * - If natural language text was provided as input, `query_text` contains + * a copy of the input. + * - If natural language speech audio was provided as input, `query_text` + * contains the speech recognition result. If speech recognizer produced + * multiple alternatives, a particular one is picked. + * - If automatic spell correction is enabled, `query_text` will contain the + * corrected user input. + * @type string $language_code + * The language that was triggered during intent detection. + * See [Language + * Support](https://cloud.google.com/dialogflow/docs/reference/language) + * for a list of the currently supported language codes. + * @type float $speech_recognition_confidence + * The Speech recognition confidence between 0.0 and 1.0. A higher number + * indicates an estimated greater likelihood that the recognized words are + * correct. The default of 0.0 is a sentinel value indicating that confidence + * was not set. + * This field is not guaranteed to be accurate or set. In particular this + * field isn't set for StreamingDetectIntent since the streaming endpoint has + * separate confidence estimates per portion of the audio in + * StreamingRecognitionResult. + * @type string $action + * The action name from the matched intent. + * @type \Google\Protobuf\Struct $parameters + * The collection of extracted parameters. + * Depending on your protocol or client library language, this is a + * map, associative array, symbol table, dictionary, or JSON object + * composed of a collection of (MapKey, MapValue) pairs: + * * MapKey type: string + * * MapKey value: parameter name + * * MapValue type: If parameter's entity type is a composite entity then use + * map, otherwise, depending on the parameter value type, it could be one of + * string, number, boolean, null, list or map. + * * MapValue value: If parameter's entity type is a composite entity then use + * map from composite entity property names to property values, otherwise, + * use parameter value. + * @type bool $all_required_params_present + * This field is set to: + * - `false` if the matched intent has required parameters and not all of + * the required parameter values have been collected. + * - `true` if all required parameter values have been collected, or if the + * matched intent doesn't contain any required parameters. + * @type bool $cancels_slot_filling + * Indicates whether the conversational query triggers a cancellation for slot + * filling. For more information, see the [cancel slot filling + * documentation](https://cloud.google.com/dialogflow/es/docs/intents-actions-parameters#cancel). + * @type string $fulfillment_text + * The text to be pronounced to the user or shown on the screen. + * Note: This is a legacy field, `fulfillment_messages` should be preferred. + * @type 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 then use + * map, otherwise, depending on the parameter value type, it could be one of + * string, number, boolean, null, list or map. + * * MapValue value: If parameter's entity type is a composite entity then use + * map from composite entity property names to property values, otherwise, + * use parameter value. + * + * Generated from protobuf field .google.protobuf.Struct parameters = 4; + * @return \Google\Protobuf\Struct|null + */ + public function getParameters() + { + return $this->parameters; + } + + public function hasParameters() + { + return isset($this->parameters); + } + + public function clearParameters() + { + unset($this->parameters); + } + + /** + * The collection of extracted parameters. + * Depending on your protocol or client library language, this is a + * map, associative array, symbol table, dictionary, or JSON object + * composed of a collection of (MapKey, MapValue) pairs: + * * MapKey type: string + * * MapKey value: parameter name + * * MapValue type: If parameter's entity type is a composite entity then use + * map, otherwise, depending on the parameter value type, it could be one of + * string, number, boolean, null, list or map. + * * MapValue value: If parameter's entity type is a composite entity then use + * map from composite entity property names to property values, otherwise, + * use parameter value. + * + * Generated from protobuf field .google.protobuf.Struct parameters = 4; + * @param \Google\Protobuf\Struct $var + * @return $this + */ + public function setParameters($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Struct::class); + $this->parameters = $var; + + return $this; + } + + /** + * This field is set to: + * - `false` if the matched intent has required parameters and not all of + * the required parameter values have been collected. + * - `true` if all required parameter values have been collected, or if the + * matched intent doesn't contain any required parameters. + * + * Generated from protobuf field bool all_required_params_present = 5; + * @return bool + */ + public function getAllRequiredParamsPresent() + { + return $this->all_required_params_present; + } + + /** + * This field is set to: + * - `false` if the matched intent has required parameters and not all of + * the required parameter values have been collected. + * - `true` if all required parameter values have been collected, or if the + * matched intent doesn't contain any required parameters. + * + * Generated from protobuf field bool all_required_params_present = 5; + * @param bool $var + * @return $this + */ + public function setAllRequiredParamsPresent($var) + { + GPBUtil::checkBool($var); + $this->all_required_params_present = $var; + + return $this; + } + + /** + * Indicates whether the conversational query triggers a cancellation for slot + * filling. For more information, see the [cancel slot filling + * documentation](https://cloud.google.com/dialogflow/es/docs/intents-actions-parameters#cancel). + * + * Generated from protobuf field bool cancels_slot_filling = 21; + * @return bool + */ + public function getCancelsSlotFilling() + { + return $this->cancels_slot_filling; + } + + /** + * Indicates whether the conversational query triggers a cancellation for slot + * filling. For more information, see the [cancel slot filling + * documentation](https://cloud.google.com/dialogflow/es/docs/intents-actions-parameters#cancel). + * + * Generated from protobuf field bool cancels_slot_filling = 21; + * @param bool $var + * @return $this + */ + public function setCancelsSlotFilling($var) + { + GPBUtil::checkBool($var); + $this->cancels_slot_filling = $var; + + return $this; + } + + /** + * The text to be pronounced to the user or shown on the screen. + * Note: This is a legacy field, `fulfillment_messages` should be preferred. + * + * Generated from protobuf field string fulfillment_text = 6; + * @return string + */ + public function getFulfillmentText() + { + return $this->fulfillment_text; + } + + /** + * The text to be pronounced to the user or shown on the screen. + * Note: This is a legacy field, `fulfillment_messages` should be preferred. + * + * Generated from protobuf field string fulfillment_text = 6; + * @param string $var + * @return $this + */ + public function setFulfillmentText($var) + { + GPBUtil::checkString($var, True); + $this->fulfillment_text = $var; + + return $this; + } + + /** + * The collection of rich messages to present to the user. + * + * Generated from protobuf field repeated .google.cloud.dialogflow.v2.Intent.Message fulfillment_messages = 7; + * @return \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/SearchKnowledgeAnswer.php b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/SearchKnowledgeAnswer.php new file mode 100644 index 000000000000..9e7e6214b069 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/SearchKnowledgeAnswer.php @@ -0,0 +1,181 @@ +google.cloud.dialogflow.v2.SearchKnowledgeAnswer + */ +class SearchKnowledgeAnswer extends \Google\Protobuf\Internal\Message +{ + /** + * The piece of text from the knowledge base documents that answers + * the search query + * + * Generated from protobuf field string answer = 1; + */ + protected $answer = ''; + /** + * The type of the answer. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.SearchKnowledgeAnswer.AnswerType answer_type = 2; + */ + protected $answer_type = 0; + /** + * All sources used to generate the answer. + * + * Generated from protobuf field repeated .google.cloud.dialogflow.v2.SearchKnowledgeAnswer.AnswerSource answer_sources = 3; + */ + private $answer_sources; + /** + * The name of the answer record. + * Format: `projects//locations//answer + * Records/` + * + * Generated from protobuf field string answer_record = 5; + */ + protected $answer_record = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $answer + * The piece of text from the knowledge base documents that answers + * the search query + * @type int $answer_type + * The type of the answer. + * @type array<\Google\Cloud\Dialogflow\V2\SearchKnowledgeAnswer\AnswerSource>|\Google\Protobuf\Internal\RepeatedField $answer_sources + * All sources used to generate the answer. + * @type string $answer_record + * The name of the answer record. + * Format: `projects//locations//answer + * Records/` + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\Conversation::initOnce(); + parent::__construct($data); + } + + /** + * The piece of text from the knowledge base documents that answers + * the search query + * + * Generated from protobuf field string answer = 1; + * @return string + */ + public function getAnswer() + { + return $this->answer; + } + + /** + * The piece of text from the knowledge base documents that answers + * the search query + * + * Generated from protobuf field string answer = 1; + * @param string $var + * @return $this + */ + public function setAnswer($var) + { + GPBUtil::checkString($var, True); + $this->answer = $var; + + return $this; + } + + /** + * The type of the answer. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.SearchKnowledgeAnswer.AnswerType answer_type = 2; + * @return int + */ + public function getAnswerType() + { + return $this->answer_type; + } + + /** + * The type of the answer. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.SearchKnowledgeAnswer.AnswerType answer_type = 2; + * @param int $var + * @return $this + */ + public function setAnswerType($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\Dialogflow\V2\SearchKnowledgeAnswer\AnswerType::class); + $this->answer_type = $var; + + return $this; + } + + /** + * All sources used to generate the answer. + * + * Generated from protobuf field repeated .google.cloud.dialogflow.v2.SearchKnowledgeAnswer.AnswerSource answer_sources = 3; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getAnswerSources() + { + return $this->answer_sources; + } + + /** + * All sources used to generate the answer. + * + * Generated from protobuf field repeated .google.cloud.dialogflow.v2.SearchKnowledgeAnswer.AnswerSource answer_sources = 3; + * @param array<\Google\Cloud\Dialogflow\V2\SearchKnowledgeAnswer\AnswerSource>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setAnswerSources($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Dialogflow\V2\SearchKnowledgeAnswer\AnswerSource::class); + $this->answer_sources = $arr; + + return $this; + } + + /** + * The name of the answer record. + * Format: `projects//locations//answer + * Records/` + * + * Generated from protobuf field string answer_record = 5; + * @return string + */ + public function getAnswerRecord() + { + return $this->answer_record; + } + + /** + * The name of the answer record. + * Format: `projects//locations//answer + * Records/` + * + * Generated from protobuf field string answer_record = 5; + * @param string $var + * @return $this + */ + public function setAnswerRecord($var) + { + GPBUtil::checkString($var, True); + $this->answer_record = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/SearchKnowledgeAnswer/AnswerSource.php b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/SearchKnowledgeAnswer/AnswerSource.php new file mode 100644 index 000000000000..dd6e5bf95ab9 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/SearchKnowledgeAnswer/AnswerSource.php @@ -0,0 +1,138 @@ +google.cloud.dialogflow.v2.SearchKnowledgeAnswer.AnswerSource + */ +class AnswerSource extends \Google\Protobuf\Internal\Message +{ + /** + * The title of the article. + * + * Generated from protobuf field string title = 1; + */ + protected $title = ''; + /** + * The URI of the article. + * + * Generated from protobuf field string uri = 2; + */ + protected $uri = ''; + /** + * The relevant snippet of the article. + * + * Generated from protobuf field string snippet = 3; + */ + protected $snippet = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $title + * The title of the article. + * @type string $uri + * The URI of the article. + * @type string $snippet + * The relevant snippet of the article. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\Conversation::initOnce(); + parent::__construct($data); + } + + /** + * The title of the article. + * + * Generated from protobuf field string title = 1; + * @return string + */ + public function getTitle() + { + return $this->title; + } + + /** + * The title of the article. + * + * Generated from protobuf field string title = 1; + * @param string $var + * @return $this + */ + public function setTitle($var) + { + GPBUtil::checkString($var, True); + $this->title = $var; + + return $this; + } + + /** + * The URI of the article. + * + * Generated from protobuf field string uri = 2; + * @return string + */ + public function getUri() + { + return $this->uri; + } + + /** + * The URI of the article. + * + * Generated from protobuf field string uri = 2; + * @param string $var + * @return $this + */ + public function setUri($var) + { + GPBUtil::checkString($var, True); + $this->uri = $var; + + return $this; + } + + /** + * The relevant snippet of the article. + * + * Generated from protobuf field string snippet = 3; + * @return string + */ + public function getSnippet() + { + return $this->snippet; + } + + /** + * The relevant snippet of the article. + * + * Generated from protobuf field string snippet = 3; + * @param string $var + * @return $this + */ + public function setSnippet($var) + { + GPBUtil::checkString($var, True); + $this->snippet = $var; + + return $this; + } + +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(AnswerSource::class, \Google\Cloud\Dialogflow\V2\SearchKnowledgeAnswer_AnswerSource::class); + diff --git a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/SearchKnowledgeAnswer/AnswerType.php b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/SearchKnowledgeAnswer/AnswerType.php new file mode 100644 index 000000000000..dbbc1d41ebdf --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/SearchKnowledgeAnswer/AnswerType.php @@ -0,0 +1,71 @@ +google.cloud.dialogflow.v2.SearchKnowledgeAnswer.AnswerType + */ +class AnswerType +{ + /** + * The answer has a unspecified type. + * + * Generated from protobuf enum ANSWER_TYPE_UNSPECIFIED = 0; + */ + const ANSWER_TYPE_UNSPECIFIED = 0; + /** + * The answer is from FAQ documents. + * + * Generated from protobuf enum FAQ = 1; + */ + const FAQ = 1; + /** + * The answer is from generative model. + * + * Generated from protobuf enum GENERATIVE = 2; + */ + const GENERATIVE = 2; + /** + * The answer is from intent matching. + * + * Generated from protobuf enum INTENT = 3; + */ + const INTENT = 3; + + private static $valueToName = [ + self::ANSWER_TYPE_UNSPECIFIED => 'ANSWER_TYPE_UNSPECIFIED', + self::FAQ => 'FAQ', + self::GENERATIVE => 'GENERATIVE', + self::INTENT => 'INTENT', + ]; + + 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(AnswerType::class, \Google\Cloud\Dialogflow\V2\SearchKnowledgeAnswer_AnswerType::class); + diff --git a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/SearchKnowledgeRequest.php b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/SearchKnowledgeRequest.php new file mode 100644 index 000000000000..d16f90981a9f --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/SearchKnowledgeRequest.php @@ -0,0 +1,308 @@ +google.cloud.dialogflow.v2.SearchKnowledgeRequest + */ +class SearchKnowledgeRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The parent resource contains the conversation profile + * Format: 'projects/' or `projects//locations/`. + * + * Generated from protobuf field string parent = 6 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $parent = ''; + /** + * Required. The natural language text query for knowledge search. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.TextInput query = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $query = null; + /** + * Required. The conversation profile used to configure the search. + * Format: `projects//locations//conversationProfiles/`. + * + * Generated from protobuf field string conversation_profile = 2 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $conversation_profile = ''; + /** + * Required. The ID of the search session. + * The session_id can be combined with Dialogflow V3 Agent ID retrieved from + * conversation profile or on its own to identify a search session. The search + * history of the same session will impact the search result. It's up to the + * API caller to choose an appropriate `Session ID`. It can be a random number + * or some type of session identifiers (preferably hashed). The length must + * not exceed 36 characters. + * + * Generated from protobuf field string session_id = 3 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $session_id = ''; + /** + * Optional. The conversation (between human agent and end user) where the + * search request is triggered. Format: `projects//locations//conversations/`. + * + * Generated from protobuf field string conversation = 4 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { + */ + protected $conversation = ''; + /** + * Optional. The name of the latest conversation message when the request is + * triggered. + * Format: `projects//locations//conversations//messages/`. + * + * Generated from protobuf field string latest_message = 5 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { + */ + protected $latest_message = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $parent + * Required. The parent resource contains the conversation profile + * Format: 'projects/' or `projects//locations/`. + * @type \Google\Cloud\Dialogflow\V2\TextInput $query + * Required. The natural language text query for knowledge search. + * @type string $conversation_profile + * Required. The conversation profile used to configure the search. + * Format: `projects//locations//conversationProfiles/`. + * @type string $session_id + * Required. The ID of the search session. + * The session_id can be combined with Dialogflow V3 Agent ID retrieved from + * conversation profile or on its own to identify a search session. The search + * history of the same session will impact the search result. It's up to the + * API caller to choose an appropriate `Session ID`. It can be a random number + * or some type of session identifiers (preferably hashed). The length must + * not exceed 36 characters. + * @type string $conversation + * Optional. The conversation (between human agent and end user) where the + * search request is triggered. Format: `projects//locations//conversations/`. + * @type string $latest_message + * Optional. The name of the latest conversation message when the request is + * triggered. + * Format: `projects//locations//conversations//messages/`. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\Conversation::initOnce(); + parent::__construct($data); + } + + /** + * Required. The parent resource contains the conversation profile + * Format: 'projects/' or `projects//locations/`. + * + * Generated from protobuf field string parent = 6 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getParent() + { + return $this->parent; + } + + /** + * Required. The parent resource contains the conversation profile + * Format: 'projects/' or `projects//locations/`. + * + * Generated from protobuf field string parent = 6 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setParent($var) + { + GPBUtil::checkString($var, True); + $this->parent = $var; + + return $this; + } + + /** + * Required. The natural language text query for knowledge search. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.TextInput query = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\Dialogflow\V2\TextInput|null + */ + public function getQuery() + { + return $this->query; + } + + public function hasQuery() + { + return isset($this->query); + } + + public function clearQuery() + { + unset($this->query); + } + + /** + * Required. The natural language text query for knowledge search. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.TextInput query = 1 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\Dialogflow\V2\TextInput $var + * @return $this + */ + public function setQuery($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Dialogflow\V2\TextInput::class); + $this->query = $var; + + return $this; + } + + /** + * Required. The conversation profile used to configure the search. + * Format: `projects//locations//conversationProfiles/`. + * + * Generated from protobuf field string conversation_profile = 2 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getConversationProfile() + { + return $this->conversation_profile; + } + + /** + * Required. The conversation profile used to configure the search. + * Format: `projects//locations//conversationProfiles/`. + * + * Generated from protobuf field string conversation_profile = 2 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setConversationProfile($var) + { + GPBUtil::checkString($var, True); + $this->conversation_profile = $var; + + return $this; + } + + /** + * Required. The ID of the search session. + * The session_id can be combined with Dialogflow V3 Agent ID retrieved from + * conversation profile or on its own to identify a search session. The search + * history of the same session will impact the search result. It's up to the + * API caller to choose an appropriate `Session ID`. It can be a random number + * or some type of session identifiers (preferably hashed). The length must + * not exceed 36 characters. + * + * Generated from protobuf field string session_id = 3 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getSessionId() + { + return $this->session_id; + } + + /** + * Required. The ID of the search session. + * The session_id can be combined with Dialogflow V3 Agent ID retrieved from + * conversation profile or on its own to identify a search session. The search + * history of the same session will impact the search result. It's up to the + * API caller to choose an appropriate `Session ID`. It can be a random number + * or some type of session identifiers (preferably hashed). The length must + * not exceed 36 characters. + * + * Generated from protobuf field string session_id = 3 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setSessionId($var) + { + GPBUtil::checkString($var, True); + $this->session_id = $var; + + return $this; + } + + /** + * Optional. The conversation (between human agent and end user) where the + * search request is triggered. Format: `projects//locations//conversations/`. + * + * Generated from protobuf field string conversation = 4 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { + * @return string + */ + public function getConversation() + { + return $this->conversation; + } + + /** + * Optional. The conversation (between human agent and end user) where the + * search request is triggered. Format: `projects//locations//conversations/`. + * + * Generated from protobuf field string conversation = 4 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setConversation($var) + { + GPBUtil::checkString($var, True); + $this->conversation = $var; + + return $this; + } + + /** + * Optional. The name of the latest conversation message when the request is + * triggered. + * Format: `projects//locations//conversations//messages/`. + * + * Generated from protobuf field string latest_message = 5 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { + * @return string + */ + public function getLatestMessage() + { + return $this->latest_message; + } + + /** + * Optional. The name of the latest conversation message when the request is + * triggered. + * Format: `projects//locations//conversations//messages/`. + * + * Generated from protobuf field string latest_message = 5 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setLatestMessage($var) + { + GPBUtil::checkString($var, True); + $this->latest_message = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/SearchKnowledgeResponse.php b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/SearchKnowledgeResponse.php new file mode 100644 index 000000000000..8e15b611b209 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/SearchKnowledgeResponse.php @@ -0,0 +1,106 @@ +google.cloud.dialogflow.v2.SearchKnowledgeResponse + */ +class SearchKnowledgeResponse extends \Google\Protobuf\Internal\Message +{ + /** + * Most relevant snippets extracted from articles in the given knowledge base, + * ordered by confidence. + * + * Generated from protobuf field repeated .google.cloud.dialogflow.v2.SearchKnowledgeAnswer answers = 2; + */ + private $answers; + /** + * The rewritten query used to search knowledge. + * + * Generated from protobuf field string rewritten_query = 3; + */ + protected $rewritten_query = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array<\Google\Cloud\Dialogflow\V2\SearchKnowledgeAnswer>|\Google\Protobuf\Internal\RepeatedField $answers + * Most relevant snippets extracted from articles in the given knowledge base, + * ordered by confidence. + * @type string $rewritten_query + * The rewritten query used to search knowledge. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\Conversation::initOnce(); + parent::__construct($data); + } + + /** + * Most relevant snippets extracted from articles in the given knowledge base, + * ordered by confidence. + * + * Generated from protobuf field repeated .google.cloud.dialogflow.v2.SearchKnowledgeAnswer answers = 2; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getAnswers() + { + return $this->answers; + } + + /** + * Most relevant snippets extracted from articles in the given knowledge base, + * ordered by confidence. + * + * Generated from protobuf field repeated .google.cloud.dialogflow.v2.SearchKnowledgeAnswer answers = 2; + * @param array<\Google\Cloud\Dialogflow\V2\SearchKnowledgeAnswer>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setAnswers($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Dialogflow\V2\SearchKnowledgeAnswer::class); + $this->answers = $arr; + + return $this; + } + + /** + * The rewritten query used to search knowledge. + * + * Generated from protobuf field string rewritten_query = 3; + * @return string + */ + public function getRewrittenQuery() + { + return $this->rewritten_query; + } + + /** + * The rewritten query used to search knowledge. + * + * Generated from protobuf field string rewritten_query = 3; + * @param string $var + * @return $this + */ + public function setRewrittenQuery($var) + { + GPBUtil::checkString($var, True); + $this->rewritten_query = $var; + + return $this; + } + +} + 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..2f9398ec632c --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/SpeechContext.php @@ -0,0 +1,162 @@ +google.cloud.dialogflow.v2.SpeechContext + */ +class SpeechContext extends \Google\Protobuf\Internal\Message +{ + /** + * Optional. A list of strings containing words and phrases that the speech + * recognizer should recognize with higher likelihood. + * This list can be used to: + * * improve accuracy for words and phrases you expect the user to say, + * e.g. typical commands for your Dialogflow agent + * * add additional words to the speech recognizer vocabulary + * * ... + * See the [Cloud Speech + * documentation](https://cloud.google.com/speech-to-text/quotas) for usage + * limits. + * + * Generated from protobuf field repeated string phrases = 1 [(.google.api.field_behavior) = OPTIONAL]; + */ + private $phrases; + /** + * Optional. Boost for this context compared to other contexts: + * * If the boost is positive, Dialogflow will increase the probability that + * the phrases in this context are recognized over similar sounding phrases. + * * If the boost is unspecified or non-positive, Dialogflow will not apply + * any boost. + * Dialogflow recommends that you use boosts in the range (0, 20] and that you + * find a value that fits your use case with binary search. + * + * Generated from protobuf field float boost = 2 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $boost = 0.0; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type 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 [(.google.api.field_behavior) = OPTIONAL]; + * @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 [(.google.api.field_behavior) = OPTIONAL]; + * @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 [(.google.api.field_behavior) = OPTIONAL]; + * @return float + */ + public function getBoost() + { + return $this->boost; + } + + /** + * Optional. Boost for this context compared to other contexts: + * * If the boost is positive, Dialogflow will increase the probability that + * the phrases in this context are recognized over similar sounding phrases. + * * If the boost is unspecified or non-positive, Dialogflow will not apply + * any boost. + * Dialogflow recommends that you use boosts in the range (0, 20] and that you + * find a value that fits your use case with binary search. + * + * Generated from protobuf field float boost = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @param float $var + * @return $this + */ + public function setBoost($var) + { + GPBUtil::checkFloat($var); + $this->boost = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/SpeechModelVariant.php b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/SpeechModelVariant.php new file mode 100644 index 000000000000..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..6d7ec2f3ac7d --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/SpeechToTextConfig.php @@ -0,0 +1,432 @@ +google.cloud.dialogflow.v2.SpeechToTextConfig + */ +class SpeechToTextConfig extends \Google\Protobuf\Internal\Message +{ + /** + * The speech model used in speech to text. + * `SPEECH_MODEL_VARIANT_UNSPECIFIED`, `USE_BEST_AVAILABLE` will be treated as + * `USE_ENHANCED`. It can be overridden in + * [AnalyzeContentRequest][google.cloud.dialogflow.v2.AnalyzeContentRequest] + * and + * [StreamingAnalyzeContentRequest][google.cloud.dialogflow.v2.StreamingAnalyzeContentRequest] + * request. If enhanced model variant is specified and an enhanced version of + * the specified model for the language does not exist, then it would emit an + * error. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.SpeechModelVariant speech_model_variant = 1; + */ + protected $speech_model_variant = 0; + /** + * Which Speech model to select. Select the + * model best suited to your domain to get best results. If a model is not + * explicitly specified, then Dialogflow auto-selects a model based on other + * parameters in the SpeechToTextConfig and Agent settings. + * If enhanced speech model is enabled for the agent and an enhanced + * version of the specified model for the language does not exist, then the + * speech is recognized using the standard version of the specified model. + * Refer to + * [Cloud Speech API + * documentation](https://cloud.google.com/speech-to-text/docs/basics#select-model) + * for more details. + * If you specify a model, the following models typically have the best + * performance: + * - phone_call (best for Agent Assist and telephony) + * - latest_short (best for Dialogflow non-telephony) + * - command_and_search + * Leave this field unspecified to use + * [Agent Speech + * settings](https://cloud.google.com/dialogflow/cx/docs/concept/agent#settings-speech) + * for model selection. + * + * Generated from protobuf field string model = 2; + */ + protected $model = ''; + /** + * Audio encoding of the audio content to process. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.AudioEncoding audio_encoding = 6; + */ + protected $audio_encoding = 0; + /** + * Sample rate (in Hertz) of the audio content sent in the query. + * Refer to [Cloud Speech API + * documentation](https://cloud.google.com/speech-to-text/docs/basics) for + * more details. + * + * Generated from protobuf field int32 sample_rate_hertz = 7; + */ + protected $sample_rate_hertz = 0; + /** + * The language of the supplied audio. Dialogflow does not do + * translations. See [Language + * Support](https://cloud.google.com/dialogflow/docs/reference/language) + * for a list of the currently supported language codes. Note that queries in + * the same session do not necessarily need to specify the same language. + * + * Generated from protobuf field string language_code = 8; + */ + protected $language_code = ''; + /** + * If `true`, Dialogflow returns + * [SpeechWordInfo][google.cloud.dialogflow.v2.SpeechWordInfo] in + * [StreamingRecognitionResult][google.cloud.dialogflow.v2.StreamingRecognitionResult] + * with information about the recognized speech words, e.g. start and end time + * offsets. If false or unspecified, Speech doesn't return any word-level + * information. + * + * Generated from protobuf field bool enable_word_info = 9; + */ + protected $enable_word_info = false; + /** + * Use timeout based endpointing, interpreting endpointer sensitivy as + * seconds of timeout value. + * + * Generated from protobuf field bool use_timeout_based_endpointing = 11; + */ + protected $use_timeout_based_endpointing = false; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type int $speech_model_variant + * The speech model used in speech to text. + * `SPEECH_MODEL_VARIANT_UNSPECIFIED`, `USE_BEST_AVAILABLE` will be treated as + * `USE_ENHANCED`. It can be overridden in + * [AnalyzeContentRequest][google.cloud.dialogflow.v2.AnalyzeContentRequest] + * and + * [StreamingAnalyzeContentRequest][google.cloud.dialogflow.v2.StreamingAnalyzeContentRequest] + * request. If enhanced model variant is specified and an enhanced version of + * the specified model for the language does not exist, then it would emit an + * error. + * @type string $model + * Which Speech model to select. Select the + * model best suited to your domain to get best results. If a model is not + * explicitly specified, then Dialogflow auto-selects a model based on other + * parameters in the SpeechToTextConfig and Agent settings. + * If enhanced speech model is enabled for the agent and an enhanced + * version of the specified model for the language does not exist, then the + * speech is recognized using the standard version of the specified model. + * Refer to + * [Cloud Speech API + * documentation](https://cloud.google.com/speech-to-text/docs/basics#select-model) + * for more details. + * If you specify a model, the following models typically have the best + * performance: + * - phone_call (best for Agent Assist and telephony) + * - latest_short (best for Dialogflow non-telephony) + * - command_and_search + * Leave this field unspecified to use + * [Agent Speech + * settings](https://cloud.google.com/dialogflow/cx/docs/concept/agent#settings-speech) + * for model selection. + * @type int $audio_encoding + * Audio encoding of the audio content to process. + * @type int $sample_rate_hertz + * Sample rate (in Hertz) of the audio content sent in the query. + * Refer to [Cloud Speech API + * documentation](https://cloud.google.com/speech-to-text/docs/basics) for + * more details. + * @type string $language_code + * The language of the supplied audio. Dialogflow does not do + * translations. See [Language + * Support](https://cloud.google.com/dialogflow/docs/reference/language) + * for a list of the currently supported language codes. Note that queries in + * the same session do not necessarily need to specify the same language. + * @type bool $enable_word_info + * If `true`, Dialogflow returns + * [SpeechWordInfo][google.cloud.dialogflow.v2.SpeechWordInfo] in + * [StreamingRecognitionResult][google.cloud.dialogflow.v2.StreamingRecognitionResult] + * with information about the recognized speech words, e.g. start and end time + * offsets. If false or unspecified, Speech doesn't return any word-level + * information. + * @type bool $use_timeout_based_endpointing + * Use timeout based endpointing, interpreting endpointer sensitivy as + * seconds of timeout value. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\AudioConfig::initOnce(); + parent::__construct($data); + } + + /** + * The speech model used in speech to text. + * `SPEECH_MODEL_VARIANT_UNSPECIFIED`, `USE_BEST_AVAILABLE` will be treated as + * `USE_ENHANCED`. It can be overridden in + * [AnalyzeContentRequest][google.cloud.dialogflow.v2.AnalyzeContentRequest] + * and + * [StreamingAnalyzeContentRequest][google.cloud.dialogflow.v2.StreamingAnalyzeContentRequest] + * request. If enhanced model variant is specified and an enhanced version of + * the specified model for the language does not exist, then it would emit an + * error. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.SpeechModelVariant speech_model_variant = 1; + * @return int + */ + public function getSpeechModelVariant() + { + return $this->speech_model_variant; + } + + /** + * The speech model used in speech to text. + * `SPEECH_MODEL_VARIANT_UNSPECIFIED`, `USE_BEST_AVAILABLE` will be treated as + * `USE_ENHANCED`. It can be overridden in + * [AnalyzeContentRequest][google.cloud.dialogflow.v2.AnalyzeContentRequest] + * and + * [StreamingAnalyzeContentRequest][google.cloud.dialogflow.v2.StreamingAnalyzeContentRequest] + * request. If enhanced model variant is specified and an enhanced version of + * the specified model for the language does not exist, then it would emit an + * error. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.SpeechModelVariant speech_model_variant = 1; + * @param int $var + * @return $this + */ + public function setSpeechModelVariant($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\Dialogflow\V2\SpeechModelVariant::class); + $this->speech_model_variant = $var; + + return $this; + } + + /** + * Which Speech model to select. Select the + * model best suited to your domain to get best results. If a model is not + * explicitly specified, then Dialogflow auto-selects a model based on other + * parameters in the SpeechToTextConfig and Agent settings. + * If enhanced speech model is enabled for the agent and an enhanced + * version of the specified model for the language does not exist, then the + * speech is recognized using the standard version of the specified model. + * Refer to + * [Cloud Speech API + * documentation](https://cloud.google.com/speech-to-text/docs/basics#select-model) + * for more details. + * If you specify a model, the following models typically have the best + * performance: + * - phone_call (best for Agent Assist and telephony) + * - latest_short (best for Dialogflow non-telephony) + * - command_and_search + * Leave this field unspecified to use + * [Agent Speech + * settings](https://cloud.google.com/dialogflow/cx/docs/concept/agent#settings-speech) + * for model selection. + * + * Generated from protobuf field string model = 2; + * @return string + */ + public function getModel() + { + return $this->model; + } + + /** + * Which Speech model to select. Select the + * model best suited to your domain to get best results. If a model is not + * explicitly specified, then Dialogflow auto-selects a model based on other + * parameters in the SpeechToTextConfig and Agent settings. + * If enhanced speech model is enabled for the agent and an enhanced + * version of the specified model for the language does not exist, then the + * speech is recognized using the standard version of the specified model. + * Refer to + * [Cloud Speech API + * documentation](https://cloud.google.com/speech-to-text/docs/basics#select-model) + * for more details. + * If you specify a model, the following models typically have the best + * performance: + * - phone_call (best for Agent Assist and telephony) + * - latest_short (best for Dialogflow non-telephony) + * - command_and_search + * Leave this field unspecified to use + * [Agent Speech + * settings](https://cloud.google.com/dialogflow/cx/docs/concept/agent#settings-speech) + * for model selection. + * + * Generated from protobuf field string model = 2; + * @param string $var + * @return $this + */ + public function setModel($var) + { + GPBUtil::checkString($var, True); + $this->model = $var; + + return $this; + } + + /** + * Audio encoding of the audio content to process. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.AudioEncoding audio_encoding = 6; + * @return int + */ + public function getAudioEncoding() + { + return $this->audio_encoding; + } + + /** + * Audio encoding of the audio content to process. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.AudioEncoding audio_encoding = 6; + * @param int $var + * @return $this + */ + public function setAudioEncoding($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\Dialogflow\V2\AudioEncoding::class); + $this->audio_encoding = $var; + + return $this; + } + + /** + * Sample rate (in Hertz) of the audio content sent in the query. + * Refer to [Cloud Speech API + * documentation](https://cloud.google.com/speech-to-text/docs/basics) for + * more details. + * + * Generated from protobuf field int32 sample_rate_hertz = 7; + * @return int + */ + public function getSampleRateHertz() + { + return $this->sample_rate_hertz; + } + + /** + * Sample rate (in Hertz) of the audio content sent in the query. + * Refer to [Cloud Speech API + * documentation](https://cloud.google.com/speech-to-text/docs/basics) for + * more details. + * + * Generated from protobuf field int32 sample_rate_hertz = 7; + * @param int $var + * @return $this + */ + public function setSampleRateHertz($var) + { + GPBUtil::checkInt32($var); + $this->sample_rate_hertz = $var; + + return $this; + } + + /** + * The language of the supplied audio. Dialogflow does not do + * translations. See [Language + * Support](https://cloud.google.com/dialogflow/docs/reference/language) + * for a list of the currently supported language codes. Note that queries in + * the same session do not necessarily need to specify the same language. + * + * Generated from protobuf field string language_code = 8; + * @return string + */ + public function getLanguageCode() + { + return $this->language_code; + } + + /** + * The language of the supplied audio. Dialogflow does not do + * translations. See [Language + * Support](https://cloud.google.com/dialogflow/docs/reference/language) + * for a list of the currently supported language codes. Note that queries in + * the same session do not necessarily need to specify the same language. + * + * Generated from protobuf field string language_code = 8; + * @param string $var + * @return $this + */ + public function setLanguageCode($var) + { + GPBUtil::checkString($var, True); + $this->language_code = $var; + + return $this; + } + + /** + * If `true`, Dialogflow returns + * [SpeechWordInfo][google.cloud.dialogflow.v2.SpeechWordInfo] in + * [StreamingRecognitionResult][google.cloud.dialogflow.v2.StreamingRecognitionResult] + * with information about the recognized speech words, e.g. start and end time + * offsets. If false or unspecified, Speech doesn't return any word-level + * information. + * + * Generated from protobuf field bool enable_word_info = 9; + * @return bool + */ + public function getEnableWordInfo() + { + return $this->enable_word_info; + } + + /** + * If `true`, Dialogflow returns + * [SpeechWordInfo][google.cloud.dialogflow.v2.SpeechWordInfo] in + * [StreamingRecognitionResult][google.cloud.dialogflow.v2.StreamingRecognitionResult] + * with information about the recognized speech words, e.g. start and end time + * offsets. If false or unspecified, Speech doesn't return any word-level + * information. + * + * Generated from protobuf field bool enable_word_info = 9; + * @param bool $var + * @return $this + */ + public function setEnableWordInfo($var) + { + GPBUtil::checkBool($var); + $this->enable_word_info = $var; + + return $this; + } + + /** + * Use timeout based endpointing, interpreting endpointer sensitivy as + * seconds of timeout value. + * + * Generated from protobuf field bool use_timeout_based_endpointing = 11; + * @return bool + */ + public function getUseTimeoutBasedEndpointing() + { + return $this->use_timeout_based_endpointing; + } + + /** + * Use timeout based endpointing, interpreting endpointer sensitivy as + * seconds of timeout value. + * + * Generated from protobuf field bool use_timeout_based_endpointing = 11; + * @param bool $var + * @return $this + */ + public function setUseTimeoutBasedEndpointing($var) + { + GPBUtil::checkBool($var); + $this->use_timeout_based_endpointing = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/SpeechWordInfo.php b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/SpeechWordInfo.php new file mode 100644 index 000000000000..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..7861bbaeedd2 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/StreamingAnalyzeContentRequest.php @@ -0,0 +1,693 @@ +google.cloud.dialogflow.v2.StreamingAnalyzeContentRequest + */ +class StreamingAnalyzeContentRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The name of the participant this text comes from. + * Format: `projects//locations//conversations//participants/`. + * + * Generated from protobuf field string participant = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $participant = ''; + /** + * Speech synthesis configuration. + * The speech synthesis settings for a virtual agent that may be configured + * for the associated conversation profile are not used when calling + * StreamingAnalyzeContent. If this configuration is not supplied, speech + * synthesis is disabled. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.OutputAudioConfig reply_audio_config = 4; + */ + protected $reply_audio_config = null; + /** + * Parameters for a Dialogflow virtual-agent query. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.QueryParameters query_params = 7; + */ + protected $query_params = null; + /** + * Parameters for a human assist query. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.AssistQueryParameters assist_query_params = 8; + */ + protected $assist_query_params = null; + /** + * Additional parameters to be put into Dialogflow CX session parameters. To + * remove a parameter from the session, clients should explicitly set the + * parameter value to null. + * Note: this field should only be used if you are connecting to a Dialogflow + * CX agent. + * + * Generated from protobuf field .google.protobuf.Struct cx_parameters = 13; + */ + protected $cx_parameters = null; + /** + * Optional. Enable full bidirectional streaming. You can keep streaming the + * audio until timeout, and there's no need to half close the stream to get + * the response. + * Restrictions: + * - Timeout: 3 mins. + * - Audio Encoding: only supports + * [AudioEncoding.AUDIO_ENCODING_LINEAR_16][google.cloud.dialogflow.v2.AudioEncoding.AUDIO_ENCODING_LINEAR_16] + * and + * [AudioEncoding.AUDIO_ENCODING_MULAW][google.cloud.dialogflow.v2.AudioEncoding.AUDIO_ENCODING_MULAW] + * - Lifecycle: conversation should be in `Assist Stage`, go to + * [Conversation.CreateConversation][] for more information. + * InvalidArgument Error will be returned if the one of restriction checks + * failed. + * You can find more details in + * https://cloud.google.com/agent-assist/docs/extended-streaming + * + * Generated from protobuf field bool enable_extended_streaming = 11 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $enable_extended_streaming = false; + /** + * 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, and would cancel the speech recognition if any ongoing. + * @type \Google\Cloud\Dialogflow\V2\TelephonyDtmfEvents $input_dtmf + * The DTMF digits used to invoke intent and fill in parameter value. + * This input is ignored if the previous response indicated that DTMF input + * is not accepted. + * @type \Google\Cloud\Dialogflow\V2\QueryParameters $query_params + * Parameters for a Dialogflow virtual-agent query. + * @type \Google\Cloud\Dialogflow\V2\AssistQueryParameters $assist_query_params + * Parameters for a human assist query. + * @type \Google\Protobuf\Struct $cx_parameters + * Additional parameters to be put into Dialogflow CX session parameters. To + * remove a parameter from the session, clients should explicitly set the + * parameter value to null. + * Note: this field should only be used if you are connecting to a Dialogflow + * CX agent. + * @type bool $enable_extended_streaming + * Optional. Enable full bidirectional streaming. You can keep streaming the + * audio until timeout, and there's no need to half close the stream to get + * the response. + * Restrictions: + * - Timeout: 3 mins. + * - Audio Encoding: only supports + * [AudioEncoding.AUDIO_ENCODING_LINEAR_16][google.cloud.dialogflow.v2.AudioEncoding.AUDIO_ENCODING_LINEAR_16] + * and + * [AudioEncoding.AUDIO_ENCODING_MULAW][google.cloud.dialogflow.v2.AudioEncoding.AUDIO_ENCODING_MULAW] + * - Lifecycle: conversation should be in `Assist Stage`, go to + * [Conversation.CreateConversation][] for more information. + * InvalidArgument Error will be returned if the one of restriction checks + * failed. + * You can find more details in + * https://cloud.google.com/agent-assist/docs/extended-streaming + * @type bool $enable_partial_automated_agent_reply + * 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, and would cancel the speech recognition if any ongoing. + * + * Generated from protobuf field string input_text = 6; + * @return string + */ + public function getInputText() + { + return $this->readOneof(6); + } + + public function hasInputText() + { + return $this->hasOneof(6); + } + + /** + * The UTF-8 encoded natural language text to be processed. Must be sent if + * `text_config` is set in the first message. Text length must not exceed + * 256 bytes for virtual agent interactions. The `input_text` field can be + * only sent once, and would cancel the speech recognition if any ongoing. + * + * Generated from protobuf field string input_text = 6; + * @param string $var + * @return $this + */ + public function setInputText($var) + { + GPBUtil::checkString($var, True); + $this->writeOneof(6, $var); + + return $this; + } + + /** + * The DTMF digits used to invoke intent and fill in parameter value. + * This input is ignored if the previous response indicated that DTMF input + * is not accepted. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.TelephonyDtmfEvents input_dtmf = 9; + * @return \Google\Cloud\Dialogflow\V2\TelephonyDtmfEvents|null + */ + public function getInputDtmf() + { + return $this->readOneof(9); + } + + public function hasInputDtmf() + { + return $this->hasOneof(9); + } + + /** + * The DTMF digits used to invoke intent and fill in parameter value. + * This input is ignored if the previous response indicated that DTMF input + * is not accepted. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.TelephonyDtmfEvents input_dtmf = 9; + * @param \Google\Cloud\Dialogflow\V2\TelephonyDtmfEvents $var + * @return $this + */ + public function setInputDtmf($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Dialogflow\V2\TelephonyDtmfEvents::class); + $this->writeOneof(9, $var); + + return $this; + } + + /** + * Parameters for a Dialogflow virtual-agent query. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.QueryParameters query_params = 7; + * @return \Google\Cloud\Dialogflow\V2\QueryParameters|null + */ + public function getQueryParams() + { + return $this->query_params; + } + + public function hasQueryParams() + { + return isset($this->query_params); + } + + public function clearQueryParams() + { + unset($this->query_params); + } + + /** + * Parameters for a Dialogflow virtual-agent query. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.QueryParameters query_params = 7; + * @param \Google\Cloud\Dialogflow\V2\QueryParameters $var + * @return $this + */ + public function setQueryParams($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Dialogflow\V2\QueryParameters::class); + $this->query_params = $var; + + return $this; + } + + /** + * Parameters for a human assist query. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.AssistQueryParameters assist_query_params = 8; + * @return \Google\Cloud\Dialogflow\V2\AssistQueryParameters|null + */ + public function getAssistQueryParams() + { + return $this->assist_query_params; + } + + public function hasAssistQueryParams() + { + return isset($this->assist_query_params); + } + + public function clearAssistQueryParams() + { + unset($this->assist_query_params); + } + + /** + * Parameters for a human assist query. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.AssistQueryParameters assist_query_params = 8; + * @param \Google\Cloud\Dialogflow\V2\AssistQueryParameters $var + * @return $this + */ + public function setAssistQueryParams($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Dialogflow\V2\AssistQueryParameters::class); + $this->assist_query_params = $var; + + return $this; + } + + /** + * Additional parameters to be put into Dialogflow CX session parameters. To + * remove a parameter from the session, clients should explicitly set the + * parameter value to null. + * Note: this field should only be used if you are connecting to a Dialogflow + * CX agent. + * + * Generated from protobuf field .google.protobuf.Struct cx_parameters = 13; + * @return \Google\Protobuf\Struct|null + */ + public function getCxParameters() + { + return $this->cx_parameters; + } + + public function hasCxParameters() + { + return isset($this->cx_parameters); + } + + public function clearCxParameters() + { + unset($this->cx_parameters); + } + + /** + * Additional parameters to be put into Dialogflow CX session parameters. To + * remove a parameter from the session, clients should explicitly set the + * parameter value to null. + * Note: this field should only be used if you are connecting to a Dialogflow + * CX agent. + * + * Generated from protobuf field .google.protobuf.Struct cx_parameters = 13; + * @param \Google\Protobuf\Struct $var + * @return $this + */ + public function setCxParameters($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Struct::class); + $this->cx_parameters = $var; + + return $this; + } + + /** + * Optional. Enable full bidirectional streaming. You can keep streaming the + * audio until timeout, and there's no need to half close the stream to get + * the response. + * Restrictions: + * - Timeout: 3 mins. + * - Audio Encoding: only supports + * [AudioEncoding.AUDIO_ENCODING_LINEAR_16][google.cloud.dialogflow.v2.AudioEncoding.AUDIO_ENCODING_LINEAR_16] + * and + * [AudioEncoding.AUDIO_ENCODING_MULAW][google.cloud.dialogflow.v2.AudioEncoding.AUDIO_ENCODING_MULAW] + * - Lifecycle: conversation should be in `Assist Stage`, go to + * [Conversation.CreateConversation][] for more information. + * InvalidArgument Error will be returned if the one of restriction checks + * failed. + * You can find more details in + * https://cloud.google.com/agent-assist/docs/extended-streaming + * + * Generated from protobuf field bool enable_extended_streaming = 11 [(.google.api.field_behavior) = OPTIONAL]; + * @return bool + */ + public function getEnableExtendedStreaming() + { + return $this->enable_extended_streaming; + } + + /** + * Optional. Enable full bidirectional streaming. You can keep streaming the + * audio until timeout, and there's no need to half close the stream to get + * the response. + * Restrictions: + * - Timeout: 3 mins. + * - Audio Encoding: only supports + * [AudioEncoding.AUDIO_ENCODING_LINEAR_16][google.cloud.dialogflow.v2.AudioEncoding.AUDIO_ENCODING_LINEAR_16] + * and + * [AudioEncoding.AUDIO_ENCODING_MULAW][google.cloud.dialogflow.v2.AudioEncoding.AUDIO_ENCODING_MULAW] + * - Lifecycle: conversation should be in `Assist Stage`, go to + * [Conversation.CreateConversation][] for more information. + * InvalidArgument Error will be returned if the one of restriction checks + * failed. + * You can find more details in + * https://cloud.google.com/agent-assist/docs/extended-streaming + * + * Generated from protobuf field bool enable_extended_streaming = 11 [(.google.api.field_behavior) = OPTIONAL]; + * @param bool $var + * @return $this + */ + public function setEnableExtendedStreaming($var) + { + GPBUtil::checkBool($var); + $this->enable_extended_streaming = $var; + + return $this; + } + + /** + * 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..344d25b5d757 --- /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..44445567a3c9 --- /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; + /** + * This event indicates that the server has detected the end of the user's + * speech utterance and expects no additional inputs. + * Therefore, the server will not process additional audio (although it may + * subsequently return additional results). The client should stop sending + * additional audio data, half-close the gRPC connection, and wait for any + * additional results until the server closes the gRPC connection. This + * message is only sent if `single_utterance` was set to `true`, and is not + * used otherwise. + * + * Generated from protobuf enum END_OF_SINGLE_UTTERANCE = 2; + */ + const END_OF_SINGLE_UTTERANCE = 2; + + private static $valueToName = [ + self::MESSAGE_TYPE_UNSPECIFIED => 'MESSAGE_TYPE_UNSPECIFIED', + self::TRANSCRIPT => 'TRANSCRIPT', + self::END_OF_SINGLE_UTTERANCE => 'END_OF_SINGLE_UTTERANCE', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + +// 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..e648058b21e6 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/SuggestConversationSummaryRequest.php @@ -0,0 +1,232 @@ +google.cloud.dialogflow.v2.SuggestConversationSummaryRequest + */ +class SuggestConversationSummaryRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The conversation to fetch suggestion for. + * Format: `projects//locations//conversations/`. + * + * Generated from protobuf field string conversation = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $conversation = ''; + /** + * Optional. The name of the latest conversation message used as context for + * compiling suggestion. If empty, the latest message of the conversation will + * be used. + * Format: `projects//locations//conversations//messages/`. + * + * Generated from protobuf field string latest_message = 3 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { + */ + protected $latest_message = ''; + /** + * Optional. Max number of messages prior to and including + * [latest_message] to use as context when compiling the + * suggestion. By default 500 and at most 1000. + * + * Generated from protobuf field int32 context_size = 4 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $context_size = 0; + /** + * Optional. Parameters for a human assist query. Only used for POC/demo + * purpose. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.AssistQueryParameters assist_query_params = 5 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $assist_query_params = null; + + /** + * @param string $conversation Required. The conversation to fetch suggestion for. + * Format: `projects//locations//conversations/`. Please see + * {@see ConversationsClient::conversationName()} for help formatting this field. + * + * @return \Google\Cloud\Dialogflow\V2\SuggestConversationSummaryRequest + * + * @experimental + */ + public static function build(string $conversation): self + { + return (new self()) + ->setConversation($conversation); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $conversation + * Required. The conversation to fetch suggestion for. + * Format: `projects//locations//conversations/`. + * @type string $latest_message + * Optional. The name of the latest conversation message used as context for + * compiling suggestion. If empty, the latest message of the conversation will + * be used. + * Format: `projects//locations//conversations//messages/`. + * @type int $context_size + * Optional. Max number of messages prior to and including + * [latest_message] to use as context when compiling the + * suggestion. By default 500 and at most 1000. + * @type \Google\Cloud\Dialogflow\V2\AssistQueryParameters $assist_query_params + * Optional. Parameters for a human assist query. Only used for POC/demo + * purpose. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\Conversation::initOnce(); + parent::__construct($data); + } + + /** + * Required. The conversation to fetch suggestion for. + * Format: `projects//locations//conversations/`. + * + * Generated from protobuf field string conversation = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getConversation() + { + return $this->conversation; + } + + /** + * Required. The conversation to fetch suggestion for. + * Format: `projects//locations//conversations/`. + * + * Generated from protobuf field string conversation = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setConversation($var) + { + GPBUtil::checkString($var, True); + $this->conversation = $var; + + return $this; + } + + /** + * Optional. The name of the latest conversation message used as context for + * compiling suggestion. If empty, the latest message of the conversation will + * be used. + * Format: `projects//locations//conversations//messages/`. + * + * Generated from protobuf field string latest_message = 3 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { + * @return string + */ + public function getLatestMessage() + { + return $this->latest_message; + } + + /** + * Optional. The name of the latest conversation message used as context for + * compiling suggestion. If empty, the latest message of the conversation will + * be used. + * Format: `projects//locations//conversations//messages/`. + * + * Generated from protobuf field string latest_message = 3 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setLatestMessage($var) + { + GPBUtil::checkString($var, True); + $this->latest_message = $var; + + return $this; + } + + /** + * Optional. Max number of messages prior to and including + * [latest_message] to use as context when compiling the + * suggestion. By default 500 and at most 1000. + * + * Generated from protobuf field int32 context_size = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @return int + */ + public function getContextSize() + { + return $this->context_size; + } + + /** + * Optional. Max number of messages prior to and including + * [latest_message] to use as context when compiling the + * suggestion. By default 500 and at most 1000. + * + * Generated from protobuf field int32 context_size = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @param int $var + * @return $this + */ + public function setContextSize($var) + { + GPBUtil::checkInt32($var); + $this->context_size = $var; + + return $this; + } + + /** + * Optional. Parameters for a human assist query. Only used for POC/demo + * purpose. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.AssistQueryParameters assist_query_params = 5 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Cloud\Dialogflow\V2\AssistQueryParameters|null + */ + public function getAssistQueryParams() + { + return $this->assist_query_params; + } + + public function hasAssistQueryParams() + { + return isset($this->assist_query_params); + } + + public function clearAssistQueryParams() + { + unset($this->assist_query_params); + } + + /** + * Optional. Parameters for a human assist query. Only used for POC/demo + * purpose. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.AssistQueryParameters assist_query_params = 5 [(.google.api.field_behavior) = OPTIONAL]; + * @param \Google\Cloud\Dialogflow\V2\AssistQueryParameters $var + * @return $this + */ + public function setAssistQueryParams($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Dialogflow\V2\AssistQueryParameters::class); + $this->assist_query_params = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/SuggestConversationSummaryResponse.php b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/SuggestConversationSummaryResponse.php new file mode 100644 index 000000000000..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..eb2a074d400b --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/SuggestConversationSummaryResponse/Summary.php @@ -0,0 +1,188 @@ +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 = ''; + /** + * The baseline model version used to generate this summary. It is empty if + * a baseline model was not used to generate this summary. + * + * Generated from protobuf field string baseline_model_version = 5; + */ + protected $baseline_model_version = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $text + * The summary content that is concatenated into one string. + * @type array|\Google\Protobuf\Internal\MapField $text_sections + * The summary content that is divided into sections. The key is the + * section's name and the value is the section's content. There is no + * specific format for the key or value. + * @type string $answer_record + * The name of the answer record. Format: + * "projects//answerRecords/" + * @type string $baseline_model_version + * The baseline model version used to generate this summary. It is empty if + * a baseline model was not used to generate this summary. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\Conversation::initOnce(); + parent::__construct($data); + } + + /** + * The summary content that is concatenated into one string. + * + * Generated from protobuf field string text = 1; + * @return string + */ + public function getText() + { + return $this->text; + } + + /** + * The summary content that is concatenated into one string. + * + * Generated from protobuf field string text = 1; + * @param string $var + * @return $this + */ + public function setText($var) + { + GPBUtil::checkString($var, True); + $this->text = $var; + + return $this; + } + + /** + * The summary content that is divided into sections. The key is the + * section's name and the value is the section's content. There is no + * specific format for the key or value. + * + * Generated from protobuf field map text_sections = 4; + * @return \Google\Protobuf\Internal\MapField + */ + public function getTextSections() + { + return $this->text_sections; + } + + /** + * The summary content that is divided into sections. The key is the + * section's name and the value is the section's content. There is no + * specific format for the key or value. + * + * Generated from protobuf field map text_sections = 4; + * @param array|\Google\Protobuf\Internal\MapField $var + * @return $this + */ + public function setTextSections($var) + { + $arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::STRING, \Google\Protobuf\Internal\GPBType::STRING); + $this->text_sections = $arr; + + return $this; + } + + /** + * The name of the answer record. Format: + * "projects//answerRecords/" + * + * Generated from protobuf field string answer_record = 3 [(.google.api.resource_reference) = { + * @return string + */ + public function getAnswerRecord() + { + return $this->answer_record; + } + + /** + * The name of the answer record. Format: + * "projects//answerRecords/" + * + * Generated from protobuf field string answer_record = 3 [(.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setAnswerRecord($var) + { + GPBUtil::checkString($var, True); + $this->answer_record = $var; + + return $this; + } + + /** + * The baseline model version used to generate this summary. It is empty if + * a baseline model was not used to generate this summary. + * + * Generated from protobuf field string baseline_model_version = 5; + * @return string + */ + public function getBaselineModelVersion() + { + return $this->baseline_model_version; + } + + /** + * The baseline model version used to generate this summary. It is empty if + * a baseline model was not used to generate this summary. + * + * Generated from protobuf field string baseline_model_version = 5; + * @param string $var + * @return $this + */ + public function setBaselineModelVersion($var) + { + GPBUtil::checkString($var, True); + $this->baseline_model_version = $var; + + return $this; + } + +} + +// 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/SuggestKnowledgeAssistRequest.php b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/SuggestKnowledgeAssistRequest.php new file mode 100644 index 000000000000..8cb2fed5f399 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/SuggestKnowledgeAssistRequest.php @@ -0,0 +1,214 @@ +google.cloud.dialogflow.v2.SuggestKnowledgeAssistRequest + */ +class SuggestKnowledgeAssistRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The name of the participant to fetch suggestions for. + * Format: `projects//locations//conversations//participants/`. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $parent = ''; + /** + * Optional. The name of the latest conversation message to compile + * suggestions for. If empty, it will be the latest message of the + * conversation. Format: `projects//locations//conversations//messages/`. + * + * Generated from protobuf field string latest_message = 2 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { + */ + protected $latest_message = ''; + /** + * Optional. Max number of messages prior to and including + * [latest_message][google.cloud.dialogflow.v2.SuggestKnowledgeAssistRequest.latest_message] + * to use as context when compiling the suggestion. The context size is by + * default 100 and at most 100. + * + * Generated from protobuf field int32 context_size = 3 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $context_size = 0; + /** + * Optional. The previously suggested query for the given conversation. This + * helps identify whether the next suggestion we generate is resonably + * different from the previous one. This is useful to avoid similar + * suggestions within the conversation. + * + * Generated from protobuf field string previous_suggested_query = 4 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $previous_suggested_query = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $parent + * Required. The name of the participant to fetch suggestions for. + * Format: `projects//locations//conversations//participants/`. + * @type string $latest_message + * Optional. The name of the latest conversation message to compile + * suggestions for. If empty, it will be the latest message of the + * conversation. Format: `projects//locations//conversations//messages/`. + * @type int $context_size + * Optional. Max number of messages prior to and including + * [latest_message][google.cloud.dialogflow.v2.SuggestKnowledgeAssistRequest.latest_message] + * to use as context when compiling the suggestion. The context size is by + * default 100 and at most 100. + * @type string $previous_suggested_query + * Optional. The previously suggested query for the given conversation. This + * helps identify whether the next suggestion we generate is resonably + * different from the previous one. This is useful to avoid similar + * suggestions within the conversation. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\Participant::initOnce(); + parent::__construct($data); + } + + /** + * Required. The name of the participant to fetch suggestions for. + * Format: `projects//locations//conversations//participants/`. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getParent() + { + return $this->parent; + } + + /** + * Required. The name of the participant to fetch suggestions for. + * Format: `projects//locations//conversations//participants/`. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setParent($var) + { + GPBUtil::checkString($var, True); + $this->parent = $var; + + return $this; + } + + /** + * Optional. The name of the latest conversation message to compile + * suggestions for. If empty, it will be the latest message of the + * conversation. Format: `projects//locations//conversations//messages/`. + * + * Generated from protobuf field string latest_message = 2 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { + * @return string + */ + public function getLatestMessage() + { + return $this->latest_message; + } + + /** + * Optional. The name of the latest conversation message to compile + * suggestions for. If empty, it will be the latest message of the + * conversation. Format: `projects//locations//conversations//messages/`. + * + * Generated from protobuf field string latest_message = 2 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setLatestMessage($var) + { + GPBUtil::checkString($var, True); + $this->latest_message = $var; + + return $this; + } + + /** + * Optional. Max number of messages prior to and including + * [latest_message][google.cloud.dialogflow.v2.SuggestKnowledgeAssistRequest.latest_message] + * to use as context when compiling the suggestion. The context size is by + * default 100 and at most 100. + * + * Generated from protobuf field int32 context_size = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @return int + */ + public function getContextSize() + { + return $this->context_size; + } + + /** + * Optional. Max number of messages prior to and including + * [latest_message][google.cloud.dialogflow.v2.SuggestKnowledgeAssistRequest.latest_message] + * to use as context when compiling the suggestion. The context size is by + * default 100 and at most 100. + * + * Generated from protobuf field int32 context_size = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @param int $var + * @return $this + */ + public function setContextSize($var) + { + GPBUtil::checkInt32($var); + $this->context_size = $var; + + return $this; + } + + /** + * Optional. The previously suggested query for the given conversation. This + * helps identify whether the next suggestion we generate is resonably + * different from the previous one. This is useful to avoid similar + * suggestions within the conversation. + * + * Generated from protobuf field string previous_suggested_query = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getPreviousSuggestedQuery() + { + return $this->previous_suggested_query; + } + + /** + * Optional. The previously suggested query for the given conversation. This + * helps identify whether the next suggestion we generate is resonably + * different from the previous one. This is useful to avoid similar + * suggestions within the conversation. + * + * Generated from protobuf field string previous_suggested_query = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setPreviousSuggestedQuery($var) + { + GPBUtil::checkString($var, True); + $this->previous_suggested_query = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/SuggestKnowledgeAssistResponse.php b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/SuggestKnowledgeAssistResponse.php new file mode 100644 index 000000000000..c153303cc3ef --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/SuggestKnowledgeAssistResponse.php @@ -0,0 +1,170 @@ +google.cloud.dialogflow.v2.SuggestKnowledgeAssistResponse + */ +class SuggestKnowledgeAssistResponse extends \Google\Protobuf\Internal\Message +{ + /** + * Output only. Knowledge Assist suggestion. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.KnowledgeAssistAnswer knowledge_assist_answer = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $knowledge_assist_answer = null; + /** + * The name of the latest conversation message used to compile suggestion for. + * Format: `projects//locations//conversations//messages/`. + * + * Generated from protobuf field string latest_message = 2; + */ + protected $latest_message = ''; + /** + * Number of messages prior to and including + * [latest_message][google.cloud.dialogflow.v2.SuggestKnowledgeAssistResponse.latest_message] + * to compile the suggestion. It may be smaller than the + * [SuggestKnowledgeAssistRequest.context_size][google.cloud.dialogflow.v2.SuggestKnowledgeAssistRequest.context_size] + * field in the request if there are fewer messages in the conversation. + * + * Generated from protobuf field int32 context_size = 3; + */ + protected $context_size = 0; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\Dialogflow\V2\KnowledgeAssistAnswer $knowledge_assist_answer + * Output only. Knowledge Assist suggestion. + * @type string $latest_message + * The name of the latest conversation message used to compile suggestion for. + * Format: `projects//locations//conversations//messages/`. + * @type int $context_size + * Number of messages prior to and including + * [latest_message][google.cloud.dialogflow.v2.SuggestKnowledgeAssistResponse.latest_message] + * to compile the suggestion. It may be smaller than the + * [SuggestKnowledgeAssistRequest.context_size][google.cloud.dialogflow.v2.SuggestKnowledgeAssistRequest.context_size] + * field in the request if there are fewer messages in the conversation. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\Participant::initOnce(); + parent::__construct($data); + } + + /** + * Output only. Knowledge Assist suggestion. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.KnowledgeAssistAnswer knowledge_assist_answer = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Cloud\Dialogflow\V2\KnowledgeAssistAnswer|null + */ + public function getKnowledgeAssistAnswer() + { + return $this->knowledge_assist_answer; + } + + public function hasKnowledgeAssistAnswer() + { + return isset($this->knowledge_assist_answer); + } + + public function clearKnowledgeAssistAnswer() + { + unset($this->knowledge_assist_answer); + } + + /** + * Output only. Knowledge Assist suggestion. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.KnowledgeAssistAnswer knowledge_assist_answer = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Cloud\Dialogflow\V2\KnowledgeAssistAnswer $var + * @return $this + */ + public function setKnowledgeAssistAnswer($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Dialogflow\V2\KnowledgeAssistAnswer::class); + $this->knowledge_assist_answer = $var; + + return $this; + } + + /** + * The name of the latest conversation message used to compile suggestion for. + * Format: `projects//locations//conversations//messages/`. + * + * Generated from protobuf field string latest_message = 2; + * @return string + */ + public function getLatestMessage() + { + return $this->latest_message; + } + + /** + * The name of the latest conversation message used to compile suggestion for. + * Format: `projects//locations//conversations//messages/`. + * + * Generated from protobuf field string latest_message = 2; + * @param string $var + * @return $this + */ + public function setLatestMessage($var) + { + GPBUtil::checkString($var, True); + $this->latest_message = $var; + + return $this; + } + + /** + * Number of messages prior to and including + * [latest_message][google.cloud.dialogflow.v2.SuggestKnowledgeAssistResponse.latest_message] + * to compile the suggestion. It may be smaller than the + * [SuggestKnowledgeAssistRequest.context_size][google.cloud.dialogflow.v2.SuggestKnowledgeAssistRequest.context_size] + * field in the request if there are fewer messages in the conversation. + * + * Generated from protobuf field int32 context_size = 3; + * @return int + */ + public function getContextSize() + { + return $this->context_size; + } + + /** + * Number of messages prior to and including + * [latest_message][google.cloud.dialogflow.v2.SuggestKnowledgeAssistResponse.latest_message] + * to compile the suggestion. It may be smaller than the + * [SuggestKnowledgeAssistRequest.context_size][google.cloud.dialogflow.v2.SuggestKnowledgeAssistRequest.context_size] + * field in the request if there are fewer messages in the conversation. + * + * Generated from protobuf field int32 context_size = 3; + * @param int $var + * @return $this + */ + public function setContextSize($var) + { + GPBUtil::checkInt32($var); + $this->context_size = $var; + + return $this; + } + +} + 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..eb42871c36c0 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/SuggestionFeature/Type.php @@ -0,0 +1,85 @@ +google.cloud.dialogflow.v2.SuggestionFeature.Type + */ +class Type +{ + /** + * Unspecified feature type. + * + * Generated from protobuf enum TYPE_UNSPECIFIED = 0; + */ + const TYPE_UNSPECIFIED = 0; + /** + * Run article suggestion model for chat. + * + * Generated from protobuf enum ARTICLE_SUGGESTION = 1; + */ + const ARTICLE_SUGGESTION = 1; + /** + * Run FAQ model for chat. + * + * Generated from protobuf enum FAQ = 2; + */ + const FAQ = 2; + /** + * Run smart reply model for chat. + * + * Generated from protobuf enum SMART_REPLY = 3; + */ + const SMART_REPLY = 3; + /** + * Run knowledge search with text input from agent or text generated query. + * + * Generated from protobuf enum KNOWLEDGE_SEARCH = 14; + */ + const KNOWLEDGE_SEARCH = 14; + /** + * Run knowledge assist with automatic query generation. + * + * Generated from protobuf enum KNOWLEDGE_ASSIST = 15; + */ + const KNOWLEDGE_ASSIST = 15; + + private static $valueToName = [ + self::TYPE_UNSPECIFIED => 'TYPE_UNSPECIFIED', + self::ARTICLE_SUGGESTION => 'ARTICLE_SUGGESTION', + self::FAQ => 'FAQ', + self::SMART_REPLY => 'SMART_REPLY', + self::KNOWLEDGE_SEARCH => 'KNOWLEDGE_SEARCH', + self::KNOWLEDGE_ASSIST => 'KNOWLEDGE_ASSIST', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + +// 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/SuggestionInput.php b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/SuggestionInput.php new file mode 100644 index 000000000000..bd6a71451c17 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/SuggestionInput.php @@ -0,0 +1,87 @@ +google.cloud.dialogflow.v2.SuggestionInput + */ +class SuggestionInput extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The ID of a suggestion selected by the human agent. + * The suggestion(s) were generated in a previous call to + * request Dialogflow assist. + * The format is: + * `projects//locations//answerRecords/` where is an alphanumeric string. + * + * Generated from protobuf field string answer_record = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $answer_record = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $answer_record + * Required. The ID of a suggestion selected by the human agent. + * The suggestion(s) were generated in a previous call to + * request Dialogflow assist. + * The format is: + * `projects//locations//answerRecords/` where is an alphanumeric string. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\Participant::initOnce(); + parent::__construct($data); + } + + /** + * Required. The ID of a suggestion selected by the human agent. + * The suggestion(s) were generated in a previous call to + * request Dialogflow assist. + * The format is: + * `projects//locations//answerRecords/` where is an alphanumeric string. + * + * Generated from protobuf field string answer_record = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getAnswerRecord() + { + return $this->answer_record; + } + + /** + * Required. The ID of a suggestion selected by the human agent. + * The suggestion(s) were generated in a previous call to + * request Dialogflow assist. + * The format is: + * `projects//locations//answerRecords/` where is an alphanumeric string. + * + * Generated from protobuf field string answer_record = 1 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setAnswerRecord($var) + { + GPBUtil::checkString($var, True); + $this->answer_record = $var; + + return $this; + } + +} + 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..f93ae3753a44 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/SuggestionResult.php @@ -0,0 +1,213 @@ +google.cloud.dialogflow.v2.SuggestionResult + */ +class SuggestionResult extends \Google\Protobuf\Internal\Message +{ + protected $suggestion_response; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Rpc\Status $error + * Error status if the request failed. + * @type \Google\Cloud\Dialogflow\V2\SuggestArticlesResponse $suggest_articles_response + * SuggestArticlesResponse if request is for ARTICLE_SUGGESTION. + * @type \Google\Cloud\Dialogflow\V2\SuggestKnowledgeAssistResponse $suggest_knowledge_assist_response + * SuggestKnowledgeAssistResponse if request is for KNOWLEDGE_ASSIST. + * @type \Google\Cloud\Dialogflow\V2\SuggestFaqAnswersResponse $suggest_faq_answers_response + * SuggestFaqAnswersResponse if request is for FAQ_ANSWER. + * @type \Google\Cloud\Dialogflow\V2\SuggestSmartRepliesResponse $suggest_smart_replies_response + * SuggestSmartRepliesResponse if request is for SMART_REPLY. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\Participant::initOnce(); + parent::__construct($data); + } + + /** + * Error status if the request failed. + * + * Generated from protobuf field .google.rpc.Status error = 1; + * @return \Google\Rpc\Status|null + */ + public function getError() + { + return $this->readOneof(1); + } + + public function hasError() + { + return $this->hasOneof(1); + } + + /** + * Error status if the request failed. + * + * Generated from protobuf field .google.rpc.Status error = 1; + * @param \Google\Rpc\Status $var + * @return $this + */ + public function setError($var) + { + GPBUtil::checkMessage($var, \Google\Rpc\Status::class); + $this->writeOneof(1, $var); + + return $this; + } + + /** + * SuggestArticlesResponse if request is for ARTICLE_SUGGESTION. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.SuggestArticlesResponse suggest_articles_response = 2; + * @return \Google\Cloud\Dialogflow\V2\SuggestArticlesResponse|null + */ + public function getSuggestArticlesResponse() + { + return $this->readOneof(2); + } + + public function hasSuggestArticlesResponse() + { + return $this->hasOneof(2); + } + + /** + * SuggestArticlesResponse if request is for ARTICLE_SUGGESTION. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.SuggestArticlesResponse suggest_articles_response = 2; + * @param \Google\Cloud\Dialogflow\V2\SuggestArticlesResponse $var + * @return $this + */ + public function setSuggestArticlesResponse($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Dialogflow\V2\SuggestArticlesResponse::class); + $this->writeOneof(2, $var); + + return $this; + } + + /** + * SuggestKnowledgeAssistResponse if request is for KNOWLEDGE_ASSIST. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.SuggestKnowledgeAssistResponse suggest_knowledge_assist_response = 8; + * @return \Google\Cloud\Dialogflow\V2\SuggestKnowledgeAssistResponse|null + */ + public function getSuggestKnowledgeAssistResponse() + { + return $this->readOneof(8); + } + + public function hasSuggestKnowledgeAssistResponse() + { + return $this->hasOneof(8); + } + + /** + * SuggestKnowledgeAssistResponse if request is for KNOWLEDGE_ASSIST. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.SuggestKnowledgeAssistResponse suggest_knowledge_assist_response = 8; + * @param \Google\Cloud\Dialogflow\V2\SuggestKnowledgeAssistResponse $var + * @return $this + */ + public function setSuggestKnowledgeAssistResponse($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Dialogflow\V2\SuggestKnowledgeAssistResponse::class); + $this->writeOneof(8, $var); + + return $this; + } + + /** + * SuggestFaqAnswersResponse if request is for FAQ_ANSWER. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.SuggestFaqAnswersResponse suggest_faq_answers_response = 3; + * @return \Google\Cloud\Dialogflow\V2\SuggestFaqAnswersResponse|null + */ + public function getSuggestFaqAnswersResponse() + { + return $this->readOneof(3); + } + + public function hasSuggestFaqAnswersResponse() + { + return $this->hasOneof(3); + } + + /** + * SuggestFaqAnswersResponse if request is for FAQ_ANSWER. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.SuggestFaqAnswersResponse suggest_faq_answers_response = 3; + * @param \Google\Cloud\Dialogflow\V2\SuggestFaqAnswersResponse $var + * @return $this + */ + public function setSuggestFaqAnswersResponse($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Dialogflow\V2\SuggestFaqAnswersResponse::class); + $this->writeOneof(3, $var); + + return $this; + } + + /** + * SuggestSmartRepliesResponse if request is for SMART_REPLY. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.SuggestSmartRepliesResponse suggest_smart_replies_response = 4; + * @return \Google\Cloud\Dialogflow\V2\SuggestSmartRepliesResponse|null + */ + public function getSuggestSmartRepliesResponse() + { + return $this->readOneof(4); + } + + public function hasSuggestSmartRepliesResponse() + { + return $this->hasOneof(4); + } + + /** + * SuggestSmartRepliesResponse if request is for SMART_REPLY. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.SuggestSmartRepliesResponse suggest_smart_replies_response = 4; + * @param \Google\Cloud\Dialogflow\V2\SuggestSmartRepliesResponse $var + * @return $this + */ + public function setSuggestSmartRepliesResponse($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Dialogflow\V2\SuggestSmartRepliesResponse::class); + $this->writeOneof(4, $var); + + return $this; + } + + /** + * @return string + */ + public function getSuggestionResponse() + { + return $this->whichOneof("suggestion_response"); + } + +} + diff --git a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/SummarizationContext.php b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/SummarizationContext.php new file mode 100644 index 000000000000..3b8dacc8925f --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/SummarizationContext.php @@ -0,0 +1,185 @@ +google.cloud.dialogflow.v2.SummarizationContext + */ +class SummarizationContext extends \Google\Protobuf\Internal\Message +{ + /** + * Optional. List of sections. Note it contains both predefined section sand + * customer defined sections. + * + * Generated from protobuf field repeated .google.cloud.dialogflow.v2.SummarizationSection summarization_sections = 1 [(.google.api.field_behavior) = OPTIONAL]; + */ + private $summarization_sections; + /** + * Optional. List of few shot examples. + * + * Generated from protobuf field repeated .google.cloud.dialogflow.v2.FewShotExample few_shot_examples = 2 [(.google.api.field_behavior) = OPTIONAL]; + */ + private $few_shot_examples; + /** + * Optional. Version of the feature. If not set, default to latest version. + * Current candidates are ["1.0"]. + * + * Generated from protobuf field string version = 3 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $version = ''; + /** + * Optional. The target language of the generated summary. The language code + * for conversation will be used if this field is empty. Supported 2.0 and + * later versions. + * + * Generated from protobuf field string output_language_code = 6 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $output_language_code = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array<\Google\Cloud\Dialogflow\V2\SummarizationSection>|\Google\Protobuf\Internal\RepeatedField $summarization_sections + * Optional. List of sections. Note it contains both predefined section sand + * customer defined sections. + * @type array<\Google\Cloud\Dialogflow\V2\FewShotExample>|\Google\Protobuf\Internal\RepeatedField $few_shot_examples + * Optional. List of few shot examples. + * @type string $version + * Optional. Version of the feature. If not set, default to latest version. + * Current candidates are ["1.0"]. + * @type string $output_language_code + * Optional. The target language of the generated summary. The language code + * for conversation will be used if this field is empty. Supported 2.0 and + * later versions. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\Generator::initOnce(); + parent::__construct($data); + } + + /** + * Optional. List of sections. Note it contains both predefined section sand + * customer defined sections. + * + * Generated from protobuf field repeated .google.cloud.dialogflow.v2.SummarizationSection summarization_sections = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getSummarizationSections() + { + return $this->summarization_sections; + } + + /** + * Optional. List of sections. Note it contains both predefined section sand + * customer defined sections. + * + * Generated from protobuf field repeated .google.cloud.dialogflow.v2.SummarizationSection summarization_sections = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @param array<\Google\Cloud\Dialogflow\V2\SummarizationSection>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setSummarizationSections($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Dialogflow\V2\SummarizationSection::class); + $this->summarization_sections = $arr; + + return $this; + } + + /** + * Optional. List of few shot examples. + * + * Generated from protobuf field repeated .google.cloud.dialogflow.v2.FewShotExample few_shot_examples = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getFewShotExamples() + { + return $this->few_shot_examples; + } + + /** + * Optional. List of few shot examples. + * + * Generated from protobuf field repeated .google.cloud.dialogflow.v2.FewShotExample few_shot_examples = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @param array<\Google\Cloud\Dialogflow\V2\FewShotExample>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setFewShotExamples($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Dialogflow\V2\FewShotExample::class); + $this->few_shot_examples = $arr; + + return $this; + } + + /** + * Optional. Version of the feature. If not set, default to latest version. + * Current candidates are ["1.0"]. + * + * Generated from protobuf field string version = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getVersion() + { + return $this->version; + } + + /** + * Optional. Version of the feature. If not set, default to latest version. + * Current candidates are ["1.0"]. + * + * Generated from protobuf field string version = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setVersion($var) + { + GPBUtil::checkString($var, True); + $this->version = $var; + + return $this; + } + + /** + * Optional. The target language of the generated summary. The language code + * for conversation will be used if this field is empty. Supported 2.0 and + * later versions. + * + * Generated from protobuf field string output_language_code = 6 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getOutputLanguageCode() + { + return $this->output_language_code; + } + + /** + * Optional. The target language of the generated summary. The language code + * for conversation will be used if this field is empty. Supported 2.0 and + * later versions. + * + * Generated from protobuf field string output_language_code = 6 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setOutputLanguageCode($var) + { + GPBUtil::checkString($var, True); + $this->output_language_code = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/SummarizationSection.php b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/SummarizationSection.php new file mode 100644 index 000000000000..c1ffe61abc31 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/SummarizationSection.php @@ -0,0 +1,139 @@ +google.cloud.dialogflow.v2.SummarizationSection + */ +class SummarizationSection extends \Google\Protobuf\Internal\Message +{ + /** + * Optional. Name of the section, for example, "situation". + * + * Generated from protobuf field string key = 1 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $key = ''; + /** + * Optional. Definition of the section, for example, "what the customer needs + * help with or has question about." + * + * Generated from protobuf field string definition = 2 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $definition = ''; + /** + * Optional. Type of the summarization section. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.SummarizationSection.Type type = 3 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $type = 0; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $key + * Optional. Name of the section, for example, "situation". + * @type string $definition + * Optional. Definition of the section, for example, "what the customer needs + * help with or has question about." + * @type int $type + * Optional. Type of the summarization section. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\Generator::initOnce(); + parent::__construct($data); + } + + /** + * Optional. Name of the section, for example, "situation". + * + * Generated from protobuf field string key = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getKey() + { + return $this->key; + } + + /** + * Optional. Name of the section, for example, "situation". + * + * Generated from protobuf field string key = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setKey($var) + { + GPBUtil::checkString($var, True); + $this->key = $var; + + return $this; + } + + /** + * Optional. Definition of the section, for example, "what the customer needs + * help with or has question about." + * + * Generated from protobuf field string definition = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getDefinition() + { + return $this->definition; + } + + /** + * Optional. Definition of the section, for example, "what the customer needs + * help with or has question about." + * + * Generated from protobuf field string definition = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setDefinition($var) + { + GPBUtil::checkString($var, True); + $this->definition = $var; + + return $this; + } + + /** + * Optional. Type of the summarization section. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.SummarizationSection.Type type = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @return int + */ + public function getType() + { + return $this->type; + } + + /** + * Optional. Type of the summarization section. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.SummarizationSection.Type type = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @param int $var + * @return $this + */ + public function setType($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\Dialogflow\V2\SummarizationSection\Type::class); + $this->type = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/SummarizationSection/Type.php b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/SummarizationSection/Type.php new file mode 100644 index 000000000000..ac4a0442e8f4 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/SummarizationSection/Type.php @@ -0,0 +1,109 @@ +google.cloud.dialogflow.v2.SummarizationSection.Type + */ +class Type +{ + /** + * Undefined section type, does not return anything. + * + * Generated from protobuf enum TYPE_UNSPECIFIED = 0; + */ + const TYPE_UNSPECIFIED = 0; + /** + * What the customer needs help with or has question about. + * Section name: "situation". + * + * Generated from protobuf enum SITUATION = 1; + */ + const SITUATION = 1; + /** + * What the agent does to help the customer. + * Section name: "action". + * + * Generated from protobuf enum ACTION = 2; + */ + const ACTION = 2; + /** + * Result of the customer service. A single word describing the result + * of the conversation. + * Section name: "resolution". + * + * Generated from protobuf enum RESOLUTION = 3; + */ + const RESOLUTION = 3; + /** + * Reason for cancellation if the customer requests for a cancellation. + * "N/A" otherwise. + * Section name: "reason_for_cancellation". + * + * Generated from protobuf enum REASON_FOR_CANCELLATION = 4; + */ + const REASON_FOR_CANCELLATION = 4; + /** + * "Unsatisfied" or "Satisfied" depending on the customer's feelings at + * the end of the conversation. + * Section name: "customer_satisfaction". + * + * Generated from protobuf enum CUSTOMER_SATISFACTION = 5; + */ + const CUSTOMER_SATISFACTION = 5; + /** + * Key entities extracted from the conversation, such as ticket number, + * order number, dollar amount, etc. + * Section names are prefixed by "entities/". + * + * Generated from protobuf enum ENTITIES = 6; + */ + const ENTITIES = 6; + /** + * Customer defined sections. + * + * Generated from protobuf enum CUSTOMER_DEFINED = 7; + */ + const CUSTOMER_DEFINED = 7; + + private static $valueToName = [ + self::TYPE_UNSPECIFIED => 'TYPE_UNSPECIFIED', + self::SITUATION => 'SITUATION', + self::ACTION => 'ACTION', + self::RESOLUTION => 'RESOLUTION', + self::REASON_FOR_CANCELLATION => 'REASON_FOR_CANCELLATION', + self::CUSTOMER_SATISFACTION => 'CUSTOMER_SATISFACTION', + self::ENTITIES => 'ENTITIES', + self::CUSTOMER_DEFINED => 'CUSTOMER_DEFINED', + ]; + + 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\SummarizationSection_Type::class); + diff --git a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/SummarizationSectionList.php b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/SummarizationSectionList.php new file mode 100644 index 000000000000..d565c6b7162c --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/SummarizationSectionList.php @@ -0,0 +1,67 @@ +google.cloud.dialogflow.v2.SummarizationSectionList + */ +class SummarizationSectionList extends \Google\Protobuf\Internal\Message +{ + /** + * Optional. Summarization sections. + * + * Generated from protobuf field repeated .google.cloud.dialogflow.v2.SummarizationSection summarization_sections = 1 [(.google.api.field_behavior) = OPTIONAL]; + */ + private $summarization_sections; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array<\Google\Cloud\Dialogflow\V2\SummarizationSection>|\Google\Protobuf\Internal\RepeatedField $summarization_sections + * Optional. Summarization sections. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\Generator::initOnce(); + parent::__construct($data); + } + + /** + * Optional. Summarization sections. + * + * Generated from protobuf field repeated .google.cloud.dialogflow.v2.SummarizationSection summarization_sections = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getSummarizationSections() + { + return $this->summarization_sections; + } + + /** + * Optional. Summarization sections. + * + * Generated from protobuf field repeated .google.cloud.dialogflow.v2.SummarizationSection summarization_sections = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @param array<\Google\Cloud\Dialogflow\V2\SummarizationSection>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setSummarizationSections($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Dialogflow\V2\SummarizationSection::class); + $this->summarization_sections = $arr; + + return $this; + } + +} + diff --git a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/SummarySuggestion.php b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/SummarySuggestion.php new file mode 100644 index 000000000000..592840193943 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/SummarySuggestion.php @@ -0,0 +1,67 @@ +google.cloud.dialogflow.v2.SummarySuggestion + */ +class SummarySuggestion extends \Google\Protobuf\Internal\Message +{ + /** + * Required. All the parts of generated summary. + * + * Generated from protobuf field repeated .google.cloud.dialogflow.v2.SummarySuggestion.SummarySection summary_sections = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + private $summary_sections; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array<\Google\Cloud\Dialogflow\V2\SummarySuggestion\SummarySection>|\Google\Protobuf\Internal\RepeatedField $summary_sections + * Required. All the parts of generated summary. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\Generator::initOnce(); + parent::__construct($data); + } + + /** + * Required. All the parts of generated summary. + * + * Generated from protobuf field repeated .google.cloud.dialogflow.v2.SummarySuggestion.SummarySection summary_sections = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getSummarySections() + { + return $this->summary_sections; + } + + /** + * Required. All the parts of generated summary. + * + * Generated from protobuf field repeated .google.cloud.dialogflow.v2.SummarySuggestion.SummarySection summary_sections = 1 [(.google.api.field_behavior) = REQUIRED]; + * @param array<\Google\Cloud\Dialogflow\V2\SummarySuggestion\SummarySection>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setSummarySections($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Dialogflow\V2\SummarySuggestion\SummarySection::class); + $this->summary_sections = $arr; + + return $this; + } + +} + diff --git a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/SummarySuggestion/SummarySection.php b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/SummarySuggestion/SummarySection.php new file mode 100644 index 000000000000..d6e160a2293c --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/SummarySuggestion/SummarySection.php @@ -0,0 +1,104 @@ +google.cloud.dialogflow.v2.SummarySuggestion.SummarySection + */ +class SummarySection extends \Google\Protobuf\Internal\Message +{ + /** + * Required. Name of the section. + * + * Generated from protobuf field string section = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $section = ''; + /** + * Required. Summary text for the section. + * + * Generated from protobuf field string summary = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $summary = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $section + * Required. Name of the section. + * @type string $summary + * Required. Summary text for the section. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\Generator::initOnce(); + parent::__construct($data); + } + + /** + * Required. Name of the section. + * + * Generated from protobuf field string section = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getSection() + { + return $this->section; + } + + /** + * Required. Name of the section. + * + * Generated from protobuf field string section = 1 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setSection($var) + { + GPBUtil::checkString($var, True); + $this->section = $var; + + return $this; + } + + /** + * Required. Summary text for the section. + * + * Generated from protobuf field string summary = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getSummary() + { + return $this->summary; + } + + /** + * Required. Summary text for the section. + * + * Generated from protobuf field string summary = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setSummary($var) + { + GPBUtil::checkString($var, True); + $this->summary = $var; + + return $this; + } + +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(SummarySection::class, \Google\Cloud\Dialogflow\V2\SummarySuggestion_SummarySection::class); + 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..d0507cc812f8 --- /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 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $speaking_rate = 0.0; + /** + * Optional. Speaking pitch, in the range [-20.0, 20.0]. 20 means increase 20 + * semitones from the original pitch. -20 means decrease 20 semitones from the + * original pitch. + * + * Generated from protobuf field double pitch = 2 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $pitch = 0.0; + /** + * Optional. Volume gain (in dB) of the normal native volume supported by the + * specific voice, in the range [-96.0, 16.0]. If unset, or set to a value of + * 0.0 (dB), will play at normal native signal amplitude. A value of -6.0 (dB) + * will play at approximately half the amplitude of the normal native signal + * amplitude. A value of +6.0 (dB) will play at approximately twice the + * amplitude of the normal native signal amplitude. We strongly recommend not + * to exceed +10 (dB) as there's usually no effective increase in loudness for + * any value greater than that. + * + * Generated from protobuf field double volume_gain_db = 3 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $volume_gain_db = 0.0; + /** + * Optional. An identifier which selects 'audio effects' profiles that are + * applied on (post synthesized) text to speech. Effects are applied on top of + * each other in the order they are given. + * + * Generated from protobuf field repeated string effects_profile_id = 5 [(.google.api.field_behavior) = OPTIONAL]; + */ + private $effects_profile_id; + /** + * Optional. The desired voice of the synthesized audio. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.VoiceSelectionParams voice = 4 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $voice = null; + + /** + * 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 [(.google.api.field_behavior) = OPTIONAL]; + * @return float + */ + public function getSpeakingRate() + { + return $this->speaking_rate; + } + + /** + * Optional. Speaking rate/speed, in the range [0.25, 4.0]. 1.0 is the normal + * native speed supported by the specific voice. 2.0 is twice as fast, and 0.5 + * is half as fast. If unset(0.0), defaults to the native 1.0 speed. Any other + * values < 0.25 or > 4.0 will return an error. + * + * Generated from protobuf field double speaking_rate = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @param float $var + * @return $this + */ + public function setSpeakingRate($var) + { + GPBUtil::checkDouble($var); + $this->speaking_rate = $var; + + return $this; + } + + /** + * Optional. Speaking pitch, in the range [-20.0, 20.0]. 20 means increase 20 + * semitones from the original pitch. -20 means decrease 20 semitones from the + * original pitch. + * + * Generated from protobuf field double pitch = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @return float + */ + public function getPitch() + { + return $this->pitch; + } + + /** + * Optional. Speaking pitch, in the range [-20.0, 20.0]. 20 means increase 20 + * semitones from the original pitch. -20 means decrease 20 semitones from the + * original pitch. + * + * Generated from protobuf field double pitch = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @param float $var + * @return $this + */ + public function setPitch($var) + { + GPBUtil::checkDouble($var); + $this->pitch = $var; + + return $this; + } + + /** + * Optional. Volume gain (in dB) of the normal native volume supported by the + * specific voice, in the range [-96.0, 16.0]. If unset, or set to a value of + * 0.0 (dB), will play at normal native signal amplitude. A value of -6.0 (dB) + * will play at approximately half the amplitude of the normal native signal + * amplitude. A value of +6.0 (dB) will play at approximately twice the + * amplitude of the normal native signal amplitude. We strongly recommend not + * to exceed +10 (dB) as there's usually no effective increase in loudness for + * any value greater than that. + * + * Generated from protobuf field double volume_gain_db = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @return float + */ + public function getVolumeGainDb() + { + return $this->volume_gain_db; + } + + /** + * Optional. Volume gain (in dB) of the normal native volume supported by the + * specific voice, in the range [-96.0, 16.0]. If unset, or set to a value of + * 0.0 (dB), will play at normal native signal amplitude. A value of -6.0 (dB) + * will play at approximately half the amplitude of the normal native signal + * amplitude. A value of +6.0 (dB) will play at approximately twice the + * amplitude of the normal native signal amplitude. We strongly recommend not + * to exceed +10 (dB) as there's usually no effective increase in loudness for + * any value greater than that. + * + * Generated from protobuf field double volume_gain_db = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @param float $var + * @return $this + */ + public function setVolumeGainDb($var) + { + GPBUtil::checkDouble($var); + $this->volume_gain_db = $var; + + return $this; + } + + /** + * Optional. An identifier which selects 'audio effects' profiles that are + * applied on (post synthesized) text to speech. Effects are applied on top of + * each other in the order they are given. + * + * Generated from protobuf field repeated string effects_profile_id = 5 [(.google.api.field_behavior) = OPTIONAL]; + * @return \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 [(.google.api.field_behavior) = OPTIONAL]; + * @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 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Cloud\Dialogflow\V2\VoiceSelectionParams|null + */ + public function getVoice() + { + return $this->voice; + } + + public function hasVoice() + { + return isset($this->voice); + } + + public function clearVoice() + { + unset($this->voice); + } + + /** + * Optional. The desired voice of the synthesized audio. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.VoiceSelectionParams voice = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @param \Google\Cloud\Dialogflow\V2\VoiceSelectionParams $var + * @return $this + */ + public function setVoice($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Dialogflow\V2\VoiceSelectionParams::class); + $this->voice = $var; + + return $this; + } + +} + 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..601c8942c1d8 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/TextInput.php @@ -0,0 +1,118 @@ +google.cloud.dialogflow.v2.TextInput + */ +class TextInput extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The UTF-8 encoded natural language text to be processed. + * Text length must not exceed 256 characters for virtual agent interactions. + * + * Generated from protobuf field string text = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $text = ''; + /** + * Required. The language of this conversational query. See [Language + * Support](https://cloud.google.com/dialogflow/docs/reference/language) + * for a list of the currently supported language codes. Note that queries in + * the same session do not necessarily need to specify the same language. + * + * Generated from protobuf field string language_code = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $language_code = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $text + * Required. The UTF-8 encoded natural language text to be processed. + * Text length must not exceed 256 characters for virtual agent interactions. + * @type string $language_code + * Required. The language of this conversational query. See [Language + * Support](https://cloud.google.com/dialogflow/docs/reference/language) + * for a list of the currently supported language codes. Note that queries in + * the same session do not necessarily need to specify the same language. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\Session::initOnce(); + parent::__construct($data); + } + + /** + * Required. The UTF-8 encoded natural language text to be processed. + * Text length must not exceed 256 characters for virtual agent interactions. + * + * Generated from protobuf field string text = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getText() + { + return $this->text; + } + + /** + * Required. The UTF-8 encoded natural language text to be processed. + * Text length must not exceed 256 characters for virtual agent interactions. + * + * Generated from protobuf field string text = 1 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setText($var) + { + GPBUtil::checkString($var, True); + $this->text = $var; + + return $this; + } + + /** + * Required. The language of this conversational query. See [Language + * Support](https://cloud.google.com/dialogflow/docs/reference/language) + * for a list of the currently supported language codes. Note that queries in + * the same session do not necessarily need to specify the same language. + * + * Generated from protobuf field string language_code = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getLanguageCode() + { + return $this->language_code; + } + + /** + * Required. The language of this conversational query. See [Language + * Support](https://cloud.google.com/dialogflow/docs/reference/language) + * for a list of the currently supported language codes. Note that queries in + * the same session do not necessarily need to specify the same language. + * + * Generated from protobuf field string language_code = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setLanguageCode($var) + { + GPBUtil::checkString($var, True); + $this->language_code = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/TextToSpeechSettings.php b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/TextToSpeechSettings.php new file mode 100644 index 000000000000..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/TriggerEvent.php b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/TriggerEvent.php new file mode 100644 index 000000000000..a26516d38a48 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/TriggerEvent.php @@ -0,0 +1,63 @@ +google.cloud.dialogflow.v2.TriggerEvent + */ +class TriggerEvent +{ + /** + * Default value for TriggerEvent. + * + * Generated from protobuf enum TRIGGER_EVENT_UNSPECIFIED = 0; + */ + const TRIGGER_EVENT_UNSPECIFIED = 0; + /** + * Triggers when each chat message or voice utterance ends. + * + * Generated from protobuf enum END_OF_UTTERANCE = 1; + */ + const END_OF_UTTERANCE = 1; + /** + * Triggers on the conversation manually by API calls, such as + * Conversations.GenerateStatelessSuggestion and + * Conversations.GenerateSuggestions. + * + * Generated from protobuf enum MANUAL_CALL = 2; + */ + const MANUAL_CALL = 2; + + private static $valueToName = [ + self::TRIGGER_EVENT_UNSPECIFIED => 'TRIGGER_EVENT_UNSPECIFIED', + self::END_OF_UTTERANCE => 'END_OF_UTTERANCE', + self::MANUAL_CALL => 'MANUAL_CALL', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + diff --git a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/UndeployConversationModelOperationMetadata.php b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/UndeployConversationModelOperationMetadata.php new file mode 100644 index 000000000000..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/UpdateGeneratorRequest.php b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/UpdateGeneratorRequest.php new file mode 100644 index 000000000000..583853e7d6e8 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/UpdateGeneratorRequest.php @@ -0,0 +1,141 @@ +google.cloud.dialogflow.v2.UpdateGeneratorRequest + */ +class UpdateGeneratorRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The generator to update. + * The name field of generator is to identify the generator to update. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.Generator generator = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $generator = null; + /** + * Optional. The list of fields to update. + * + * Generated from protobuf field .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $update_mask = null; + + /** + * @param \Google\Cloud\Dialogflow\V2\Generator $generator Required. The generator to update. + * The name field of generator is to identify the generator to update. + * @param \Google\Protobuf\FieldMask $updateMask Optional. The list of fields to update. + * + * @return \Google\Cloud\Dialogflow\V2\UpdateGeneratorRequest + * + * @experimental + */ + public static function build(\Google\Cloud\Dialogflow\V2\Generator $generator, \Google\Protobuf\FieldMask $updateMask): self + { + return (new self()) + ->setGenerator($generator) + ->setUpdateMask($updateMask); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\Dialogflow\V2\Generator $generator + * Required. The generator to update. + * The name field of generator is to identify the generator to update. + * @type \Google\Protobuf\FieldMask $update_mask + * Optional. The list of fields to update. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\Generator::initOnce(); + parent::__construct($data); + } + + /** + * Required. The generator to update. + * The name field of generator is to identify the generator to update. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.Generator generator = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\Dialogflow\V2\Generator|null + */ + public function getGenerator() + { + return $this->generator; + } + + public function hasGenerator() + { + return isset($this->generator); + } + + public function clearGenerator() + { + unset($this->generator); + } + + /** + * Required. The generator to update. + * The name field of generator is to identify the generator to update. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.Generator generator = 1 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\Dialogflow\V2\Generator $var + * @return $this + */ + public function setGenerator($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Dialogflow\V2\Generator::class); + $this->generator = $var; + + return $this; + } + + /** + * Optional. The list of fields to update. + * + * Generated from protobuf field .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Protobuf\FieldMask|null + */ + public function getUpdateMask() + { + return $this->update_mask; + } + + public function hasUpdateMask() + { + return isset($this->update_mask); + } + + public function clearUpdateMask() + { + unset($this->update_mask); + } + + /** + * Optional. The list of fields to update. + * + * Generated from protobuf field .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @param \Google\Protobuf\FieldMask $var + * @return $this + */ + public function setUpdateMask($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\FieldMask::class); + $this->update_mask = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/UpdateIntentRequest.php b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/UpdateIntentRequest.php new file mode 100644 index 000000000000..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..77f102d74f74 --- /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..cf034643bb4b --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/VoiceSelectionParams.php @@ -0,0 +1,129 @@ +google.cloud.dialogflow.v2.VoiceSelectionParams + */ +class VoiceSelectionParams extends \Google\Protobuf\Internal\Message +{ + /** + * Optional. The name of the voice. If not set, the service will choose a + * voice based on the other parameters such as language_code and + * [ssml_gender][google.cloud.dialogflow.v2.VoiceSelectionParams.ssml_gender]. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $name = ''; + /** + * Optional. The preferred gender of the voice. If not set, the service will + * choose a voice based on the other parameters such as language_code and + * [name][google.cloud.dialogflow.v2.VoiceSelectionParams.name]. Note that + * this is only a preference, not requirement. If a voice of the appropriate + * gender is not available, the synthesizer should substitute a voice with a + * different gender rather than failing the request. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.SsmlVoiceGender ssml_gender = 2 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $ssml_gender = 0; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Optional. The name of the voice. If not set, the service will choose a + * voice based on the other parameters such as language_code and + * [ssml_gender][google.cloud.dialogflow.v2.VoiceSelectionParams.ssml_gender]. + * @type int $ssml_gender + * Optional. The preferred gender of the voice. If not set, the service will + * choose a voice based on the other parameters such as language_code and + * [name][google.cloud.dialogflow.v2.VoiceSelectionParams.name]. Note that + * this is only a preference, not requirement. If a voice of the appropriate + * gender is not available, the synthesizer should substitute a voice with a + * different gender rather than failing the request. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dialogflow\V2\AudioConfig::initOnce(); + parent::__construct($data); + } + + /** + * Optional. The name of the voice. If not set, the service will choose a + * voice based on the other parameters such as language_code and + * [ssml_gender][google.cloud.dialogflow.v2.VoiceSelectionParams.ssml_gender]. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Optional. The name of the voice. If not set, the service will choose a + * voice based on the other parameters such as language_code and + * [ssml_gender][google.cloud.dialogflow.v2.VoiceSelectionParams.ssml_gender]. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + + /** + * Optional. The preferred gender of the voice. If not set, the service will + * choose a voice based on the other parameters such as language_code and + * [name][google.cloud.dialogflow.v2.VoiceSelectionParams.name]. Note that + * this is only a preference, not requirement. If a voice of the appropriate + * gender is not available, the synthesizer should substitute a voice with a + * different gender rather than failing the request. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.SsmlVoiceGender ssml_gender = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @return int + */ + public function getSsmlGender() + { + return $this->ssml_gender; + } + + /** + * Optional. The preferred gender of the voice. If not set, the service will + * choose a voice based on the other parameters such as language_code and + * [name][google.cloud.dialogflow.v2.VoiceSelectionParams.name]. Note that + * this is only a preference, not requirement. If a voice of the appropriate + * gender is not available, the synthesizer should substitute a voice with a + * different gender rather than failing the request. + * + * Generated from protobuf field .google.cloud.dialogflow.v2.SsmlVoiceGender ssml_gender = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @param int $var + * @return $this + */ + public function setSsmlGender($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\Dialogflow\V2\SsmlVoiceGender::class); + $this->ssml_gender = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/WebhookRequest.php b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/WebhookRequest.php new file mode 100644 index 000000000000..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..4866414090ce --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/samples/V2/AgentsClient/delete_agent.php @@ -0,0 +1,70 @@ +`. Please see + * {@see AgentsClient::projectName()} for help formatting this field. + */ +function delete_agent_sample(string $formattedParent): void +{ + // Create a client. + $agentsClient = new AgentsClient(); + + // Prepare the request message. + $request = (new DeleteAgentRequest()) + ->setParent($formattedParent); + + // Call the API and handle any network failures. + try { + $agentsClient->deleteAgent($request); + printf('Call completed successfully.' . PHP_EOL); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedParent = AgentsClient::projectName('[PROJECT]'); + + delete_agent_sample($formattedParent); +} +// [END dialogflow_v2_generated_Agents_DeleteAgent_sync] diff --git a/owl-bot-staging/Dialogflow/v2/samples/V2/AgentsClient/export_agent.php b/owl-bot-staging/Dialogflow/v2/samples/V2/AgentsClient/export_agent.php new file mode 100644 index 000000000000..40dddde24421 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/samples/V2/AgentsClient/export_agent.php @@ -0,0 +1,105 @@ +`. Please see + * {@see AgentsClient::projectName()} for help formatting this field. + * @param string $agentUri The [Google Cloud + * Storage](https://cloud.google.com/storage/docs/) URI to export the agent + * to. The format of this URI must be `gs:///`. If + * left unspecified, the serialized agent is returned inline. + * + * Dialogflow performs a write operation for the Cloud Storage object + * on the caller's behalf, so your request authentication must + * have write permissions for the object. For more information, see + * [Dialogflow access + * control](https://cloud.google.com/dialogflow/cx/docs/concept/access-control#storage). + */ +function export_agent_sample(string $formattedParent, string $agentUri): void +{ + // Create a client. + $agentsClient = new AgentsClient(); + + // Prepare the request message. + $request = (new ExportAgentRequest()) + ->setParent($formattedParent) + ->setAgentUri($agentUri); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $agentsClient->exportAgent($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + /** @var ExportAgentResponse $result */ + $result = $response->getResult(); + printf('Operation successful with response data: %s' . PHP_EOL, $result->serializeToJsonString()); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedParent = AgentsClient::projectName('[PROJECT]'); + $agentUri = '[AGENT_URI]'; + + export_agent_sample($formattedParent, $agentUri); +} +// [END dialogflow_v2_generated_Agents_ExportAgent_sync] diff --git a/owl-bot-staging/Dialogflow/v2/samples/V2/AgentsClient/get_agent.php b/owl-bot-staging/Dialogflow/v2/samples/V2/AgentsClient/get_agent.php new file mode 100644 index 000000000000..d44d6025e757 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/samples/V2/AgentsClient/get_agent.php @@ -0,0 +1,72 @@ +`. Please see + * {@see AgentsClient::projectName()} for help formatting this field. + */ +function get_agent_sample(string $formattedParent): void +{ + // Create a client. + $agentsClient = new AgentsClient(); + + // Prepare the request message. + $request = (new GetAgentRequest()) + ->setParent($formattedParent); + + // Call the API and handle any network failures. + try { + /** @var Agent $response */ + $response = $agentsClient->getAgent($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedParent = AgentsClient::projectName('[PROJECT]'); + + get_agent_sample($formattedParent); +} +// [END dialogflow_v2_generated_Agents_GetAgent_sync] diff --git a/owl-bot-staging/Dialogflow/v2/samples/V2/AgentsClient/get_location.php b/owl-bot-staging/Dialogflow/v2/samples/V2/AgentsClient/get_location.php new file mode 100644 index 000000000000..e3b46d604a20 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/samples/V2/AgentsClient/get_location.php @@ -0,0 +1,57 @@ +getLocation($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} +// [END dialogflow_v2_generated_Agents_GetLocation_sync] diff --git a/owl-bot-staging/Dialogflow/v2/samples/V2/AgentsClient/get_validation_result.php b/owl-bot-staging/Dialogflow/v2/samples/V2/AgentsClient/get_validation_result.php new file mode 100644 index 000000000000..fcd46f1e12d5 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/samples/V2/AgentsClient/get_validation_result.php @@ -0,0 +1,73 @@ +`. Please see + * {@see AgentsClient::projectName()} for help formatting this field. + */ +function get_validation_result_sample(string $formattedParent): void +{ + // Create a client. + $agentsClient = new AgentsClient(); + + // Prepare the request message. + $request = (new GetValidationResultRequest()) + ->setParent($formattedParent); + + // Call the API and handle any network failures. + try { + /** @var ValidationResult $response */ + $response = $agentsClient->getValidationResult($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedParent = AgentsClient::projectName('[PROJECT]'); + + get_validation_result_sample($formattedParent); +} +// [END dialogflow_v2_generated_Agents_GetValidationResult_sync] diff --git a/owl-bot-staging/Dialogflow/v2/samples/V2/AgentsClient/import_agent.php b/owl-bot-staging/Dialogflow/v2/samples/V2/AgentsClient/import_agent.php new file mode 100644 index 000000000000..85b9346604ea --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/samples/V2/AgentsClient/import_agent.php @@ -0,0 +1,107 @@ +`. Please see + * {@see AgentsClient::projectName()} for help formatting this field. + */ +function import_agent_sample(string $formattedParent): void +{ + // Create a client. + $agentsClient = new AgentsClient(); + + // Prepare the request message. + $request = (new ImportAgentRequest()) + ->setParent($formattedParent); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $agentsClient->importAgent($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + printf('Operation completed successfully.' . PHP_EOL); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedParent = AgentsClient::projectName('[PROJECT]'); + + import_agent_sample($formattedParent); +} +// [END dialogflow_v2_generated_Agents_ImportAgent_sync] diff --git a/owl-bot-staging/Dialogflow/v2/samples/V2/AgentsClient/list_locations.php b/owl-bot-staging/Dialogflow/v2/samples/V2/AgentsClient/list_locations.php new file mode 100644 index 000000000000..a4a72b9b3fe8 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/samples/V2/AgentsClient/list_locations.php @@ -0,0 +1,62 @@ +listLocations($request); + + /** @var Location $element */ + foreach ($response as $element) { + printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} +// [END dialogflow_v2_generated_Agents_ListLocations_sync] diff --git a/owl-bot-staging/Dialogflow/v2/samples/V2/AgentsClient/restore_agent.php b/owl-bot-staging/Dialogflow/v2/samples/V2/AgentsClient/restore_agent.php new file mode 100644 index 000000000000..ec05d8131768 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/samples/V2/AgentsClient/restore_agent.php @@ -0,0 +1,105 @@ +`. Please see + * {@see AgentsClient::projectName()} for help formatting this field. + */ +function restore_agent_sample(string $formattedParent): void +{ + // Create a client. + $agentsClient = new AgentsClient(); + + // Prepare the request message. + $request = (new RestoreAgentRequest()) + ->setParent($formattedParent); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $agentsClient->restoreAgent($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + printf('Operation completed successfully.' . PHP_EOL); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedParent = AgentsClient::projectName('[PROJECT]'); + + restore_agent_sample($formattedParent); +} +// [END dialogflow_v2_generated_Agents_RestoreAgent_sync] diff --git a/owl-bot-staging/Dialogflow/v2/samples/V2/AgentsClient/search_agents.php b/owl-bot-staging/Dialogflow/v2/samples/V2/AgentsClient/search_agents.php new file mode 100644 index 000000000000..f8566a1332b9 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/samples/V2/AgentsClient/search_agents.php @@ -0,0 +1,83 @@ +`. Please see + * {@see AgentsClient::projectName()} for help formatting this field. + */ +function search_agents_sample(string $formattedParent): void +{ + // Create a client. + $agentsClient = new AgentsClient(); + + // Prepare the request message. + $request = (new SearchAgentsRequest()) + ->setParent($formattedParent); + + // Call the API and handle any network failures. + try { + /** @var PagedListResponse $response */ + $response = $agentsClient->searchAgents($request); + + /** @var Agent $element */ + foreach ($response as $element) { + printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedParent = AgentsClient::projectName('[PROJECT]'); + + search_agents_sample($formattedParent); +} +// [END dialogflow_v2_generated_Agents_SearchAgents_sync] diff --git a/owl-bot-staging/Dialogflow/v2/samples/V2/AgentsClient/set_agent.php b/owl-bot-staging/Dialogflow/v2/samples/V2/AgentsClient/set_agent.php new file mode 100644 index 000000000000..bf1518ebc7d9 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/samples/V2/AgentsClient/set_agent.php @@ -0,0 +1,102 @@ +`. Please see + * {@see AgentsClient::projectName()} for help formatting this field. + * @param string $agentDisplayName The name of this agent. + * @param string $agentDefaultLanguageCode The default language of the agent as a language tag. See + * [Language + * Support](https://cloud.google.com/dialogflow/docs/reference/language) + * for a list of the currently supported language codes. This field cannot be + * set by the `Update` method. + * @param string $agentTimeZone The time zone of this agent from the + * [time zone database](https://www.iana.org/time-zones), e.g., + * America/New_York, Europe/Paris. + */ +function set_agent_sample( + string $formattedAgentParent, + string $agentDisplayName, + string $agentDefaultLanguageCode, + string $agentTimeZone +): void { + // Create a client. + $agentsClient = new AgentsClient(); + + // Prepare the request message. + $agent = (new Agent()) + ->setParent($formattedAgentParent) + ->setDisplayName($agentDisplayName) + ->setDefaultLanguageCode($agentDefaultLanguageCode) + ->setTimeZone($agentTimeZone); + $request = (new SetAgentRequest()) + ->setAgent($agent); + + // Call the API and handle any network failures. + try { + /** @var Agent $response */ + $response = $agentsClient->setAgent($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedAgentParent = AgentsClient::projectName('[PROJECT]'); + $agentDisplayName = '[DISPLAY_NAME]'; + $agentDefaultLanguageCode = '[DEFAULT_LANGUAGE_CODE]'; + $agentTimeZone = '[TIME_ZONE]'; + + set_agent_sample( + $formattedAgentParent, + $agentDisplayName, + $agentDefaultLanguageCode, + $agentTimeZone + ); +} +// [END dialogflow_v2_generated_Agents_SetAgent_sync] diff --git a/owl-bot-staging/Dialogflow/v2/samples/V2/AgentsClient/train_agent.php b/owl-bot-staging/Dialogflow/v2/samples/V2/AgentsClient/train_agent.php new file mode 100644 index 000000000000..2e6e02c83dd9 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/samples/V2/AgentsClient/train_agent.php @@ -0,0 +1,94 @@ +`. Please see + * {@see AgentsClient::projectName()} for help formatting this field. + */ +function train_agent_sample(string $formattedParent): void +{ + // Create a client. + $agentsClient = new AgentsClient(); + + // Prepare the request message. + $request = (new TrainAgentRequest()) + ->setParent($formattedParent); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $agentsClient->trainAgent($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + printf('Operation completed successfully.' . PHP_EOL); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedParent = AgentsClient::projectName('[PROJECT]'); + + train_agent_sample($formattedParent); +} +// [END dialogflow_v2_generated_Agents_TrainAgent_sync] diff --git a/owl-bot-staging/Dialogflow/v2/samples/V2/AnswerRecordsClient/get_location.php b/owl-bot-staging/Dialogflow/v2/samples/V2/AnswerRecordsClient/get_location.php new file mode 100644 index 000000000000..70c4576c0fa6 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/samples/V2/AnswerRecordsClient/get_location.php @@ -0,0 +1,57 @@ +getLocation($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} +// [END dialogflow_v2_generated_AnswerRecords_GetLocation_sync] diff --git a/owl-bot-staging/Dialogflow/v2/samples/V2/AnswerRecordsClient/list_answer_records.php b/owl-bot-staging/Dialogflow/v2/samples/V2/AnswerRecordsClient/list_answer_records.php new file mode 100644 index 000000000000..d95f35aa965c --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/samples/V2/AnswerRecordsClient/list_answer_records.php @@ -0,0 +1,79 @@ +/locations/`. Please see + * {@see AnswerRecordsClient::projectName()} for help formatting this field. + */ +function list_answer_records_sample(string $formattedParent): void +{ + // Create a client. + $answerRecordsClient = new AnswerRecordsClient(); + + // Prepare the request message. + $request = (new ListAnswerRecordsRequest()) + ->setParent($formattedParent); + + // Call the API and handle any network failures. + try { + /** @var PagedListResponse $response */ + $response = $answerRecordsClient->listAnswerRecords($request); + + /** @var AnswerRecord $element */ + foreach ($response as $element) { + printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedParent = AnswerRecordsClient::projectName('[PROJECT]'); + + list_answer_records_sample($formattedParent); +} +// [END dialogflow_v2_generated_AnswerRecords_ListAnswerRecords_sync] diff --git a/owl-bot-staging/Dialogflow/v2/samples/V2/AnswerRecordsClient/list_locations.php b/owl-bot-staging/Dialogflow/v2/samples/V2/AnswerRecordsClient/list_locations.php new file mode 100644 index 000000000000..cb03fe82bf84 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/samples/V2/AnswerRecordsClient/list_locations.php @@ -0,0 +1,62 @@ +listLocations($request); + + /** @var Location $element */ + foreach ($response as $element) { + printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} +// [END dialogflow_v2_generated_AnswerRecords_ListLocations_sync] diff --git a/owl-bot-staging/Dialogflow/v2/samples/V2/AnswerRecordsClient/update_answer_record.php b/owl-bot-staging/Dialogflow/v2/samples/V2/AnswerRecordsClient/update_answer_record.php new file mode 100644 index 000000000000..b9775cbec198 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/samples/V2/AnswerRecordsClient/update_answer_record.php @@ -0,0 +1,65 @@ +setAnswerFeedback($answerRecordAnswerFeedback); + $updateMask = new FieldMask(); + $request = (new UpdateAnswerRecordRequest()) + ->setAnswerRecord($answerRecord) + ->setUpdateMask($updateMask); + + // Call the API and handle any network failures. + try { + /** @var AnswerRecord $response */ + $response = $answerRecordsClient->updateAnswerRecord($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} +// [END dialogflow_v2_generated_AnswerRecords_UpdateAnswerRecord_sync] diff --git a/owl-bot-staging/Dialogflow/v2/samples/V2/ContextsClient/create_context.php b/owl-bot-staging/Dialogflow/v2/samples/V2/ContextsClient/create_context.php new file mode 100644 index 000000000000..5d2652b53362 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/samples/V2/ContextsClient/create_context.php @@ -0,0 +1,99 @@ +/agent/sessions/` or + * `projects//agent/environments//users//sessions/`. + * If `Environment ID` is not specified, we assume default 'draft' + * environment. If `User ID` is not specified, we assume default '-' user. Please see + * {@see ContextsClient::sessionName()} for help formatting this field. + * @param string $contextName The unique identifier of the context. Format: + * `projects//agent/sessions//contexts/`, + * or `projects//agent/environments//users//sessions//contexts/`. + * + * The `Context ID` is always converted to lowercase, may only contain + * characters in `a-zA-Z0-9_-%` and may be at most 250 bytes long. + * + * If `Environment ID` is not specified, we assume default 'draft' + * environment. If `User ID` is not specified, we assume default '-' user. + * + * The following context names are reserved for internal use by Dialogflow. + * You should not use these contexts or create contexts with these names: + * + * * `__system_counters__` + * * `*_id_dialog_context` + * * `*_dialog_params_size` + */ +function create_context_sample(string $formattedParent, string $contextName): void +{ + // Create a client. + $contextsClient = new ContextsClient(); + + // Prepare the request message. + $context = (new Context()) + ->setName($contextName); + $request = (new CreateContextRequest()) + ->setParent($formattedParent) + ->setContext($context); + + // Call the API and handle any network failures. + try { + /** @var Context $response */ + $response = $contextsClient->createContext($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedParent = ContextsClient::sessionName('[PROJECT]', '[SESSION]'); + $contextName = '[NAME]'; + + create_context_sample($formattedParent, $contextName); +} +// [END dialogflow_v2_generated_Contexts_CreateContext_sync] diff --git a/owl-bot-staging/Dialogflow/v2/samples/V2/ContextsClient/delete_all_contexts.php b/owl-bot-staging/Dialogflow/v2/samples/V2/ContextsClient/delete_all_contexts.php new file mode 100644 index 000000000000..b73e52474e95 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/samples/V2/ContextsClient/delete_all_contexts.php @@ -0,0 +1,74 @@ +/agent/sessions/` or `projects//agent/environments//users//sessions/`. + * If `Environment ID` is not specified we assume default 'draft' environment. + * If `User ID` is not specified, we assume default '-' user. Please see + * {@see ContextsClient::sessionName()} for help formatting this field. + */ +function delete_all_contexts_sample(string $formattedParent): void +{ + // Create a client. + $contextsClient = new ContextsClient(); + + // Prepare the request message. + $request = (new DeleteAllContextsRequest()) + ->setParent($formattedParent); + + // Call the API and handle any network failures. + try { + $contextsClient->deleteAllContexts($request); + printf('Call completed successfully.' . PHP_EOL); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedParent = ContextsClient::sessionName('[PROJECT]', '[SESSION]'); + + delete_all_contexts_sample($formattedParent); +} +// [END dialogflow_v2_generated_Contexts_DeleteAllContexts_sync] diff --git a/owl-bot-staging/Dialogflow/v2/samples/V2/ContextsClient/delete_context.php b/owl-bot-staging/Dialogflow/v2/samples/V2/ContextsClient/delete_context.php new file mode 100644 index 000000000000..c9eebb23580c --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/samples/V2/ContextsClient/delete_context.php @@ -0,0 +1,74 @@ +/agent/sessions//contexts/` + * or `projects//agent/environments//users//sessions//contexts/`. + * If `Environment ID` is not specified, we assume default 'draft' + * environment. If `User ID` is not specified, we assume default '-' user. Please see + * {@see ContextsClient::contextName()} for help formatting this field. + */ +function delete_context_sample(string $formattedName): void +{ + // Create a client. + $contextsClient = new ContextsClient(); + + // Prepare the request message. + $request = (new DeleteContextRequest()) + ->setName($formattedName); + + // Call the API and handle any network failures. + try { + $contextsClient->deleteContext($request); + printf('Call completed successfully.' . PHP_EOL); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedName = ContextsClient::contextName('[PROJECT]', '[SESSION]', '[CONTEXT]'); + + delete_context_sample($formattedName); +} +// [END dialogflow_v2_generated_Contexts_DeleteContext_sync] diff --git a/owl-bot-staging/Dialogflow/v2/samples/V2/ContextsClient/get_context.php b/owl-bot-staging/Dialogflow/v2/samples/V2/ContextsClient/get_context.php new file mode 100644 index 000000000000..a658eca64e24 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/samples/V2/ContextsClient/get_context.php @@ -0,0 +1,76 @@ +/agent/sessions//contexts/` + * or `projects//agent/environments//users//sessions//contexts/`. + * If `Environment ID` is not specified, we assume default 'draft' + * environment. If `User ID` is not specified, we assume default '-' user. Please see + * {@see ContextsClient::contextName()} for help formatting this field. + */ +function get_context_sample(string $formattedName): void +{ + // Create a client. + $contextsClient = new ContextsClient(); + + // Prepare the request message. + $request = (new GetContextRequest()) + ->setName($formattedName); + + // Call the API and handle any network failures. + try { + /** @var Context $response */ + $response = $contextsClient->getContext($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedName = ContextsClient::contextName('[PROJECT]', '[SESSION]', '[CONTEXT]'); + + get_context_sample($formattedName); +} +// [END dialogflow_v2_generated_Contexts_GetContext_sync] diff --git a/owl-bot-staging/Dialogflow/v2/samples/V2/ContextsClient/get_location.php b/owl-bot-staging/Dialogflow/v2/samples/V2/ContextsClient/get_location.php new file mode 100644 index 000000000000..346717181fa2 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/samples/V2/ContextsClient/get_location.php @@ -0,0 +1,57 @@ +getLocation($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} +// [END dialogflow_v2_generated_Contexts_GetLocation_sync] diff --git a/owl-bot-staging/Dialogflow/v2/samples/V2/ContextsClient/list_contexts.php b/owl-bot-staging/Dialogflow/v2/samples/V2/ContextsClient/list_contexts.php new file mode 100644 index 000000000000..736dc8412972 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/samples/V2/ContextsClient/list_contexts.php @@ -0,0 +1,81 @@ +/agent/sessions/` or + * `projects//agent/environments//users//sessions/`. + * If `Environment ID` is not specified, we assume default 'draft' + * environment. If `User ID` is not specified, we assume default '-' user. Please see + * {@see ContextsClient::sessionName()} for help formatting this field. + */ +function list_contexts_sample(string $formattedParent): void +{ + // Create a client. + $contextsClient = new ContextsClient(); + + // Prepare the request message. + $request = (new ListContextsRequest()) + ->setParent($formattedParent); + + // Call the API and handle any network failures. + try { + /** @var PagedListResponse $response */ + $response = $contextsClient->listContexts($request); + + /** @var Context $element */ + foreach ($response as $element) { + printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedParent = ContextsClient::sessionName('[PROJECT]', '[SESSION]'); + + list_contexts_sample($formattedParent); +} +// [END dialogflow_v2_generated_Contexts_ListContexts_sync] diff --git a/owl-bot-staging/Dialogflow/v2/samples/V2/ContextsClient/list_locations.php b/owl-bot-staging/Dialogflow/v2/samples/V2/ContextsClient/list_locations.php new file mode 100644 index 000000000000..d3359e3f5713 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/samples/V2/ContextsClient/list_locations.php @@ -0,0 +1,62 @@ +listLocations($request); + + /** @var Location $element */ + foreach ($response as $element) { + printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} +// [END dialogflow_v2_generated_Contexts_ListLocations_sync] diff --git a/owl-bot-staging/Dialogflow/v2/samples/V2/ContextsClient/update_context.php b/owl-bot-staging/Dialogflow/v2/samples/V2/ContextsClient/update_context.php new file mode 100644 index 000000000000..91568637832f --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/samples/V2/ContextsClient/update_context.php @@ -0,0 +1,88 @@ +/agent/sessions//contexts/`, + * or `projects//agent/environments//users//sessions//contexts/`. + * + * The `Context ID` is always converted to lowercase, may only contain + * characters in `a-zA-Z0-9_-%` and may be at most 250 bytes long. + * + * If `Environment ID` is not specified, we assume default 'draft' + * environment. If `User ID` is not specified, we assume default '-' user. + * + * The following context names are reserved for internal use by Dialogflow. + * You should not use these contexts or create contexts with these names: + * + * * `__system_counters__` + * * `*_id_dialog_context` + * * `*_dialog_params_size` + */ +function update_context_sample(string $contextName): void +{ + // Create a client. + $contextsClient = new ContextsClient(); + + // Prepare the request message. + $context = (new Context()) + ->setName($contextName); + $request = (new UpdateContextRequest()) + ->setContext($context); + + // Call the API and handle any network failures. + try { + /** @var Context $response */ + $response = $contextsClient->updateContext($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $contextName = '[NAME]'; + + update_context_sample($contextName); +} +// [END dialogflow_v2_generated_Contexts_UpdateContext_sync] diff --git a/owl-bot-staging/Dialogflow/v2/samples/V2/ConversationDatasetsClient/create_conversation_dataset.php b/owl-bot-staging/Dialogflow/v2/samples/V2/ConversationDatasetsClient/create_conversation_dataset.php new file mode 100644 index 000000000000..955bcf40ffd0 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/samples/V2/ConversationDatasetsClient/create_conversation_dataset.php @@ -0,0 +1,99 @@ +/locations/` + * @param string $conversationDatasetDisplayName The display name of the dataset. Maximum of 64 bytes. + */ +function create_conversation_dataset_sample( + string $parent, + string $conversationDatasetDisplayName +): void { + // Create a client. + $conversationDatasetsClient = new ConversationDatasetsClient(); + + // Prepare the request message. + $conversationDataset = (new ConversationDataset()) + ->setDisplayName($conversationDatasetDisplayName); + $request = (new CreateConversationDatasetRequest()) + ->setParent($parent) + ->setConversationDataset($conversationDataset); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $conversationDatasetsClient->createConversationDataset($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + /** @var ConversationDataset $result */ + $result = $response->getResult(); + printf('Operation successful with response data: %s' . PHP_EOL, $result->serializeToJsonString()); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $parent = '[PARENT]'; + $conversationDatasetDisplayName = '[DISPLAY_NAME]'; + + create_conversation_dataset_sample($parent, $conversationDatasetDisplayName); +} +// [END dialogflow_v2_generated_ConversationDatasets_CreateConversationDataset_sync] diff --git a/owl-bot-staging/Dialogflow/v2/samples/V2/ConversationDatasetsClient/delete_conversation_dataset.php b/owl-bot-staging/Dialogflow/v2/samples/V2/ConversationDatasetsClient/delete_conversation_dataset.php new file mode 100644 index 000000000000..8ad394a04734 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/samples/V2/ConversationDatasetsClient/delete_conversation_dataset.php @@ -0,0 +1,95 @@ +/locations//conversationDatasets/` + * Please see {@see ConversationDatasetsClient::conversationDatasetName()} for help formatting this field. + */ +function delete_conversation_dataset_sample(string $formattedName): void +{ + // Create a client. + $conversationDatasetsClient = new ConversationDatasetsClient(); + + // Prepare the request message. + $request = (new DeleteConversationDatasetRequest()) + ->setName($formattedName); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $conversationDatasetsClient->deleteConversationDataset($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + printf('Operation completed successfully.' . PHP_EOL); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedName = ConversationDatasetsClient::conversationDatasetName( + '[PROJECT]', + '[LOCATION]', + '[CONVERSATION_DATASET]' + ); + + delete_conversation_dataset_sample($formattedName); +} +// [END dialogflow_v2_generated_ConversationDatasets_DeleteConversationDataset_sync] diff --git a/owl-bot-staging/Dialogflow/v2/samples/V2/ConversationDatasetsClient/get_conversation_dataset.php b/owl-bot-staging/Dialogflow/v2/samples/V2/ConversationDatasetsClient/get_conversation_dataset.php new file mode 100644 index 000000000000..0523563c722d --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/samples/V2/ConversationDatasetsClient/get_conversation_dataset.php @@ -0,0 +1,77 @@ +/locations//conversationDatasets/` + * Please see {@see ConversationDatasetsClient::conversationDatasetName()} for help formatting this field. + */ +function get_conversation_dataset_sample(string $formattedName): void +{ + // Create a client. + $conversationDatasetsClient = new ConversationDatasetsClient(); + + // Prepare the request message. + $request = (new GetConversationDatasetRequest()) + ->setName($formattedName); + + // Call the API and handle any network failures. + try { + /** @var ConversationDataset $response */ + $response = $conversationDatasetsClient->getConversationDataset($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedName = ConversationDatasetsClient::conversationDatasetName( + '[PROJECT]', + '[LOCATION]', + '[CONVERSATION_DATASET]' + ); + + get_conversation_dataset_sample($formattedName); +} +// [END dialogflow_v2_generated_ConversationDatasets_GetConversationDataset_sync] diff --git a/owl-bot-staging/Dialogflow/v2/samples/V2/ConversationDatasetsClient/get_location.php b/owl-bot-staging/Dialogflow/v2/samples/V2/ConversationDatasetsClient/get_location.php new file mode 100644 index 000000000000..124ed9b01813 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/samples/V2/ConversationDatasetsClient/get_location.php @@ -0,0 +1,57 @@ +getLocation($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} +// [END dialogflow_v2_generated_ConversationDatasets_GetLocation_sync] diff --git a/owl-bot-staging/Dialogflow/v2/samples/V2/ConversationDatasetsClient/import_conversation_data.php b/owl-bot-staging/Dialogflow/v2/samples/V2/ConversationDatasetsClient/import_conversation_data.php new file mode 100644 index 000000000000..bc45b150ef6c --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/samples/V2/ConversationDatasetsClient/import_conversation_data.php @@ -0,0 +1,103 @@ +/locations//conversationDatasets/` + * Please see {@see ConversationDatasetsClient::conversationDatasetName()} for help formatting this field. + */ +function import_conversation_data_sample(string $formattedName): void +{ + // Create a client. + $conversationDatasetsClient = new ConversationDatasetsClient(); + + // Prepare the request message. + $inputConfig = new InputConfig(); + $request = (new ImportConversationDataRequest()) + ->setName($formattedName) + ->setInputConfig($inputConfig); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $conversationDatasetsClient->importConversationData($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + /** @var ImportConversationDataOperationResponse $result */ + $result = $response->getResult(); + printf('Operation successful with response data: %s' . PHP_EOL, $result->serializeToJsonString()); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedName = ConversationDatasetsClient::conversationDatasetName( + '[PROJECT]', + '[LOCATION]', + '[CONVERSATION_DATASET]' + ); + + import_conversation_data_sample($formattedName); +} +// [END dialogflow_v2_generated_ConversationDatasets_ImportConversationData_sync] diff --git a/owl-bot-staging/Dialogflow/v2/samples/V2/ConversationDatasetsClient/list_conversation_datasets.php b/owl-bot-staging/Dialogflow/v2/samples/V2/ConversationDatasetsClient/list_conversation_datasets.php new file mode 100644 index 000000000000..3fa0e4aed3de --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/samples/V2/ConversationDatasetsClient/list_conversation_datasets.php @@ -0,0 +1,78 @@ +/locations/` + * Please see {@see ConversationDatasetsClient::locationName()} for help formatting this field. + */ +function list_conversation_datasets_sample(string $formattedParent): void +{ + // Create a client. + $conversationDatasetsClient = new ConversationDatasetsClient(); + + // Prepare the request message. + $request = (new ListConversationDatasetsRequest()) + ->setParent($formattedParent); + + // Call the API and handle any network failures. + try { + /** @var PagedListResponse $response */ + $response = $conversationDatasetsClient->listConversationDatasets($request); + + /** @var ConversationDataset $element */ + foreach ($response as $element) { + printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedParent = ConversationDatasetsClient::locationName('[PROJECT]', '[LOCATION]'); + + list_conversation_datasets_sample($formattedParent); +} +// [END dialogflow_v2_generated_ConversationDatasets_ListConversationDatasets_sync] diff --git a/owl-bot-staging/Dialogflow/v2/samples/V2/ConversationDatasetsClient/list_locations.php b/owl-bot-staging/Dialogflow/v2/samples/V2/ConversationDatasetsClient/list_locations.php new file mode 100644 index 000000000000..38f568d30dad --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/samples/V2/ConversationDatasetsClient/list_locations.php @@ -0,0 +1,62 @@ +listLocations($request); + + /** @var Location $element */ + foreach ($response as $element) { + printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} +// [END dialogflow_v2_generated_ConversationDatasets_ListLocations_sync] diff --git a/owl-bot-staging/Dialogflow/v2/samples/V2/ConversationModelsClient/create_conversation_model.php b/owl-bot-staging/Dialogflow/v2/samples/V2/ConversationModelsClient/create_conversation_model.php new file mode 100644 index 000000000000..c5b2699dc6f7 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/samples/V2/ConversationModelsClient/create_conversation_model.php @@ -0,0 +1,112 @@ +/locations//conversationDatasets/` + * Please see {@see ConversationModelsClient::conversationDatasetName()} for help formatting this field. + */ +function create_conversation_model_sample( + string $conversationModelDisplayName, + string $formattedConversationModelDatasetsDataset +): void { + // Create a client. + $conversationModelsClient = new ConversationModelsClient(); + + // Prepare the request message. + $inputDataset = (new InputDataset()) + ->setDataset($formattedConversationModelDatasetsDataset); + $conversationModelDatasets = [$inputDataset,]; + $conversationModel = (new ConversationModel()) + ->setDisplayName($conversationModelDisplayName) + ->setDatasets($conversationModelDatasets); + $request = (new CreateConversationModelRequest()) + ->setConversationModel($conversationModel); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $conversationModelsClient->createConversationModel($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + /** @var ConversationModel $result */ + $result = $response->getResult(); + printf('Operation successful with response data: %s' . PHP_EOL, $result->serializeToJsonString()); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $conversationModelDisplayName = '[DISPLAY_NAME]'; + $formattedConversationModelDatasetsDataset = ConversationModelsClient::conversationDatasetName( + '[PROJECT]', + '[LOCATION]', + '[CONVERSATION_DATASET]' + ); + + create_conversation_model_sample( + $conversationModelDisplayName, + $formattedConversationModelDatasetsDataset + ); +} +// [END dialogflow_v2_generated_ConversationModels_CreateConversationModel_sync] diff --git a/owl-bot-staging/Dialogflow/v2/samples/V2/ConversationModelsClient/create_conversation_model_evaluation.php b/owl-bot-staging/Dialogflow/v2/samples/V2/ConversationModelsClient/create_conversation_model_evaluation.php new file mode 100644 index 000000000000..e81554b2f6aa --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/samples/V2/ConversationModelsClient/create_conversation_model_evaluation.php @@ -0,0 +1,91 @@ +/locations//conversationModels/` + * Please see {@see ConversationModelsClient::conversationModelName()} for help formatting this field. + */ +function create_conversation_model_evaluation_sample(string $formattedParent): void +{ + // Create a client. + $conversationModelsClient = new ConversationModelsClient(); + + // Prepare the request message. + $conversationModelEvaluation = new ConversationModelEvaluation(); + $request = (new CreateConversationModelEvaluationRequest()) + ->setParent($formattedParent) + ->setConversationModelEvaluation($conversationModelEvaluation); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $conversationModelsClient->createConversationModelEvaluation($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + /** @var ConversationModelEvaluation $result */ + $result = $response->getResult(); + printf('Operation successful with response data: %s' . PHP_EOL, $result->serializeToJsonString()); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedParent = ConversationModelsClient::conversationModelName( + '[PROJECT]', + '[LOCATION]', + '[CONVERSATION_MODEL]' + ); + + create_conversation_model_evaluation_sample($formattedParent); +} +// [END dialogflow_v2_generated_ConversationModels_CreateConversationModelEvaluation_sync] diff --git a/owl-bot-staging/Dialogflow/v2/samples/V2/ConversationModelsClient/delete_conversation_model.php b/owl-bot-staging/Dialogflow/v2/samples/V2/ConversationModelsClient/delete_conversation_model.php new file mode 100644 index 000000000000..ffe3e416fe12 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/samples/V2/ConversationModelsClient/delete_conversation_model.php @@ -0,0 +1,89 @@ +/conversationModels/` + */ +function delete_conversation_model_sample(string $name): void +{ + // Create a client. + $conversationModelsClient = new ConversationModelsClient(); + + // Prepare the request message. + $request = (new DeleteConversationModelRequest()) + ->setName($name); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $conversationModelsClient->deleteConversationModel($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + printf('Operation completed successfully.' . PHP_EOL); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $name = '[NAME]'; + + delete_conversation_model_sample($name); +} +// [END dialogflow_v2_generated_ConversationModels_DeleteConversationModel_sync] diff --git a/owl-bot-staging/Dialogflow/v2/samples/V2/ConversationModelsClient/deploy_conversation_model.php b/owl-bot-staging/Dialogflow/v2/samples/V2/ConversationModelsClient/deploy_conversation_model.php new file mode 100644 index 000000000000..5562d6f483e4 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/samples/V2/ConversationModelsClient/deploy_conversation_model.php @@ -0,0 +1,92 @@ +/conversationModels/` + */ +function deploy_conversation_model_sample(string $name): void +{ + // Create a client. + $conversationModelsClient = new ConversationModelsClient(); + + // Prepare the request message. + $request = (new DeployConversationModelRequest()) + ->setName($name); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $conversationModelsClient->deployConversationModel($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + printf('Operation completed successfully.' . PHP_EOL); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $name = '[NAME]'; + + deploy_conversation_model_sample($name); +} +// [END dialogflow_v2_generated_ConversationModels_DeployConversationModel_sync] diff --git a/owl-bot-staging/Dialogflow/v2/samples/V2/ConversationModelsClient/get_conversation_model.php b/owl-bot-staging/Dialogflow/v2/samples/V2/ConversationModelsClient/get_conversation_model.php new file mode 100644 index 000000000000..2d301dbde9b8 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/samples/V2/ConversationModelsClient/get_conversation_model.php @@ -0,0 +1,71 @@ +/conversationModels/` + */ +function get_conversation_model_sample(string $name): void +{ + // Create a client. + $conversationModelsClient = new ConversationModelsClient(); + + // Prepare the request message. + $request = (new GetConversationModelRequest()) + ->setName($name); + + // Call the API and handle any network failures. + try { + /** @var ConversationModel $response */ + $response = $conversationModelsClient->getConversationModel($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $name = '[NAME]'; + + get_conversation_model_sample($name); +} +// [END dialogflow_v2_generated_ConversationModels_GetConversationModel_sync] diff --git a/owl-bot-staging/Dialogflow/v2/samples/V2/ConversationModelsClient/get_conversation_model_evaluation.php b/owl-bot-staging/Dialogflow/v2/samples/V2/ConversationModelsClient/get_conversation_model_evaluation.php new file mode 100644 index 000000000000..573a526f7465 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/samples/V2/ConversationModelsClient/get_conversation_model_evaluation.php @@ -0,0 +1,72 @@ +/conversationModels//evaluations/` + */ +function get_conversation_model_evaluation_sample(string $name): void +{ + // Create a client. + $conversationModelsClient = new ConversationModelsClient(); + + // Prepare the request message. + $request = (new GetConversationModelEvaluationRequest()) + ->setName($name); + + // Call the API and handle any network failures. + try { + /** @var ConversationModelEvaluation $response */ + $response = $conversationModelsClient->getConversationModelEvaluation($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $name = '[NAME]'; + + get_conversation_model_evaluation_sample($name); +} +// [END dialogflow_v2_generated_ConversationModels_GetConversationModelEvaluation_sync] diff --git a/owl-bot-staging/Dialogflow/v2/samples/V2/ConversationModelsClient/get_location.php b/owl-bot-staging/Dialogflow/v2/samples/V2/ConversationModelsClient/get_location.php new file mode 100644 index 000000000000..ae226f71c9a8 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/samples/V2/ConversationModelsClient/get_location.php @@ -0,0 +1,57 @@ +getLocation($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} +// [END dialogflow_v2_generated_ConversationModels_GetLocation_sync] diff --git a/owl-bot-staging/Dialogflow/v2/samples/V2/ConversationModelsClient/list_conversation_model_evaluations.php b/owl-bot-staging/Dialogflow/v2/samples/V2/ConversationModelsClient/list_conversation_model_evaluations.php new file mode 100644 index 000000000000..6a4b9f7f115a --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/samples/V2/ConversationModelsClient/list_conversation_model_evaluations.php @@ -0,0 +1,76 @@ +/conversationModels/` + */ +function list_conversation_model_evaluations_sample(string $parent): void +{ + // Create a client. + $conversationModelsClient = new ConversationModelsClient(); + + // Prepare the request message. + $request = (new ListConversationModelEvaluationsRequest()) + ->setParent($parent); + + // Call the API and handle any network failures. + try { + /** @var PagedListResponse $response */ + $response = $conversationModelsClient->listConversationModelEvaluations($request); + + /** @var ConversationModelEvaluation $element */ + foreach ($response as $element) { + printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $parent = '[PARENT]'; + + list_conversation_model_evaluations_sample($parent); +} +// [END dialogflow_v2_generated_ConversationModels_ListConversationModelEvaluations_sync] diff --git a/owl-bot-staging/Dialogflow/v2/samples/V2/ConversationModelsClient/list_conversation_models.php b/owl-bot-staging/Dialogflow/v2/samples/V2/ConversationModelsClient/list_conversation_models.php new file mode 100644 index 000000000000..6fa74df6595c --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/samples/V2/ConversationModelsClient/list_conversation_models.php @@ -0,0 +1,76 @@ +` + */ +function list_conversation_models_sample(string $parent): void +{ + // Create a client. + $conversationModelsClient = new ConversationModelsClient(); + + // Prepare the request message. + $request = (new ListConversationModelsRequest()) + ->setParent($parent); + + // Call the API and handle any network failures. + try { + /** @var PagedListResponse $response */ + $response = $conversationModelsClient->listConversationModels($request); + + /** @var ConversationModel $element */ + foreach ($response as $element) { + printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $parent = '[PARENT]'; + + list_conversation_models_sample($parent); +} +// [END dialogflow_v2_generated_ConversationModels_ListConversationModels_sync] diff --git a/owl-bot-staging/Dialogflow/v2/samples/V2/ConversationModelsClient/list_locations.php b/owl-bot-staging/Dialogflow/v2/samples/V2/ConversationModelsClient/list_locations.php new file mode 100644 index 000000000000..03be700097b1 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/samples/V2/ConversationModelsClient/list_locations.php @@ -0,0 +1,62 @@ +listLocations($request); + + /** @var Location $element */ + foreach ($response as $element) { + printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} +// [END dialogflow_v2_generated_ConversationModels_ListLocations_sync] diff --git a/owl-bot-staging/Dialogflow/v2/samples/V2/ConversationModelsClient/undeploy_conversation_model.php b/owl-bot-staging/Dialogflow/v2/samples/V2/ConversationModelsClient/undeploy_conversation_model.php new file mode 100644 index 000000000000..a50478e6c970 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/samples/V2/ConversationModelsClient/undeploy_conversation_model.php @@ -0,0 +1,92 @@ +/conversationModels/` + */ +function undeploy_conversation_model_sample(string $name): void +{ + // Create a client. + $conversationModelsClient = new ConversationModelsClient(); + + // Prepare the request message. + $request = (new UndeployConversationModelRequest()) + ->setName($name); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $conversationModelsClient->undeployConversationModel($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + printf('Operation completed successfully.' . PHP_EOL); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $name = '[NAME]'; + + undeploy_conversation_model_sample($name); +} +// [END dialogflow_v2_generated_ConversationModels_UndeployConversationModel_sync] diff --git a/owl-bot-staging/Dialogflow/v2/samples/V2/ConversationProfilesClient/clear_suggestion_feature_config.php b/owl-bot-staging/Dialogflow/v2/samples/V2/ConversationProfilesClient/clear_suggestion_feature_config.php new file mode 100644 index 000000000000..1badc11b0579 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/samples/V2/ConversationProfilesClient/clear_suggestion_feature_config.php @@ -0,0 +1,110 @@ +/locations//conversationProfiles/`. + * @param int $participantRole The participant role to remove the suggestion feature + * config. Only HUMAN_AGENT or END_USER can be used. + * @param int $suggestionFeatureType The type of the suggestion feature to remove. + */ +function clear_suggestion_feature_config_sample( + string $conversationProfile, + int $participantRole, + int $suggestionFeatureType +): void { + // Create a client. + $conversationProfilesClient = new ConversationProfilesClient(); + + // Prepare the request message. + $request = (new ClearSuggestionFeatureConfigRequest()) + ->setConversationProfile($conversationProfile) + ->setParticipantRole($participantRole) + ->setSuggestionFeatureType($suggestionFeatureType); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $conversationProfilesClient->clearSuggestionFeatureConfig($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + /** @var ConversationProfile $result */ + $result = $response->getResult(); + printf('Operation successful with response data: %s' . PHP_EOL, $result->serializeToJsonString()); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $conversationProfile = '[CONVERSATION_PROFILE]'; + $participantRole = Role::ROLE_UNSPECIFIED; + $suggestionFeatureType = Type::TYPE_UNSPECIFIED; + + clear_suggestion_feature_config_sample( + $conversationProfile, + $participantRole, + $suggestionFeatureType + ); +} +// [END dialogflow_v2_generated_ConversationProfiles_ClearSuggestionFeatureConfig_sync] diff --git a/owl-bot-staging/Dialogflow/v2/samples/V2/ConversationProfilesClient/create_conversation_profile.php b/owl-bot-staging/Dialogflow/v2/samples/V2/ConversationProfilesClient/create_conversation_profile.php new file mode 100644 index 000000000000..32902b894190 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/samples/V2/ConversationProfilesClient/create_conversation_profile.php @@ -0,0 +1,84 @@ +/locations/`. Please see + * {@see ConversationProfilesClient::projectName()} for help formatting this field. + * @param string $conversationProfileDisplayName Human readable name for this profile. Max length 1024 bytes. + */ +function create_conversation_profile_sample( + string $formattedParent, + string $conversationProfileDisplayName +): void { + // Create a client. + $conversationProfilesClient = new ConversationProfilesClient(); + + // Prepare the request message. + $conversationProfile = (new ConversationProfile()) + ->setDisplayName($conversationProfileDisplayName); + $request = (new CreateConversationProfileRequest()) + ->setParent($formattedParent) + ->setConversationProfile($conversationProfile); + + // Call the API and handle any network failures. + try { + /** @var ConversationProfile $response */ + $response = $conversationProfilesClient->createConversationProfile($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedParent = ConversationProfilesClient::projectName('[PROJECT]'); + $conversationProfileDisplayName = '[DISPLAY_NAME]'; + + create_conversation_profile_sample($formattedParent, $conversationProfileDisplayName); +} +// [END dialogflow_v2_generated_ConversationProfiles_CreateConversationProfile_sync] diff --git a/owl-bot-staging/Dialogflow/v2/samples/V2/ConversationProfilesClient/delete_conversation_profile.php b/owl-bot-staging/Dialogflow/v2/samples/V2/ConversationProfilesClient/delete_conversation_profile.php new file mode 100644 index 000000000000..f6eb0db3ebf3 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/samples/V2/ConversationProfilesClient/delete_conversation_profile.php @@ -0,0 +1,74 @@ +/locations//conversationProfiles/`. Please see + * {@see ConversationProfilesClient::conversationProfileName()} for help formatting this field. + */ +function delete_conversation_profile_sample(string $formattedName): void +{ + // Create a client. + $conversationProfilesClient = new ConversationProfilesClient(); + + // Prepare the request message. + $request = (new DeleteConversationProfileRequest()) + ->setName($formattedName); + + // Call the API and handle any network failures. + try { + $conversationProfilesClient->deleteConversationProfile($request); + printf('Call completed successfully.' . PHP_EOL); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedName = ConversationProfilesClient::conversationProfileName( + '[PROJECT]', + '[CONVERSATION_PROFILE]' + ); + + delete_conversation_profile_sample($formattedName); +} +// [END dialogflow_v2_generated_ConversationProfiles_DeleteConversationProfile_sync] diff --git a/owl-bot-staging/Dialogflow/v2/samples/V2/ConversationProfilesClient/get_conversation_profile.php b/owl-bot-staging/Dialogflow/v2/samples/V2/ConversationProfilesClient/get_conversation_profile.php new file mode 100644 index 000000000000..cf84747196f0 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/samples/V2/ConversationProfilesClient/get_conversation_profile.php @@ -0,0 +1,76 @@ +/locations//conversationProfiles/`. Please see + * {@see ConversationProfilesClient::conversationProfileName()} for help formatting this field. + */ +function get_conversation_profile_sample(string $formattedName): void +{ + // Create a client. + $conversationProfilesClient = new ConversationProfilesClient(); + + // Prepare the request message. + $request = (new GetConversationProfileRequest()) + ->setName($formattedName); + + // Call the API and handle any network failures. + try { + /** @var ConversationProfile $response */ + $response = $conversationProfilesClient->getConversationProfile($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedName = ConversationProfilesClient::conversationProfileName( + '[PROJECT]', + '[CONVERSATION_PROFILE]' + ); + + get_conversation_profile_sample($formattedName); +} +// [END dialogflow_v2_generated_ConversationProfiles_GetConversationProfile_sync] diff --git a/owl-bot-staging/Dialogflow/v2/samples/V2/ConversationProfilesClient/get_location.php b/owl-bot-staging/Dialogflow/v2/samples/V2/ConversationProfilesClient/get_location.php new file mode 100644 index 000000000000..b9ff1675582d --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/samples/V2/ConversationProfilesClient/get_location.php @@ -0,0 +1,57 @@ +getLocation($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} +// [END dialogflow_v2_generated_ConversationProfiles_GetLocation_sync] diff --git a/owl-bot-staging/Dialogflow/v2/samples/V2/ConversationProfilesClient/list_conversation_profiles.php b/owl-bot-staging/Dialogflow/v2/samples/V2/ConversationProfilesClient/list_conversation_profiles.php new file mode 100644 index 000000000000..81ec5677dd0e --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/samples/V2/ConversationProfilesClient/list_conversation_profiles.php @@ -0,0 +1,77 @@ +/locations/`. Please see + * {@see ConversationProfilesClient::projectName()} for help formatting this field. + */ +function list_conversation_profiles_sample(string $formattedParent): void +{ + // Create a client. + $conversationProfilesClient = new ConversationProfilesClient(); + + // Prepare the request message. + $request = (new ListConversationProfilesRequest()) + ->setParent($formattedParent); + + // Call the API and handle any network failures. + try { + /** @var PagedListResponse $response */ + $response = $conversationProfilesClient->listConversationProfiles($request); + + /** @var ConversationProfile $element */ + foreach ($response as $element) { + printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedParent = ConversationProfilesClient::projectName('[PROJECT]'); + + list_conversation_profiles_sample($formattedParent); +} +// [END dialogflow_v2_generated_ConversationProfiles_ListConversationProfiles_sync] diff --git a/owl-bot-staging/Dialogflow/v2/samples/V2/ConversationProfilesClient/list_locations.php b/owl-bot-staging/Dialogflow/v2/samples/V2/ConversationProfilesClient/list_locations.php new file mode 100644 index 000000000000..9b8a0bdc0b97 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/samples/V2/ConversationProfilesClient/list_locations.php @@ -0,0 +1,62 @@ +listLocations($request); + + /** @var Location $element */ + foreach ($response as $element) { + printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} +// [END dialogflow_v2_generated_ConversationProfiles_ListLocations_sync] diff --git a/owl-bot-staging/Dialogflow/v2/samples/V2/ConversationProfilesClient/set_suggestion_feature_config.php b/owl-bot-staging/Dialogflow/v2/samples/V2/ConversationProfilesClient/set_suggestion_feature_config.php new file mode 100644 index 000000000000..d2918d9418a1 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/samples/V2/ConversationProfilesClient/set_suggestion_feature_config.php @@ -0,0 +1,111 @@ +/locations//conversationProfiles/`. + * @param int $participantRole The participant role to add or update the suggestion feature + * config. Only HUMAN_AGENT or END_USER can be used. + */ +function set_suggestion_feature_config_sample( + string $conversationProfile, + int $participantRole +): void { + // Create a client. + $conversationProfilesClient = new ConversationProfilesClient(); + + // Prepare the request message. + $suggestionFeatureConfig = new SuggestionFeatureConfig(); + $request = (new SetSuggestionFeatureConfigRequest()) + ->setConversationProfile($conversationProfile) + ->setParticipantRole($participantRole) + ->setSuggestionFeatureConfig($suggestionFeatureConfig); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $conversationProfilesClient->setSuggestionFeatureConfig($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + /** @var ConversationProfile $result */ + $result = $response->getResult(); + printf('Operation successful with response data: %s' . PHP_EOL, $result->serializeToJsonString()); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $conversationProfile = '[CONVERSATION_PROFILE]'; + $participantRole = Role::ROLE_UNSPECIFIED; + + set_suggestion_feature_config_sample($conversationProfile, $participantRole); +} +// [END dialogflow_v2_generated_ConversationProfiles_SetSuggestionFeatureConfig_sync] diff --git a/owl-bot-staging/Dialogflow/v2/samples/V2/ConversationProfilesClient/update_conversation_profile.php b/owl-bot-staging/Dialogflow/v2/samples/V2/ConversationProfilesClient/update_conversation_profile.php new file mode 100644 index 000000000000..40602907b0dd --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/samples/V2/ConversationProfilesClient/update_conversation_profile.php @@ -0,0 +1,80 @@ +setDisplayName($conversationProfileDisplayName); + $updateMask = new FieldMask(); + $request = (new UpdateConversationProfileRequest()) + ->setConversationProfile($conversationProfile) + ->setUpdateMask($updateMask); + + // Call the API and handle any network failures. + try { + /** @var ConversationProfile $response */ + $response = $conversationProfilesClient->updateConversationProfile($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $conversationProfileDisplayName = '[DISPLAY_NAME]'; + + update_conversation_profile_sample($conversationProfileDisplayName); +} +// [END dialogflow_v2_generated_ConversationProfiles_UpdateConversationProfile_sync] diff --git a/owl-bot-staging/Dialogflow/v2/samples/V2/ConversationsClient/complete_conversation.php b/owl-bot-staging/Dialogflow/v2/samples/V2/ConversationsClient/complete_conversation.php new file mode 100644 index 000000000000..3102ad42d45b --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/samples/V2/ConversationsClient/complete_conversation.php @@ -0,0 +1,74 @@ +/locations//conversations/`. Please see + * {@see ConversationsClient::conversationName()} for help formatting this field. + */ +function complete_conversation_sample(string $formattedName): void +{ + // Create a client. + $conversationsClient = new ConversationsClient(); + + // Prepare the request message. + $request = (new CompleteConversationRequest()) + ->setName($formattedName); + + // Call the API and handle any network failures. + try { + /** @var Conversation $response */ + $response = $conversationsClient->completeConversation($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedName = ConversationsClient::conversationName('[PROJECT]', '[CONVERSATION]'); + + complete_conversation_sample($formattedName); +} +// [END dialogflow_v2_generated_Conversations_CompleteConversation_sync] diff --git a/owl-bot-staging/Dialogflow/v2/samples/V2/ConversationsClient/create_conversation.php b/owl-bot-staging/Dialogflow/v2/samples/V2/ConversationsClient/create_conversation.php new file mode 100644 index 000000000000..241269388f57 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/samples/V2/ConversationsClient/create_conversation.php @@ -0,0 +1,106 @@ +/locations/`. Please see + * {@see ConversationsClient::projectName()} for help formatting this field. + * @param string $formattedConversationConversationProfile The Conversation Profile to be used to configure this + * Conversation. This field cannot be updated. + * Format: `projects//locations//conversationProfiles/`. Please see + * {@see ConversationsClient::conversationProfileName()} for help formatting this field. + */ +function create_conversation_sample( + string $formattedParent, + string $formattedConversationConversationProfile +): void { + // Create a client. + $conversationsClient = new ConversationsClient(); + + // Prepare the request message. + $conversation = (new Conversation()) + ->setConversationProfile($formattedConversationConversationProfile); + $request = (new CreateConversationRequest()) + ->setParent($formattedParent) + ->setConversation($conversation); + + // Call the API and handle any network failures. + try { + /** @var Conversation $response */ + $response = $conversationsClient->createConversation($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedParent = ConversationsClient::projectName('[PROJECT]'); + $formattedConversationConversationProfile = ConversationsClient::conversationProfileName( + '[PROJECT]', + '[CONVERSATION_PROFILE]' + ); + + create_conversation_sample($formattedParent, $formattedConversationConversationProfile); +} +// [END dialogflow_v2_generated_Conversations_CreateConversation_sync] diff --git a/owl-bot-staging/Dialogflow/v2/samples/V2/ConversationsClient/generate_stateless_suggestion.php b/owl-bot-staging/Dialogflow/v2/samples/V2/ConversationsClient/generate_stateless_suggestion.php new file mode 100644 index 000000000000..3f0c6871bbf6 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/samples/V2/ConversationsClient/generate_stateless_suggestion.php @@ -0,0 +1,73 @@ +/locations/`. Please see + * {@see ConversationsClient::locationName()} for help formatting this field. + */ +function generate_stateless_suggestion_sample(string $formattedParent): void +{ + // Create a client. + $conversationsClient = new ConversationsClient(); + + // Prepare the request message. + $request = (new GenerateStatelessSuggestionRequest()) + ->setParent($formattedParent); + + // Call the API and handle any network failures. + try { + /** @var GenerateStatelessSuggestionResponse $response */ + $response = $conversationsClient->generateStatelessSuggestion($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedParent = ConversationsClient::locationName('[PROJECT]', '[LOCATION]'); + + generate_stateless_suggestion_sample($formattedParent); +} +// [END dialogflow_v2_generated_Conversations_GenerateStatelessSuggestion_sync] diff --git a/owl-bot-staging/Dialogflow/v2/samples/V2/ConversationsClient/generate_stateless_summary.php b/owl-bot-staging/Dialogflow/v2/samples/V2/ConversationsClient/generate_stateless_summary.php new file mode 100644 index 000000000000..d24784c144fb --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/samples/V2/ConversationsClient/generate_stateless_summary.php @@ -0,0 +1,99 @@ +/locations/`. Please see + * {@see ConversationsClient::locationName()} for help formatting this field. + * @param string $conversationProfileDisplayName Human readable name for this profile. Max length 1024 bytes. + */ +function generate_stateless_summary_sample( + string $statelessConversationMessagesContent, + string $formattedStatelessConversationParent, + string $conversationProfileDisplayName +): void { + // Create a client. + $conversationsClient = new ConversationsClient(); + + // Prepare the request message. + $message = (new Message()) + ->setContent($statelessConversationMessagesContent); + $statelessConversationMessages = [$message,]; + $statelessConversation = (new MinimalConversation()) + ->setMessages($statelessConversationMessages) + ->setParent($formattedStatelessConversationParent); + $conversationProfile = (new ConversationProfile()) + ->setDisplayName($conversationProfileDisplayName); + $request = (new GenerateStatelessSummaryRequest()) + ->setStatelessConversation($statelessConversation) + ->setConversationProfile($conversationProfile); + + // Call the API and handle any network failures. + try { + /** @var GenerateStatelessSummaryResponse $response */ + $response = $conversationsClient->generateStatelessSummary($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $statelessConversationMessagesContent = '[CONTENT]'; + $formattedStatelessConversationParent = ConversationsClient::locationName( + '[PROJECT]', + '[LOCATION]' + ); + $conversationProfileDisplayName = '[DISPLAY_NAME]'; + + generate_stateless_summary_sample( + $statelessConversationMessagesContent, + $formattedStatelessConversationParent, + $conversationProfileDisplayName + ); +} +// [END dialogflow_v2_generated_Conversations_GenerateStatelessSummary_sync] diff --git a/owl-bot-staging/Dialogflow/v2/samples/V2/ConversationsClient/get_conversation.php b/owl-bot-staging/Dialogflow/v2/samples/V2/ConversationsClient/get_conversation.php new file mode 100644 index 000000000000..0a12e2bf87d0 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/samples/V2/ConversationsClient/get_conversation.php @@ -0,0 +1,73 @@ +/locations//conversations/`. Please see + * {@see ConversationsClient::conversationName()} for help formatting this field. + */ +function get_conversation_sample(string $formattedName): void +{ + // Create a client. + $conversationsClient = new ConversationsClient(); + + // Prepare the request message. + $request = (new GetConversationRequest()) + ->setName($formattedName); + + // Call the API and handle any network failures. + try { + /** @var Conversation $response */ + $response = $conversationsClient->getConversation($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedName = ConversationsClient::conversationName('[PROJECT]', '[CONVERSATION]'); + + get_conversation_sample($formattedName); +} +// [END dialogflow_v2_generated_Conversations_GetConversation_sync] diff --git a/owl-bot-staging/Dialogflow/v2/samples/V2/ConversationsClient/get_location.php b/owl-bot-staging/Dialogflow/v2/samples/V2/ConversationsClient/get_location.php new file mode 100644 index 000000000000..3967209951a4 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/samples/V2/ConversationsClient/get_location.php @@ -0,0 +1,57 @@ +getLocation($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} +// [END dialogflow_v2_generated_Conversations_GetLocation_sync] diff --git a/owl-bot-staging/Dialogflow/v2/samples/V2/ConversationsClient/list_conversations.php b/owl-bot-staging/Dialogflow/v2/samples/V2/ConversationsClient/list_conversations.php new file mode 100644 index 000000000000..82614a642265 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/samples/V2/ConversationsClient/list_conversations.php @@ -0,0 +1,77 @@ +/locations/`. Please see + * {@see ConversationsClient::projectName()} for help formatting this field. + */ +function list_conversations_sample(string $formattedParent): void +{ + // Create a client. + $conversationsClient = new ConversationsClient(); + + // Prepare the request message. + $request = (new ListConversationsRequest()) + ->setParent($formattedParent); + + // Call the API and handle any network failures. + try { + /** @var PagedListResponse $response */ + $response = $conversationsClient->listConversations($request); + + /** @var Conversation $element */ + foreach ($response as $element) { + printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedParent = ConversationsClient::projectName('[PROJECT]'); + + list_conversations_sample($formattedParent); +} +// [END dialogflow_v2_generated_Conversations_ListConversations_sync] diff --git a/owl-bot-staging/Dialogflow/v2/samples/V2/ConversationsClient/list_locations.php b/owl-bot-staging/Dialogflow/v2/samples/V2/ConversationsClient/list_locations.php new file mode 100644 index 000000000000..c6b6c1518fa1 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/samples/V2/ConversationsClient/list_locations.php @@ -0,0 +1,62 @@ +listLocations($request); + + /** @var Location $element */ + foreach ($response as $element) { + printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} +// [END dialogflow_v2_generated_Conversations_ListLocations_sync] diff --git a/owl-bot-staging/Dialogflow/v2/samples/V2/ConversationsClient/list_messages.php b/owl-bot-staging/Dialogflow/v2/samples/V2/ConversationsClient/list_messages.php new file mode 100644 index 000000000000..b4f6aa376b9a --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/samples/V2/ConversationsClient/list_messages.php @@ -0,0 +1,82 @@ + + * [first item's create_time of previous request]` and empty page_token. + * + * @param string $formattedParent The name of the conversation to list messages for. + * Format: `projects//locations//conversations/` + * Please see {@see ConversationsClient::conversationName()} for help formatting this field. + */ +function list_messages_sample(string $formattedParent): void +{ + // Create a client. + $conversationsClient = new ConversationsClient(); + + // Prepare the request message. + $request = (new ListMessagesRequest()) + ->setParent($formattedParent); + + // Call the API and handle any network failures. + try { + /** @var PagedListResponse $response */ + $response = $conversationsClient->listMessages($request); + + /** @var Message $element */ + foreach ($response as $element) { + printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedParent = ConversationsClient::conversationName('[PROJECT]', '[CONVERSATION]'); + + list_messages_sample($formattedParent); +} +// [END dialogflow_v2_generated_Conversations_ListMessages_sync] diff --git a/owl-bot-staging/Dialogflow/v2/samples/V2/ConversationsClient/search_knowledge.php b/owl-bot-staging/Dialogflow/v2/samples/V2/ConversationsClient/search_knowledge.php new file mode 100644 index 000000000000..7eb22022ffde --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/samples/V2/ConversationsClient/search_knowledge.php @@ -0,0 +1,92 @@ +/locations//conversationProfiles/`. Please see + * {@see ConversationsClient::conversationProfileName()} for help formatting this field. + */ +function search_knowledge_sample( + string $queryText, + string $queryLanguageCode, + string $formattedConversationProfile +): void { + // Create a client. + $conversationsClient = new ConversationsClient(); + + // Prepare the request message. + $query = (new TextInput()) + ->setText($queryText) + ->setLanguageCode($queryLanguageCode); + $request = (new SearchKnowledgeRequest()) + ->setQuery($query) + ->setConversationProfile($formattedConversationProfile); + + // Call the API and handle any network failures. + try { + /** @var SearchKnowledgeResponse $response */ + $response = $conversationsClient->searchKnowledge($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $queryText = '[TEXT]'; + $queryLanguageCode = '[LANGUAGE_CODE]'; + $formattedConversationProfile = ConversationsClient::conversationProfileName( + '[PROJECT]', + '[CONVERSATION_PROFILE]' + ); + + search_knowledge_sample($queryText, $queryLanguageCode, $formattedConversationProfile); +} +// [END dialogflow_v2_generated_Conversations_SearchKnowledge_sync] diff --git a/owl-bot-staging/Dialogflow/v2/samples/V2/ConversationsClient/suggest_conversation_summary.php b/owl-bot-staging/Dialogflow/v2/samples/V2/ConversationsClient/suggest_conversation_summary.php new file mode 100644 index 000000000000..60ddb69da08f --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/samples/V2/ConversationsClient/suggest_conversation_summary.php @@ -0,0 +1,75 @@ +/locations//conversations/`. Please see + * {@see ConversationsClient::conversationName()} for help formatting this field. + */ +function suggest_conversation_summary_sample(string $formattedConversation): void +{ + // Create a client. + $conversationsClient = new ConversationsClient(); + + // Prepare the request message. + $request = (new SuggestConversationSummaryRequest()) + ->setConversation($formattedConversation); + + // Call the API and handle any network failures. + try { + /** @var SuggestConversationSummaryResponse $response */ + $response = $conversationsClient->suggestConversationSummary($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedConversation = ConversationsClient::conversationName('[PROJECT]', '[CONVERSATION]'); + + suggest_conversation_summary_sample($formattedConversation); +} +// [END dialogflow_v2_generated_Conversations_SuggestConversationSummary_sync] diff --git a/owl-bot-staging/Dialogflow/v2/samples/V2/DocumentsClient/create_document.php b/owl-bot-staging/Dialogflow/v2/samples/V2/DocumentsClient/create_document.php new file mode 100644 index 000000000000..be4a2bd29543 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/samples/V2/DocumentsClient/create_document.php @@ -0,0 +1,116 @@ +/locations//knowledgeBases/`. Please see + * {@see DocumentsClient::knowledgeBaseName()} for help formatting this field. + * @param string $documentDisplayName The display name of the document. The name must be 1024 bytes or + * less; otherwise, the creation request fails. + * @param string $documentMimeType The MIME type of this document. + * @param int $documentKnowledgeTypesElement The knowledge type of document content. + */ +function create_document_sample( + string $formattedParent, + string $documentDisplayName, + string $documentMimeType, + int $documentKnowledgeTypesElement +): void { + // Create a client. + $documentsClient = new DocumentsClient(); + + // Prepare the request message. + $documentKnowledgeTypes = [$documentKnowledgeTypesElement,]; + $document = (new Document()) + ->setDisplayName($documentDisplayName) + ->setMimeType($documentMimeType) + ->setKnowledgeTypes($documentKnowledgeTypes); + $request = (new CreateDocumentRequest()) + ->setParent($formattedParent) + ->setDocument($document); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $documentsClient->createDocument($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + /** @var Document $result */ + $result = $response->getResult(); + printf('Operation successful with response data: %s' . PHP_EOL, $result->serializeToJsonString()); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedParent = DocumentsClient::knowledgeBaseName('[PROJECT]', '[KNOWLEDGE_BASE]'); + $documentDisplayName = '[DISPLAY_NAME]'; + $documentMimeType = '[MIME_TYPE]'; + $documentKnowledgeTypesElement = KnowledgeType::KNOWLEDGE_TYPE_UNSPECIFIED; + + create_document_sample( + $formattedParent, + $documentDisplayName, + $documentMimeType, + $documentKnowledgeTypesElement + ); +} +// [END dialogflow_v2_generated_Documents_CreateDocument_sync] diff --git a/owl-bot-staging/Dialogflow/v2/samples/V2/DocumentsClient/delete_document.php b/owl-bot-staging/Dialogflow/v2/samples/V2/DocumentsClient/delete_document.php new file mode 100644 index 000000000000..7bf0a0877466 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/samples/V2/DocumentsClient/delete_document.php @@ -0,0 +1,91 @@ +/locations//knowledgeBases//documents/`. Please see + * {@see DocumentsClient::documentName()} for help formatting this field. + */ +function delete_document_sample(string $formattedName): void +{ + // Create a client. + $documentsClient = new DocumentsClient(); + + // Prepare the request message. + $request = (new DeleteDocumentRequest()) + ->setName($formattedName); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $documentsClient->deleteDocument($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + printf('Operation completed successfully.' . PHP_EOL); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedName = DocumentsClient::documentName('[PROJECT]', '[KNOWLEDGE_BASE]', '[DOCUMENT]'); + + delete_document_sample($formattedName); +} +// [END dialogflow_v2_generated_Documents_DeleteDocument_sync] diff --git a/owl-bot-staging/Dialogflow/v2/samples/V2/DocumentsClient/export_document.php b/owl-bot-staging/Dialogflow/v2/samples/V2/DocumentsClient/export_document.php new file mode 100644 index 000000000000..598b09f2b032 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/samples/V2/DocumentsClient/export_document.php @@ -0,0 +1,94 @@ +/locations//knowledgeBases//documents/`. Please see + * {@see DocumentsClient::documentName()} for help formatting this field. + */ +function export_document_sample(string $formattedName): void +{ + // Create a client. + $documentsClient = new DocumentsClient(); + + // Prepare the request message. + $request = (new ExportDocumentRequest()) + ->setName($formattedName); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $documentsClient->exportDocument($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + /** @var Document $result */ + $result = $response->getResult(); + printf('Operation successful with response data: %s' . PHP_EOL, $result->serializeToJsonString()); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedName = DocumentsClient::documentName('[PROJECT]', '[KNOWLEDGE_BASE]', '[DOCUMENT]'); + + export_document_sample($formattedName); +} +// [END dialogflow_v2_generated_Documents_ExportDocument_sync] diff --git a/owl-bot-staging/Dialogflow/v2/samples/V2/DocumentsClient/get_document.php b/owl-bot-staging/Dialogflow/v2/samples/V2/DocumentsClient/get_document.php new file mode 100644 index 000000000000..cc429086cfe6 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/samples/V2/DocumentsClient/get_document.php @@ -0,0 +1,73 @@ +/locations//knowledgeBases//documents/`. Please see + * {@see DocumentsClient::documentName()} for help formatting this field. + */ +function get_document_sample(string $formattedName): void +{ + // Create a client. + $documentsClient = new DocumentsClient(); + + // Prepare the request message. + $request = (new GetDocumentRequest()) + ->setName($formattedName); + + // Call the API and handle any network failures. + try { + /** @var Document $response */ + $response = $documentsClient->getDocument($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedName = DocumentsClient::documentName('[PROJECT]', '[KNOWLEDGE_BASE]', '[DOCUMENT]'); + + get_document_sample($formattedName); +} +// [END dialogflow_v2_generated_Documents_GetDocument_sync] diff --git a/owl-bot-staging/Dialogflow/v2/samples/V2/DocumentsClient/get_location.php b/owl-bot-staging/Dialogflow/v2/samples/V2/DocumentsClient/get_location.php new file mode 100644 index 000000000000..60bb4949ad03 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/samples/V2/DocumentsClient/get_location.php @@ -0,0 +1,57 @@ +getLocation($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} +// [END dialogflow_v2_generated_Documents_GetLocation_sync] diff --git a/owl-bot-staging/Dialogflow/v2/samples/V2/DocumentsClient/import_documents.php b/owl-bot-staging/Dialogflow/v2/samples/V2/DocumentsClient/import_documents.php new file mode 100644 index 000000000000..923510d53be7 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/samples/V2/DocumentsClient/import_documents.php @@ -0,0 +1,114 @@ +/locations//knowledgeBases/`. Please see + * {@see DocumentsClient::knowledgeBaseName()} for help formatting this field. + * @param string $documentTemplateMimeType The MIME type of the document. + * @param int $documentTemplateKnowledgeTypesElement The knowledge type of document content. + */ +function import_documents_sample( + string $formattedParent, + string $documentTemplateMimeType, + int $documentTemplateKnowledgeTypesElement +): void { + // Create a client. + $documentsClient = new DocumentsClient(); + + // Prepare the request message. + $documentTemplateKnowledgeTypes = [$documentTemplateKnowledgeTypesElement,]; + $documentTemplate = (new ImportDocumentTemplate()) + ->setMimeType($documentTemplateMimeType) + ->setKnowledgeTypes($documentTemplateKnowledgeTypes); + $request = (new ImportDocumentsRequest()) + ->setParent($formattedParent) + ->setDocumentTemplate($documentTemplate); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $documentsClient->importDocuments($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + /** @var ImportDocumentsResponse $result */ + $result = $response->getResult(); + printf('Operation successful with response data: %s' . PHP_EOL, $result->serializeToJsonString()); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedParent = DocumentsClient::knowledgeBaseName('[PROJECT]', '[KNOWLEDGE_BASE]'); + $documentTemplateMimeType = '[MIME_TYPE]'; + $documentTemplateKnowledgeTypesElement = KnowledgeType::KNOWLEDGE_TYPE_UNSPECIFIED; + + import_documents_sample( + $formattedParent, + $documentTemplateMimeType, + $documentTemplateKnowledgeTypesElement + ); +} +// [END dialogflow_v2_generated_Documents_ImportDocuments_sync] diff --git a/owl-bot-staging/Dialogflow/v2/samples/V2/DocumentsClient/list_documents.php b/owl-bot-staging/Dialogflow/v2/samples/V2/DocumentsClient/list_documents.php new file mode 100644 index 000000000000..14f4aeb72a6b --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/samples/V2/DocumentsClient/list_documents.php @@ -0,0 +1,78 @@ +/locations//knowledgeBases/`. Please see + * {@see DocumentsClient::knowledgeBaseName()} for help formatting this field. + */ +function list_documents_sample(string $formattedParent): void +{ + // Create a client. + $documentsClient = new DocumentsClient(); + + // Prepare the request message. + $request = (new ListDocumentsRequest()) + ->setParent($formattedParent); + + // Call the API and handle any network failures. + try { + /** @var PagedListResponse $response */ + $response = $documentsClient->listDocuments($request); + + /** @var Document $element */ + foreach ($response as $element) { + printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedParent = DocumentsClient::knowledgeBaseName('[PROJECT]', '[KNOWLEDGE_BASE]'); + + list_documents_sample($formattedParent); +} +// [END dialogflow_v2_generated_Documents_ListDocuments_sync] diff --git a/owl-bot-staging/Dialogflow/v2/samples/V2/DocumentsClient/list_locations.php b/owl-bot-staging/Dialogflow/v2/samples/V2/DocumentsClient/list_locations.php new file mode 100644 index 000000000000..22cb179b8124 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/samples/V2/DocumentsClient/list_locations.php @@ -0,0 +1,62 @@ +listLocations($request); + + /** @var Location $element */ + foreach ($response as $element) { + printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} +// [END dialogflow_v2_generated_Documents_ListLocations_sync] diff --git a/owl-bot-staging/Dialogflow/v2/samples/V2/DocumentsClient/reload_document.php b/owl-bot-staging/Dialogflow/v2/samples/V2/DocumentsClient/reload_document.php new file mode 100644 index 000000000000..c5eacb4d763e --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/samples/V2/DocumentsClient/reload_document.php @@ -0,0 +1,99 @@ +/locations//knowledgeBases//documents/` + * Please see {@see DocumentsClient::documentName()} for help formatting this field. + */ +function reload_document_sample(string $formattedName): void +{ + // Create a client. + $documentsClient = new DocumentsClient(); + + // Prepare the request message. + $request = (new ReloadDocumentRequest()) + ->setName($formattedName); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $documentsClient->reloadDocument($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + /** @var Document $result */ + $result = $response->getResult(); + printf('Operation successful with response data: %s' . PHP_EOL, $result->serializeToJsonString()); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedName = DocumentsClient::documentName('[PROJECT]', '[KNOWLEDGE_BASE]', '[DOCUMENT]'); + + reload_document_sample($formattedName); +} +// [END dialogflow_v2_generated_Documents_ReloadDocument_sync] diff --git a/owl-bot-staging/Dialogflow/v2/samples/V2/DocumentsClient/update_document.php b/owl-bot-staging/Dialogflow/v2/samples/V2/DocumentsClient/update_document.php new file mode 100644 index 000000000000..2f8341f476aa --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/samples/V2/DocumentsClient/update_document.php @@ -0,0 +1,104 @@ +setDisplayName($documentDisplayName) + ->setMimeType($documentMimeType) + ->setKnowledgeTypes($documentKnowledgeTypes); + $request = (new UpdateDocumentRequest()) + ->setDocument($document); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $documentsClient->updateDocument($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + /** @var Document $result */ + $result = $response->getResult(); + printf('Operation successful with response data: %s' . PHP_EOL, $result->serializeToJsonString()); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $documentDisplayName = '[DISPLAY_NAME]'; + $documentMimeType = '[MIME_TYPE]'; + $documentKnowledgeTypesElement = KnowledgeType::KNOWLEDGE_TYPE_UNSPECIFIED; + + update_document_sample($documentDisplayName, $documentMimeType, $documentKnowledgeTypesElement); +} +// [END dialogflow_v2_generated_Documents_UpdateDocument_sync] diff --git a/owl-bot-staging/Dialogflow/v2/samples/V2/EncryptionSpecServiceClient/get_encryption_spec.php b/owl-bot-staging/Dialogflow/v2/samples/V2/EncryptionSpecServiceClient/get_encryption_spec.php new file mode 100644 index 000000000000..4c85980a36ce --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/samples/V2/EncryptionSpecServiceClient/get_encryption_spec.php @@ -0,0 +1,71 @@ +setName($formattedName); + + // Call the API and handle any network failures. + try { + /** @var EncryptionSpec $response */ + $response = $encryptionSpecServiceClient->getEncryptionSpec($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedName = EncryptionSpecServiceClient::encryptionSpecName('[PROJECT]', '[LOCATION]'); + + get_encryption_spec_sample($formattedName); +} +// [END dialogflow_v2_generated_EncryptionSpecService_GetEncryptionSpec_sync] diff --git a/owl-bot-staging/Dialogflow/v2/samples/V2/EncryptionSpecServiceClient/get_location.php b/owl-bot-staging/Dialogflow/v2/samples/V2/EncryptionSpecServiceClient/get_location.php new file mode 100644 index 000000000000..05eb0090ee99 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/samples/V2/EncryptionSpecServiceClient/get_location.php @@ -0,0 +1,57 @@ +getLocation($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} +// [END dialogflow_v2_generated_EncryptionSpecService_GetLocation_sync] diff --git a/owl-bot-staging/Dialogflow/v2/samples/V2/EncryptionSpecServiceClient/initialize_encryption_spec.php b/owl-bot-staging/Dialogflow/v2/samples/V2/EncryptionSpecServiceClient/initialize_encryption_spec.php new file mode 100644 index 000000000000..dcd0b036c07f --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/samples/V2/EncryptionSpecServiceClient/initialize_encryption_spec.php @@ -0,0 +1,93 @@ +setKmsKey($encryptionSpecKmsKey); + $request = (new InitializeEncryptionSpecRequest()) + ->setEncryptionSpec($encryptionSpec); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $encryptionSpecServiceClient->initializeEncryptionSpec($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + /** @var InitializeEncryptionSpecResponse $result */ + $result = $response->getResult(); + printf('Operation successful with response data: %s' . PHP_EOL, $result->serializeToJsonString()); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $encryptionSpecKmsKey = '[KMS_KEY]'; + + initialize_encryption_spec_sample($encryptionSpecKmsKey); +} +// [END dialogflow_v2_generated_EncryptionSpecService_InitializeEncryptionSpec_sync] diff --git a/owl-bot-staging/Dialogflow/v2/samples/V2/EncryptionSpecServiceClient/list_locations.php b/owl-bot-staging/Dialogflow/v2/samples/V2/EncryptionSpecServiceClient/list_locations.php new file mode 100644 index 000000000000..faea8028b38d --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/samples/V2/EncryptionSpecServiceClient/list_locations.php @@ -0,0 +1,62 @@ +listLocations($request); + + /** @var Location $element */ + foreach ($response as $element) { + printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} +// [END dialogflow_v2_generated_EncryptionSpecService_ListLocations_sync] diff --git a/owl-bot-staging/Dialogflow/v2/samples/V2/EntityTypesClient/batch_create_entities.php b/owl-bot-staging/Dialogflow/v2/samples/V2/EntityTypesClient/batch_create_entities.php new file mode 100644 index 000000000000..d925001f0c3b --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/samples/V2/EntityTypesClient/batch_create_entities.php @@ -0,0 +1,125 @@ +/agent/entityTypes/`. Please see + * {@see EntityTypesClient::entityTypeName()} for help formatting this field. + * @param string $entitiesValue The primary value associated with this entity entry. + * For example, if the entity type is *vegetable*, the value could be + * *scallions*. + * + * For `KIND_MAP` entity types: + * + * * A reference value to be used in place of synonyms. + * + * For `KIND_LIST` entity types: + * + * * A string that can contain references to other entity types (with or + * without aliases). + * @param string $entitiesSynonymsElement A collection of value synonyms. For example, if the entity type + * is *vegetable*, and `value` is *scallions*, a synonym could be *green + * onions*. + * + * For `KIND_LIST` entity types: + * + * * This collection must contain exactly one synonym equal to `value`. + */ +function batch_create_entities_sample( + string $formattedParent, + string $entitiesValue, + string $entitiesSynonymsElement +): void { + // Create a client. + $entityTypesClient = new EntityTypesClient(); + + // Prepare the request message. + $entitiesSynonyms = [$entitiesSynonymsElement,]; + $entity = (new Entity()) + ->setValue($entitiesValue) + ->setSynonyms($entitiesSynonyms); + $entities = [$entity,]; + $request = (new BatchCreateEntitiesRequest()) + ->setParent($formattedParent) + ->setEntities($entities); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $entityTypesClient->batchCreateEntities($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + printf('Operation completed successfully.' . PHP_EOL); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedParent = EntityTypesClient::entityTypeName('[PROJECT]', '[ENTITY_TYPE]'); + $entitiesValue = '[VALUE]'; + $entitiesSynonymsElement = '[SYNONYMS]'; + + batch_create_entities_sample($formattedParent, $entitiesValue, $entitiesSynonymsElement); +} +// [END dialogflow_v2_generated_EntityTypes_BatchCreateEntities_sync] diff --git a/owl-bot-staging/Dialogflow/v2/samples/V2/EntityTypesClient/batch_delete_entities.php b/owl-bot-staging/Dialogflow/v2/samples/V2/EntityTypesClient/batch_delete_entities.php new file mode 100644 index 000000000000..4cb1b6f1483f --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/samples/V2/EntityTypesClient/batch_delete_entities.php @@ -0,0 +1,100 @@ +/agent/entityTypes/`. Please see + * {@see EntityTypesClient::entityTypeName()} for help formatting this field. + * @param string $entityValuesElement The reference `values` of the entities to delete. Note that + * these are not fully-qualified names, i.e. they don't start with + * `projects/`. + */ +function batch_delete_entities_sample(string $formattedParent, string $entityValuesElement): void +{ + // Create a client. + $entityTypesClient = new EntityTypesClient(); + + // Prepare the request message. + $entityValues = [$entityValuesElement,]; + $request = (new BatchDeleteEntitiesRequest()) + ->setParent($formattedParent) + ->setEntityValues($entityValues); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $entityTypesClient->batchDeleteEntities($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + printf('Operation completed successfully.' . PHP_EOL); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedParent = EntityTypesClient::entityTypeName('[PROJECT]', '[ENTITY_TYPE]'); + $entityValuesElement = '[ENTITY_VALUES]'; + + batch_delete_entities_sample($formattedParent, $entityValuesElement); +} +// [END dialogflow_v2_generated_EntityTypes_BatchDeleteEntities_sync] diff --git a/owl-bot-staging/Dialogflow/v2/samples/V2/EntityTypesClient/batch_delete_entity_types.php b/owl-bot-staging/Dialogflow/v2/samples/V2/EntityTypesClient/batch_delete_entity_types.php new file mode 100644 index 000000000000..b2b9b48c0985 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/samples/V2/EntityTypesClient/batch_delete_entity_types.php @@ -0,0 +1,101 @@ +/agent`. Please see + * {@see EntityTypesClient::agentName()} for help formatting this field. + * @param string $entityTypeNamesElement The names entity types to delete. All names must point to the + * same agent as `parent`. + */ +function batch_delete_entity_types_sample( + string $formattedParent, + string $entityTypeNamesElement +): void { + // Create a client. + $entityTypesClient = new EntityTypesClient(); + + // Prepare the request message. + $entityTypeNames = [$entityTypeNamesElement,]; + $request = (new BatchDeleteEntityTypesRequest()) + ->setParent($formattedParent) + ->setEntityTypeNames($entityTypeNames); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $entityTypesClient->batchDeleteEntityTypes($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + printf('Operation completed successfully.' . PHP_EOL); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedParent = EntityTypesClient::agentName('[PROJECT]'); + $entityTypeNamesElement = '[ENTITY_TYPE_NAMES]'; + + batch_delete_entity_types_sample($formattedParent, $entityTypeNamesElement); +} +// [END dialogflow_v2_generated_EntityTypes_BatchDeleteEntityTypes_sync] diff --git a/owl-bot-staging/Dialogflow/v2/samples/V2/EntityTypesClient/batch_update_entities.php b/owl-bot-staging/Dialogflow/v2/samples/V2/EntityTypesClient/batch_update_entities.php new file mode 100644 index 000000000000..4232b5c93fc5 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/samples/V2/EntityTypesClient/batch_update_entities.php @@ -0,0 +1,128 @@ +/agent/entityTypes/`. Please see + * {@see EntityTypesClient::entityTypeName()} for help formatting this field. + * @param string $entitiesValue The primary value associated with this entity entry. + * For example, if the entity type is *vegetable*, the value could be + * *scallions*. + * + * For `KIND_MAP` entity types: + * + * * A reference value to be used in place of synonyms. + * + * For `KIND_LIST` entity types: + * + * * A string that can contain references to other entity types (with or + * without aliases). + * @param string $entitiesSynonymsElement A collection of value synonyms. For example, if the entity type + * is *vegetable*, and `value` is *scallions*, a synonym could be *green + * onions*. + * + * For `KIND_LIST` entity types: + * + * * This collection must contain exactly one synonym equal to `value`. + */ +function batch_update_entities_sample( + string $formattedParent, + string $entitiesValue, + string $entitiesSynonymsElement +): void { + // Create a client. + $entityTypesClient = new EntityTypesClient(); + + // Prepare the request message. + $entitiesSynonyms = [$entitiesSynonymsElement,]; + $entity = (new Entity()) + ->setValue($entitiesValue) + ->setSynonyms($entitiesSynonyms); + $entities = [$entity,]; + $request = (new BatchUpdateEntitiesRequest()) + ->setParent($formattedParent) + ->setEntities($entities); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $entityTypesClient->batchUpdateEntities($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + printf('Operation completed successfully.' . PHP_EOL); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedParent = EntityTypesClient::entityTypeName('[PROJECT]', '[ENTITY_TYPE]'); + $entitiesValue = '[VALUE]'; + $entitiesSynonymsElement = '[SYNONYMS]'; + + batch_update_entities_sample($formattedParent, $entitiesValue, $entitiesSynonymsElement); +} +// [END dialogflow_v2_generated_EntityTypes_BatchUpdateEntities_sync] diff --git a/owl-bot-staging/Dialogflow/v2/samples/V2/EntityTypesClient/batch_update_entity_types.php b/owl-bot-staging/Dialogflow/v2/samples/V2/EntityTypesClient/batch_update_entity_types.php new file mode 100644 index 000000000000..abdbef28737a --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/samples/V2/EntityTypesClient/batch_update_entity_types.php @@ -0,0 +1,97 @@ +/agent`. Please see + * {@see EntityTypesClient::agentName()} for help formatting this field. + */ +function batch_update_entity_types_sample(string $formattedParent): void +{ + // Create a client. + $entityTypesClient = new EntityTypesClient(); + + // Prepare the request message. + $request = (new BatchUpdateEntityTypesRequest()) + ->setParent($formattedParent); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $entityTypesClient->batchUpdateEntityTypes($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + /** @var BatchUpdateEntityTypesResponse $result */ + $result = $response->getResult(); + printf('Operation successful with response data: %s' . PHP_EOL, $result->serializeToJsonString()); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedParent = EntityTypesClient::agentName('[PROJECT]'); + + batch_update_entity_types_sample($formattedParent); +} +// [END dialogflow_v2_generated_EntityTypes_BatchUpdateEntityTypes_sync] diff --git a/owl-bot-staging/Dialogflow/v2/samples/V2/EntityTypesClient/create_entity_type.php b/owl-bot-staging/Dialogflow/v2/samples/V2/EntityTypesClient/create_entity_type.php new file mode 100644 index 000000000000..e9bb50968276 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/samples/V2/EntityTypesClient/create_entity_type.php @@ -0,0 +1,88 @@ +/agent`. Please see + * {@see EntityTypesClient::agentName()} for help formatting this field. + * @param string $entityTypeDisplayName The name of the entity type. + * @param int $entityTypeKind Indicates the kind of entity type. + */ +function create_entity_type_sample( + string $formattedParent, + string $entityTypeDisplayName, + int $entityTypeKind +): void { + // Create a client. + $entityTypesClient = new EntityTypesClient(); + + // Prepare the request message. + $entityType = (new EntityType()) + ->setDisplayName($entityTypeDisplayName) + ->setKind($entityTypeKind); + $request = (new CreateEntityTypeRequest()) + ->setParent($formattedParent) + ->setEntityType($entityType); + + // Call the API and handle any network failures. + try { + /** @var EntityType $response */ + $response = $entityTypesClient->createEntityType($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedParent = EntityTypesClient::agentName('[PROJECT]'); + $entityTypeDisplayName = '[DISPLAY_NAME]'; + $entityTypeKind = Kind::KIND_UNSPECIFIED; + + create_entity_type_sample($formattedParent, $entityTypeDisplayName, $entityTypeKind); +} +// [END dialogflow_v2_generated_EntityTypes_CreateEntityType_sync] diff --git a/owl-bot-staging/Dialogflow/v2/samples/V2/EntityTypesClient/delete_entity_type.php b/owl-bot-staging/Dialogflow/v2/samples/V2/EntityTypesClient/delete_entity_type.php new file mode 100644 index 000000000000..2f1bc44659cd --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/samples/V2/EntityTypesClient/delete_entity_type.php @@ -0,0 +1,74 @@ +/agent/entityTypes/`. Please see + * {@see EntityTypesClient::entityTypeName()} for help formatting this field. + */ +function delete_entity_type_sample(string $formattedName): void +{ + // Create a client. + $entityTypesClient = new EntityTypesClient(); + + // Prepare the request message. + $request = (new DeleteEntityTypeRequest()) + ->setName($formattedName); + + // Call the API and handle any network failures. + try { + $entityTypesClient->deleteEntityType($request); + printf('Call completed successfully.' . PHP_EOL); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedName = EntityTypesClient::entityTypeName('[PROJECT]', '[ENTITY_TYPE]'); + + delete_entity_type_sample($formattedName); +} +// [END dialogflow_v2_generated_EntityTypes_DeleteEntityType_sync] diff --git a/owl-bot-staging/Dialogflow/v2/samples/V2/EntityTypesClient/get_entity_type.php b/owl-bot-staging/Dialogflow/v2/samples/V2/EntityTypesClient/get_entity_type.php new file mode 100644 index 000000000000..cfcc6758d825 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/samples/V2/EntityTypesClient/get_entity_type.php @@ -0,0 +1,72 @@ +/agent/entityTypes/`. Please see + * {@see EntityTypesClient::entityTypeName()} for help formatting this field. + */ +function get_entity_type_sample(string $formattedName): void +{ + // Create a client. + $entityTypesClient = new EntityTypesClient(); + + // Prepare the request message. + $request = (new GetEntityTypeRequest()) + ->setName($formattedName); + + // Call the API and handle any network failures. + try { + /** @var EntityType $response */ + $response = $entityTypesClient->getEntityType($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedName = EntityTypesClient::entityTypeName('[PROJECT]', '[ENTITY_TYPE]'); + + get_entity_type_sample($formattedName); +} +// [END dialogflow_v2_generated_EntityTypes_GetEntityType_sync] diff --git a/owl-bot-staging/Dialogflow/v2/samples/V2/EntityTypesClient/get_location.php b/owl-bot-staging/Dialogflow/v2/samples/V2/EntityTypesClient/get_location.php new file mode 100644 index 000000000000..065cbfb35c8c --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/samples/V2/EntityTypesClient/get_location.php @@ -0,0 +1,57 @@ +getLocation($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} +// [END dialogflow_v2_generated_EntityTypes_GetLocation_sync] diff --git a/owl-bot-staging/Dialogflow/v2/samples/V2/EntityTypesClient/list_entity_types.php b/owl-bot-staging/Dialogflow/v2/samples/V2/EntityTypesClient/list_entity_types.php new file mode 100644 index 000000000000..6c450e73334d --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/samples/V2/EntityTypesClient/list_entity_types.php @@ -0,0 +1,77 @@ +/agent`. Please see + * {@see EntityTypesClient::agentName()} for help formatting this field. + */ +function list_entity_types_sample(string $formattedParent): void +{ + // Create a client. + $entityTypesClient = new EntityTypesClient(); + + // Prepare the request message. + $request = (new ListEntityTypesRequest()) + ->setParent($formattedParent); + + // Call the API and handle any network failures. + try { + /** @var PagedListResponse $response */ + $response = $entityTypesClient->listEntityTypes($request); + + /** @var EntityType $element */ + foreach ($response as $element) { + printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedParent = EntityTypesClient::agentName('[PROJECT]'); + + list_entity_types_sample($formattedParent); +} +// [END dialogflow_v2_generated_EntityTypes_ListEntityTypes_sync] diff --git a/owl-bot-staging/Dialogflow/v2/samples/V2/EntityTypesClient/list_locations.php b/owl-bot-staging/Dialogflow/v2/samples/V2/EntityTypesClient/list_locations.php new file mode 100644 index 000000000000..7759f46bfa04 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/samples/V2/EntityTypesClient/list_locations.php @@ -0,0 +1,62 @@ +listLocations($request); + + /** @var Location $element */ + foreach ($response as $element) { + printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} +// [END dialogflow_v2_generated_EntityTypes_ListLocations_sync] diff --git a/owl-bot-staging/Dialogflow/v2/samples/V2/EntityTypesClient/update_entity_type.php b/owl-bot-staging/Dialogflow/v2/samples/V2/EntityTypesClient/update_entity_type.php new file mode 100644 index 000000000000..ac45a4db42be --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/samples/V2/EntityTypesClient/update_entity_type.php @@ -0,0 +1,80 @@ +setDisplayName($entityTypeDisplayName) + ->setKind($entityTypeKind); + $request = (new UpdateEntityTypeRequest()) + ->setEntityType($entityType); + + // Call the API and handle any network failures. + try { + /** @var EntityType $response */ + $response = $entityTypesClient->updateEntityType($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $entityTypeDisplayName = '[DISPLAY_NAME]'; + $entityTypeKind = Kind::KIND_UNSPECIFIED; + + update_entity_type_sample($entityTypeDisplayName, $entityTypeKind); +} +// [END dialogflow_v2_generated_EntityTypes_UpdateEntityType_sync] diff --git a/owl-bot-staging/Dialogflow/v2/samples/V2/EnvironmentsClient/create_environment.php b/owl-bot-staging/Dialogflow/v2/samples/V2/EnvironmentsClient/create_environment.php new file mode 100644 index 000000000000..414eb6379819 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/samples/V2/EnvironmentsClient/create_environment.php @@ -0,0 +1,80 @@ +/agent` + * - `projects//locations//agent` + * Please see {@see EnvironmentsClient::agentName()} for help formatting this field. + * @param string $environmentId The unique id of the new environment. + */ +function create_environment_sample(string $formattedParent, string $environmentId): void +{ + // Create a client. + $environmentsClient = new EnvironmentsClient(); + + // Prepare the request message. + $environment = new Environment(); + $request = (new CreateEnvironmentRequest()) + ->setParent($formattedParent) + ->setEnvironment($environment) + ->setEnvironmentId($environmentId); + + // Call the API and handle any network failures. + try { + /** @var Environment $response */ + $response = $environmentsClient->createEnvironment($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedParent = EnvironmentsClient::agentName('[PROJECT]'); + $environmentId = '[ENVIRONMENT_ID]'; + + create_environment_sample($formattedParent, $environmentId); +} +// [END dialogflow_v2_generated_Environments_CreateEnvironment_sync] diff --git a/owl-bot-staging/Dialogflow/v2/samples/V2/EnvironmentsClient/delete_environment.php b/owl-bot-staging/Dialogflow/v2/samples/V2/EnvironmentsClient/delete_environment.php new file mode 100644 index 000000000000..70e12ffa46a0 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/samples/V2/EnvironmentsClient/delete_environment.php @@ -0,0 +1,76 @@ +/agent/environments/` + * - `projects//locations//agent/environments/` + * + * The environment ID for the default environment is `-`. Please see + * {@see EnvironmentsClient::environmentName()} for help formatting this field. + */ +function delete_environment_sample(string $formattedName): void +{ + // Create a client. + $environmentsClient = new EnvironmentsClient(); + + // Prepare the request message. + $request = (new DeleteEnvironmentRequest()) + ->setName($formattedName); + + // Call the API and handle any network failures. + try { + $environmentsClient->deleteEnvironment($request); + printf('Call completed successfully.' . PHP_EOL); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedName = EnvironmentsClient::environmentName('[PROJECT]', '[ENVIRONMENT]'); + + delete_environment_sample($formattedName); +} +// [END dialogflow_v2_generated_Environments_DeleteEnvironment_sync] diff --git a/owl-bot-staging/Dialogflow/v2/samples/V2/EnvironmentsClient/get_environment.php b/owl-bot-staging/Dialogflow/v2/samples/V2/EnvironmentsClient/get_environment.php new file mode 100644 index 000000000000..2b20b35a876e --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/samples/V2/EnvironmentsClient/get_environment.php @@ -0,0 +1,78 @@ +/agent/environments/` + * - `projects//locations//agent/environments/` + * + * The environment ID for the default environment is `-`. Please see + * {@see EnvironmentsClient::environmentName()} for help formatting this field. + */ +function get_environment_sample(string $formattedName): void +{ + // Create a client. + $environmentsClient = new EnvironmentsClient(); + + // Prepare the request message. + $request = (new GetEnvironmentRequest()) + ->setName($formattedName); + + // Call the API and handle any network failures. + try { + /** @var Environment $response */ + $response = $environmentsClient->getEnvironment($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedName = EnvironmentsClient::environmentName('[PROJECT]', '[ENVIRONMENT]'); + + get_environment_sample($formattedName); +} +// [END dialogflow_v2_generated_Environments_GetEnvironment_sync] diff --git a/owl-bot-staging/Dialogflow/v2/samples/V2/EnvironmentsClient/get_environment_history.php b/owl-bot-staging/Dialogflow/v2/samples/V2/EnvironmentsClient/get_environment_history.php new file mode 100644 index 000000000000..f10f6dbbeea6 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/samples/V2/EnvironmentsClient/get_environment_history.php @@ -0,0 +1,83 @@ +/agent/environments/` + * - `projects//locations//agent/environments/` + * + * The environment ID for the default environment is `-`. Please see + * {@see EnvironmentsClient::environmentName()} for help formatting this field. + */ +function get_environment_history_sample(string $formattedParent): void +{ + // Create a client. + $environmentsClient = new EnvironmentsClient(); + + // Prepare the request message. + $request = (new GetEnvironmentHistoryRequest()) + ->setParent($formattedParent); + + // Call the API and handle any network failures. + try { + /** @var PagedListResponse $response */ + $response = $environmentsClient->getEnvironmentHistory($request); + + /** @var Entry $element */ + foreach ($response as $element) { + printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedParent = EnvironmentsClient::environmentName('[PROJECT]', '[ENVIRONMENT]'); + + get_environment_history_sample($formattedParent); +} +// [END dialogflow_v2_generated_Environments_GetEnvironmentHistory_sync] diff --git a/owl-bot-staging/Dialogflow/v2/samples/V2/EnvironmentsClient/get_location.php b/owl-bot-staging/Dialogflow/v2/samples/V2/EnvironmentsClient/get_location.php new file mode 100644 index 000000000000..47ddbfb408ee --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/samples/V2/EnvironmentsClient/get_location.php @@ -0,0 +1,57 @@ +getLocation($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} +// [END dialogflow_v2_generated_Environments_GetLocation_sync] diff --git a/owl-bot-staging/Dialogflow/v2/samples/V2/EnvironmentsClient/list_environments.php b/owl-bot-staging/Dialogflow/v2/samples/V2/EnvironmentsClient/list_environments.php new file mode 100644 index 000000000000..cf3aaca72049 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/samples/V2/EnvironmentsClient/list_environments.php @@ -0,0 +1,80 @@ +/agent` + * - `projects//locations//agent` + * Please see {@see EnvironmentsClient::agentName()} for help formatting this field. + */ +function list_environments_sample(string $formattedParent): void +{ + // Create a client. + $environmentsClient = new EnvironmentsClient(); + + // Prepare the request message. + $request = (new ListEnvironmentsRequest()) + ->setParent($formattedParent); + + // Call the API and handle any network failures. + try { + /** @var PagedListResponse $response */ + $response = $environmentsClient->listEnvironments($request); + + /** @var Environment $element */ + foreach ($response as $element) { + printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedParent = EnvironmentsClient::agentName('[PROJECT]'); + + list_environments_sample($formattedParent); +} +// [END dialogflow_v2_generated_Environments_ListEnvironments_sync] diff --git a/owl-bot-staging/Dialogflow/v2/samples/V2/EnvironmentsClient/list_locations.php b/owl-bot-staging/Dialogflow/v2/samples/V2/EnvironmentsClient/list_locations.php new file mode 100644 index 000000000000..67b91e16d141 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/samples/V2/EnvironmentsClient/list_locations.php @@ -0,0 +1,62 @@ +listLocations($request); + + /** @var Location $element */ + foreach ($response as $element) { + printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} +// [END dialogflow_v2_generated_Environments_ListLocations_sync] diff --git a/owl-bot-staging/Dialogflow/v2/samples/V2/EnvironmentsClient/update_environment.php b/owl-bot-staging/Dialogflow/v2/samples/V2/EnvironmentsClient/update_environment.php new file mode 100644 index 000000000000..d8c7b8d1b9f1 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/samples/V2/EnvironmentsClient/update_environment.php @@ -0,0 +1,73 @@ +setEnvironment($environment) + ->setUpdateMask($updateMask); + + // Call the API and handle any network failures. + try { + /** @var Environment $response */ + $response = $environmentsClient->updateEnvironment($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} +// [END dialogflow_v2_generated_Environments_UpdateEnvironment_sync] diff --git a/owl-bot-staging/Dialogflow/v2/samples/V2/FulfillmentsClient/get_fulfillment.php b/owl-bot-staging/Dialogflow/v2/samples/V2/FulfillmentsClient/get_fulfillment.php new file mode 100644 index 000000000000..95c8a447eb92 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/samples/V2/FulfillmentsClient/get_fulfillment.php @@ -0,0 +1,72 @@ +/agent/fulfillment`. Please see + * {@see FulfillmentsClient::fulfillmentName()} for help formatting this field. + */ +function get_fulfillment_sample(string $formattedName): void +{ + // Create a client. + $fulfillmentsClient = new FulfillmentsClient(); + + // Prepare the request message. + $request = (new GetFulfillmentRequest()) + ->setName($formattedName); + + // Call the API and handle any network failures. + try { + /** @var Fulfillment $response */ + $response = $fulfillmentsClient->getFulfillment($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedName = FulfillmentsClient::fulfillmentName('[PROJECT]'); + + get_fulfillment_sample($formattedName); +} +// [END dialogflow_v2_generated_Fulfillments_GetFulfillment_sync] diff --git a/owl-bot-staging/Dialogflow/v2/samples/V2/FulfillmentsClient/get_location.php b/owl-bot-staging/Dialogflow/v2/samples/V2/FulfillmentsClient/get_location.php new file mode 100644 index 000000000000..220f98998443 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/samples/V2/FulfillmentsClient/get_location.php @@ -0,0 +1,57 @@ +getLocation($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} +// [END dialogflow_v2_generated_Fulfillments_GetLocation_sync] diff --git a/owl-bot-staging/Dialogflow/v2/samples/V2/FulfillmentsClient/list_locations.php b/owl-bot-staging/Dialogflow/v2/samples/V2/FulfillmentsClient/list_locations.php new file mode 100644 index 000000000000..88eba160adee --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/samples/V2/FulfillmentsClient/list_locations.php @@ -0,0 +1,62 @@ +listLocations($request); + + /** @var Location $element */ + foreach ($response as $element) { + printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} +// [END dialogflow_v2_generated_Fulfillments_ListLocations_sync] diff --git a/owl-bot-staging/Dialogflow/v2/samples/V2/FulfillmentsClient/update_fulfillment.php b/owl-bot-staging/Dialogflow/v2/samples/V2/FulfillmentsClient/update_fulfillment.php new file mode 100644 index 000000000000..fd7c92fe1f9f --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/samples/V2/FulfillmentsClient/update_fulfillment.php @@ -0,0 +1,81 @@ +/agent/fulfillment` + * - `projects//locations//agent/fulfillment` + * + * This field is not used for Fulfillment in an Environment. + */ +function update_fulfillment_sample(string $fulfillmentName): void +{ + // Create a client. + $fulfillmentsClient = new FulfillmentsClient(); + + // Prepare the request message. + $fulfillment = (new Fulfillment()) + ->setName($fulfillmentName); + $updateMask = new FieldMask(); + $request = (new UpdateFulfillmentRequest()) + ->setFulfillment($fulfillment) + ->setUpdateMask($updateMask); + + // Call the API and handle any network failures. + try { + /** @var Fulfillment $response */ + $response = $fulfillmentsClient->updateFulfillment($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $fulfillmentName = '[NAME]'; + + update_fulfillment_sample($fulfillmentName); +} +// [END dialogflow_v2_generated_Fulfillments_UpdateFulfillment_sync] diff --git a/owl-bot-staging/Dialogflow/v2/samples/V2/GeneratorsClient/create_generator.php b/owl-bot-staging/Dialogflow/v2/samples/V2/GeneratorsClient/create_generator.php new file mode 100644 index 000000000000..a4bef654c828 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/samples/V2/GeneratorsClient/create_generator.php @@ -0,0 +1,74 @@ +/locations/` + * Please see {@see GeneratorsClient::projectName()} for help formatting this field. + */ +function create_generator_sample(string $formattedParent): void +{ + // Create a client. + $generatorsClient = new GeneratorsClient(); + + // Prepare the request message. + $generator = new Generator(); + $request = (new CreateGeneratorRequest()) + ->setParent($formattedParent) + ->setGenerator($generator); + + // Call the API and handle any network failures. + try { + /** @var Generator $response */ + $response = $generatorsClient->createGenerator($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedParent = GeneratorsClient::projectName('[PROJECT]'); + + create_generator_sample($formattedParent); +} +// [END dialogflow_v2_generated_Generators_CreateGenerator_sync] diff --git a/owl-bot-staging/Dialogflow/v2/samples/V2/GeneratorsClient/delete_generator.php b/owl-bot-staging/Dialogflow/v2/samples/V2/GeneratorsClient/delete_generator.php new file mode 100644 index 000000000000..73293152827d --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/samples/V2/GeneratorsClient/delete_generator.php @@ -0,0 +1,70 @@ +/locations//generators/` + * Please see {@see GeneratorsClient::generatorName()} for help formatting this field. + */ +function delete_generator_sample(string $formattedName): void +{ + // Create a client. + $generatorsClient = new GeneratorsClient(); + + // Prepare the request message. + $request = (new DeleteGeneratorRequest()) + ->setName($formattedName); + + // Call the API and handle any network failures. + try { + $generatorsClient->deleteGenerator($request); + printf('Call completed successfully.' . PHP_EOL); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedName = GeneratorsClient::generatorName('[PROJECT]', '[LOCATION]', '[GENERATOR]'); + + delete_generator_sample($formattedName); +} +// [END dialogflow_v2_generated_Generators_DeleteGenerator_sync] diff --git a/owl-bot-staging/Dialogflow/v2/samples/V2/GeneratorsClient/get_generator.php b/owl-bot-staging/Dialogflow/v2/samples/V2/GeneratorsClient/get_generator.php new file mode 100644 index 000000000000..d532ba546bd4 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/samples/V2/GeneratorsClient/get_generator.php @@ -0,0 +1,72 @@ +/locations/`/generators/` + * Please see {@see GeneratorsClient::generatorName()} for help formatting this field. + */ +function get_generator_sample(string $formattedName): void +{ + // Create a client. + $generatorsClient = new GeneratorsClient(); + + // Prepare the request message. + $request = (new GetGeneratorRequest()) + ->setName($formattedName); + + // Call the API and handle any network failures. + try { + /** @var Generator $response */ + $response = $generatorsClient->getGenerator($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedName = GeneratorsClient::generatorName('[PROJECT]', '[LOCATION]', '[GENERATOR]'); + + get_generator_sample($formattedName); +} +// [END dialogflow_v2_generated_Generators_GetGenerator_sync] diff --git a/owl-bot-staging/Dialogflow/v2/samples/V2/GeneratorsClient/get_location.php b/owl-bot-staging/Dialogflow/v2/samples/V2/GeneratorsClient/get_location.php new file mode 100644 index 000000000000..2f4b34e83ed5 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/samples/V2/GeneratorsClient/get_location.php @@ -0,0 +1,57 @@ +getLocation($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} +// [END dialogflow_v2_generated_Generators_GetLocation_sync] diff --git a/owl-bot-staging/Dialogflow/v2/samples/V2/GeneratorsClient/list_generators.php b/owl-bot-staging/Dialogflow/v2/samples/V2/GeneratorsClient/list_generators.php new file mode 100644 index 000000000000..213b49176cb7 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/samples/V2/GeneratorsClient/list_generators.php @@ -0,0 +1,77 @@ +/locations/` + * Please see {@see GeneratorsClient::projectName()} for help formatting this field. + */ +function list_generators_sample(string $formattedParent): void +{ + // Create a client. + $generatorsClient = new GeneratorsClient(); + + // Prepare the request message. + $request = (new ListGeneratorsRequest()) + ->setParent($formattedParent); + + // Call the API and handle any network failures. + try { + /** @var PagedListResponse $response */ + $response = $generatorsClient->listGenerators($request); + + /** @var Generator $element */ + foreach ($response as $element) { + printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedParent = GeneratorsClient::projectName('[PROJECT]'); + + list_generators_sample($formattedParent); +} +// [END dialogflow_v2_generated_Generators_ListGenerators_sync] diff --git a/owl-bot-staging/Dialogflow/v2/samples/V2/GeneratorsClient/list_locations.php b/owl-bot-staging/Dialogflow/v2/samples/V2/GeneratorsClient/list_locations.php new file mode 100644 index 000000000000..e39e4235af79 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/samples/V2/GeneratorsClient/list_locations.php @@ -0,0 +1,62 @@ +listLocations($request); + + /** @var Location $element */ + foreach ($response as $element) { + printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} +// [END dialogflow_v2_generated_Generators_ListLocations_sync] diff --git a/owl-bot-staging/Dialogflow/v2/samples/V2/GeneratorsClient/update_generator.php b/owl-bot-staging/Dialogflow/v2/samples/V2/GeneratorsClient/update_generator.php new file mode 100644 index 000000000000..35b3dfc6538b --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/samples/V2/GeneratorsClient/update_generator.php @@ -0,0 +1,59 @@ +setGenerator($generator); + + // Call the API and handle any network failures. + try { + /** @var Generator $response */ + $response = $generatorsClient->updateGenerator($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} +// [END dialogflow_v2_generated_Generators_UpdateGenerator_sync] diff --git a/owl-bot-staging/Dialogflow/v2/samples/V2/IntentsClient/batch_delete_intents.php b/owl-bot-staging/Dialogflow/v2/samples/V2/IntentsClient/batch_delete_intents.php new file mode 100644 index 000000000000..f229786f6052 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/samples/V2/IntentsClient/batch_delete_intents.php @@ -0,0 +1,101 @@ +/agent`. Please see + * {@see IntentsClient::agentName()} for help formatting this field. + * @param string $intentsDisplayName The name of this intent. + */ +function batch_delete_intents_sample(string $formattedParent, string $intentsDisplayName): void +{ + // Create a client. + $intentsClient = new IntentsClient(); + + // Prepare the request message. + $intent = (new Intent()) + ->setDisplayName($intentsDisplayName); + $intents = [$intent,]; + $request = (new BatchDeleteIntentsRequest()) + ->setParent($formattedParent) + ->setIntents($intents); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $intentsClient->batchDeleteIntents($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + printf('Operation completed successfully.' . PHP_EOL); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedParent = IntentsClient::agentName('[PROJECT]'); + $intentsDisplayName = '[DISPLAY_NAME]'; + + batch_delete_intents_sample($formattedParent, $intentsDisplayName); +} +// [END dialogflow_v2_generated_Intents_BatchDeleteIntents_sync] diff --git a/owl-bot-staging/Dialogflow/v2/samples/V2/IntentsClient/batch_update_intents.php b/owl-bot-staging/Dialogflow/v2/samples/V2/IntentsClient/batch_update_intents.php new file mode 100644 index 000000000000..c81cebdfc54a --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/samples/V2/IntentsClient/batch_update_intents.php @@ -0,0 +1,97 @@ +/agent`. Please see + * {@see IntentsClient::agentName()} for help formatting this field. + */ +function batch_update_intents_sample(string $formattedParent): void +{ + // Create a client. + $intentsClient = new IntentsClient(); + + // Prepare the request message. + $request = (new BatchUpdateIntentsRequest()) + ->setParent($formattedParent); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $intentsClient->batchUpdateIntents($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + /** @var BatchUpdateIntentsResponse $result */ + $result = $response->getResult(); + printf('Operation successful with response data: %s' . PHP_EOL, $result->serializeToJsonString()); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedParent = IntentsClient::agentName('[PROJECT]'); + + batch_update_intents_sample($formattedParent); +} +// [END dialogflow_v2_generated_Intents_BatchUpdateIntents_sync] diff --git a/owl-bot-staging/Dialogflow/v2/samples/V2/IntentsClient/create_intent.php b/owl-bot-staging/Dialogflow/v2/samples/V2/IntentsClient/create_intent.php new file mode 100644 index 000000000000..a1dec96ef2a4 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/samples/V2/IntentsClient/create_intent.php @@ -0,0 +1,81 @@ +/agent`. Please see + * {@see IntentsClient::agentName()} for help formatting this field. + * @param string $intentDisplayName The name of this intent. + */ +function create_intent_sample(string $formattedParent, string $intentDisplayName): void +{ + // Create a client. + $intentsClient = new IntentsClient(); + + // Prepare the request message. + $intent = (new Intent()) + ->setDisplayName($intentDisplayName); + $request = (new CreateIntentRequest()) + ->setParent($formattedParent) + ->setIntent($intent); + + // Call the API and handle any network failures. + try { + /** @var Intent $response */ + $response = $intentsClient->createIntent($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedParent = IntentsClient::agentName('[PROJECT]'); + $intentDisplayName = '[DISPLAY_NAME]'; + + create_intent_sample($formattedParent, $intentDisplayName); +} +// [END dialogflow_v2_generated_Intents_CreateIntent_sync] diff --git a/owl-bot-staging/Dialogflow/v2/samples/V2/IntentsClient/delete_intent.php b/owl-bot-staging/Dialogflow/v2/samples/V2/IntentsClient/delete_intent.php new file mode 100644 index 000000000000..96cee57c1820 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/samples/V2/IntentsClient/delete_intent.php @@ -0,0 +1,75 @@ +/agent/intents/`. Please see + * {@see IntentsClient::intentName()} for help formatting this field. + */ +function delete_intent_sample(string $formattedName): void +{ + // Create a client. + $intentsClient = new IntentsClient(); + + // Prepare the request message. + $request = (new DeleteIntentRequest()) + ->setName($formattedName); + + // Call the API and handle any network failures. + try { + $intentsClient->deleteIntent($request); + printf('Call completed successfully.' . PHP_EOL); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedName = IntentsClient::intentName('[PROJECT]', '[INTENT]'); + + delete_intent_sample($formattedName); +} +// [END dialogflow_v2_generated_Intents_DeleteIntent_sync] diff --git a/owl-bot-staging/Dialogflow/v2/samples/V2/IntentsClient/get_intent.php b/owl-bot-staging/Dialogflow/v2/samples/V2/IntentsClient/get_intent.php new file mode 100644 index 000000000000..ef16a6691463 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/samples/V2/IntentsClient/get_intent.php @@ -0,0 +1,72 @@ +/agent/intents/`. Please see + * {@see IntentsClient::intentName()} for help formatting this field. + */ +function get_intent_sample(string $formattedName): void +{ + // Create a client. + $intentsClient = new IntentsClient(); + + // Prepare the request message. + $request = (new GetIntentRequest()) + ->setName($formattedName); + + // Call the API and handle any network failures. + try { + /** @var Intent $response */ + $response = $intentsClient->getIntent($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedName = IntentsClient::intentName('[PROJECT]', '[INTENT]'); + + get_intent_sample($formattedName); +} +// [END dialogflow_v2_generated_Intents_GetIntent_sync] diff --git a/owl-bot-staging/Dialogflow/v2/samples/V2/IntentsClient/get_location.php b/owl-bot-staging/Dialogflow/v2/samples/V2/IntentsClient/get_location.php new file mode 100644 index 000000000000..3f9878d2c29f --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/samples/V2/IntentsClient/get_location.php @@ -0,0 +1,57 @@ +getLocation($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} +// [END dialogflow_v2_generated_Intents_GetLocation_sync] diff --git a/owl-bot-staging/Dialogflow/v2/samples/V2/IntentsClient/list_intents.php b/owl-bot-staging/Dialogflow/v2/samples/V2/IntentsClient/list_intents.php new file mode 100644 index 000000000000..9e33c6e33fcb --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/samples/V2/IntentsClient/list_intents.php @@ -0,0 +1,85 @@ +/agent` or `projects//locations//agent`. + * + * Alternatively, you can specify the environment to list intents for. + * Format: `projects//agent/environments/` + * or `projects//locations//agent/environments/`. + * Note: training phrases of the intents will not be returned for non-draft + * environment. Please see + * {@see IntentsClient::agentName()} for help formatting this field. + */ +function list_intents_sample(string $formattedParent): void +{ + // Create a client. + $intentsClient = new IntentsClient(); + + // Prepare the request message. + $request = (new ListIntentsRequest()) + ->setParent($formattedParent); + + // Call the API and handle any network failures. + try { + /** @var PagedListResponse $response */ + $response = $intentsClient->listIntents($request); + + /** @var Intent $element */ + foreach ($response as $element) { + printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedParent = IntentsClient::agentName('[PROJECT]'); + + list_intents_sample($formattedParent); +} +// [END dialogflow_v2_generated_Intents_ListIntents_sync] diff --git a/owl-bot-staging/Dialogflow/v2/samples/V2/IntentsClient/list_locations.php b/owl-bot-staging/Dialogflow/v2/samples/V2/IntentsClient/list_locations.php new file mode 100644 index 000000000000..24744e08050e --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/samples/V2/IntentsClient/list_locations.php @@ -0,0 +1,62 @@ +listLocations($request); + + /** @var Location $element */ + foreach ($response as $element) { + printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} +// [END dialogflow_v2_generated_Intents_ListLocations_sync] diff --git a/owl-bot-staging/Dialogflow/v2/samples/V2/IntentsClient/update_intent.php b/owl-bot-staging/Dialogflow/v2/samples/V2/IntentsClient/update_intent.php new file mode 100644 index 000000000000..f72c59d23643 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/samples/V2/IntentsClient/update_intent.php @@ -0,0 +1,76 @@ +setDisplayName($intentDisplayName); + $request = (new UpdateIntentRequest()) + ->setIntent($intent); + + // Call the API and handle any network failures. + try { + /** @var Intent $response */ + $response = $intentsClient->updateIntent($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $intentDisplayName = '[DISPLAY_NAME]'; + + update_intent_sample($intentDisplayName); +} +// [END dialogflow_v2_generated_Intents_UpdateIntent_sync] diff --git a/owl-bot-staging/Dialogflow/v2/samples/V2/KnowledgeBasesClient/create_knowledge_base.php b/owl-bot-staging/Dialogflow/v2/samples/V2/KnowledgeBasesClient/create_knowledge_base.php new file mode 100644 index 000000000000..7a064e189d1b --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/samples/V2/KnowledgeBasesClient/create_knowledge_base.php @@ -0,0 +1,80 @@ +/locations/`. Please see + * {@see KnowledgeBasesClient::projectName()} for help formatting this field. + * @param string $knowledgeBaseDisplayName The display name of the knowledge base. The name must be 1024 + * bytes or less; otherwise, the creation request fails. + */ +function create_knowledge_base_sample( + string $formattedParent, + string $knowledgeBaseDisplayName +): void { + // Create a client. + $knowledgeBasesClient = new KnowledgeBasesClient(); + + // Prepare the request message. + $knowledgeBase = (new KnowledgeBase()) + ->setDisplayName($knowledgeBaseDisplayName); + $request = (new CreateKnowledgeBaseRequest()) + ->setParent($formattedParent) + ->setKnowledgeBase($knowledgeBase); + + // Call the API and handle any network failures. + try { + /** @var KnowledgeBase $response */ + $response = $knowledgeBasesClient->createKnowledgeBase($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedParent = KnowledgeBasesClient::projectName('[PROJECT]'); + $knowledgeBaseDisplayName = '[DISPLAY_NAME]'; + + create_knowledge_base_sample($formattedParent, $knowledgeBaseDisplayName); +} +// [END dialogflow_v2_generated_KnowledgeBases_CreateKnowledgeBase_sync] diff --git a/owl-bot-staging/Dialogflow/v2/samples/V2/KnowledgeBasesClient/delete_knowledge_base.php b/owl-bot-staging/Dialogflow/v2/samples/V2/KnowledgeBasesClient/delete_knowledge_base.php new file mode 100644 index 000000000000..c7615ccd188d --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/samples/V2/KnowledgeBasesClient/delete_knowledge_base.php @@ -0,0 +1,71 @@ +/locations//knowledgeBases/`. Please see + * {@see KnowledgeBasesClient::knowledgeBaseName()} for help formatting this field. + */ +function delete_knowledge_base_sample(string $formattedName): void +{ + // Create a client. + $knowledgeBasesClient = new KnowledgeBasesClient(); + + // Prepare the request message. + $request = (new DeleteKnowledgeBaseRequest()) + ->setName($formattedName); + + // Call the API and handle any network failures. + try { + $knowledgeBasesClient->deleteKnowledgeBase($request); + printf('Call completed successfully.' . PHP_EOL); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedName = KnowledgeBasesClient::knowledgeBaseName('[PROJECT]', '[KNOWLEDGE_BASE]'); + + delete_knowledge_base_sample($formattedName); +} +// [END dialogflow_v2_generated_KnowledgeBases_DeleteKnowledgeBase_sync] diff --git a/owl-bot-staging/Dialogflow/v2/samples/V2/KnowledgeBasesClient/get_knowledge_base.php b/owl-bot-staging/Dialogflow/v2/samples/V2/KnowledgeBasesClient/get_knowledge_base.php new file mode 100644 index 000000000000..b673f45f01ce --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/samples/V2/KnowledgeBasesClient/get_knowledge_base.php @@ -0,0 +1,73 @@ +/locations//knowledgeBases/`. Please see + * {@see KnowledgeBasesClient::knowledgeBaseName()} for help formatting this field. + */ +function get_knowledge_base_sample(string $formattedName): void +{ + // Create a client. + $knowledgeBasesClient = new KnowledgeBasesClient(); + + // Prepare the request message. + $request = (new GetKnowledgeBaseRequest()) + ->setName($formattedName); + + // Call the API and handle any network failures. + try { + /** @var KnowledgeBase $response */ + $response = $knowledgeBasesClient->getKnowledgeBase($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedName = KnowledgeBasesClient::knowledgeBaseName('[PROJECT]', '[KNOWLEDGE_BASE]'); + + get_knowledge_base_sample($formattedName); +} +// [END dialogflow_v2_generated_KnowledgeBases_GetKnowledgeBase_sync] diff --git a/owl-bot-staging/Dialogflow/v2/samples/V2/KnowledgeBasesClient/get_location.php b/owl-bot-staging/Dialogflow/v2/samples/V2/KnowledgeBasesClient/get_location.php new file mode 100644 index 000000000000..7ddf260013a7 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/samples/V2/KnowledgeBasesClient/get_location.php @@ -0,0 +1,57 @@ +getLocation($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} +// [END dialogflow_v2_generated_KnowledgeBases_GetLocation_sync] diff --git a/owl-bot-staging/Dialogflow/v2/samples/V2/KnowledgeBasesClient/list_knowledge_bases.php b/owl-bot-staging/Dialogflow/v2/samples/V2/KnowledgeBasesClient/list_knowledge_bases.php new file mode 100644 index 000000000000..49af5e5193c6 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/samples/V2/KnowledgeBasesClient/list_knowledge_bases.php @@ -0,0 +1,77 @@ +/locations/`. Please see + * {@see KnowledgeBasesClient::projectName()} for help formatting this field. + */ +function list_knowledge_bases_sample(string $formattedParent): void +{ + // Create a client. + $knowledgeBasesClient = new KnowledgeBasesClient(); + + // Prepare the request message. + $request = (new ListKnowledgeBasesRequest()) + ->setParent($formattedParent); + + // Call the API and handle any network failures. + try { + /** @var PagedListResponse $response */ + $response = $knowledgeBasesClient->listKnowledgeBases($request); + + /** @var KnowledgeBase $element */ + foreach ($response as $element) { + printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedParent = KnowledgeBasesClient::projectName('[PROJECT]'); + + list_knowledge_bases_sample($formattedParent); +} +// [END dialogflow_v2_generated_KnowledgeBases_ListKnowledgeBases_sync] diff --git a/owl-bot-staging/Dialogflow/v2/samples/V2/KnowledgeBasesClient/list_locations.php b/owl-bot-staging/Dialogflow/v2/samples/V2/KnowledgeBasesClient/list_locations.php new file mode 100644 index 000000000000..34a9e8a99fe5 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/samples/V2/KnowledgeBasesClient/list_locations.php @@ -0,0 +1,62 @@ +listLocations($request); + + /** @var Location $element */ + foreach ($response as $element) { + printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} +// [END dialogflow_v2_generated_KnowledgeBases_ListLocations_sync] diff --git a/owl-bot-staging/Dialogflow/v2/samples/V2/KnowledgeBasesClient/update_knowledge_base.php b/owl-bot-staging/Dialogflow/v2/samples/V2/KnowledgeBasesClient/update_knowledge_base.php new file mode 100644 index 000000000000..86966ede92cd --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/samples/V2/KnowledgeBasesClient/update_knowledge_base.php @@ -0,0 +1,73 @@ +setDisplayName($knowledgeBaseDisplayName); + $request = (new UpdateKnowledgeBaseRequest()) + ->setKnowledgeBase($knowledgeBase); + + // Call the API and handle any network failures. + try { + /** @var KnowledgeBase $response */ + $response = $knowledgeBasesClient->updateKnowledgeBase($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $knowledgeBaseDisplayName = '[DISPLAY_NAME]'; + + update_knowledge_base_sample($knowledgeBaseDisplayName); +} +// [END dialogflow_v2_generated_KnowledgeBases_UpdateKnowledgeBase_sync] diff --git a/owl-bot-staging/Dialogflow/v2/samples/V2/ParticipantsClient/analyze_content.php b/owl-bot-staging/Dialogflow/v2/samples/V2/ParticipantsClient/analyze_content.php new file mode 100644 index 000000000000..9c001a950d22 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/samples/V2/ParticipantsClient/analyze_content.php @@ -0,0 +1,82 @@ +/locations//conversations//participants/`. Please see + * {@see ParticipantsClient::participantName()} for help formatting this field. + */ +function analyze_content_sample(string $formattedParticipant): void +{ + // Create a client. + $participantsClient = new ParticipantsClient(); + + // Prepare the request message. + $request = (new AnalyzeContentRequest()) + ->setParticipant($formattedParticipant); + + // Call the API and handle any network failures. + try { + /** @var AnalyzeContentResponse $response */ + $response = $participantsClient->analyzeContent($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedParticipant = ParticipantsClient::participantName( + '[PROJECT]', + '[CONVERSATION]', + '[PARTICIPANT]' + ); + + analyze_content_sample($formattedParticipant); +} +// [END dialogflow_v2_generated_Participants_AnalyzeContent_sync] diff --git a/owl-bot-staging/Dialogflow/v2/samples/V2/ParticipantsClient/create_participant.php b/owl-bot-staging/Dialogflow/v2/samples/V2/ParticipantsClient/create_participant.php new file mode 100644 index 000000000000..1fe86c08bb57 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/samples/V2/ParticipantsClient/create_participant.php @@ -0,0 +1,75 @@ +/locations//conversations/`. Please see + * {@see ParticipantsClient::conversationName()} for help formatting this field. + */ +function create_participant_sample(string $formattedParent): void +{ + // Create a client. + $participantsClient = new ParticipantsClient(); + + // Prepare the request message. + $participant = new Participant(); + $request = (new CreateParticipantRequest()) + ->setParent($formattedParent) + ->setParticipant($participant); + + // Call the API and handle any network failures. + try { + /** @var Participant $response */ + $response = $participantsClient->createParticipant($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedParent = ParticipantsClient::conversationName('[PROJECT]', '[CONVERSATION]'); + + create_participant_sample($formattedParent); +} +// [END dialogflow_v2_generated_Participants_CreateParticipant_sync] diff --git a/owl-bot-staging/Dialogflow/v2/samples/V2/ParticipantsClient/get_location.php b/owl-bot-staging/Dialogflow/v2/samples/V2/ParticipantsClient/get_location.php new file mode 100644 index 000000000000..20d03909d7cc --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/samples/V2/ParticipantsClient/get_location.php @@ -0,0 +1,57 @@ +getLocation($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} +// [END dialogflow_v2_generated_Participants_GetLocation_sync] diff --git a/owl-bot-staging/Dialogflow/v2/samples/V2/ParticipantsClient/get_participant.php b/owl-bot-staging/Dialogflow/v2/samples/V2/ParticipantsClient/get_participant.php new file mode 100644 index 000000000000..aa179288ba83 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/samples/V2/ParticipantsClient/get_participant.php @@ -0,0 +1,77 @@ +/locations//conversations//participants/`. Please see + * {@see ParticipantsClient::participantName()} for help formatting this field. + */ +function get_participant_sample(string $formattedName): void +{ + // Create a client. + $participantsClient = new ParticipantsClient(); + + // Prepare the request message. + $request = (new GetParticipantRequest()) + ->setName($formattedName); + + // Call the API and handle any network failures. + try { + /** @var Participant $response */ + $response = $participantsClient->getParticipant($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedName = ParticipantsClient::participantName( + '[PROJECT]', + '[CONVERSATION]', + '[PARTICIPANT]' + ); + + get_participant_sample($formattedName); +} +// [END dialogflow_v2_generated_Participants_GetParticipant_sync] diff --git a/owl-bot-staging/Dialogflow/v2/samples/V2/ParticipantsClient/list_locations.php b/owl-bot-staging/Dialogflow/v2/samples/V2/ParticipantsClient/list_locations.php new file mode 100644 index 000000000000..d912ac4f5d82 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/samples/V2/ParticipantsClient/list_locations.php @@ -0,0 +1,62 @@ +listLocations($request); + + /** @var Location $element */ + foreach ($response as $element) { + printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} +// [END dialogflow_v2_generated_Participants_ListLocations_sync] diff --git a/owl-bot-staging/Dialogflow/v2/samples/V2/ParticipantsClient/list_participants.php b/owl-bot-staging/Dialogflow/v2/samples/V2/ParticipantsClient/list_participants.php new file mode 100644 index 000000000000..2e7598014278 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/samples/V2/ParticipantsClient/list_participants.php @@ -0,0 +1,78 @@ +/locations//conversations/`. Please see + * {@see ParticipantsClient::conversationName()} for help formatting this field. + */ +function list_participants_sample(string $formattedParent): void +{ + // Create a client. + $participantsClient = new ParticipantsClient(); + + // Prepare the request message. + $request = (new ListParticipantsRequest()) + ->setParent($formattedParent); + + // Call the API and handle any network failures. + try { + /** @var PagedListResponse $response */ + $response = $participantsClient->listParticipants($request); + + /** @var Participant $element */ + foreach ($response as $element) { + printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedParent = ParticipantsClient::conversationName('[PROJECT]', '[CONVERSATION]'); + + list_participants_sample($formattedParent); +} +// [END dialogflow_v2_generated_Participants_ListParticipants_sync] diff --git a/owl-bot-staging/Dialogflow/v2/samples/V2/ParticipantsClient/streaming_analyze_content.php b/owl-bot-staging/Dialogflow/v2/samples/V2/ParticipantsClient/streaming_analyze_content.php new file mode 100644 index 000000000000..feaa5a96d29a --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/samples/V2/ParticipantsClient/streaming_analyze_content.php @@ -0,0 +1,97 @@ +/locations//conversations//participants/`. Please see + * {@see ParticipantsClient::participantName()} for help formatting this field. + */ +function streaming_analyze_content_sample(string $formattedParticipant): void +{ + // Create a client. + $participantsClient = new ParticipantsClient(); + + // Prepare the request message. + $request = (new StreamingAnalyzeContentRequest()) + ->setParticipant($formattedParticipant); + + // Call the API and handle any network failures. + try { + /** @var BidiStream $stream */ + $stream = $participantsClient->streamingAnalyzeContent(); + $stream->writeAll([$request,]); + + /** @var StreamingAnalyzeContentResponse $element */ + foreach ($stream->closeWriteAndReadAll() as $element) { + printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedParticipant = ParticipantsClient::participantName( + '[PROJECT]', + '[CONVERSATION]', + '[PARTICIPANT]' + ); + + streaming_analyze_content_sample($formattedParticipant); +} +// [END dialogflow_v2_generated_Participants_StreamingAnalyzeContent_sync] diff --git a/owl-bot-staging/Dialogflow/v2/samples/V2/ParticipantsClient/suggest_articles.php b/owl-bot-staging/Dialogflow/v2/samples/V2/ParticipantsClient/suggest_articles.php new file mode 100644 index 000000000000..e1a3cba75cf1 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/samples/V2/ParticipantsClient/suggest_articles.php @@ -0,0 +1,78 @@ +/locations//conversations//participants/`. Please see + * {@see ParticipantsClient::participantName()} for help formatting this field. + */ +function suggest_articles_sample(string $formattedParent): void +{ + // Create a client. + $participantsClient = new ParticipantsClient(); + + // Prepare the request message. + $request = (new SuggestArticlesRequest()) + ->setParent($formattedParent); + + // Call the API and handle any network failures. + try { + /** @var SuggestArticlesResponse $response */ + $response = $participantsClient->suggestArticles($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedParent = ParticipantsClient::participantName( + '[PROJECT]', + '[CONVERSATION]', + '[PARTICIPANT]' + ); + + suggest_articles_sample($formattedParent); +} +// [END dialogflow_v2_generated_Participants_SuggestArticles_sync] diff --git a/owl-bot-staging/Dialogflow/v2/samples/V2/ParticipantsClient/suggest_faq_answers.php b/owl-bot-staging/Dialogflow/v2/samples/V2/ParticipantsClient/suggest_faq_answers.php new file mode 100644 index 000000000000..7f75844f05cf --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/samples/V2/ParticipantsClient/suggest_faq_answers.php @@ -0,0 +1,78 @@ +/locations//conversations//participants/`. Please see + * {@see ParticipantsClient::participantName()} for help formatting this field. + */ +function suggest_faq_answers_sample(string $formattedParent): void +{ + // Create a client. + $participantsClient = new ParticipantsClient(); + + // Prepare the request message. + $request = (new SuggestFaqAnswersRequest()) + ->setParent($formattedParent); + + // Call the API and handle any network failures. + try { + /** @var SuggestFaqAnswersResponse $response */ + $response = $participantsClient->suggestFaqAnswers($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedParent = ParticipantsClient::participantName( + '[PROJECT]', + '[CONVERSATION]', + '[PARTICIPANT]' + ); + + suggest_faq_answers_sample($formattedParent); +} +// [END dialogflow_v2_generated_Participants_SuggestFaqAnswers_sync] diff --git a/owl-bot-staging/Dialogflow/v2/samples/V2/ParticipantsClient/suggest_knowledge_assist.php b/owl-bot-staging/Dialogflow/v2/samples/V2/ParticipantsClient/suggest_knowledge_assist.php new file mode 100644 index 000000000000..be42b7b7fb31 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/samples/V2/ParticipantsClient/suggest_knowledge_assist.php @@ -0,0 +1,77 @@ +/locations//conversations//participants/`. Please see + * {@see ParticipantsClient::participantName()} for help formatting this field. + */ +function suggest_knowledge_assist_sample(string $formattedParent): void +{ + // Create a client. + $participantsClient = new ParticipantsClient(); + + // Prepare the request message. + $request = (new SuggestKnowledgeAssistRequest()) + ->setParent($formattedParent); + + // Call the API and handle any network failures. + try { + /** @var SuggestKnowledgeAssistResponse $response */ + $response = $participantsClient->suggestKnowledgeAssist($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedParent = ParticipantsClient::participantName( + '[PROJECT]', + '[CONVERSATION]', + '[PARTICIPANT]' + ); + + suggest_knowledge_assist_sample($formattedParent); +} +// [END dialogflow_v2_generated_Participants_SuggestKnowledgeAssist_sync] diff --git a/owl-bot-staging/Dialogflow/v2/samples/V2/ParticipantsClient/suggest_smart_replies.php b/owl-bot-staging/Dialogflow/v2/samples/V2/ParticipantsClient/suggest_smart_replies.php new file mode 100644 index 000000000000..6fd2a66e94f1 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/samples/V2/ParticipantsClient/suggest_smart_replies.php @@ -0,0 +1,78 @@ +/locations//conversations//participants/`. Please see + * {@see ParticipantsClient::participantName()} for help formatting this field. + */ +function suggest_smart_replies_sample(string $formattedParent): void +{ + // Create a client. + $participantsClient = new ParticipantsClient(); + + // Prepare the request message. + $request = (new SuggestSmartRepliesRequest()) + ->setParent($formattedParent); + + // Call the API and handle any network failures. + try { + /** @var SuggestSmartRepliesResponse $response */ + $response = $participantsClient->suggestSmartReplies($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedParent = ParticipantsClient::participantName( + '[PROJECT]', + '[CONVERSATION]', + '[PARTICIPANT]' + ); + + suggest_smart_replies_sample($formattedParent); +} +// [END dialogflow_v2_generated_Participants_SuggestSmartReplies_sync] diff --git a/owl-bot-staging/Dialogflow/v2/samples/V2/ParticipantsClient/update_participant.php b/owl-bot-staging/Dialogflow/v2/samples/V2/ParticipantsClient/update_participant.php new file mode 100644 index 000000000000..ba42bea1b21b --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/samples/V2/ParticipantsClient/update_participant.php @@ -0,0 +1,62 @@ +setParticipant($participant) + ->setUpdateMask($updateMask); + + // Call the API and handle any network failures. + try { + /** @var Participant $response */ + $response = $participantsClient->updateParticipant($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} +// [END dialogflow_v2_generated_Participants_UpdateParticipant_sync] diff --git a/owl-bot-staging/Dialogflow/v2/samples/V2/SessionEntityTypesClient/create_session_entity_type.php b/owl-bot-staging/Dialogflow/v2/samples/V2/SessionEntityTypesClient/create_session_entity_type.php new file mode 100644 index 000000000000..876b536688d9 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/samples/V2/SessionEntityTypesClient/create_session_entity_type.php @@ -0,0 +1,141 @@ +/agent/sessions/` or + * `projects//agent/environments//users// + * sessions/`. + * If `Environment ID` is not specified, we assume default 'draft' + * environment. If `User ID` is not specified, we assume default '-' user. Please see + * {@see SessionEntityTypesClient::sessionName()} for help formatting this field. + * @param string $sessionEntityTypeName The unique identifier of this session entity type. Format: + * `projects//agent/sessions//entityTypes/`, or `projects//agent/environments//users//sessions//entityTypes/`. + * If `Environment ID` is not specified, we assume default 'draft' + * environment. If `User ID` is not specified, we assume default '-' user. + * + * `` must be the display name of an existing entity + * type in the same agent that will be overridden or supplemented. + * @param int $sessionEntityTypeEntityOverrideMode Indicates whether the additional data should override or + * supplement the custom entity type definition. + * @param string $sessionEntityTypeEntitiesValue The primary value associated with this entity entry. + * For example, if the entity type is *vegetable*, the value could be + * *scallions*. + * + * For `KIND_MAP` entity types: + * + * * A reference value to be used in place of synonyms. + * + * For `KIND_LIST` entity types: + * + * * A string that can contain references to other entity types (with or + * without aliases). + * @param string $sessionEntityTypeEntitiesSynonymsElement A collection of value synonyms. For example, if the entity type + * is *vegetable*, and `value` is *scallions*, a synonym could be *green + * onions*. + * + * For `KIND_LIST` entity types: + * + * * This collection must contain exactly one synonym equal to `value`. + */ +function create_session_entity_type_sample( + string $formattedParent, + string $sessionEntityTypeName, + int $sessionEntityTypeEntityOverrideMode, + string $sessionEntityTypeEntitiesValue, + string $sessionEntityTypeEntitiesSynonymsElement +): void { + // Create a client. + $sessionEntityTypesClient = new SessionEntityTypesClient(); + + // Prepare the request message. + $sessionEntityTypeEntitiesSynonyms = [$sessionEntityTypeEntitiesSynonymsElement,]; + $entity = (new Entity()) + ->setValue($sessionEntityTypeEntitiesValue) + ->setSynonyms($sessionEntityTypeEntitiesSynonyms); + $sessionEntityTypeEntities = [$entity,]; + $sessionEntityType = (new SessionEntityType()) + ->setName($sessionEntityTypeName) + ->setEntityOverrideMode($sessionEntityTypeEntityOverrideMode) + ->setEntities($sessionEntityTypeEntities); + $request = (new CreateSessionEntityTypeRequest()) + ->setParent($formattedParent) + ->setSessionEntityType($sessionEntityType); + + // Call the API and handle any network failures. + try { + /** @var SessionEntityType $response */ + $response = $sessionEntityTypesClient->createSessionEntityType($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedParent = SessionEntityTypesClient::sessionName('[PROJECT]', '[SESSION]'); + $sessionEntityTypeName = '[NAME]'; + $sessionEntityTypeEntityOverrideMode = EntityOverrideMode::ENTITY_OVERRIDE_MODE_UNSPECIFIED; + $sessionEntityTypeEntitiesValue = '[VALUE]'; + $sessionEntityTypeEntitiesSynonymsElement = '[SYNONYMS]'; + + create_session_entity_type_sample( + $formattedParent, + $sessionEntityTypeName, + $sessionEntityTypeEntityOverrideMode, + $sessionEntityTypeEntitiesValue, + $sessionEntityTypeEntitiesSynonymsElement + ); +} +// [END dialogflow_v2_generated_SessionEntityTypes_CreateSessionEntityType_sync] diff --git a/owl-bot-staging/Dialogflow/v2/samples/V2/SessionEntityTypesClient/delete_session_entity_type.php b/owl-bot-staging/Dialogflow/v2/samples/V2/SessionEntityTypesClient/delete_session_entity_type.php new file mode 100644 index 000000000000..56e42e7169cf --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/samples/V2/SessionEntityTypesClient/delete_session_entity_type.php @@ -0,0 +1,83 @@ +/agent/sessions//entityTypes/` or `projects//agent/environments//users//sessions//entityTypes/`. + * If `Environment ID` is not specified, we assume default 'draft' + * environment. If `User ID` is not specified, we assume default '-' user. Please see + * {@see SessionEntityTypesClient::sessionEntityTypeName()} for help formatting this field. + */ +function delete_session_entity_type_sample(string $formattedName): void +{ + // Create a client. + $sessionEntityTypesClient = new SessionEntityTypesClient(); + + // Prepare the request message. + $request = (new DeleteSessionEntityTypeRequest()) + ->setName($formattedName); + + // Call the API and handle any network failures. + try { + $sessionEntityTypesClient->deleteSessionEntityType($request); + printf('Call completed successfully.' . PHP_EOL); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedName = SessionEntityTypesClient::sessionEntityTypeName( + '[PROJECT]', + '[SESSION]', + '[ENTITY_TYPE]' + ); + + delete_session_entity_type_sample($formattedName); +} +// [END dialogflow_v2_generated_SessionEntityTypes_DeleteSessionEntityType_sync] diff --git a/owl-bot-staging/Dialogflow/v2/samples/V2/SessionEntityTypesClient/get_location.php b/owl-bot-staging/Dialogflow/v2/samples/V2/SessionEntityTypesClient/get_location.php new file mode 100644 index 000000000000..4d09a7ff386c --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/samples/V2/SessionEntityTypesClient/get_location.php @@ -0,0 +1,57 @@ +getLocation($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} +// [END dialogflow_v2_generated_SessionEntityTypes_GetLocation_sync] diff --git a/owl-bot-staging/Dialogflow/v2/samples/V2/SessionEntityTypesClient/get_session_entity_type.php b/owl-bot-staging/Dialogflow/v2/samples/V2/SessionEntityTypesClient/get_session_entity_type.php new file mode 100644 index 000000000000..44ea277d7807 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/samples/V2/SessionEntityTypesClient/get_session_entity_type.php @@ -0,0 +1,85 @@ +/agent/sessions//entityTypes/` or `projects//agent/environments//users//sessions//entityTypes/`. + * If `Environment ID` is not specified, we assume default 'draft' + * environment. If `User ID` is not specified, we assume default '-' user. Please see + * {@see SessionEntityTypesClient::sessionEntityTypeName()} for help formatting this field. + */ +function get_session_entity_type_sample(string $formattedName): void +{ + // Create a client. + $sessionEntityTypesClient = new SessionEntityTypesClient(); + + // Prepare the request message. + $request = (new GetSessionEntityTypeRequest()) + ->setName($formattedName); + + // Call the API and handle any network failures. + try { + /** @var SessionEntityType $response */ + $response = $sessionEntityTypesClient->getSessionEntityType($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedName = SessionEntityTypesClient::sessionEntityTypeName( + '[PROJECT]', + '[SESSION]', + '[ENTITY_TYPE]' + ); + + get_session_entity_type_sample($formattedName); +} +// [END dialogflow_v2_generated_SessionEntityTypes_GetSessionEntityType_sync] diff --git a/owl-bot-staging/Dialogflow/v2/samples/V2/SessionEntityTypesClient/list_locations.php b/owl-bot-staging/Dialogflow/v2/samples/V2/SessionEntityTypesClient/list_locations.php new file mode 100644 index 000000000000..83342535fab3 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/samples/V2/SessionEntityTypesClient/list_locations.php @@ -0,0 +1,62 @@ +listLocations($request); + + /** @var Location $element */ + foreach ($response as $element) { + printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} +// [END dialogflow_v2_generated_SessionEntityTypes_ListLocations_sync] diff --git a/owl-bot-staging/Dialogflow/v2/samples/V2/SessionEntityTypesClient/list_session_entity_types.php b/owl-bot-staging/Dialogflow/v2/samples/V2/SessionEntityTypesClient/list_session_entity_types.php new file mode 100644 index 000000000000..e777cf8ec9b6 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/samples/V2/SessionEntityTypesClient/list_session_entity_types.php @@ -0,0 +1,85 @@ +/agent/sessions/` or + * `projects//agent/environments//users// + * sessions/`. + * If `Environment ID` is not specified, we assume default 'draft' + * environment. If `User ID` is not specified, we assume default '-' user. Please see + * {@see SessionEntityTypesClient::sessionName()} for help formatting this field. + */ +function list_session_entity_types_sample(string $formattedParent): void +{ + // Create a client. + $sessionEntityTypesClient = new SessionEntityTypesClient(); + + // Prepare the request message. + $request = (new ListSessionEntityTypesRequest()) + ->setParent($formattedParent); + + // Call the API and handle any network failures. + try { + /** @var PagedListResponse $response */ + $response = $sessionEntityTypesClient->listSessionEntityTypes($request); + + /** @var SessionEntityType $element */ + foreach ($response as $element) { + printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedParent = SessionEntityTypesClient::sessionName('[PROJECT]', '[SESSION]'); + + list_session_entity_types_sample($formattedParent); +} +// [END dialogflow_v2_generated_SessionEntityTypes_ListSessionEntityTypes_sync] diff --git a/owl-bot-staging/Dialogflow/v2/samples/V2/SessionEntityTypesClient/update_session_entity_type.php b/owl-bot-staging/Dialogflow/v2/samples/V2/SessionEntityTypesClient/update_session_entity_type.php new file mode 100644 index 000000000000..dba3d72c969c --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/samples/V2/SessionEntityTypesClient/update_session_entity_type.php @@ -0,0 +1,127 @@ +/agent/sessions//entityTypes/`, or `projects//agent/environments//users//sessions//entityTypes/`. + * If `Environment ID` is not specified, we assume default 'draft' + * environment. If `User ID` is not specified, we assume default '-' user. + * + * `` must be the display name of an existing entity + * type in the same agent that will be overridden or supplemented. + * @param int $sessionEntityTypeEntityOverrideMode Indicates whether the additional data should override or + * supplement the custom entity type definition. + * @param string $sessionEntityTypeEntitiesValue The primary value associated with this entity entry. + * For example, if the entity type is *vegetable*, the value could be + * *scallions*. + * + * For `KIND_MAP` entity types: + * + * * A reference value to be used in place of synonyms. + * + * For `KIND_LIST` entity types: + * + * * A string that can contain references to other entity types (with or + * without aliases). + * @param string $sessionEntityTypeEntitiesSynonymsElement A collection of value synonyms. For example, if the entity type + * is *vegetable*, and `value` is *scallions*, a synonym could be *green + * onions*. + * + * For `KIND_LIST` entity types: + * + * * This collection must contain exactly one synonym equal to `value`. + */ +function update_session_entity_type_sample( + string $sessionEntityTypeName, + int $sessionEntityTypeEntityOverrideMode, + string $sessionEntityTypeEntitiesValue, + string $sessionEntityTypeEntitiesSynonymsElement +): void { + // Create a client. + $sessionEntityTypesClient = new SessionEntityTypesClient(); + + // Prepare the request message. + $sessionEntityTypeEntitiesSynonyms = [$sessionEntityTypeEntitiesSynonymsElement,]; + $entity = (new Entity()) + ->setValue($sessionEntityTypeEntitiesValue) + ->setSynonyms($sessionEntityTypeEntitiesSynonyms); + $sessionEntityTypeEntities = [$entity,]; + $sessionEntityType = (new SessionEntityType()) + ->setName($sessionEntityTypeName) + ->setEntityOverrideMode($sessionEntityTypeEntityOverrideMode) + ->setEntities($sessionEntityTypeEntities); + $request = (new UpdateSessionEntityTypeRequest()) + ->setSessionEntityType($sessionEntityType); + + // Call the API and handle any network failures. + try { + /** @var SessionEntityType $response */ + $response = $sessionEntityTypesClient->updateSessionEntityType($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $sessionEntityTypeName = '[NAME]'; + $sessionEntityTypeEntityOverrideMode = EntityOverrideMode::ENTITY_OVERRIDE_MODE_UNSPECIFIED; + $sessionEntityTypeEntitiesValue = '[VALUE]'; + $sessionEntityTypeEntitiesSynonymsElement = '[SYNONYMS]'; + + update_session_entity_type_sample( + $sessionEntityTypeName, + $sessionEntityTypeEntityOverrideMode, + $sessionEntityTypeEntitiesValue, + $sessionEntityTypeEntitiesSynonymsElement + ); +} +// [END dialogflow_v2_generated_SessionEntityTypes_UpdateSessionEntityType_sync] diff --git a/owl-bot-staging/Dialogflow/v2/samples/V2/SessionsClient/detect_intent.php b/owl-bot-staging/Dialogflow/v2/samples/V2/SessionsClient/detect_intent.php new file mode 100644 index 000000000000..de8d2c6f8ecd --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/samples/V2/SessionsClient/detect_intent.php @@ -0,0 +1,104 @@ +/agent/sessions/`, or + * `projects//agent/environments//users//sessions/`. If `Environment ID` is not specified, we assume + * default 'draft' environment (`Environment ID` might be referred to as + * environment name at some places). If `User ID` is not specified, we are + * using "-". It's up to the API caller to choose an appropriate `Session ID` + * and `User Id`. They can be a random number or some type of user and session + * identifiers (preferably hashed). The length of the `Session ID` and + * `User ID` must not exceed 36 characters. + * + * For more information, see the [API interactions + * guide](https://cloud.google.com/dialogflow/docs/api-overview). + * + * Note: Always use agent versions for production traffic. + * See [Versions and + * environments](https://cloud.google.com/dialogflow/es/docs/agents-versions). Please see + * {@see SessionsClient::sessionName()} for help formatting this field. + */ +function detect_intent_sample(string $formattedSession): void +{ + // Create a client. + $sessionsClient = new SessionsClient(); + + // Prepare the request message. + $queryInput = new QueryInput(); + $request = (new DetectIntentRequest()) + ->setSession($formattedSession) + ->setQueryInput($queryInput); + + // Call the API and handle any network failures. + try { + /** @var DetectIntentResponse $response */ + $response = $sessionsClient->detectIntent($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedSession = SessionsClient::sessionName('[PROJECT]', '[SESSION]'); + + detect_intent_sample($formattedSession); +} +// [END dialogflow_v2_generated_Sessions_DetectIntent_sync] diff --git a/owl-bot-staging/Dialogflow/v2/samples/V2/SessionsClient/get_location.php b/owl-bot-staging/Dialogflow/v2/samples/V2/SessionsClient/get_location.php new file mode 100644 index 000000000000..e6b03e26b4d8 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/samples/V2/SessionsClient/get_location.php @@ -0,0 +1,57 @@ +getLocation($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} +// [END dialogflow_v2_generated_Sessions_GetLocation_sync] diff --git a/owl-bot-staging/Dialogflow/v2/samples/V2/SessionsClient/list_locations.php b/owl-bot-staging/Dialogflow/v2/samples/V2/SessionsClient/list_locations.php new file mode 100644 index 000000000000..e0ccfedb46cc --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/samples/V2/SessionsClient/list_locations.php @@ -0,0 +1,62 @@ +listLocations($request); + + /** @var Location $element */ + foreach ($response as $element) { + printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} +// [END dialogflow_v2_generated_Sessions_ListLocations_sync] diff --git a/owl-bot-staging/Dialogflow/v2/samples/V2/SessionsClient/streaming_detect_intent.php b/owl-bot-staging/Dialogflow/v2/samples/V2/SessionsClient/streaming_detect_intent.php new file mode 100644 index 000000000000..784c55b77a3b --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/samples/V2/SessionsClient/streaming_detect_intent.php @@ -0,0 +1,109 @@ +/agent/sessions/`, or + * `projects//agent/environments//users//sessions/`. If `Environment ID` is not specified, we assume + * default 'draft' environment. If `User ID` is not specified, we are using + * "-". It's up to the API caller to choose an appropriate `Session ID` and + * `User Id`. They can be a random number or some type of user and session + * identifiers (preferably hashed). The length of the `Session ID` and + * `User ID` must not exceed 36 characters. + * + * For more information, see the [API interactions + * guide](https://cloud.google.com/dialogflow/docs/api-overview). + * + * Note: Always use agent versions for production traffic. + * See [Versions and + * environments](https://cloud.google.com/dialogflow/es/docs/agents-versions). Please see + * {@see SessionsClient::sessionName()} for help formatting this field. + */ +function streaming_detect_intent_sample(string $formattedSession): void +{ + // Create a client. + $sessionsClient = new SessionsClient(); + + // Prepare the request message. + $queryInput = new QueryInput(); + $request = (new StreamingDetectIntentRequest()) + ->setSession($formattedSession) + ->setQueryInput($queryInput); + + // Call the API and handle any network failures. + try { + /** @var BidiStream $stream */ + $stream = $sessionsClient->streamingDetectIntent(); + $stream->writeAll([$request,]); + + /** @var StreamingDetectIntentResponse $element */ + foreach ($stream->closeWriteAndReadAll() as $element) { + printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedSession = SessionsClient::sessionName('[PROJECT]', '[SESSION]'); + + streaming_detect_intent_sample($formattedSession); +} +// [END dialogflow_v2_generated_Sessions_StreamingDetectIntent_sync] diff --git a/owl-bot-staging/Dialogflow/v2/samples/V2/VersionsClient/create_version.php b/owl-bot-staging/Dialogflow/v2/samples/V2/VersionsClient/create_version.php new file mode 100644 index 000000000000..b52e31d7088d --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/samples/V2/VersionsClient/create_version.php @@ -0,0 +1,79 @@ +/agent` + * - `projects//locations//agent` + * Please see {@see VersionsClient::agentName()} for help formatting this field. + */ +function create_version_sample(string $formattedParent): void +{ + // Create a client. + $versionsClient = new VersionsClient(); + + // Prepare the request message. + $version = new Version(); + $request = (new CreateVersionRequest()) + ->setParent($formattedParent) + ->setVersion($version); + + // Call the API and handle any network failures. + try { + /** @var Version $response */ + $response = $versionsClient->createVersion($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedParent = VersionsClient::agentName('[PROJECT]'); + + create_version_sample($formattedParent); +} +// [END dialogflow_v2_generated_Versions_CreateVersion_sync] diff --git a/owl-bot-staging/Dialogflow/v2/samples/V2/VersionsClient/delete_version.php b/owl-bot-staging/Dialogflow/v2/samples/V2/VersionsClient/delete_version.php new file mode 100644 index 000000000000..51810e52ef2b --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/samples/V2/VersionsClient/delete_version.php @@ -0,0 +1,74 @@ +/agent/versions/` + * - `projects//locations//agent/versions/` + * Please see {@see VersionsClient::versionName()} for help formatting this field. + */ +function delete_version_sample(string $formattedName): void +{ + // Create a client. + $versionsClient = new VersionsClient(); + + // Prepare the request message. + $request = (new DeleteVersionRequest()) + ->setName($formattedName); + + // Call the API and handle any network failures. + try { + $versionsClient->deleteVersion($request); + printf('Call completed successfully.' . PHP_EOL); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedName = VersionsClient::versionName('[PROJECT]', '[VERSION]'); + + delete_version_sample($formattedName); +} +// [END dialogflow_v2_generated_Versions_DeleteVersion_sync] diff --git a/owl-bot-staging/Dialogflow/v2/samples/V2/VersionsClient/get_location.php b/owl-bot-staging/Dialogflow/v2/samples/V2/VersionsClient/get_location.php new file mode 100644 index 000000000000..2a3a70d0bd2e --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/samples/V2/VersionsClient/get_location.php @@ -0,0 +1,57 @@ +getLocation($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} +// [END dialogflow_v2_generated_Versions_GetLocation_sync] diff --git a/owl-bot-staging/Dialogflow/v2/samples/V2/VersionsClient/get_version.php b/owl-bot-staging/Dialogflow/v2/samples/V2/VersionsClient/get_version.php new file mode 100644 index 000000000000..fdc635a6c1d1 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/samples/V2/VersionsClient/get_version.php @@ -0,0 +1,76 @@ +/agent/versions/` + * - `projects//locations//agent/versions/` + * Please see {@see VersionsClient::versionName()} for help formatting this field. + */ +function get_version_sample(string $formattedName): void +{ + // Create a client. + $versionsClient = new VersionsClient(); + + // Prepare the request message. + $request = (new GetVersionRequest()) + ->setName($formattedName); + + // Call the API and handle any network failures. + try { + /** @var Version $response */ + $response = $versionsClient->getVersion($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedName = VersionsClient::versionName('[PROJECT]', '[VERSION]'); + + get_version_sample($formattedName); +} +// [END dialogflow_v2_generated_Versions_GetVersion_sync] diff --git a/owl-bot-staging/Dialogflow/v2/samples/V2/VersionsClient/list_locations.php b/owl-bot-staging/Dialogflow/v2/samples/V2/VersionsClient/list_locations.php new file mode 100644 index 000000000000..ae96aa834904 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/samples/V2/VersionsClient/list_locations.php @@ -0,0 +1,62 @@ +listLocations($request); + + /** @var Location $element */ + foreach ($response as $element) { + printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} +// [END dialogflow_v2_generated_Versions_ListLocations_sync] diff --git a/owl-bot-staging/Dialogflow/v2/samples/V2/VersionsClient/list_versions.php b/owl-bot-staging/Dialogflow/v2/samples/V2/VersionsClient/list_versions.php new file mode 100644 index 000000000000..72bc7027b63b --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/samples/V2/VersionsClient/list_versions.php @@ -0,0 +1,80 @@ +/agent` + * - `projects//locations//agent` + * Please see {@see VersionsClient::agentName()} for help formatting this field. + */ +function list_versions_sample(string $formattedParent): void +{ + // Create a client. + $versionsClient = new VersionsClient(); + + // Prepare the request message. + $request = (new ListVersionsRequest()) + ->setParent($formattedParent); + + // Call the API and handle any network failures. + try { + /** @var PagedListResponse $response */ + $response = $versionsClient->listVersions($request); + + /** @var Version $element */ + foreach ($response as $element) { + printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedParent = VersionsClient::agentName('[PROJECT]'); + + list_versions_sample($formattedParent); +} +// [END dialogflow_v2_generated_Versions_ListVersions_sync] diff --git a/owl-bot-staging/Dialogflow/v2/samples/V2/VersionsClient/update_version.php b/owl-bot-staging/Dialogflow/v2/samples/V2/VersionsClient/update_version.php new file mode 100644 index 000000000000..a67372ff48b5 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/samples/V2/VersionsClient/update_version.php @@ -0,0 +1,66 @@ +setVersion($version) + ->setUpdateMask($updateMask); + + // Call the API and handle any network failures. + try { + /** @var Version $response */ + $response = $versionsClient->updateVersion($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} +// [END dialogflow_v2_generated_Versions_UpdateVersion_sync] diff --git a/owl-bot-staging/Dialogflow/v2/src/V2/AgentsClient.php b/owl-bot-staging/Dialogflow/v2/src/V2/AgentsClient.php new file mode 100644 index 000000000000..56409c3c99e8 --- /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 AgentsClient::deleteAgentAsync()} . + * + * @example samples/V2/AgentsClient/delete_agent.php + * + * @param DeleteAgentRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @throws ApiException Thrown if the API call fails. + */ + public function deleteAgent(DeleteAgentRequest $request, array $callOptions = []): void + { + $this->startApiCall('DeleteAgent', $request, $callOptions)->wait(); + } + + /** + * Exports the specified agent to a ZIP file. + * + * This method is a [long-running + * operation](https://cloud.google.com/dialogflow/es/docs/how/long-running-operations). + * The returned `Operation` type has the following method-specific fields: + * + * - `metadata`: An empty [Struct + * message](https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#struct) + * - `response`: + * [ExportAgentResponse][google.cloud.dialogflow.v2.ExportAgentResponse] + * + * The async variant is {@see AgentsClient::exportAgentAsync()} . + * + * @example samples/V2/AgentsClient/export_agent.php + * + * @param ExportAgentRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function exportAgent(ExportAgentRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('ExportAgent', $request, $callOptions)->wait(); + } + + /** + * Retrieves the specified agent. + * + * The async variant is {@see AgentsClient::getAgentAsync()} . + * + * @example samples/V2/AgentsClient/get_agent.php + * + * @param GetAgentRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return Agent + * + * @throws ApiException Thrown if the API call fails. + */ + public function getAgent(GetAgentRequest $request, array $callOptions = []): Agent + { + return $this->startApiCall('GetAgent', $request, $callOptions)->wait(); + } + + /** + * Gets agent validation result. Agent validation is performed during + * training time and is updated automatically when training is completed. + * + * The async variant is {@see AgentsClient::getValidationResultAsync()} . + * + * @example samples/V2/AgentsClient/get_validation_result.php + * + * @param GetValidationResultRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return ValidationResult + * + * @throws ApiException Thrown if the API call fails. + */ + public function getValidationResult(GetValidationResultRequest $request, array $callOptions = []): ValidationResult + { + return $this->startApiCall('GetValidationResult', $request, $callOptions)->wait(); + } + + /** + * Imports the specified agent from a ZIP file. + * + * Uploads new intents and entity types without deleting the existing ones. + * Intents and entity types with the same name are replaced with the new + * versions from + * [ImportAgentRequest][google.cloud.dialogflow.v2.ImportAgentRequest]. After + * the import, the imported draft agent will be trained automatically (unless + * disabled in agent settings). However, once the import is done, training may + * not be completed yet. Please call + * [TrainAgent][google.cloud.dialogflow.v2.Agents.TrainAgent] and wait for the + * operation it returns in order to train explicitly. + * + * This method is a [long-running + * operation](https://cloud.google.com/dialogflow/es/docs/how/long-running-operations). + * The returned `Operation` type has the following method-specific fields: + * + * - `metadata`: An empty [Struct + * message](https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#struct) + * - `response`: An [Empty + * message](https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#empty) + * + * The operation only tracks when importing is complete, not when it is done + * training. + * + * Note: You should always train an agent prior to sending it queries. See the + * [training + * documentation](https://cloud.google.com/dialogflow/es/docs/training). + * + * The async variant is {@see AgentsClient::importAgentAsync()} . + * + * @example samples/V2/AgentsClient/import_agent.php + * + * @param ImportAgentRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function importAgent(ImportAgentRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('ImportAgent', $request, $callOptions)->wait(); + } + + /** + * Restores the specified agent from a ZIP file. + * + * Replaces the current agent version with a new one. All the intents and + * entity types in the older version are deleted. After the restore, the + * restored draft agent will be trained automatically (unless disabled in + * agent settings). However, once the restore is done, training may not be + * completed yet. Please call + * [TrainAgent][google.cloud.dialogflow.v2.Agents.TrainAgent] and wait for the + * operation it returns in order to train explicitly. + * + * This method is a [long-running + * operation](https://cloud.google.com/dialogflow/es/docs/how/long-running-operations). + * The returned `Operation` type has the following method-specific fields: + * + * - `metadata`: An empty [Struct + * message](https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#struct) + * - `response`: An [Empty + * message](https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#empty) + * + * The operation only tracks when restoring is complete, not when it is done + * training. + * + * Note: You should always train an agent prior to sending it queries. See the + * [training + * documentation](https://cloud.google.com/dialogflow/es/docs/training). + * + * The async variant is {@see AgentsClient::restoreAgentAsync()} . + * + * @example samples/V2/AgentsClient/restore_agent.php + * + * @param RestoreAgentRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function restoreAgent(RestoreAgentRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('RestoreAgent', $request, $callOptions)->wait(); + } + + /** + * Returns the list of agents. + * + * Since there is at most one conversational agent per project, this method is + * useful primarily for listing all agents across projects the caller has + * access to. One can achieve that with a wildcard project collection id "-". + * Refer to [List + * Sub-Collections](https://cloud.google.com/apis/design/design_patterns#list_sub-collections). + * + * The async variant is {@see AgentsClient::searchAgentsAsync()} . + * + * @example samples/V2/AgentsClient/search_agents.php + * + * @param SearchAgentsRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return PagedListResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function searchAgents(SearchAgentsRequest $request, array $callOptions = []): PagedListResponse + { + return $this->startApiCall('SearchAgents', $request, $callOptions); + } + + /** + * Creates/updates the specified agent. + * + * Note: You should always train an agent prior to sending it queries. See the + * [training + * documentation](https://cloud.google.com/dialogflow/es/docs/training). + * + * The async variant is {@see AgentsClient::setAgentAsync()} . + * + * @example samples/V2/AgentsClient/set_agent.php + * + * @param SetAgentRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return Agent + * + * @throws ApiException Thrown if the API call fails. + */ + public function setAgent(SetAgentRequest $request, array $callOptions = []): Agent + { + return $this->startApiCall('SetAgent', $request, $callOptions)->wait(); + } + + /** + * Trains the specified agent. + * + * This method is a [long-running + * operation](https://cloud.google.com/dialogflow/es/docs/how/long-running-operations). + * The returned `Operation` type has the following method-specific fields: + * + * - `metadata`: An empty [Struct + * message](https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#struct) + * - `response`: An [Empty + * message](https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#empty) + * + * Note: You should always train an agent prior to sending it queries. See the + * [training + * documentation](https://cloud.google.com/dialogflow/es/docs/training). + * + * The async variant is {@see AgentsClient::trainAgentAsync()} . + * + * @example samples/V2/AgentsClient/train_agent.php + * + * @param TrainAgentRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function trainAgent(TrainAgentRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('TrainAgent', $request, $callOptions)->wait(); + } + + /** + * Gets information about a location. + * + * The async variant is {@see AgentsClient::getLocationAsync()} . + * + * @example samples/V2/AgentsClient/get_location.php + * + * @param GetLocationRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return Location + * + * @throws ApiException Thrown if the API call fails. + */ + public function getLocation(GetLocationRequest $request, array $callOptions = []): Location + { + return $this->startApiCall('GetLocation', $request, $callOptions)->wait(); + } + + /** + * Lists information about the supported locations for this service. + * + * The async variant is {@see AgentsClient::listLocationsAsync()} . + * + * @example samples/V2/AgentsClient/list_locations.php + * + * @param ListLocationsRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return PagedListResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function listLocations(ListLocationsRequest $request, array $callOptions = []): PagedListResponse + { + return $this->startApiCall('ListLocations', $request, $callOptions); + } +} diff --git a/owl-bot-staging/Dialogflow/v2/src/V2/Client/AnswerRecordsClient.php b/owl-bot-staging/Dialogflow/v2/src/V2/Client/AnswerRecordsClient.php new file mode 100644 index 000000000000..f228a3e5ca51 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/src/V2/Client/AnswerRecordsClient.php @@ -0,0 +1,718 @@ + self::SERVICE_NAME, + 'apiEndpoint' => self::SERVICE_ADDRESS . ':' . self::DEFAULT_SERVICE_PORT, + 'clientConfig' => __DIR__ . '/../resources/answer_records_client_config.json', + 'descriptorsConfigPath' => __DIR__ . '/../resources/answer_records_descriptor_config.php', + 'gcpApiConfigPath' => __DIR__ . '/../resources/answer_records_grpc_config.json', + 'credentialsConfig' => [ + 'defaultScopes' => self::$serviceScopes, + ], + 'transportConfig' => [ + 'rest' => [ + 'restClientConfigPath' => __DIR__ . '/../resources/answer_records_rest_client_config.php', + ], + ], + ]; + } + + /** + * Formats a string containing the fully-qualified path to represent a agent + * resource. + * + * @param string $project + * + * @return string The formatted agent resource. + */ + public static function agentName(string $project): string + { + return self::getPathTemplate('agent')->render([ + 'project' => $project, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a + * answer_record resource. + * + * @param string $project + * @param string $answerRecord + * + * @return string The formatted answer_record resource. + */ + public static function answerRecordName(string $project, string $answerRecord): string + { + return self::getPathTemplate('answerRecord')->render([ + 'project' => $project, + 'answer_record' => $answerRecord, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a context + * resource. + * + * @param string $project + * @param string $session + * @param string $context + * + * @return string The formatted context resource. + */ + public static function contextName(string $project, string $session, string $context): string + { + return self::getPathTemplate('context')->render([ + 'project' => $project, + 'session' => $session, + 'context' => $context, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a intent + * resource. + * + * @param string $project + * @param string $intent + * + * @return string The formatted intent resource. + */ + public static function intentName(string $project, string $intent): string + { + return self::getPathTemplate('intent')->render([ + 'project' => $project, + 'intent' => $intent, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a location + * resource. + * + * @param string $project + * @param string $location + * + * @return string The formatted location resource. + */ + public static function locationName(string $project, string $location): string + { + return self::getPathTemplate('location')->render([ + 'project' => $project, + 'location' => $location, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a project + * resource. + * + * @param string $project + * + * @return string The formatted project resource. + */ + public static function projectName(string $project): string + { + return self::getPathTemplate('project')->render([ + 'project' => $project, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a + * project_agent resource. + * + * @param string $project + * + * @return string The formatted project_agent resource. + */ + public static function projectAgentName(string $project): string + { + return self::getPathTemplate('projectAgent')->render([ + 'project' => $project, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a + * project_answer_record resource. + * + * @param string $project + * @param string $answerRecord + * + * @return string The formatted project_answer_record resource. + */ + public static function projectAnswerRecordName(string $project, string $answerRecord): string + { + return self::getPathTemplate('projectAnswerRecord')->render([ + 'project' => $project, + 'answer_record' => $answerRecord, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a + * project_environment_user_session resource. + * + * @param string $project + * @param string $environment + * @param string $user + * @param string $session + * + * @return string The formatted project_environment_user_session resource. + */ + public static function projectEnvironmentUserSessionName(string $project, string $environment, string $user, string $session): string + { + return self::getPathTemplate('projectEnvironmentUserSession')->render([ + 'project' => $project, + 'environment' => $environment, + 'user' => $user, + 'session' => $session, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a + * project_environment_user_session_context resource. + * + * @param string $project + * @param string $environment + * @param string $user + * @param string $session + * @param string $context + * + * @return string The formatted project_environment_user_session_context resource. + */ + public static function projectEnvironmentUserSessionContextName(string $project, string $environment, string $user, string $session, string $context): string + { + return self::getPathTemplate('projectEnvironmentUserSessionContext')->render([ + 'project' => $project, + 'environment' => $environment, + 'user' => $user, + 'session' => $session, + 'context' => $context, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a + * project_intent resource. + * + * @param string $project + * @param string $intent + * + * @return string The formatted project_intent resource. + */ + public static function projectIntentName(string $project, string $intent): string + { + return self::getPathTemplate('projectIntent')->render([ + 'project' => $project, + 'intent' => $intent, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a + * project_location_agent resource. + * + * @param string $project + * @param string $location + * + * @return string The formatted project_location_agent resource. + */ + public static function projectLocationAgentName(string $project, string $location): string + { + return self::getPathTemplate('projectLocationAgent')->render([ + 'project' => $project, + 'location' => $location, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a + * project_location_answer_record resource. + * + * @param string $project + * @param string $location + * @param string $answerRecord + * + * @return string The formatted project_location_answer_record resource. + */ + public static function projectLocationAnswerRecordName(string $project, string $location, string $answerRecord): string + { + return self::getPathTemplate('projectLocationAnswerRecord')->render([ + 'project' => $project, + 'location' => $location, + 'answer_record' => $answerRecord, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a + * project_location_environment_user_session resource. + * + * @param string $project + * @param string $location + * @param string $environment + * @param string $user + * @param string $session + * + * @return string The formatted project_location_environment_user_session resource. + */ + public static function projectLocationEnvironmentUserSessionName(string $project, string $location, string $environment, string $user, string $session): string + { + return self::getPathTemplate('projectLocationEnvironmentUserSession')->render([ + 'project' => $project, + 'location' => $location, + 'environment' => $environment, + 'user' => $user, + 'session' => $session, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a + * project_location_environment_user_session_context resource. + * + * @param string $project + * @param string $location + * @param string $environment + * @param string $user + * @param string $session + * @param string $context + * + * @return string The formatted project_location_environment_user_session_context resource. + */ + public static function projectLocationEnvironmentUserSessionContextName(string $project, string $location, string $environment, string $user, string $session, string $context): string + { + return self::getPathTemplate('projectLocationEnvironmentUserSessionContext')->render([ + 'project' => $project, + 'location' => $location, + 'environment' => $environment, + 'user' => $user, + 'session' => $session, + 'context' => $context, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a + * project_location_intent resource. + * + * @param string $project + * @param string $location + * @param string $intent + * + * @return string The formatted project_location_intent resource. + */ + public static function projectLocationIntentName(string $project, string $location, string $intent): string + { + return self::getPathTemplate('projectLocationIntent')->render([ + 'project' => $project, + 'location' => $location, + 'intent' => $intent, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a + * project_location_session resource. + * + * @param string $project + * @param string $location + * @param string $session + * + * @return string The formatted project_location_session resource. + */ + public static function projectLocationSessionName(string $project, string $location, string $session): string + { + return self::getPathTemplate('projectLocationSession')->render([ + 'project' => $project, + 'location' => $location, + 'session' => $session, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a + * project_location_session_context resource. + * + * @param string $project + * @param string $location + * @param string $session + * @param string $context + * + * @return string The formatted project_location_session_context resource. + */ + public static function projectLocationSessionContextName(string $project, string $location, string $session, string $context): string + { + return self::getPathTemplate('projectLocationSessionContext')->render([ + 'project' => $project, + 'location' => $location, + 'session' => $session, + 'context' => $context, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a + * project_session resource. + * + * @param string $project + * @param string $session + * + * @return string The formatted project_session resource. + */ + public static function projectSessionName(string $project, string $session): string + { + return self::getPathTemplate('projectSession')->render([ + 'project' => $project, + 'session' => $session, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a + * project_session_context resource. + * + * @param string $project + * @param string $session + * @param string $context + * + * @return string The formatted project_session_context resource. + */ + public static function projectSessionContextName(string $project, string $session, string $context): string + { + return self::getPathTemplate('projectSessionContext')->render([ + 'project' => $project, + 'session' => $session, + 'context' => $context, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a session + * resource. + * + * @param string $project + * @param string $session + * + * @return string The formatted session resource. + */ + public static function sessionName(string $project, string $session): string + { + return self::getPathTemplate('session')->render([ + 'project' => $project, + 'session' => $session, + ]); + } + + /** + * Parses a formatted name string and returns an associative array of the components in the name. + * The following name formats are supported: + * Template: Pattern + * - agent: projects/{project}/agent + * - answerRecord: projects/{project}/answerRecords/{answer_record} + * - context: projects/{project}/agent/sessions/{session}/contexts/{context} + * - intent: projects/{project}/agent/intents/{intent} + * - location: projects/{project}/locations/{location} + * - project: projects/{project} + * - projectAgent: projects/{project}/agent + * - projectAnswerRecord: projects/{project}/answerRecords/{answer_record} + * - projectEnvironmentUserSession: projects/{project}/agent/environments/{environment}/users/{user}/sessions/{session} + * - projectEnvironmentUserSessionContext: projects/{project}/agent/environments/{environment}/users/{user}/sessions/{session}/contexts/{context} + * - projectIntent: projects/{project}/agent/intents/{intent} + * - projectLocationAgent: projects/{project}/locations/{location}/agent + * - projectLocationAnswerRecord: projects/{project}/locations/{location}/answerRecords/{answer_record} + * - projectLocationEnvironmentUserSession: projects/{project}/locations/{location}/agent/environments/{environment}/users/{user}/sessions/{session} + * - projectLocationEnvironmentUserSessionContext: projects/{project}/locations/{location}/agent/environments/{environment}/users/{user}/sessions/{session}/contexts/{context} + * - projectLocationIntent: projects/{project}/locations/{location}/agent/intents/{intent} + * - projectLocationSession: projects/{project}/locations/{location}/agent/sessions/{session} + * - projectLocationSessionContext: projects/{project}/locations/{location}/agent/sessions/{session}/contexts/{context} + * - projectSession: projects/{project}/agent/sessions/{session} + * - projectSessionContext: projects/{project}/agent/sessions/{session}/contexts/{context} + * - session: projects/{project}/agent/sessions/{session} + * + * 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 AnswerRecordsClient::listAnswerRecordsAsync()} . + * + * @example samples/V2/AnswerRecordsClient/list_answer_records.php + * + * @param ListAnswerRecordsRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return PagedListResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function listAnswerRecords(ListAnswerRecordsRequest $request, array $callOptions = []): PagedListResponse + { + return $this->startApiCall('ListAnswerRecords', $request, $callOptions); + } + + /** + * Updates the specified answer record. + * + * The async variant is {@see AnswerRecordsClient::updateAnswerRecordAsync()} . + * + * @example samples/V2/AnswerRecordsClient/update_answer_record.php + * + * @param UpdateAnswerRecordRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return AnswerRecord + * + * @throws ApiException Thrown if the API call fails. + */ + public function updateAnswerRecord(UpdateAnswerRecordRequest $request, array $callOptions = []): AnswerRecord + { + return $this->startApiCall('UpdateAnswerRecord', $request, $callOptions)->wait(); + } + + /** + * Gets information about a location. + * + * The async variant is {@see AnswerRecordsClient::getLocationAsync()} . + * + * @example samples/V2/AnswerRecordsClient/get_location.php + * + * @param GetLocationRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return Location + * + * @throws ApiException Thrown if the API call fails. + */ + public function getLocation(GetLocationRequest $request, array $callOptions = []): Location + { + return $this->startApiCall('GetLocation', $request, $callOptions)->wait(); + } + + /** + * Lists information about the supported locations for this service. + * + * The async variant is {@see AnswerRecordsClient::listLocationsAsync()} . + * + * @example samples/V2/AnswerRecordsClient/list_locations.php + * + * @param ListLocationsRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return PagedListResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function listLocations(ListLocationsRequest $request, array $callOptions = []): PagedListResponse + { + return $this->startApiCall('ListLocations', $request, $callOptions); + } +} diff --git a/owl-bot-staging/Dialogflow/v2/src/V2/Client/ContextsClient.php b/owl-bot-staging/Dialogflow/v2/src/V2/Client/ContextsClient.php new file mode 100644 index 000000000000..d49a60c2729e --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/src/V2/Client/ContextsClient.php @@ -0,0 +1,630 @@ + 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 ContextsClient::createContextAsync()} . + * + * @example samples/V2/ContextsClient/create_context.php + * + * @param CreateContextRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return Context + * + * @throws ApiException Thrown if the API call fails. + */ + public function createContext(CreateContextRequest $request, array $callOptions = []): Context + { + return $this->startApiCall('CreateContext', $request, $callOptions)->wait(); + } + + /** + * Deletes all active contexts in the specified session. + * + * The async variant is {@see ContextsClient::deleteAllContextsAsync()} . + * + * @example samples/V2/ContextsClient/delete_all_contexts.php + * + * @param DeleteAllContextsRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @throws ApiException Thrown if the API call fails. + */ + public function deleteAllContexts(DeleteAllContextsRequest $request, array $callOptions = []): void + { + $this->startApiCall('DeleteAllContexts', $request, $callOptions)->wait(); + } + + /** + * Deletes the specified context. + * + * The async variant is {@see ContextsClient::deleteContextAsync()} . + * + * @example samples/V2/ContextsClient/delete_context.php + * + * @param DeleteContextRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @throws ApiException Thrown if the API call fails. + */ + public function deleteContext(DeleteContextRequest $request, array $callOptions = []): void + { + $this->startApiCall('DeleteContext', $request, $callOptions)->wait(); + } + + /** + * Retrieves the specified context. + * + * The async variant is {@see ContextsClient::getContextAsync()} . + * + * @example samples/V2/ContextsClient/get_context.php + * + * @param GetContextRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return Context + * + * @throws ApiException Thrown if the API call fails. + */ + public function getContext(GetContextRequest $request, array $callOptions = []): Context + { + return $this->startApiCall('GetContext', $request, $callOptions)->wait(); + } + + /** + * Returns the list of all contexts in the specified session. + * + * The async variant is {@see ContextsClient::listContextsAsync()} . + * + * @example samples/V2/ContextsClient/list_contexts.php + * + * @param ListContextsRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return PagedListResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function listContexts(ListContextsRequest $request, array $callOptions = []): PagedListResponse + { + return $this->startApiCall('ListContexts', $request, $callOptions); + } + + /** + * Updates the specified context. + * + * The async variant is {@see ContextsClient::updateContextAsync()} . + * + * @example samples/V2/ContextsClient/update_context.php + * + * @param UpdateContextRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return Context + * + * @throws ApiException Thrown if the API call fails. + */ + public function updateContext(UpdateContextRequest $request, array $callOptions = []): Context + { + return $this->startApiCall('UpdateContext', $request, $callOptions)->wait(); + } + + /** + * Gets information about a location. + * + * The async variant is {@see ContextsClient::getLocationAsync()} . + * + * @example samples/V2/ContextsClient/get_location.php + * + * @param GetLocationRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return Location + * + * @throws ApiException Thrown if the API call fails. + */ + public function getLocation(GetLocationRequest $request, array $callOptions = []): Location + { + return $this->startApiCall('GetLocation', $request, $callOptions)->wait(); + } + + /** + * Lists information about the supported locations for this service. + * + * The async variant is {@see ContextsClient::listLocationsAsync()} . + * + * @example samples/V2/ContextsClient/list_locations.php + * + * @param ListLocationsRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return PagedListResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function listLocations(ListLocationsRequest $request, array $callOptions = []): PagedListResponse + { + return $this->startApiCall('ListLocations', $request, $callOptions); + } +} diff --git a/owl-bot-staging/Dialogflow/v2/src/V2/Client/ConversationDatasetsClient.php b/owl-bot-staging/Dialogflow/v2/src/V2/Client/ConversationDatasetsClient.php new file mode 100644 index 000000000000..6002f4ac4287 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/src/V2/Client/ConversationDatasetsClient.php @@ -0,0 +1,505 @@ + 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 ConversationDatasetsClient::createConversationDatasetAsync()} . + * + * @example samples/V2/ConversationDatasetsClient/create_conversation_dataset.php + * + * @param CreateConversationDatasetRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function createConversationDataset(CreateConversationDatasetRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('CreateConversationDataset', $request, $callOptions)->wait(); + } + + /** + * Deletes the specified conversation dataset. + * + * This method is a [long-running + * operation](https://cloud.google.com/dialogflow/es/docs/how/long-running-operations). + * The returned `Operation` type has the following method-specific fields: + * + * - `metadata`: + * [DeleteConversationDatasetOperationMetadata][google.cloud.dialogflow.v2.DeleteConversationDatasetOperationMetadata] + * - `response`: An [Empty + * message](https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#empty) + * + * The async variant is + * {@see ConversationDatasetsClient::deleteConversationDatasetAsync()} . + * + * @example samples/V2/ConversationDatasetsClient/delete_conversation_dataset.php + * + * @param DeleteConversationDatasetRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function deleteConversationDataset(DeleteConversationDatasetRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('DeleteConversationDataset', $request, $callOptions)->wait(); + } + + /** + * Retrieves the specified conversation dataset. + * + * The async variant is + * {@see ConversationDatasetsClient::getConversationDatasetAsync()} . + * + * @example samples/V2/ConversationDatasetsClient/get_conversation_dataset.php + * + * @param GetConversationDatasetRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return ConversationDataset + * + * @throws ApiException Thrown if the API call fails. + */ + public function getConversationDataset(GetConversationDatasetRequest $request, array $callOptions = []): ConversationDataset + { + return $this->startApiCall('GetConversationDataset', $request, $callOptions)->wait(); + } + + /** + * Import data into the specified conversation dataset. Note that it + * is not allowed to import data to a conversation dataset that + * already has data in it. + * + * This method is a [long-running + * operation](https://cloud.google.com/dialogflow/es/docs/how/long-running-operations). + * The returned `Operation` type has the following method-specific fields: + * + * - `metadata`: + * [ImportConversationDataOperationMetadata][google.cloud.dialogflow.v2.ImportConversationDataOperationMetadata] + * - `response`: + * [ImportConversationDataOperationResponse][google.cloud.dialogflow.v2.ImportConversationDataOperationResponse] + * + * The async variant is + * {@see ConversationDatasetsClient::importConversationDataAsync()} . + * + * @example samples/V2/ConversationDatasetsClient/import_conversation_data.php + * + * @param ImportConversationDataRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function importConversationData(ImportConversationDataRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('ImportConversationData', $request, $callOptions)->wait(); + } + + /** + * Returns the list of all conversation datasets in the specified + * project and location. + * + * The async variant is + * {@see ConversationDatasetsClient::listConversationDatasetsAsync()} . + * + * @example samples/V2/ConversationDatasetsClient/list_conversation_datasets.php + * + * @param ListConversationDatasetsRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return PagedListResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function listConversationDatasets(ListConversationDatasetsRequest $request, array $callOptions = []): PagedListResponse + { + return $this->startApiCall('ListConversationDatasets', $request, $callOptions); + } + + /** + * Gets information about a location. + * + * The async variant is {@see ConversationDatasetsClient::getLocationAsync()} . + * + * @example samples/V2/ConversationDatasetsClient/get_location.php + * + * @param GetLocationRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return Location + * + * @throws ApiException Thrown if the API call fails. + */ + public function getLocation(GetLocationRequest $request, array $callOptions = []): Location + { + return $this->startApiCall('GetLocation', $request, $callOptions)->wait(); + } + + /** + * Lists information about the supported locations for this service. + * + * The async variant is {@see ConversationDatasetsClient::listLocationsAsync()} . + * + * @example samples/V2/ConversationDatasetsClient/list_locations.php + * + * @param ListLocationsRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return PagedListResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function listLocations(ListLocationsRequest $request, array $callOptions = []): PagedListResponse + { + return $this->startApiCall('ListLocations', $request, $callOptions); + } +} diff --git a/owl-bot-staging/Dialogflow/v2/src/V2/Client/ConversationModelsClient.php b/owl-bot-staging/Dialogflow/v2/src/V2/Client/ConversationModelsClient.php new file mode 100644 index 000000000000..39d7ae400931 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/src/V2/Client/ConversationModelsClient.php @@ -0,0 +1,795 @@ + 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 ConversationModelsClient::createConversationModelAsync()} . + * + * @example samples/V2/ConversationModelsClient/create_conversation_model.php + * + * @param CreateConversationModelRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function createConversationModel(CreateConversationModelRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('CreateConversationModel', $request, $callOptions)->wait(); + } + + /** + * Creates evaluation of a conversation model. + * + * The async variant is + * {@see ConversationModelsClient::createConversationModelEvaluationAsync()} . + * + * @example samples/V2/ConversationModelsClient/create_conversation_model_evaluation.php + * + * @param CreateConversationModelEvaluationRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function createConversationModelEvaluation(CreateConversationModelEvaluationRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('CreateConversationModelEvaluation', $request, $callOptions)->wait(); + } + + /** + * Deletes a model. + * + * This method is a [long-running + * operation](https://cloud.google.com/dialogflow/es/docs/how/long-running-operations). + * The returned `Operation` type has the following method-specific fields: + * + * - `metadata`: + * [DeleteConversationModelOperationMetadata][google.cloud.dialogflow.v2.DeleteConversationModelOperationMetadata] + * - `response`: An [Empty + * message](https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#empty) + * + * The async variant is + * {@see ConversationModelsClient::deleteConversationModelAsync()} . + * + * @example samples/V2/ConversationModelsClient/delete_conversation_model.php + * + * @param DeleteConversationModelRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function deleteConversationModel(DeleteConversationModelRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('DeleteConversationModel', $request, $callOptions)->wait(); + } + + /** + * Deploys a model. If a model is already deployed, deploying it + * has no effect. A model can only serve prediction requests after it gets + * deployed. For article suggestion, custom model will not be used unless + * it is deployed. + * + * This method is a [long-running + * operation](https://cloud.google.com/dialogflow/es/docs/how/long-running-operations). + * The returned `Operation` type has the following method-specific fields: + * + * - `metadata`: + * [DeployConversationModelOperationMetadata][google.cloud.dialogflow.v2.DeployConversationModelOperationMetadata] + * - `response`: An [Empty + * message](https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#empty) + * + * The async variant is + * {@see ConversationModelsClient::deployConversationModelAsync()} . + * + * @example samples/V2/ConversationModelsClient/deploy_conversation_model.php + * + * @param DeployConversationModelRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function deployConversationModel(DeployConversationModelRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('DeployConversationModel', $request, $callOptions)->wait(); + } + + /** + * Gets conversation model. + * + * The async variant is + * {@see ConversationModelsClient::getConversationModelAsync()} . + * + * @example samples/V2/ConversationModelsClient/get_conversation_model.php + * + * @param GetConversationModelRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return ConversationModel + * + * @throws ApiException Thrown if the API call fails. + */ + public function getConversationModel(GetConversationModelRequest $request, array $callOptions = []): ConversationModel + { + return $this->startApiCall('GetConversationModel', $request, $callOptions)->wait(); + } + + /** + * Gets an evaluation of conversation model. + * + * The async variant is + * {@see ConversationModelsClient::getConversationModelEvaluationAsync()} . + * + * @example samples/V2/ConversationModelsClient/get_conversation_model_evaluation.php + * + * @param GetConversationModelEvaluationRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return ConversationModelEvaluation + * + * @throws ApiException Thrown if the API call fails. + */ + public function getConversationModelEvaluation(GetConversationModelEvaluationRequest $request, array $callOptions = []): ConversationModelEvaluation + { + return $this->startApiCall('GetConversationModelEvaluation', $request, $callOptions)->wait(); + } + + /** + * Lists evaluations of a conversation model. + * + * The async variant is + * {@see ConversationModelsClient::listConversationModelEvaluationsAsync()} . + * + * @example samples/V2/ConversationModelsClient/list_conversation_model_evaluations.php + * + * @param ListConversationModelEvaluationsRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return PagedListResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function listConversationModelEvaluations(ListConversationModelEvaluationsRequest $request, array $callOptions = []): PagedListResponse + { + return $this->startApiCall('ListConversationModelEvaluations', $request, $callOptions); + } + + /** + * Lists conversation models. + * + * The async variant is + * {@see ConversationModelsClient::listConversationModelsAsync()} . + * + * @example samples/V2/ConversationModelsClient/list_conversation_models.php + * + * @param ListConversationModelsRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return PagedListResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function listConversationModels(ListConversationModelsRequest $request, array $callOptions = []): PagedListResponse + { + return $this->startApiCall('ListConversationModels', $request, $callOptions); + } + + /** + * Undeploys a model. If the model is not deployed this method has no effect. + * If the model is currently being used: + * - For article suggestion, article suggestion will fallback to the default + * model if model is undeployed. + * + * This method is a [long-running + * operation](https://cloud.google.com/dialogflow/es/docs/how/long-running-operations). + * The returned `Operation` type has the following method-specific fields: + * + * - `metadata`: + * [UndeployConversationModelOperationMetadata][google.cloud.dialogflow.v2.UndeployConversationModelOperationMetadata] + * - `response`: An [Empty + * message](https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#empty) + * + * The async variant is + * {@see ConversationModelsClient::undeployConversationModelAsync()} . + * + * @example samples/V2/ConversationModelsClient/undeploy_conversation_model.php + * + * @param UndeployConversationModelRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function undeployConversationModel(UndeployConversationModelRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('UndeployConversationModel', $request, $callOptions)->wait(); + } + + /** + * Gets information about a location. + * + * The async variant is {@see ConversationModelsClient::getLocationAsync()} . + * + * @example samples/V2/ConversationModelsClient/get_location.php + * + * @param GetLocationRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return Location + * + * @throws ApiException Thrown if the API call fails. + */ + public function getLocation(GetLocationRequest $request, array $callOptions = []): Location + { + return $this->startApiCall('GetLocation', $request, $callOptions)->wait(); + } + + /** + * Lists information about the supported locations for this service. + * + * The async variant is {@see ConversationModelsClient::listLocationsAsync()} . + * + * @example samples/V2/ConversationModelsClient/list_locations.php + * + * @param ListLocationsRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return PagedListResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function listLocations(ListLocationsRequest $request, array $callOptions = []): PagedListResponse + { + return $this->startApiCall('ListLocations', $request, $callOptions); + } +} diff --git a/owl-bot-staging/Dialogflow/v2/src/V2/Client/ConversationProfilesClient.php b/owl-bot-staging/Dialogflow/v2/src/V2/Client/ConversationProfilesClient.php new file mode 100644 index 000000000000..f6e4a010a80b --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/src/V2/Client/ConversationProfilesClient.php @@ -0,0 +1,882 @@ + 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 generator + * resource. + * + * @param string $project + * @param string $location + * @param string $generator + * + * @return string The formatted generator resource. + */ + public static function generatorName(string $project, string $location, string $generator): string + { + return self::getPathTemplate('generator')->render([ + 'project' => $project, + 'location' => $location, + 'generator' => $generator, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a + * knowledge_base resource. + * + * @param string $project + * @param string $knowledgeBase + * + * @return string The formatted knowledge_base resource. + */ + public static function knowledgeBaseName(string $project, string $knowledgeBase): string + { + return self::getPathTemplate('knowledgeBase')->render([ + 'project' => $project, + 'knowledge_base' => $knowledgeBase, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a location + * resource. + * + * @param string $project + * @param string $location + * + * @return string The formatted location resource. + */ + public static function locationName(string $project, string $location): string + { + return self::getPathTemplate('location')->render([ + 'project' => $project, + 'location' => $location, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a project + * resource. + * + * @param string $project + * + * @return string The formatted project resource. + */ + public static function projectName(string $project): string + { + return self::getPathTemplate('project')->render([ + 'project' => $project, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a + * project_agent resource. + * + * @param string $project + * + * @return string The formatted project_agent resource. + */ + public static function projectAgentName(string $project): string + { + return self::getPathTemplate('projectAgent')->render([ + 'project' => $project, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a + * project_conversation_model resource. + * + * @param string $project + * @param string $conversationModel + * + * @return string The formatted project_conversation_model resource. + */ + public static function projectConversationModelName(string $project, string $conversationModel): string + { + return self::getPathTemplate('projectConversationModel')->render([ + 'project' => $project, + 'conversation_model' => $conversationModel, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a + * project_conversation_profile resource. + * + * @param string $project + * @param string $conversationProfile + * + * @return string The formatted project_conversation_profile resource. + */ + public static function projectConversationProfileName(string $project, string $conversationProfile): string + { + return self::getPathTemplate('projectConversationProfile')->render([ + 'project' => $project, + 'conversation_profile' => $conversationProfile, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a + * project_knowledge_base resource. + * + * @param string $project + * @param string $knowledgeBase + * + * @return string The formatted project_knowledge_base resource. + */ + public static function projectKnowledgeBaseName(string $project, string $knowledgeBase): string + { + return self::getPathTemplate('projectKnowledgeBase')->render([ + 'project' => $project, + 'knowledge_base' => $knowledgeBase, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a + * project_knowledge_base_document resource. + * + * @param string $project + * @param string $knowledgeBase + * @param string $document + * + * @return string The formatted project_knowledge_base_document resource. + */ + public static function projectKnowledgeBaseDocumentName(string $project, string $knowledgeBase, string $document): string + { + return self::getPathTemplate('projectKnowledgeBaseDocument')->render([ + 'project' => $project, + 'knowledge_base' => $knowledgeBase, + 'document' => $document, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a + * project_location_agent resource. + * + * @param string $project + * @param string $location + * + * @return string The formatted project_location_agent resource. + */ + public static function projectLocationAgentName(string $project, string $location): string + { + return self::getPathTemplate('projectLocationAgent')->render([ + 'project' => $project, + 'location' => $location, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a + * project_location_conversation_model resource. + * + * @param string $project + * @param string $location + * @param string $conversationModel + * + * @return string The formatted project_location_conversation_model resource. + */ + public static function projectLocationConversationModelName(string $project, string $location, string $conversationModel): string + { + return self::getPathTemplate('projectLocationConversationModel')->render([ + 'project' => $project, + 'location' => $location, + 'conversation_model' => $conversationModel, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a + * project_location_conversation_profile resource. + * + * @param string $project + * @param string $location + * @param string $conversationProfile + * + * @return string The formatted project_location_conversation_profile resource. + */ + public static function projectLocationConversationProfileName(string $project, string $location, string $conversationProfile): string + { + return self::getPathTemplate('projectLocationConversationProfile')->render([ + 'project' => $project, + 'location' => $location, + 'conversation_profile' => $conversationProfile, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a + * project_location_knowledge_base resource. + * + * @param string $project + * @param string $location + * @param string $knowledgeBase + * + * @return string The formatted project_location_knowledge_base resource. + */ + public static function projectLocationKnowledgeBaseName(string $project, string $location, string $knowledgeBase): string + { + return self::getPathTemplate('projectLocationKnowledgeBase')->render([ + 'project' => $project, + 'location' => $location, + 'knowledge_base' => $knowledgeBase, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a + * project_location_knowledge_base_document resource. + * + * @param string $project + * @param string $location + * @param string $knowledgeBase + * @param string $document + * + * @return string The formatted project_location_knowledge_base_document resource. + */ + public static function projectLocationKnowledgeBaseDocumentName(string $project, string $location, string $knowledgeBase, string $document): string + { + return self::getPathTemplate('projectLocationKnowledgeBaseDocument')->render([ + 'project' => $project, + 'location' => $location, + 'knowledge_base' => $knowledgeBase, + 'document' => $document, + ]); + } + + /** + * Parses a formatted name string and returns an associative array of the components in the name. + * The following name formats are supported: + * Template: Pattern + * - agent: projects/{project}/agent + * - cXSecuritySettings: projects/{project}/locations/{location}/securitySettings/{security_settings} + * - conversationModel: projects/{project}/locations/{location}/conversationModels/{conversation_model} + * - conversationProfile: projects/{project}/conversationProfiles/{conversation_profile} + * - document: projects/{project}/knowledgeBases/{knowledge_base}/documents/{document} + * - generator: projects/{project}/locations/{location}/generators/{generator} + * - knowledgeBase: projects/{project}/knowledgeBases/{knowledge_base} + * - location: projects/{project}/locations/{location} + * - 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 ConversationProfilesClient::clearSuggestionFeatureConfigAsync()} . + * + * @example samples/V2/ConversationProfilesClient/clear_suggestion_feature_config.php + * + * @param ClearSuggestionFeatureConfigRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function clearSuggestionFeatureConfig(ClearSuggestionFeatureConfigRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('ClearSuggestionFeatureConfig', $request, $callOptions)->wait(); + } + + /** + * Creates a conversation profile in the specified project. + * + * [ConversationProfile.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 ConversationProfilesClient::createConversationProfileAsync()} . + * + * @example samples/V2/ConversationProfilesClient/create_conversation_profile.php + * + * @param CreateConversationProfileRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return ConversationProfile + * + * @throws ApiException Thrown if the API call fails. + */ + public function createConversationProfile(CreateConversationProfileRequest $request, array $callOptions = []): ConversationProfile + { + return $this->startApiCall('CreateConversationProfile', $request, $callOptions)->wait(); + } + + /** + * Deletes the specified conversation profile. + * + * The async variant is + * {@see ConversationProfilesClient::deleteConversationProfileAsync()} . + * + * @example samples/V2/ConversationProfilesClient/delete_conversation_profile.php + * + * @param DeleteConversationProfileRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @throws ApiException Thrown if the API call fails. + */ + public function deleteConversationProfile(DeleteConversationProfileRequest $request, array $callOptions = []): void + { + $this->startApiCall('DeleteConversationProfile', $request, $callOptions)->wait(); + } + + /** + * Retrieves the specified conversation profile. + * + * The async variant is + * {@see ConversationProfilesClient::getConversationProfileAsync()} . + * + * @example samples/V2/ConversationProfilesClient/get_conversation_profile.php + * + * @param GetConversationProfileRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return ConversationProfile + * + * @throws ApiException Thrown if the API call fails. + */ + public function getConversationProfile(GetConversationProfileRequest $request, array $callOptions = []): ConversationProfile + { + return $this->startApiCall('GetConversationProfile', $request, $callOptions)->wait(); + } + + /** + * Returns the list of all conversation profiles in the specified project. + * + * The async variant is + * {@see ConversationProfilesClient::listConversationProfilesAsync()} . + * + * @example samples/V2/ConversationProfilesClient/list_conversation_profiles.php + * + * @param ListConversationProfilesRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return PagedListResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function listConversationProfiles(ListConversationProfilesRequest $request, array $callOptions = []): PagedListResponse + { + return $this->startApiCall('ListConversationProfiles', $request, $callOptions); + } + + /** + * Adds or updates a suggestion feature in a conversation profile. + * If the conversation profile contains the type of suggestion feature for + * the participant role, it will update it. Otherwise it will insert the + * suggestion feature. + * + * This method is a [long-running + * operation](https://cloud.google.com/dialogflow/es/docs/how/long-running-operations). + * The returned `Operation` type has the following method-specific fields: + * + * - `metadata`: + * [SetSuggestionFeatureConfigOperationMetadata][google.cloud.dialogflow.v2.SetSuggestionFeatureConfigOperationMetadata] + * - `response`: + * [ConversationProfile][google.cloud.dialogflow.v2.ConversationProfile] + * + * If a long running operation to add or update suggestion feature + * config for the same conversation profile, participant role and suggestion + * feature type exists, please cancel the existing long running operation + * before sending such request, otherwise the request will be rejected. + * + * The async variant is + * {@see ConversationProfilesClient::setSuggestionFeatureConfigAsync()} . + * + * @example samples/V2/ConversationProfilesClient/set_suggestion_feature_config.php + * + * @param SetSuggestionFeatureConfigRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function setSuggestionFeatureConfig(SetSuggestionFeatureConfigRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('SetSuggestionFeatureConfig', $request, $callOptions)->wait(); + } + + /** + * Updates the specified conversation profile. + * + * [ConversationProfile.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 ConversationProfilesClient::updateConversationProfileAsync()} . + * + * @example samples/V2/ConversationProfilesClient/update_conversation_profile.php + * + * @param UpdateConversationProfileRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return ConversationProfile + * + * @throws ApiException Thrown if the API call fails. + */ + public function updateConversationProfile(UpdateConversationProfileRequest $request, array $callOptions = []): ConversationProfile + { + return $this->startApiCall('UpdateConversationProfile', $request, $callOptions)->wait(); + } + + /** + * Gets information about a location. + * + * The async variant is {@see ConversationProfilesClient::getLocationAsync()} . + * + * @example samples/V2/ConversationProfilesClient/get_location.php + * + * @param GetLocationRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return Location + * + * @throws ApiException Thrown if the API call fails. + */ + public function getLocation(GetLocationRequest $request, array $callOptions = []): Location + { + return $this->startApiCall('GetLocation', $request, $callOptions)->wait(); + } + + /** + * Lists information about the supported locations for this service. + * + * The async variant is {@see ConversationProfilesClient::listLocationsAsync()} . + * + * @example samples/V2/ConversationProfilesClient/list_locations.php + * + * @param ListLocationsRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return PagedListResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function listLocations(ListLocationsRequest $request, array $callOptions = []): PagedListResponse + { + return $this->startApiCall('ListLocations', $request, $callOptions); + } +} diff --git a/owl-bot-staging/Dialogflow/v2/src/V2/Client/ConversationsClient.php b/owl-bot-staging/Dialogflow/v2/src/V2/Client/ConversationsClient.php new file mode 100644 index 000000000000..b8c52c90cc26 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/src/V2/Client/ConversationsClient.php @@ -0,0 +1,1013 @@ + 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 generator + * resource. + * + * @param string $project + * @param string $location + * @param string $generator + * + * @return string The formatted generator resource. + */ + public static function generatorName(string $project, string $location, string $generator): string + { + return self::getPathTemplate('generator')->render([ + 'project' => $project, + 'location' => $location, + 'generator' => $generator, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a + * knowledge_base resource. + * + * @param string $project + * @param string $knowledgeBase + * + * @return string The formatted knowledge_base resource. + */ + public static function knowledgeBaseName(string $project, string $knowledgeBase): string + { + return self::getPathTemplate('knowledgeBase')->render([ + 'project' => $project, + 'knowledge_base' => $knowledgeBase, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a location + * resource. + * + * @param string $project + * @param string $location + * + * @return string The formatted location resource. + */ + public static function locationName(string $project, string $location): string + { + return self::getPathTemplate('location')->render([ + 'project' => $project, + 'location' => $location, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a message + * resource. + * + * @param string $project + * @param string $conversation + * @param string $message + * + * @return string The formatted message resource. + */ + public static function messageName(string $project, string $conversation, string $message): string + { + return self::getPathTemplate('message')->render([ + 'project' => $project, + 'conversation' => $conversation, + 'message' => $message, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a 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} + * - generator: projects/{project}/locations/{location}/generators/{generator} + * - knowledgeBase: projects/{project}/knowledgeBases/{knowledge_base} + * - location: projects/{project}/locations/{location} + * - message: projects/{project}/conversations/{conversation}/messages/{message} + * - 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 ConversationsClient::completeConversationAsync()} . + * + * @example samples/V2/ConversationsClient/complete_conversation.php + * + * @param CompleteConversationRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return Conversation + * + * @throws ApiException Thrown if the API call fails. + */ + public function completeConversation(CompleteConversationRequest $request, array $callOptions = []): Conversation + { + return $this->startApiCall('CompleteConversation', $request, $callOptions)->wait(); + } + + /** + * Creates a new conversation. Conversations are auto-completed after 24 + * hours. + * + * Conversation Lifecycle: + * There are two stages during a conversation: Automated Agent Stage and + * Assist Stage. + * + * For Automated Agent Stage, there will be a dialogflow agent responding to + * user queries. + * + * For Assist Stage, there's no dialogflow agent responding to user queries. + * But we will provide suggestions which are generated from conversation. + * + * If + * [Conversation.conversation_profile][google.cloud.dialogflow.v2.Conversation.conversation_profile] + * is configured for a dialogflow agent, conversation will start from + * `Automated Agent Stage`, otherwise, it will start from `Assist Stage`. And + * during `Automated Agent Stage`, once an + * [Intent][google.cloud.dialogflow.v2.Intent] with + * [Intent.live_agent_handoff][google.cloud.dialogflow.v2.Intent.live_agent_handoff] + * is triggered, conversation will transfer to Assist Stage. + * + * The async variant is {@see ConversationsClient::createConversationAsync()} . + * + * @example samples/V2/ConversationsClient/create_conversation.php + * + * @param CreateConversationRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return Conversation + * + * @throws ApiException Thrown if the API call fails. + */ + public function createConversation(CreateConversationRequest $request, array $callOptions = []): Conversation + { + return $this->startApiCall('CreateConversation', $request, $callOptions)->wait(); + } + + /** + * Generates and returns a suggestion for a conversation that does not have a + * resource created for it. + * + * The async variant is + * {@see ConversationsClient::generateStatelessSuggestionAsync()} . + * + * @example samples/V2/ConversationsClient/generate_stateless_suggestion.php + * + * @param GenerateStatelessSuggestionRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return GenerateStatelessSuggestionResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function generateStatelessSuggestion(GenerateStatelessSuggestionRequest $request, array $callOptions = []): GenerateStatelessSuggestionResponse + { + return $this->startApiCall('GenerateStatelessSuggestion', $request, $callOptions)->wait(); + } + + /** + * Generates and returns a summary for a conversation that does not have a + * resource created for it. + * + * The async variant is {@see ConversationsClient::generateStatelessSummaryAsync()} + * . + * + * @example samples/V2/ConversationsClient/generate_stateless_summary.php + * + * @param GenerateStatelessSummaryRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return GenerateStatelessSummaryResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function generateStatelessSummary(GenerateStatelessSummaryRequest $request, array $callOptions = []): GenerateStatelessSummaryResponse + { + return $this->startApiCall('GenerateStatelessSummary', $request, $callOptions)->wait(); + } + + /** + * Retrieves the specific conversation. + * + * The async variant is {@see ConversationsClient::getConversationAsync()} . + * + * @example samples/V2/ConversationsClient/get_conversation.php + * + * @param GetConversationRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return Conversation + * + * @throws ApiException Thrown if the API call fails. + */ + public function getConversation(GetConversationRequest $request, array $callOptions = []): Conversation + { + return $this->startApiCall('GetConversation', $request, $callOptions)->wait(); + } + + /** + * Returns the list of all conversations in the specified project. + * + * The async variant is {@see ConversationsClient::listConversationsAsync()} . + * + * @example samples/V2/ConversationsClient/list_conversations.php + * + * @param ListConversationsRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return PagedListResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function listConversations(ListConversationsRequest $request, array $callOptions = []): PagedListResponse + { + return $this->startApiCall('ListConversations', $request, $callOptions); + } + + /** + * Lists messages that belong to a given conversation. + * `messages` are ordered by `create_time` in descending order. To fetch + * updates without duplication, send request with filter + * `create_time_epoch_microseconds > + * [first item's create_time of previous request]` and empty page_token. + * + * The async variant is {@see ConversationsClient::listMessagesAsync()} . + * + * @example samples/V2/ConversationsClient/list_messages.php + * + * @param ListMessagesRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return PagedListResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function listMessages(ListMessagesRequest $request, array $callOptions = []): PagedListResponse + { + return $this->startApiCall('ListMessages', $request, $callOptions); + } + + /** + * Get answers for the given query based on knowledge documents. + * + * The async variant is {@see ConversationsClient::searchKnowledgeAsync()} . + * + * @example samples/V2/ConversationsClient/search_knowledge.php + * + * @param SearchKnowledgeRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return SearchKnowledgeResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function searchKnowledge(SearchKnowledgeRequest $request, array $callOptions = []): SearchKnowledgeResponse + { + return $this->startApiCall('SearchKnowledge', $request, $callOptions)->wait(); + } + + /** + * Suggests summary for a conversation based on specific historical messages. + * The range of the messages to be used for summary can be specified in the + * request. + * + * The async variant is + * {@see ConversationsClient::suggestConversationSummaryAsync()} . + * + * @example samples/V2/ConversationsClient/suggest_conversation_summary.php + * + * @param SuggestConversationSummaryRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return SuggestConversationSummaryResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function suggestConversationSummary(SuggestConversationSummaryRequest $request, array $callOptions = []): SuggestConversationSummaryResponse + { + return $this->startApiCall('SuggestConversationSummary', $request, $callOptions)->wait(); + } + + /** + * Gets information about a location. + * + * The async variant is {@see ConversationsClient::getLocationAsync()} . + * + * @example samples/V2/ConversationsClient/get_location.php + * + * @param GetLocationRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return Location + * + * @throws ApiException Thrown if the API call fails. + */ + public function getLocation(GetLocationRequest $request, array $callOptions = []): Location + { + return $this->startApiCall('GetLocation', $request, $callOptions)->wait(); + } + + /** + * Lists information about the supported locations for this service. + * + * The async variant is {@see ConversationsClient::listLocationsAsync()} . + * + * @example samples/V2/ConversationsClient/list_locations.php + * + * @param ListLocationsRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return PagedListResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function listLocations(ListLocationsRequest $request, array $callOptions = []): PagedListResponse + { + return $this->startApiCall('ListLocations', $request, $callOptions); + } +} diff --git a/owl-bot-staging/Dialogflow/v2/src/V2/Client/DocumentsClient.php b/owl-bot-staging/Dialogflow/v2/src/V2/Client/DocumentsClient.php new file mode 100644 index 000000000000..421d7cb533e4 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/src/V2/Client/DocumentsClient.php @@ -0,0 +1,689 @@ + 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 DocumentsClient::createDocumentAsync()} . + * + * @example samples/V2/DocumentsClient/create_document.php + * + * @param CreateDocumentRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function createDocument(CreateDocumentRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('CreateDocument', $request, $callOptions)->wait(); + } + + /** + * Deletes the specified document. + * + * This method is a [long-running + * operation](https://cloud.google.com/dialogflow/cx/docs/how/long-running-operation). + * The returned `Operation` type has the following method-specific fields: + * + * - `metadata`: + * [KnowledgeOperationMetadata][google.cloud.dialogflow.v2.KnowledgeOperationMetadata] + * - `response`: An [Empty + * message](https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#empty) + * + * The async variant is {@see DocumentsClient::deleteDocumentAsync()} . + * + * @example samples/V2/DocumentsClient/delete_document.php + * + * @param DeleteDocumentRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function deleteDocument(DeleteDocumentRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('DeleteDocument', $request, $callOptions)->wait(); + } + + /** + * Exports a smart messaging candidate document into the specified + * destination. + * + * This method is a [long-running + * operation](https://cloud.google.com/dialogflow/cx/docs/how/long-running-operation). + * The returned `Operation` type has the following method-specific fields: + * + * - `metadata`: + * [KnowledgeOperationMetadata][google.cloud.dialogflow.v2.KnowledgeOperationMetadata] + * - `response`: [Document][google.cloud.dialogflow.v2.Document] + * + * The async variant is {@see DocumentsClient::exportDocumentAsync()} . + * + * @example samples/V2/DocumentsClient/export_document.php + * + * @param ExportDocumentRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function exportDocument(ExportDocumentRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('ExportDocument', $request, $callOptions)->wait(); + } + + /** + * Retrieves the specified document. + * + * The async variant is {@see DocumentsClient::getDocumentAsync()} . + * + * @example samples/V2/DocumentsClient/get_document.php + * + * @param GetDocumentRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return Document + * + * @throws ApiException Thrown if the API call fails. + */ + public function getDocument(GetDocumentRequest $request, array $callOptions = []): Document + { + return $this->startApiCall('GetDocument', $request, $callOptions)->wait(); + } + + /** + * Creates documents by importing data from external sources. + * Dialogflow supports up to 350 documents in each request. If you try to + * import more, Dialogflow will return an error. + * + * This method is a [long-running + * operation](https://cloud.google.com/dialogflow/cx/docs/how/long-running-operation). + * The returned `Operation` type has the following method-specific fields: + * + * - `metadata`: + * [KnowledgeOperationMetadata][google.cloud.dialogflow.v2.KnowledgeOperationMetadata] + * - `response`: + * [ImportDocumentsResponse][google.cloud.dialogflow.v2.ImportDocumentsResponse] + * + * The async variant is {@see DocumentsClient::importDocumentsAsync()} . + * + * @example samples/V2/DocumentsClient/import_documents.php + * + * @param ImportDocumentsRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function importDocuments(ImportDocumentsRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('ImportDocuments', $request, $callOptions)->wait(); + } + + /** + * Returns the list of all documents of the knowledge base. + * + * The async variant is {@see DocumentsClient::listDocumentsAsync()} . + * + * @example samples/V2/DocumentsClient/list_documents.php + * + * @param ListDocumentsRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return PagedListResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function listDocuments(ListDocumentsRequest $request, array $callOptions = []): PagedListResponse + { + return $this->startApiCall('ListDocuments', $request, $callOptions); + } + + /** + * Reloads the specified document from its specified source, content_uri or + * content. The previously loaded content of the document will be deleted. + * Note: Even when the content of the document has not changed, there still + * may be side effects because of internal implementation changes. + * + * This method is a [long-running + * operation](https://cloud.google.com/dialogflow/cx/docs/how/long-running-operation). + * The returned `Operation` type has the following method-specific fields: + * + * - `metadata`: + * [KnowledgeOperationMetadata][google.cloud.dialogflow.v2.KnowledgeOperationMetadata] + * - `response`: [Document][google.cloud.dialogflow.v2.Document] + * + * Note: The `projects.agent.knowledgeBases.documents` resource is deprecated; + * only use `projects.knowledgeBases.documents`. + * + * The async variant is {@see DocumentsClient::reloadDocumentAsync()} . + * + * @example samples/V2/DocumentsClient/reload_document.php + * + * @param ReloadDocumentRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function reloadDocument(ReloadDocumentRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('ReloadDocument', $request, $callOptions)->wait(); + } + + /** + * Updates the specified document. + * + * This method is a [long-running + * operation](https://cloud.google.com/dialogflow/cx/docs/how/long-running-operation). + * The returned `Operation` type has the following method-specific fields: + * + * - `metadata`: + * [KnowledgeOperationMetadata][google.cloud.dialogflow.v2.KnowledgeOperationMetadata] + * - `response`: [Document][google.cloud.dialogflow.v2.Document] + * + * The async variant is {@see DocumentsClient::updateDocumentAsync()} . + * + * @example samples/V2/DocumentsClient/update_document.php + * + * @param UpdateDocumentRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function updateDocument(UpdateDocumentRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('UpdateDocument', $request, $callOptions)->wait(); + } + + /** + * Gets information about a location. + * + * The async variant is {@see DocumentsClient::getLocationAsync()} . + * + * @example samples/V2/DocumentsClient/get_location.php + * + * @param GetLocationRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return Location + * + * @throws ApiException Thrown if the API call fails. + */ + public function getLocation(GetLocationRequest $request, array $callOptions = []): Location + { + return $this->startApiCall('GetLocation', $request, $callOptions)->wait(); + } + + /** + * Lists information about the supported locations for this service. + * + * The async variant is {@see DocumentsClient::listLocationsAsync()} . + * + * @example samples/V2/DocumentsClient/list_locations.php + * + * @param ListLocationsRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return PagedListResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function listLocations(ListLocationsRequest $request, array $callOptions = []): PagedListResponse + { + return $this->startApiCall('ListLocations', $request, $callOptions); + } +} diff --git a/owl-bot-staging/Dialogflow/v2/src/V2/Client/EncryptionSpecServiceClient.php b/owl-bot-staging/Dialogflow/v2/src/V2/Client/EncryptionSpecServiceClient.php new file mode 100644 index 000000000000..547b5b510197 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/src/V2/Client/EncryptionSpecServiceClient.php @@ -0,0 +1,365 @@ + self::SERVICE_NAME, + 'apiEndpoint' => self::SERVICE_ADDRESS . ':' . self::DEFAULT_SERVICE_PORT, + 'clientConfig' => __DIR__ . '/../resources/encryption_spec_service_client_config.json', + 'descriptorsConfigPath' => __DIR__ . '/../resources/encryption_spec_service_descriptor_config.php', + 'gcpApiConfigPath' => __DIR__ . '/../resources/encryption_spec_service_grpc_config.json', + 'credentialsConfig' => [ + 'defaultScopes' => self::$serviceScopes, + ], + 'transportConfig' => [ + 'rest' => [ + 'restClientConfigPath' => __DIR__ . '/../resources/encryption_spec_service_rest_client_config.php', + ], + ], + ]; + } + + /** + * Return an OperationsClient object with the same endpoint as $this. + * + * @return OperationsClient + */ + public function getOperationsClient() + { + return $this->operationsClient; + } + + /** + * Resume an existing long running operation that was previously started by a long + * running API method. If $methodName is not provided, or does not match a long + * running API method, then the operation can still be resumed, but the + * OperationResponse object will not deserialize the final response. + * + * @param string $operationName The name of the long running operation + * @param string $methodName The name of the method used to start the operation + * + * @return OperationResponse + */ + public function resumeOperation($operationName, $methodName = null) + { + $options = 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 + * encryption_spec resource. + * + * @param string $project + * @param string $location + * + * @return string The formatted encryption_spec resource. + */ + public static function encryptionSpecName(string $project, string $location): string + { + return self::getPathTemplate('encryptionSpec')->render([ + 'project' => $project, + 'location' => $location, + ]); + } + + /** + * Parses a formatted name string and returns an associative array of the components in the name. + * The following name formats are supported: + * Template: Pattern + * - encryptionSpec: projects/{project}/locations/{location}/encryptionSpec + * + * The optional $template argument can be supplied to specify a particular pattern, + * and must match one of the templates listed above. If no $template argument is + * provided, or if the $template argument does not match one of the templates + * listed, then parseName will check each of the supported templates, and return + * the first match. + * + * @param string $formattedName The formatted name string + * @param string $template Optional name of template to match + * + * @return array An associative array from name component IDs to component values. + * + * @throws ValidationException If $formattedName could not be matched. + */ + public static function parseName(string $formattedName, string $template = null): array + { + return self::parseFormattedName($formattedName, $template); + } + + /** + * Constructor. + * + * @param array $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); + } + + /** + * Gets location-level encryption key specification. + * + * The async variant is + * {@see EncryptionSpecServiceClient::getEncryptionSpecAsync()} . + * + * @example samples/V2/EncryptionSpecServiceClient/get_encryption_spec.php + * + * @param GetEncryptionSpecRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return EncryptionSpec + * + * @throws ApiException Thrown if the API call fails. + */ + public function getEncryptionSpec(GetEncryptionSpecRequest $request, array $callOptions = []): EncryptionSpec + { + return $this->startApiCall('GetEncryptionSpec', $request, $callOptions)->wait(); + } + + /** + * Initializes a location-level encryption key specification. An error will + * be thrown if the location has resources already created before the + * initialization. Once the encryption specification is initialized at a + * location, it is immutable and all newly created resources under the + * location will be encrypted with the existing specification. + * + * The async variant is + * {@see EncryptionSpecServiceClient::initializeEncryptionSpecAsync()} . + * + * @example samples/V2/EncryptionSpecServiceClient/initialize_encryption_spec.php + * + * @param InitializeEncryptionSpecRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function initializeEncryptionSpec(InitializeEncryptionSpecRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('InitializeEncryptionSpec', $request, $callOptions)->wait(); + } + + /** + * Gets information about a location. + * + * The async variant is {@see EncryptionSpecServiceClient::getLocationAsync()} . + * + * @example samples/V2/EncryptionSpecServiceClient/get_location.php + * + * @param GetLocationRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return Location + * + * @throws ApiException Thrown if the API call fails. + */ + public function getLocation(GetLocationRequest $request, array $callOptions = []): Location + { + return $this->startApiCall('GetLocation', $request, $callOptions)->wait(); + } + + /** + * Lists information about the supported locations for this service. + * + * The async variant is {@see EncryptionSpecServiceClient::listLocationsAsync()} . + * + * @example samples/V2/EncryptionSpecServiceClient/list_locations.php + * + * @param ListLocationsRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return PagedListResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function listLocations(ListLocationsRequest $request, array $callOptions = []): PagedListResponse + { + return $this->startApiCall('ListLocations', $request, $callOptions); + } +} diff --git a/owl-bot-staging/Dialogflow/v2/src/V2/Client/EntityTypesClient.php b/owl-bot-staging/Dialogflow/v2/src/V2/Client/EntityTypesClient.php new file mode 100644 index 000000000000..d19c1303cbd9 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/src/V2/Client/EntityTypesClient.php @@ -0,0 +1,752 @@ + 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 EntityTypesClient::batchCreateEntitiesAsync()} . + * + * @example samples/V2/EntityTypesClient/batch_create_entities.php + * + * @param BatchCreateEntitiesRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function batchCreateEntities(BatchCreateEntitiesRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('BatchCreateEntities', $request, $callOptions)->wait(); + } + + /** + * Deletes entities in the specified entity type. + * + * This method is a [long-running + * operation](https://cloud.google.com/dialogflow/es/docs/how/long-running-operations). + * The returned `Operation` type has the following method-specific fields: + * + * - `metadata`: An empty [Struct + * message](https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#struct) + * - `response`: An [Empty + * message](https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#empty) + * + * Note: You should always train an agent prior to sending it queries. See the + * [training + * documentation](https://cloud.google.com/dialogflow/es/docs/training). + * + * The async variant is {@see EntityTypesClient::batchDeleteEntitiesAsync()} . + * + * @example samples/V2/EntityTypesClient/batch_delete_entities.php + * + * @param BatchDeleteEntitiesRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function batchDeleteEntities(BatchDeleteEntitiesRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('BatchDeleteEntities', $request, $callOptions)->wait(); + } + + /** + * Deletes entity types in the specified agent. + * + * This method is a [long-running + * operation](https://cloud.google.com/dialogflow/es/docs/how/long-running-operations). + * The returned `Operation` type has the following method-specific fields: + * + * - `metadata`: An empty [Struct + * message](https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#struct) + * - `response`: An [Empty + * message](https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#empty) + * + * Note: You should always train an agent prior to sending it queries. See the + * [training + * documentation](https://cloud.google.com/dialogflow/es/docs/training). + * + * The async variant is {@see EntityTypesClient::batchDeleteEntityTypesAsync()} . + * + * @example samples/V2/EntityTypesClient/batch_delete_entity_types.php + * + * @param BatchDeleteEntityTypesRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function batchDeleteEntityTypes(BatchDeleteEntityTypesRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('BatchDeleteEntityTypes', $request, $callOptions)->wait(); + } + + /** + * Updates or creates multiple entities in the specified entity type. This + * method does not affect entities in the entity type that aren't explicitly + * specified in the request. + * + * This method is a [long-running + * operation](https://cloud.google.com/dialogflow/es/docs/how/long-running-operations). + * The returned `Operation` type has the following method-specific fields: + * + * - `metadata`: An empty [Struct + * message](https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#struct) + * - `response`: An [Empty + * message](https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#empty) + * + * Note: You should always train an agent prior to sending it queries. See the + * [training + * documentation](https://cloud.google.com/dialogflow/es/docs/training). + * + * + * The async variant is {@see EntityTypesClient::batchUpdateEntitiesAsync()} . + * + * @example samples/V2/EntityTypesClient/batch_update_entities.php + * + * @param BatchUpdateEntitiesRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function batchUpdateEntities(BatchUpdateEntitiesRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('BatchUpdateEntities', $request, $callOptions)->wait(); + } + + /** + * Updates/Creates multiple entity types in the specified agent. + * + * This method is a [long-running + * operation](https://cloud.google.com/dialogflow/es/docs/how/long-running-operations). + * The returned `Operation` type has the following method-specific fields: + * + * - `metadata`: An empty [Struct + * message](https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#struct) + * - `response`: + * [BatchUpdateEntityTypesResponse][google.cloud.dialogflow.v2.BatchUpdateEntityTypesResponse] + * + * Note: You should always train an agent prior to sending it queries. See the + * [training + * documentation](https://cloud.google.com/dialogflow/es/docs/training). + * + * The async variant is {@see EntityTypesClient::batchUpdateEntityTypesAsync()} . + * + * @example samples/V2/EntityTypesClient/batch_update_entity_types.php + * + * @param BatchUpdateEntityTypesRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function batchUpdateEntityTypes(BatchUpdateEntityTypesRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('BatchUpdateEntityTypes', $request, $callOptions)->wait(); + } + + /** + * Creates an entity type in the specified agent. + * + * Note: You should always train an agent prior to sending it queries. See the + * [training + * documentation](https://cloud.google.com/dialogflow/es/docs/training). + * + * The async variant is {@see EntityTypesClient::createEntityTypeAsync()} . + * + * @example samples/V2/EntityTypesClient/create_entity_type.php + * + * @param CreateEntityTypeRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return EntityType + * + * @throws ApiException Thrown if the API call fails. + */ + public function createEntityType(CreateEntityTypeRequest $request, array $callOptions = []): EntityType + { + return $this->startApiCall('CreateEntityType', $request, $callOptions)->wait(); + } + + /** + * Deletes the specified entity type. + * + * Note: You should always train an agent prior to sending it queries. See the + * [training + * documentation](https://cloud.google.com/dialogflow/es/docs/training). + * + * The async variant is {@see EntityTypesClient::deleteEntityTypeAsync()} . + * + * @example samples/V2/EntityTypesClient/delete_entity_type.php + * + * @param DeleteEntityTypeRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @throws ApiException Thrown if the API call fails. + */ + public function deleteEntityType(DeleteEntityTypeRequest $request, array $callOptions = []): void + { + $this->startApiCall('DeleteEntityType', $request, $callOptions)->wait(); + } + + /** + * Retrieves the specified entity type. + * + * The async variant is {@see EntityTypesClient::getEntityTypeAsync()} . + * + * @example samples/V2/EntityTypesClient/get_entity_type.php + * + * @param GetEntityTypeRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return EntityType + * + * @throws ApiException Thrown if the API call fails. + */ + public function getEntityType(GetEntityTypeRequest $request, array $callOptions = []): EntityType + { + return $this->startApiCall('GetEntityType', $request, $callOptions)->wait(); + } + + /** + * Returns the list of all entity types in the specified agent. + * + * The async variant is {@see EntityTypesClient::listEntityTypesAsync()} . + * + * @example samples/V2/EntityTypesClient/list_entity_types.php + * + * @param ListEntityTypesRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return PagedListResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function listEntityTypes(ListEntityTypesRequest $request, array $callOptions = []): PagedListResponse + { + return $this->startApiCall('ListEntityTypes', $request, $callOptions); + } + + /** + * Updates the specified entity type. + * + * Note: You should always train an agent prior to sending it queries. See the + * [training + * documentation](https://cloud.google.com/dialogflow/es/docs/training). + * + * The async variant is {@see EntityTypesClient::updateEntityTypeAsync()} . + * + * @example samples/V2/EntityTypesClient/update_entity_type.php + * + * @param UpdateEntityTypeRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return EntityType + * + * @throws ApiException Thrown if the API call fails. + */ + public function updateEntityType(UpdateEntityTypeRequest $request, array $callOptions = []): EntityType + { + return $this->startApiCall('UpdateEntityType', $request, $callOptions)->wait(); + } + + /** + * Gets information about a location. + * + * The async variant is {@see EntityTypesClient::getLocationAsync()} . + * + * @example samples/V2/EntityTypesClient/get_location.php + * + * @param GetLocationRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return Location + * + * @throws ApiException Thrown if the API call fails. + */ + public function getLocation(GetLocationRequest $request, array $callOptions = []): Location + { + return $this->startApiCall('GetLocation', $request, $callOptions)->wait(); + } + + /** + * Lists information about the supported locations for this service. + * + * The async variant is {@see EntityTypesClient::listLocationsAsync()} . + * + * @example samples/V2/EntityTypesClient/list_locations.php + * + * @param ListLocationsRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return PagedListResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function listLocations(ListLocationsRequest $request, array $callOptions = []): PagedListResponse + { + return $this->startApiCall('ListLocations', $request, $callOptions); + } +} diff --git a/owl-bot-staging/Dialogflow/v2/src/V2/Client/EnvironmentsClient.php b/owl-bot-staging/Dialogflow/v2/src/V2/Client/EnvironmentsClient.php new file mode 100644 index 000000000000..a7ec1436739a --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/src/V2/Client/EnvironmentsClient.php @@ -0,0 +1,639 @@ + 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 EnvironmentsClient::createEnvironmentAsync()} . + * + * @example samples/V2/EnvironmentsClient/create_environment.php + * + * @param CreateEnvironmentRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return Environment + * + * @throws ApiException Thrown if the API call fails. + */ + public function createEnvironment(CreateEnvironmentRequest $request, array $callOptions = []): Environment + { + return $this->startApiCall('CreateEnvironment', $request, $callOptions)->wait(); + } + + /** + * Deletes the specified agent environment. + * + * The async variant is {@see EnvironmentsClient::deleteEnvironmentAsync()} . + * + * @example samples/V2/EnvironmentsClient/delete_environment.php + * + * @param DeleteEnvironmentRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @throws ApiException Thrown if the API call fails. + */ + public function deleteEnvironment(DeleteEnvironmentRequest $request, array $callOptions = []): void + { + $this->startApiCall('DeleteEnvironment', $request, $callOptions)->wait(); + } + + /** + * Retrieves the specified agent environment. + * + * The async variant is {@see EnvironmentsClient::getEnvironmentAsync()} . + * + * @example samples/V2/EnvironmentsClient/get_environment.php + * + * @param GetEnvironmentRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return Environment + * + * @throws ApiException Thrown if the API call fails. + */ + public function getEnvironment(GetEnvironmentRequest $request, array $callOptions = []): Environment + { + return $this->startApiCall('GetEnvironment', $request, $callOptions)->wait(); + } + + /** + * Gets the history of the specified environment. + * + * The async variant is {@see EnvironmentsClient::getEnvironmentHistoryAsync()} . + * + * @example samples/V2/EnvironmentsClient/get_environment_history.php + * + * @param GetEnvironmentHistoryRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return PagedListResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function getEnvironmentHistory(GetEnvironmentHistoryRequest $request, array $callOptions = []): PagedListResponse + { + return $this->startApiCall('GetEnvironmentHistory', $request, $callOptions); + } + + /** + * Returns the list of all non-default environments of the specified agent. + * + * The async variant is {@see EnvironmentsClient::listEnvironmentsAsync()} . + * + * @example samples/V2/EnvironmentsClient/list_environments.php + * + * @param ListEnvironmentsRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return PagedListResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function listEnvironments(ListEnvironmentsRequest $request, array $callOptions = []): PagedListResponse + { + return $this->startApiCall('ListEnvironments', $request, $callOptions); + } + + /** + * Updates the specified agent environment. + * + * This method allows you to deploy new agent versions into the environment. + * When an environment is pointed to a new agent version by setting + * `environment.agent_version`, the environment is temporarily set to the + * `LOADING` state. During that time, the environment continues serving the + * previous version of the agent. After the new agent version is done loading, + * the environment is set back to the `RUNNING` state. + * You can use "-" as Environment ID in environment name to update an agent + * version in the default environment. WARNING: this will negate all recent + * changes to the draft agent and can't be undone. You may want to save the + * draft agent to a version before calling this method. + * + * The async variant is {@see EnvironmentsClient::updateEnvironmentAsync()} . + * + * @example samples/V2/EnvironmentsClient/update_environment.php + * + * @param UpdateEnvironmentRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return Environment + * + * @throws ApiException Thrown if the API call fails. + */ + public function updateEnvironment(UpdateEnvironmentRequest $request, array $callOptions = []): Environment + { + return $this->startApiCall('UpdateEnvironment', $request, $callOptions)->wait(); + } + + /** + * Gets information about a location. + * + * The async variant is {@see EnvironmentsClient::getLocationAsync()} . + * + * @example samples/V2/EnvironmentsClient/get_location.php + * + * @param GetLocationRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return Location + * + * @throws ApiException Thrown if the API call fails. + */ + public function getLocation(GetLocationRequest $request, array $callOptions = []): Location + { + return $this->startApiCall('GetLocation', $request, $callOptions)->wait(); + } + + /** + * Lists information about the supported locations for this service. + * + * The async variant is {@see EnvironmentsClient::listLocationsAsync()} . + * + * @example samples/V2/EnvironmentsClient/list_locations.php + * + * @param ListLocationsRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return PagedListResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function listLocations(ListLocationsRequest $request, array $callOptions = []): PagedListResponse + { + return $this->startApiCall('ListLocations', $request, $callOptions); + } +} diff --git a/owl-bot-staging/Dialogflow/v2/src/V2/Client/FulfillmentsClient.php b/owl-bot-staging/Dialogflow/v2/src/V2/Client/FulfillmentsClient.php new file mode 100644 index 000000000000..96a756a831c7 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/src/V2/Client/FulfillmentsClient.php @@ -0,0 +1,356 @@ + 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 FulfillmentsClient::getFulfillmentAsync()} . + * + * @example samples/V2/FulfillmentsClient/get_fulfillment.php + * + * @param GetFulfillmentRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return Fulfillment + * + * @throws ApiException Thrown if the API call fails. + */ + public function getFulfillment(GetFulfillmentRequest $request, array $callOptions = []): Fulfillment + { + return $this->startApiCall('GetFulfillment', $request, $callOptions)->wait(); + } + + /** + * Updates the fulfillment. + * + * The async variant is {@see FulfillmentsClient::updateFulfillmentAsync()} . + * + * @example samples/V2/FulfillmentsClient/update_fulfillment.php + * + * @param UpdateFulfillmentRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return Fulfillment + * + * @throws ApiException Thrown if the API call fails. + */ + public function updateFulfillment(UpdateFulfillmentRequest $request, array $callOptions = []): Fulfillment + { + return $this->startApiCall('UpdateFulfillment', $request, $callOptions)->wait(); + } + + /** + * Gets information about a location. + * + * The async variant is {@see FulfillmentsClient::getLocationAsync()} . + * + * @example samples/V2/FulfillmentsClient/get_location.php + * + * @param GetLocationRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return Location + * + * @throws ApiException Thrown if the API call fails. + */ + public function getLocation(GetLocationRequest $request, array $callOptions = []): Location + { + return $this->startApiCall('GetLocation', $request, $callOptions)->wait(); + } + + /** + * Lists information about the supported locations for this service. + * + * The async variant is {@see FulfillmentsClient::listLocationsAsync()} . + * + * @example samples/V2/FulfillmentsClient/list_locations.php + * + * @param ListLocationsRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return PagedListResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function listLocations(ListLocationsRequest $request, array $callOptions = []): PagedListResponse + { + return $this->startApiCall('ListLocations', $request, $callOptions); + } +} diff --git a/owl-bot-staging/Dialogflow/v2/src/V2/Client/GeneratorsClient.php b/owl-bot-staging/Dialogflow/v2/src/V2/Client/GeneratorsClient.php new file mode 100644 index 000000000000..495de526bd8e --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/src/V2/Client/GeneratorsClient.php @@ -0,0 +1,428 @@ + self::SERVICE_NAME, + 'apiEndpoint' => self::SERVICE_ADDRESS . ':' . self::DEFAULT_SERVICE_PORT, + 'clientConfig' => __DIR__ . '/../resources/generators_client_config.json', + 'descriptorsConfigPath' => __DIR__ . '/../resources/generators_descriptor_config.php', + 'gcpApiConfigPath' => __DIR__ . '/../resources/generators_grpc_config.json', + 'credentialsConfig' => [ + 'defaultScopes' => self::$serviceScopes, + ], + 'transportConfig' => [ + 'rest' => [ + 'restClientConfigPath' => __DIR__ . '/../resources/generators_rest_client_config.php', + ], + ], + ]; + } + + /** + * Formats a string containing the fully-qualified path to represent a generator + * resource. + * + * @param string $project + * @param string $location + * @param string $generator + * + * @return string The formatted generator resource. + */ + public static function generatorName(string $project, string $location, string $generator): string + { + return self::getPathTemplate('generator')->render([ + 'project' => $project, + 'location' => $location, + 'generator' => $generator, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a project + * resource. + * + * @param string $project + * + * @return string The formatted project resource. + */ + public static function projectName(string $project): string + { + return self::getPathTemplate('project')->render([ + 'project' => $project, + ]); + } + + /** + * Parses a formatted name string and returns an associative array of the components in the name. + * The following name formats are supported: + * Template: Pattern + * - generator: projects/{project}/locations/{location}/generators/{generator} + * - project: projects/{project} + * + * 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 generator. + * + * The async variant is {@see GeneratorsClient::createGeneratorAsync()} . + * + * @example samples/V2/GeneratorsClient/create_generator.php + * + * @param CreateGeneratorRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return Generator + * + * @throws ApiException Thrown if the API call fails. + */ + public function createGenerator(CreateGeneratorRequest $request, array $callOptions = []): Generator + { + return $this->startApiCall('CreateGenerator', $request, $callOptions)->wait(); + } + + /** + * Deletes a generator. + * + * The async variant is {@see GeneratorsClient::deleteGeneratorAsync()} . + * + * @example samples/V2/GeneratorsClient/delete_generator.php + * + * @param DeleteGeneratorRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @throws ApiException Thrown if the API call fails. + */ + public function deleteGenerator(DeleteGeneratorRequest $request, array $callOptions = []): void + { + $this->startApiCall('DeleteGenerator', $request, $callOptions)->wait(); + } + + /** + * Retrieves a generator. + * + * The async variant is {@see GeneratorsClient::getGeneratorAsync()} . + * + * @example samples/V2/GeneratorsClient/get_generator.php + * + * @param GetGeneratorRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return Generator + * + * @throws ApiException Thrown if the API call fails. + */ + public function getGenerator(GetGeneratorRequest $request, array $callOptions = []): Generator + { + return $this->startApiCall('GetGenerator', $request, $callOptions)->wait(); + } + + /** + * Lists generators. + * + * The async variant is {@see GeneratorsClient::listGeneratorsAsync()} . + * + * @example samples/V2/GeneratorsClient/list_generators.php + * + * @param ListGeneratorsRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return PagedListResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function listGenerators(ListGeneratorsRequest $request, array $callOptions = []): PagedListResponse + { + return $this->startApiCall('ListGenerators', $request, $callOptions); + } + + /** + * Updates a generator. + * + * The async variant is {@see GeneratorsClient::updateGeneratorAsync()} . + * + * @example samples/V2/GeneratorsClient/update_generator.php + * + * @param UpdateGeneratorRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return Generator + * + * @throws ApiException Thrown if the API call fails. + */ + public function updateGenerator(UpdateGeneratorRequest $request, array $callOptions = []): Generator + { + return $this->startApiCall('UpdateGenerator', $request, $callOptions)->wait(); + } + + /** + * Gets information about a location. + * + * The async variant is {@see GeneratorsClient::getLocationAsync()} . + * + * @example samples/V2/GeneratorsClient/get_location.php + * + * @param GetLocationRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return Location + * + * @throws ApiException Thrown if the API call fails. + */ + public function getLocation(GetLocationRequest $request, array $callOptions = []): Location + { + return $this->startApiCall('GetLocation', $request, $callOptions)->wait(); + } + + /** + * Lists information about the supported locations for this service. + * + * The async variant is {@see GeneratorsClient::listLocationsAsync()} . + * + * @example samples/V2/GeneratorsClient/list_locations.php + * + * @param ListLocationsRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return PagedListResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function listLocations(ListLocationsRequest $request, array $callOptions = []): PagedListResponse + { + return $this->startApiCall('ListLocations', $request, $callOptions); + } +} diff --git a/owl-bot-staging/Dialogflow/v2/src/V2/Client/IntentsClient.php b/owl-bot-staging/Dialogflow/v2/src/V2/Client/IntentsClient.php new file mode 100644 index 000000000000..7e58694cb49f --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/src/V2/Client/IntentsClient.php @@ -0,0 +1,839 @@ + 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 IntentsClient::batchDeleteIntentsAsync()} . + * + * @example samples/V2/IntentsClient/batch_delete_intents.php + * + * @param BatchDeleteIntentsRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function batchDeleteIntents(BatchDeleteIntentsRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('BatchDeleteIntents', $request, $callOptions)->wait(); + } + + /** + * Updates/Creates multiple intents in the specified agent. + * + * This method is a [long-running + * operation](https://cloud.google.com/dialogflow/es/docs/how/long-running-operations). + * The returned `Operation` type has the following method-specific fields: + * + * - `metadata`: An empty [Struct + * message](https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#struct) + * - `response`: + * [BatchUpdateIntentsResponse][google.cloud.dialogflow.v2.BatchUpdateIntentsResponse] + * + * Note: You should always train an agent prior to sending it queries. See the + * [training + * documentation](https://cloud.google.com/dialogflow/es/docs/training). + * + * The async variant is {@see IntentsClient::batchUpdateIntentsAsync()} . + * + * @example samples/V2/IntentsClient/batch_update_intents.php + * + * @param BatchUpdateIntentsRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function batchUpdateIntents(BatchUpdateIntentsRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('BatchUpdateIntents', $request, $callOptions)->wait(); + } + + /** + * Creates an intent in the specified agent. + * + * Note: You should always train an agent prior to sending it queries. See the + * [training + * documentation](https://cloud.google.com/dialogflow/es/docs/training). + * + * The async variant is {@see IntentsClient::createIntentAsync()} . + * + * @example samples/V2/IntentsClient/create_intent.php + * + * @param CreateIntentRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return Intent + * + * @throws ApiException Thrown if the API call fails. + */ + public function createIntent(CreateIntentRequest $request, array $callOptions = []): Intent + { + return $this->startApiCall('CreateIntent', $request, $callOptions)->wait(); + } + + /** + * Deletes the specified intent and its direct or indirect followup intents. + * + * Note: You should always train an agent prior to sending it queries. See the + * [training + * documentation](https://cloud.google.com/dialogflow/es/docs/training). + * + * The async variant is {@see IntentsClient::deleteIntentAsync()} . + * + * @example samples/V2/IntentsClient/delete_intent.php + * + * @param DeleteIntentRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @throws ApiException Thrown if the API call fails. + */ + public function deleteIntent(DeleteIntentRequest $request, array $callOptions = []): void + { + $this->startApiCall('DeleteIntent', $request, $callOptions)->wait(); + } + + /** + * Retrieves the specified intent. + * + * The async variant is {@see IntentsClient::getIntentAsync()} . + * + * @example samples/V2/IntentsClient/get_intent.php + * + * @param GetIntentRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return Intent + * + * @throws ApiException Thrown if the API call fails. + */ + public function getIntent(GetIntentRequest $request, array $callOptions = []): Intent + { + return $this->startApiCall('GetIntent', $request, $callOptions)->wait(); + } + + /** + * Returns the list of all intents in the specified agent. + * + * The async variant is {@see IntentsClient::listIntentsAsync()} . + * + * @example samples/V2/IntentsClient/list_intents.php + * + * @param ListIntentsRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return PagedListResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function listIntents(ListIntentsRequest $request, array $callOptions = []): PagedListResponse + { + return $this->startApiCall('ListIntents', $request, $callOptions); + } + + /** + * Updates the specified intent. + * + * Note: You should always train an agent prior to sending it queries. See the + * [training + * documentation](https://cloud.google.com/dialogflow/es/docs/training). + * + * The async variant is {@see IntentsClient::updateIntentAsync()} . + * + * @example samples/V2/IntentsClient/update_intent.php + * + * @param UpdateIntentRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return Intent + * + * @throws ApiException Thrown if the API call fails. + */ + public function updateIntent(UpdateIntentRequest $request, array $callOptions = []): Intent + { + return $this->startApiCall('UpdateIntent', $request, $callOptions)->wait(); + } + + /** + * Gets information about a location. + * + * The async variant is {@see IntentsClient::getLocationAsync()} . + * + * @example samples/V2/IntentsClient/get_location.php + * + * @param GetLocationRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return Location + * + * @throws ApiException Thrown if the API call fails. + */ + public function getLocation(GetLocationRequest $request, array $callOptions = []): Location + { + return $this->startApiCall('GetLocation', $request, $callOptions)->wait(); + } + + /** + * Lists information about the supported locations for this service. + * + * The async variant is {@see IntentsClient::listLocationsAsync()} . + * + * @example samples/V2/IntentsClient/list_locations.php + * + * @param ListLocationsRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return PagedListResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function listLocations(ListLocationsRequest $request, array $callOptions = []): PagedListResponse + { + return $this->startApiCall('ListLocations', $request, $callOptions); + } +} diff --git a/owl-bot-staging/Dialogflow/v2/src/V2/Client/KnowledgeBasesClient.php b/owl-bot-staging/Dialogflow/v2/src/V2/Client/KnowledgeBasesClient.php new file mode 100644 index 000000000000..33757f9b233b --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/src/V2/Client/KnowledgeBasesClient.php @@ -0,0 +1,479 @@ + 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 KnowledgeBasesClient::createKnowledgeBaseAsync()} . + * + * @example samples/V2/KnowledgeBasesClient/create_knowledge_base.php + * + * @param CreateKnowledgeBaseRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return KnowledgeBase + * + * @throws ApiException Thrown if the API call fails. + */ + public function createKnowledgeBase(CreateKnowledgeBaseRequest $request, array $callOptions = []): KnowledgeBase + { + return $this->startApiCall('CreateKnowledgeBase', $request, $callOptions)->wait(); + } + + /** + * Deletes the specified knowledge base. + * + * The async variant is {@see KnowledgeBasesClient::deleteKnowledgeBaseAsync()} . + * + * @example samples/V2/KnowledgeBasesClient/delete_knowledge_base.php + * + * @param DeleteKnowledgeBaseRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @throws ApiException Thrown if the API call fails. + */ + public function deleteKnowledgeBase(DeleteKnowledgeBaseRequest $request, array $callOptions = []): void + { + $this->startApiCall('DeleteKnowledgeBase', $request, $callOptions)->wait(); + } + + /** + * Retrieves the specified knowledge base. + * + * The async variant is {@see KnowledgeBasesClient::getKnowledgeBaseAsync()} . + * + * @example samples/V2/KnowledgeBasesClient/get_knowledge_base.php + * + * @param GetKnowledgeBaseRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return KnowledgeBase + * + * @throws ApiException Thrown if the API call fails. + */ + public function getKnowledgeBase(GetKnowledgeBaseRequest $request, array $callOptions = []): KnowledgeBase + { + return $this->startApiCall('GetKnowledgeBase', $request, $callOptions)->wait(); + } + + /** + * Returns the list of all knowledge bases of the specified agent. + * + * The async variant is {@see KnowledgeBasesClient::listKnowledgeBasesAsync()} . + * + * @example samples/V2/KnowledgeBasesClient/list_knowledge_bases.php + * + * @param ListKnowledgeBasesRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return PagedListResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function listKnowledgeBases(ListKnowledgeBasesRequest $request, array $callOptions = []): PagedListResponse + { + return $this->startApiCall('ListKnowledgeBases', $request, $callOptions); + } + + /** + * Updates the specified knowledge base. + * + * The async variant is {@see KnowledgeBasesClient::updateKnowledgeBaseAsync()} . + * + * @example samples/V2/KnowledgeBasesClient/update_knowledge_base.php + * + * @param UpdateKnowledgeBaseRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return KnowledgeBase + * + * @throws ApiException Thrown if the API call fails. + */ + public function updateKnowledgeBase(UpdateKnowledgeBaseRequest $request, array $callOptions = []): KnowledgeBase + { + return $this->startApiCall('UpdateKnowledgeBase', $request, $callOptions)->wait(); + } + + /** + * Gets information about a location. + * + * The async variant is {@see KnowledgeBasesClient::getLocationAsync()} . + * + * @example samples/V2/KnowledgeBasesClient/get_location.php + * + * @param GetLocationRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return Location + * + * @throws ApiException Thrown if the API call fails. + */ + public function getLocation(GetLocationRequest $request, array $callOptions = []): Location + { + return $this->startApiCall('GetLocation', $request, $callOptions)->wait(); + } + + /** + * Lists information about the supported locations for this service. + * + * The async variant is {@see KnowledgeBasesClient::listLocationsAsync()} . + * + * @example samples/V2/KnowledgeBasesClient/list_locations.php + * + * @param ListLocationsRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return PagedListResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function listLocations(ListLocationsRequest $request, array $callOptions = []): PagedListResponse + { + return $this->startApiCall('ListLocations', $request, $callOptions); + } +} diff --git a/owl-bot-staging/Dialogflow/v2/src/V2/Client/ParticipantsClient.php b/owl-bot-staging/Dialogflow/v2/src/V2/Client/ParticipantsClient.php new file mode 100644 index 000000000000..f0ee8afbdf01 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/src/V2/Client/ParticipantsClient.php @@ -0,0 +1,1057 @@ + 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 ParticipantsClient::analyzeContentAsync()} . + * + * @example samples/V2/ParticipantsClient/analyze_content.php + * + * @param AnalyzeContentRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return AnalyzeContentResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function analyzeContent(AnalyzeContentRequest $request, array $callOptions = []): AnalyzeContentResponse + { + return $this->startApiCall('AnalyzeContent', $request, $callOptions)->wait(); + } + + /** + * Creates a new participant in a conversation. + * + * The async variant is {@see ParticipantsClient::createParticipantAsync()} . + * + * @example samples/V2/ParticipantsClient/create_participant.php + * + * @param CreateParticipantRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return Participant + * + * @throws ApiException Thrown if the API call fails. + */ + public function createParticipant(CreateParticipantRequest $request, array $callOptions = []): Participant + { + return $this->startApiCall('CreateParticipant', $request, $callOptions)->wait(); + } + + /** + * Retrieves a conversation participant. + * + * The async variant is {@see ParticipantsClient::getParticipantAsync()} . + * + * @example samples/V2/ParticipantsClient/get_participant.php + * + * @param GetParticipantRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return Participant + * + * @throws ApiException Thrown if the API call fails. + */ + public function getParticipant(GetParticipantRequest $request, array $callOptions = []): Participant + { + return $this->startApiCall('GetParticipant', $request, $callOptions)->wait(); + } + + /** + * Returns the list of all participants in the specified conversation. + * + * The async variant is {@see ParticipantsClient::listParticipantsAsync()} . + * + * @example samples/V2/ParticipantsClient/list_participants.php + * + * @param ListParticipantsRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return PagedListResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function listParticipants(ListParticipantsRequest $request, array $callOptions = []): PagedListResponse + { + return $this->startApiCall('ListParticipants', $request, $callOptions); + } + + /** + * Adds a text (chat, for example), or audio (phone recording, for example) + * message from a participant into the conversation. + * Note: This method is only available through the gRPC API (not REST). + * + * The top-level message sent to the client by the server is + * `StreamingAnalyzeContentResponse`. Multiple response messages can be + * returned in order. The first one or more messages contain the + * `recognition_result` field. Each result represents a more complete + * transcript of what the user said. The next message contains the + * `reply_text` field and potentially the `reply_audio` field. The message can + * also contain the `automated_agent_reply` field. + * + * Note: Always use agent versions for production traffic + * sent to virtual agents. See [Versions and + * environments](https://cloud.google.com/dialogflow/es/docs/agents-versions). + * + * @example samples/V2/ParticipantsClient/streaming_analyze_content.php + * + * @param array $callOptions { + * Optional. + * + * @type int $timeoutMillis + * Timeout to use for this call. + * } + * + * @return BidiStream + * + * @throws ApiException Thrown if the API call fails. + */ + public function streamingAnalyzeContent(array $callOptions = []): BidiStream + { + return $this->startApiCall('StreamingAnalyzeContent', null, $callOptions); + } + + /** + * Gets suggested articles for a participant based on specific historical + * messages. + * + * The async variant is {@see ParticipantsClient::suggestArticlesAsync()} . + * + * @example samples/V2/ParticipantsClient/suggest_articles.php + * + * @param SuggestArticlesRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return SuggestArticlesResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function suggestArticles(SuggestArticlesRequest $request, array $callOptions = []): SuggestArticlesResponse + { + return $this->startApiCall('SuggestArticles', $request, $callOptions)->wait(); + } + + /** + * Gets suggested faq answers for a participant based on specific historical + * messages. + * + * The async variant is {@see ParticipantsClient::suggestFaqAnswersAsync()} . + * + * @example samples/V2/ParticipantsClient/suggest_faq_answers.php + * + * @param SuggestFaqAnswersRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return SuggestFaqAnswersResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function suggestFaqAnswers(SuggestFaqAnswersRequest $request, array $callOptions = []): SuggestFaqAnswersResponse + { + return $this->startApiCall('SuggestFaqAnswers', $request, $callOptions)->wait(); + } + + /** + * Gets knowledge assist suggestions based on historical messages. + * + * The async variant is {@see ParticipantsClient::suggestKnowledgeAssistAsync()} . + * + * @example samples/V2/ParticipantsClient/suggest_knowledge_assist.php + * + * @param SuggestKnowledgeAssistRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return SuggestKnowledgeAssistResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function suggestKnowledgeAssist(SuggestKnowledgeAssistRequest $request, array $callOptions = []): SuggestKnowledgeAssistResponse + { + return $this->startApiCall('SuggestKnowledgeAssist', $request, $callOptions)->wait(); + } + + /** + * Gets smart replies for a participant based on specific historical + * messages. + * + * The async variant is {@see ParticipantsClient::suggestSmartRepliesAsync()} . + * + * @example samples/V2/ParticipantsClient/suggest_smart_replies.php + * + * @param SuggestSmartRepliesRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return SuggestSmartRepliesResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function suggestSmartReplies(SuggestSmartRepliesRequest $request, array $callOptions = []): SuggestSmartRepliesResponse + { + return $this->startApiCall('SuggestSmartReplies', $request, $callOptions)->wait(); + } + + /** + * Updates the specified participant. + * + * The async variant is {@see ParticipantsClient::updateParticipantAsync()} . + * + * @example samples/V2/ParticipantsClient/update_participant.php + * + * @param UpdateParticipantRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return Participant + * + * @throws ApiException Thrown if the API call fails. + */ + public function updateParticipant(UpdateParticipantRequest $request, array $callOptions = []): Participant + { + return $this->startApiCall('UpdateParticipant', $request, $callOptions)->wait(); + } + + /** + * Gets information about a location. + * + * The async variant is {@see ParticipantsClient::getLocationAsync()} . + * + * @example samples/V2/ParticipantsClient/get_location.php + * + * @param GetLocationRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return Location + * + * @throws ApiException Thrown if the API call fails. + */ + public function getLocation(GetLocationRequest $request, array $callOptions = []): Location + { + return $this->startApiCall('GetLocation', $request, $callOptions)->wait(); + } + + /** + * Lists information about the supported locations for this service. + * + * The async variant is {@see ParticipantsClient::listLocationsAsync()} . + * + * @example samples/V2/ParticipantsClient/list_locations.php + * + * @param ListLocationsRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return PagedListResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function listLocations(ListLocationsRequest $request, array $callOptions = []): PagedListResponse + { + return $this->startApiCall('ListLocations', $request, $callOptions); + } +} diff --git a/owl-bot-staging/Dialogflow/v2/src/V2/Client/SessionEntityTypesClient.php b/owl-bot-staging/Dialogflow/v2/src/V2/Client/SessionEntityTypesClient.php new file mode 100644 index 000000000000..d5cefd23e243 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/src/V2/Client/SessionEntityTypesClient.php @@ -0,0 +1,631 @@ + 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 SessionEntityTypesClient::createSessionEntityTypeAsync()} . + * + * @example samples/V2/SessionEntityTypesClient/create_session_entity_type.php + * + * @param CreateSessionEntityTypeRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return SessionEntityType + * + * @throws ApiException Thrown if the API call fails. + */ + public function createSessionEntityType(CreateSessionEntityTypeRequest $request, array $callOptions = []): SessionEntityType + { + return $this->startApiCall('CreateSessionEntityType', $request, $callOptions)->wait(); + } + + /** + * Deletes the specified session entity type. + * + * This method doesn't work with Google Assistant integration. + * Contact Dialogflow support if you need to use session entities + * with Google Assistant integration. + * + * The async variant is + * {@see SessionEntityTypesClient::deleteSessionEntityTypeAsync()} . + * + * @example samples/V2/SessionEntityTypesClient/delete_session_entity_type.php + * + * @param DeleteSessionEntityTypeRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @throws ApiException Thrown if the API call fails. + */ + public function deleteSessionEntityType(DeleteSessionEntityTypeRequest $request, array $callOptions = []): void + { + $this->startApiCall('DeleteSessionEntityType', $request, $callOptions)->wait(); + } + + /** + * Retrieves the specified session entity type. + * + * This method doesn't work with Google Assistant integration. + * Contact Dialogflow support if you need to use session entities + * with Google Assistant integration. + * + * The async variant is + * {@see SessionEntityTypesClient::getSessionEntityTypeAsync()} . + * + * @example samples/V2/SessionEntityTypesClient/get_session_entity_type.php + * + * @param GetSessionEntityTypeRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return SessionEntityType + * + * @throws ApiException Thrown if the API call fails. + */ + public function getSessionEntityType(GetSessionEntityTypeRequest $request, array $callOptions = []): SessionEntityType + { + return $this->startApiCall('GetSessionEntityType', $request, $callOptions)->wait(); + } + + /** + * Returns the list of all session entity types in the specified session. + * + * This method doesn't work with Google Assistant integration. + * Contact Dialogflow support if you need to use session entities + * with Google Assistant integration. + * + * The async variant is + * {@see SessionEntityTypesClient::listSessionEntityTypesAsync()} . + * + * @example samples/V2/SessionEntityTypesClient/list_session_entity_types.php + * + * @param ListSessionEntityTypesRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return PagedListResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function listSessionEntityTypes(ListSessionEntityTypesRequest $request, array $callOptions = []): PagedListResponse + { + return $this->startApiCall('ListSessionEntityTypes', $request, $callOptions); + } + + /** + * Updates the specified session entity type. + * + * This method doesn't work with Google Assistant integration. + * Contact Dialogflow support if you need to use session entities + * with Google Assistant integration. + * + * The async variant is + * {@see SessionEntityTypesClient::updateSessionEntityTypeAsync()} . + * + * @example samples/V2/SessionEntityTypesClient/update_session_entity_type.php + * + * @param UpdateSessionEntityTypeRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return SessionEntityType + * + * @throws ApiException Thrown if the API call fails. + */ + public function updateSessionEntityType(UpdateSessionEntityTypeRequest $request, array $callOptions = []): SessionEntityType + { + return $this->startApiCall('UpdateSessionEntityType', $request, $callOptions)->wait(); + } + + /** + * Gets information about a location. + * + * The async variant is {@see SessionEntityTypesClient::getLocationAsync()} . + * + * @example samples/V2/SessionEntityTypesClient/get_location.php + * + * @param GetLocationRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return Location + * + * @throws ApiException Thrown if the API call fails. + */ + public function getLocation(GetLocationRequest $request, array $callOptions = []): Location + { + return $this->startApiCall('GetLocation', $request, $callOptions)->wait(); + } + + /** + * Lists information about the supported locations for this service. + * + * The async variant is {@see SessionEntityTypesClient::listLocationsAsync()} . + * + * @example samples/V2/SessionEntityTypesClient/list_locations.php + * + * @param ListLocationsRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return PagedListResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function listLocations(ListLocationsRequest $request, array $callOptions = []): PagedListResponse + { + return $this->startApiCall('ListLocations', $request, $callOptions); + } +} diff --git a/owl-bot-staging/Dialogflow/v2/src/V2/Client/SessionsClient.php b/owl-bot-staging/Dialogflow/v2/src/V2/Client/SessionsClient.php new file mode 100644 index 000000000000..5dd0ff20ee69 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/src/V2/Client/SessionsClient.php @@ -0,0 +1,656 @@ + 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 SessionsClient::detectIntentAsync()} . + * + * @example samples/V2/SessionsClient/detect_intent.php + * + * @param DetectIntentRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return DetectIntentResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function detectIntent(DetectIntentRequest $request, array $callOptions = []): DetectIntentResponse + { + return $this->startApiCall('DetectIntent', $request, $callOptions)->wait(); + } + + /** + * Processes a natural language query in audio format in a streaming fashion + * and returns structured, actionable data as a result. This method is only + * available via the gRPC API (not REST). + * + * If you might use + * [Agent Assist](https://cloud.google.com/dialogflow/docs/#aa) + * or other CCAI products now or in the future, consider using + * [StreamingAnalyzeContent][google.cloud.dialogflow.v2.Participants.StreamingAnalyzeContent] + * instead of `StreamingDetectIntent`. `StreamingAnalyzeContent` has + * additional functionality for Agent Assist and other CCAI products. + * + * Note: Always use agent versions for production traffic. + * See [Versions and + * environments](https://cloud.google.com/dialogflow/es/docs/agents-versions). + * + * @example samples/V2/SessionsClient/streaming_detect_intent.php + * + * @param array $callOptions { + * Optional. + * + * @type int $timeoutMillis + * Timeout to use for this call. + * } + * + * @return BidiStream + * + * @throws ApiException Thrown if the API call fails. + */ + public function streamingDetectIntent(array $callOptions = []): BidiStream + { + return $this->startApiCall('StreamingDetectIntent', null, $callOptions); + } + + /** + * Gets information about a location. + * + * The async variant is {@see SessionsClient::getLocationAsync()} . + * + * @example samples/V2/SessionsClient/get_location.php + * + * @param GetLocationRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return Location + * + * @throws ApiException Thrown if the API call fails. + */ + public function getLocation(GetLocationRequest $request, array $callOptions = []): Location + { + return $this->startApiCall('GetLocation', $request, $callOptions)->wait(); + } + + /** + * Lists information about the supported locations for this service. + * + * The async variant is {@see SessionsClient::listLocationsAsync()} . + * + * @example samples/V2/SessionsClient/list_locations.php + * + * @param ListLocationsRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return PagedListResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function listLocations(ListLocationsRequest $request, array $callOptions = []): PagedListResponse + { + return $this->startApiCall('ListLocations', $request, $callOptions); + } +} diff --git a/owl-bot-staging/Dialogflow/v2/src/V2/Client/VersionsClient.php b/owl-bot-staging/Dialogflow/v2/src/V2/Client/VersionsClient.php new file mode 100644 index 000000000000..4e190441373c --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/src/V2/Client/VersionsClient.php @@ -0,0 +1,500 @@ + 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 VersionsClient::createVersionAsync()} . + * + * @example samples/V2/VersionsClient/create_version.php + * + * @param CreateVersionRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return Version + * + * @throws ApiException Thrown if the API call fails. + */ + public function createVersion(CreateVersionRequest $request, array $callOptions = []): Version + { + return $this->startApiCall('CreateVersion', $request, $callOptions)->wait(); + } + + /** + * Delete the specified agent version. + * + * The async variant is {@see VersionsClient::deleteVersionAsync()} . + * + * @example samples/V2/VersionsClient/delete_version.php + * + * @param DeleteVersionRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @throws ApiException Thrown if the API call fails. + */ + public function deleteVersion(DeleteVersionRequest $request, array $callOptions = []): void + { + $this->startApiCall('DeleteVersion', $request, $callOptions)->wait(); + } + + /** + * Retrieves the specified agent version. + * + * The async variant is {@see VersionsClient::getVersionAsync()} . + * + * @example samples/V2/VersionsClient/get_version.php + * + * @param GetVersionRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return Version + * + * @throws ApiException Thrown if the API call fails. + */ + public function getVersion(GetVersionRequest $request, array $callOptions = []): Version + { + return $this->startApiCall('GetVersion', $request, $callOptions)->wait(); + } + + /** + * Returns the list of all versions of the specified agent. + * + * The async variant is {@see VersionsClient::listVersionsAsync()} . + * + * @example samples/V2/VersionsClient/list_versions.php + * + * @param ListVersionsRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return PagedListResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function listVersions(ListVersionsRequest $request, array $callOptions = []): PagedListResponse + { + return $this->startApiCall('ListVersions', $request, $callOptions); + } + + /** + * Updates the specified agent version. + * + * Note that this method does not allow you to update the state of the agent + * the given version points to. It allows you to update only mutable + * properties of the version resource. + * + * The async variant is {@see VersionsClient::updateVersionAsync()} . + * + * @example samples/V2/VersionsClient/update_version.php + * + * @param UpdateVersionRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return Version + * + * @throws ApiException Thrown if the API call fails. + */ + public function updateVersion(UpdateVersionRequest $request, array $callOptions = []): Version + { + return $this->startApiCall('UpdateVersion', $request, $callOptions)->wait(); + } + + /** + * Gets information about a location. + * + * The async variant is {@see VersionsClient::getLocationAsync()} . + * + * @example samples/V2/VersionsClient/get_location.php + * + * @param GetLocationRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return Location + * + * @throws ApiException Thrown if the API call fails. + */ + public function getLocation(GetLocationRequest $request, array $callOptions = []): Location + { + return $this->startApiCall('GetLocation', $request, $callOptions)->wait(); + } + + /** + * Lists information about the supported locations for this service. + * + * The async variant is {@see VersionsClient::listLocationsAsync()} . + * + * @example samples/V2/VersionsClient/list_locations.php + * + * @param ListLocationsRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return PagedListResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function listLocations(ListLocationsRequest $request, array $callOptions = []): PagedListResponse + { + return $this->startApiCall('ListLocations', $request, $callOptions); + } +} diff --git a/owl-bot-staging/Dialogflow/v2/src/V2/ContextsClient.php b/owl-bot-staging/Dialogflow/v2/src/V2/ContextsClient.php new file mode 100644 index 000000000000..3ba108241d02 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/src/V2/ContextsClient.php @@ -0,0 +1,34 @@ +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. + * + * @deprecated Please use the new service client {@see \Google\Cloud\Dialogflow\V2\Client\AgentsClient}. + */ +class AgentsGapicClient +{ + use GapicClientTrait; + + /** The name of the service. */ + const SERVICE_NAME = 'google.cloud.dialogflow.v2.Agents'; + + /** + * The default address of the service. + * + * @deprecated SERVICE_ADDRESS_TEMPLATE should be used instead. + */ + const SERVICE_ADDRESS = 'dialogflow.googleapis.com'; + + /** The address template of the service. */ + private const SERVICE_ADDRESS_TEMPLATE = 'dialogflow.UNIVERSE_DOMAIN'; + + /** The default port of the service. */ + 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..329eacc35532 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/src/V2/Gapic/AnswerRecordsGapicClient.php @@ -0,0 +1,1147 @@ +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. + * + * @deprecated Please use the new service client {@see \Google\Cloud\Dialogflow\V2\Client\AnswerRecordsClient}. + */ +class AnswerRecordsGapicClient +{ + use GapicClientTrait; + + /** The name of the service. */ + const SERVICE_NAME = 'google.cloud.dialogflow.v2.AnswerRecords'; + + /** + * The default address of the service. + * + * @deprecated SERVICE_ADDRESS_TEMPLATE should be used instead. + */ + const SERVICE_ADDRESS = 'dialogflow.googleapis.com'; + + /** The address template of the service. */ + private const SERVICE_ADDRESS_TEMPLATE = 'dialogflow.UNIVERSE_DOMAIN'; + + /** The default port of the service. */ + 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 $answerRecordNameTemplate; + + private static $contextNameTemplate; + + private static $intentNameTemplate; + + private static $locationNameTemplate; + + private static $projectNameTemplate; + + private static $projectAgentNameTemplate; + + private static $projectAnswerRecordNameTemplate; + + private static $projectEnvironmentUserSessionNameTemplate; + + private static $projectEnvironmentUserSessionContextNameTemplate; + + private static $projectIntentNameTemplate; + + private static $projectLocationAgentNameTemplate; + + private static $projectLocationAnswerRecordNameTemplate; + + 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 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 getAgentNameTemplate() + { + if (self::$agentNameTemplate == null) { + self::$agentNameTemplate = new PathTemplate('projects/{project}/agent'); + } + + return self::$agentNameTemplate; + } + + private static function getAnswerRecordNameTemplate() + { + if (self::$answerRecordNameTemplate == null) { + self::$answerRecordNameTemplate = new PathTemplate('projects/{project}/answerRecords/{answer_record}'); + } + + return self::$answerRecordNameTemplate; + } + + 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 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 getProjectAnswerRecordNameTemplate() + { + if (self::$projectAnswerRecordNameTemplate == null) { + self::$projectAnswerRecordNameTemplate = new PathTemplate('projects/{project}/answerRecords/{answer_record}'); + } + + return self::$projectAnswerRecordNameTemplate; + } + + 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 getProjectLocationAnswerRecordNameTemplate() + { + if (self::$projectLocationAnswerRecordNameTemplate == null) { + self::$projectLocationAnswerRecordNameTemplate = new PathTemplate('projects/{project}/locations/{location}/answerRecords/{answer_record}'); + } + + return self::$projectLocationAnswerRecordNameTemplate; + } + + 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(), + 'answerRecord' => self::getAnswerRecordNameTemplate(), + 'context' => self::getContextNameTemplate(), + 'intent' => self::getIntentNameTemplate(), + 'location' => self::getLocationNameTemplate(), + 'project' => self::getProjectNameTemplate(), + 'projectAgent' => self::getProjectAgentNameTemplate(), + 'projectAnswerRecord' => self::getProjectAnswerRecordNameTemplate(), + 'projectEnvironmentUserSession' => self::getProjectEnvironmentUserSessionNameTemplate(), + 'projectEnvironmentUserSessionContext' => self::getProjectEnvironmentUserSessionContextNameTemplate(), + 'projectIntent' => self::getProjectIntentNameTemplate(), + 'projectLocationAgent' => self::getProjectLocationAgentNameTemplate(), + 'projectLocationAnswerRecord' => self::getProjectLocationAnswerRecordNameTemplate(), + '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 + * 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 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 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_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_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_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, + ]); + } + + /** + * 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 + * - answerRecord: projects/{project}/answerRecords/{answer_record} + * - context: projects/{project}/agent/sessions/{session}/contexts/{context} + * - intent: projects/{project}/agent/intents/{intent} + * - location: projects/{project}/locations/{location} + * - project: projects/{project} + * - projectAgent: projects/{project}/agent + * - projectAnswerRecord: projects/{project}/answerRecords/{answer_record} + * - projectEnvironmentUserSession: projects/{project}/agent/environments/{environment}/users/{user}/sessions/{session} + * - projectEnvironmentUserSessionContext: projects/{project}/agent/environments/{environment}/users/{user}/sessions/{session}/contexts/{context} + * - projectIntent: projects/{project}/agent/intents/{intent} + * - projectLocationAgent: projects/{project}/locations/{location}/agent + * - projectLocationAnswerRecord: projects/{project}/locations/{location}/answerRecords/{answer_record} + * - projectLocationEnvironmentUserSession: projects/{project}/locations/{location}/agent/environments/{environment}/users/{user}/sessions/{session} + * - projectLocationEnvironmentUserSessionContext: projects/{project}/locations/{location}/agent/environments/{environment}/users/{user}/sessions/{session}/contexts/{context} + * - projectLocationIntent: projects/{project}/locations/{location}/agent/intents/{intent} + * - projectLocationSession: projects/{project}/locations/{location}/agent/sessions/{session} + * - projectLocationSessionContext: projects/{project}/locations/{location}/agent/sessions/{session}/contexts/{context} + * - projectSession: projects/{project}/agent/sessions/{session} + * - projectSessionContext: projects/{project}/agent/sessions/{session}/contexts/{context} + * - session: projects/{project}/agent/sessions/{session} + * + * 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..c2e879fee6d7 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/src/V2/Gapic/ContextsGapicClient.php @@ -0,0 +1,983 @@ +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. + * + * @deprecated Please use the new service client {@see \Google\Cloud\Dialogflow\V2\Client\ContextsClient}. + */ +class ContextsGapicClient +{ + use GapicClientTrait; + + /** The name of the service. */ + const SERVICE_NAME = 'google.cloud.dialogflow.v2.Contexts'; + + /** + * The default address of the service. + * + * @deprecated SERVICE_ADDRESS_TEMPLATE should be used instead. + */ + const SERVICE_ADDRESS = 'dialogflow.googleapis.com'; + + /** The address template of the service. */ + private const SERVICE_ADDRESS_TEMPLATE = 'dialogflow.UNIVERSE_DOMAIN'; + + /** The default port of the service. */ + 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..08b5398c9e65 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/src/V2/Gapic/ConversationDatasetsGapicClient.php @@ -0,0 +1,822 @@ +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. + * + * @deprecated Please use the new service client {@see \Google\Cloud\Dialogflow\V2\Client\ConversationDatasetsClient}. + */ +class ConversationDatasetsGapicClient +{ + use GapicClientTrait; + + /** The name of the service. */ + const SERVICE_NAME = 'google.cloud.dialogflow.v2.ConversationDatasets'; + + /** + * The default address of the service. + * + * @deprecated SERVICE_ADDRESS_TEMPLATE should be used instead. + */ + const SERVICE_ADDRESS = 'dialogflow.googleapis.com'; + + /** The address template of the service. */ + private const SERVICE_ADDRESS_TEMPLATE = 'dialogflow.UNIVERSE_DOMAIN'; + + /** The default port of the service. */ + 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..3b58307a1bc1 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/src/V2/Gapic/ConversationModelsGapicClient.php @@ -0,0 +1,1332 @@ +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. + * + * @deprecated Please use the new service client {@see \Google\Cloud\Dialogflow\V2\Client\ConversationModelsClient}. + */ +class ConversationModelsGapicClient +{ + use GapicClientTrait; + + /** The name of the service. */ + const SERVICE_NAME = 'google.cloud.dialogflow.v2.ConversationModels'; + + /** + * The default address of the service. + * + * @deprecated SERVICE_ADDRESS_TEMPLATE should be used instead. + */ + const SERVICE_ADDRESS = 'dialogflow.googleapis.com'; + + /** The address template of the service. */ + private const SERVICE_ADDRESS_TEMPLATE = 'dialogflow.UNIVERSE_DOMAIN'; + + /** The default port of the service. */ + 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..36264e361e3a --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/src/V2/Gapic/ConversationProfilesGapicClient.php @@ -0,0 +1,1426 @@ +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. + * + * @deprecated Please use the new service client {@see \Google\Cloud\Dialogflow\V2\Client\ConversationProfilesClient}. + */ +class ConversationProfilesGapicClient +{ + use GapicClientTrait; + + /** The name of the service. */ + const SERVICE_NAME = 'google.cloud.dialogflow.v2.ConversationProfiles'; + + /** + * The default address of the service. + * + * @deprecated SERVICE_ADDRESS_TEMPLATE should be used instead. + */ + const SERVICE_ADDRESS = 'dialogflow.googleapis.com'; + + /** The address template of the service. */ + private const SERVICE_ADDRESS_TEMPLATE = 'dialogflow.UNIVERSE_DOMAIN'; + + /** The default port of the service. */ + 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 $generatorNameTemplate; + + 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 getGeneratorNameTemplate() + { + if (self::$generatorNameTemplate == null) { + self::$generatorNameTemplate = new PathTemplate('projects/{project}/locations/{location}/generators/{generator}'); + } + + return self::$generatorNameTemplate; + } + + 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(), + 'generator' => self::getGeneratorNameTemplate(), + '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 generator + * resource. + * + * @param string $project + * @param string $location + * @param string $generator + * + * @return string The formatted generator resource. + */ + public static function generatorName($project, $location, $generator) + { + return self::getGeneratorNameTemplate()->render([ + 'project' => $project, + 'location' => $location, + 'generator' => $generator, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a + * knowledge_base resource. + * + * @param string $project + * @param string $knowledgeBase + * + * @return string The formatted knowledge_base resource. + */ + public static function knowledgeBaseName($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} + * - generator: projects/{project}/locations/{location}/generators/{generator} + * - 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..2f57d9cb22db --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/src/V2/Gapic/ConversationsGapicClient.php @@ -0,0 +1,1753 @@ +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. + * + * @deprecated Please use the new service client {@see \Google\Cloud\Dialogflow\V2\Client\ConversationsClient}. + */ +class ConversationsGapicClient +{ + use GapicClientTrait; + + /** The name of the service. */ + const SERVICE_NAME = 'google.cloud.dialogflow.v2.Conversations'; + + /** + * The default address of the service. + * + * @deprecated SERVICE_ADDRESS_TEMPLATE should be used instead. + */ + const SERVICE_ADDRESS = 'dialogflow.googleapis.com'; + + /** The address template of the service. */ + private const SERVICE_ADDRESS_TEMPLATE = 'dialogflow.UNIVERSE_DOMAIN'; + + /** The default port of the service. */ + 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 $generatorNameTemplate; + + 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 getGeneratorNameTemplate() + { + if (self::$generatorNameTemplate == null) { + self::$generatorNameTemplate = new PathTemplate('projects/{project}/locations/{location}/generators/{generator}'); + } + + return self::$generatorNameTemplate; + } + + 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(), + 'generator' => self::getGeneratorNameTemplate(), + '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 generator + * resource. + * + * @param string $project + * @param string $location + * @param string $generator + * + * @return string The formatted generator resource. + */ + public static function generatorName($project, $location, $generator) + { + return self::getGeneratorNameTemplate()->render([ + 'project' => $project, + 'location' => $location, + 'generator' => $generator, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a + * knowledge_base resource. + * + * @param string $project + * @param string $knowledgeBase + * + * @return string The formatted knowledge_base resource. + */ + public static function knowledgeBaseName($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} + * - generator: projects/{project}/locations/{location}/generators/{generator} + * - knowledgeBase: projects/{project}/knowledgeBases/{knowledge_base} + * - location: projects/{project}/locations/{location} + * - message: projects/{project}/conversations/{conversation}/messages/{message} + * - 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 suggestion for a conversation that does not have a + * resource created for it. + * + * Sample code: + * ``` + * $conversationsClient = new ConversationsClient(); + * try { + * $formattedParent = $conversationsClient->locationName('[PROJECT]', '[LOCATION]'); + * $response = $conversationsClient->generateStatelessSuggestion($formattedParent); + * } finally { + * $conversationsClient->close(); + * } + * ``` + * + * @param string $parent Required. The parent resource to charge for the Suggestion's generation. + * Format: `projects//locations/`. + * @param array $optionalArgs { + * Optional. + * + * @type Generator $generator + * Uncreated generator. It should be a complete generator that includes all + * information about the generator. + * @type string $generatorName + * The resource name of the existing created generator. Format: + * `projects//locations//generators/` + * @type ConversationContext $conversationContext + * Optional. Context of the conversation, including transcripts. + * @type int[] $triggerEvents + * Optional. A list of trigger events. Generator will be triggered only if + * it's trigger event is included here. + * For allowed values, use constants defined on {@see \Google\Cloud\Dialogflow\V2\TriggerEvent} + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. 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\GenerateStatelessSuggestionResponse + * + * @throws ApiException if the remote call fails + */ + public function generateStatelessSuggestion($parent, array $optionalArgs = []) + { + $request = new GenerateStatelessSuggestionRequest(); + $requestParamHeaders = []; + $request->setParent($parent); + $requestParamHeaders['parent'] = $parent; + if (isset($optionalArgs['generator'])) { + $request->setGenerator($optionalArgs['generator']); + } + + if (isset($optionalArgs['generatorName'])) { + $request->setGeneratorName($optionalArgs['generatorName']); + } + + if (isset($optionalArgs['conversationContext'])) { + $request->setConversationContext($optionalArgs['conversationContext']); + } + + if (isset($optionalArgs['triggerEvents'])) { + $request->setTriggerEvents($optionalArgs['triggerEvents']); + } + + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startCall('GenerateStatelessSuggestion', GenerateStatelessSuggestionResponse::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 + * Optional. The name of the latest conversation message used as context for + * generating a Summary. If empty, the latest message of the conversation will + * be used. The format is specific to the user and the names of the messages + * provided. + * @type int $maxContextSize + * Optional. Max number of messages prior to and including + * [latest_message] to use as context when compiling the + * suggestion. By default 500 and at most 1000. + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. 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 + * Optional. A filter expression that filters conversations listed in the + * response. Only `lifecycle_state` can be filtered on in this way. For + * example, the following expression only returns `COMPLETED` conversations: + * + * `lifecycle_state = "COMPLETED"` + * + * For more information about filtering, see + * [API Filtering](https://aip.dev/160). + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. 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); + } + + /** + * Get answers for the given query based on knowledge documents. + * + * Sample code: + * ``` + * $conversationsClient = new ConversationsClient(); + * try { + * $query = new TextInput(); + * $formattedConversationProfile = $conversationsClient->conversationProfileName('[PROJECT]', '[CONVERSATION_PROFILE]'); + * $response = $conversationsClient->searchKnowledge($query, $formattedConversationProfile); + * } finally { + * $conversationsClient->close(); + * } + * ``` + * + * @param TextInput $query Required. The natural language text query for knowledge search. + * @param string $conversationProfile Required. The conversation profile used to configure the search. + * Format: `projects//locations//conversationProfiles/`. + * @param array $optionalArgs { + * Optional. + * + * @type string $parent + * Required. The parent resource contains the conversation profile + * Format: 'projects/' or `projects//locations/`. + * @type string $sessionId + * Required. The ID of the search session. + * The session_id can be combined with Dialogflow V3 Agent ID retrieved from + * conversation profile or on its own to identify a search session. The search + * history of the same session will impact the search result. It's up to the + * API caller to choose an appropriate `Session ID`. It can be a random number + * or some type of session identifiers (preferably hashed). The length must + * not exceed 36 characters. + * @type string $conversation + * Optional. The conversation (between human agent and end user) where the + * search request is triggered. Format: `projects//locations//conversations/`. + * @type string $latestMessage + * Optional. The name of the latest conversation message when the request is + * triggered. + * Format: `projects//locations//conversations//messages/`. + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. 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\SearchKnowledgeResponse + * + * @throws ApiException if the remote call fails + */ + public function searchKnowledge($query, $conversationProfile, array $optionalArgs = []) + { + $request = new SearchKnowledgeRequest(); + $requestParamHeaders = []; + $request->setQuery($query); + $request->setConversationProfile($conversationProfile); + if (isset($optionalArgs['parent'])) { + $request->setParent($optionalArgs['parent']); + $requestParamHeaders['parent'] = $optionalArgs['parent']; + } + + if (isset($optionalArgs['sessionId'])) { + $request->setSessionId($optionalArgs['sessionId']); + } + + if (isset($optionalArgs['conversation'])) { + $request->setConversation($optionalArgs['conversation']); + $requestParamHeaders['conversation'] = $optionalArgs['conversation']; + } + + if (isset($optionalArgs['latestMessage'])) { + $request->setLatestMessage($optionalArgs['latestMessage']); + } + + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startCall('SearchKnowledge', SearchKnowledgeResponse::class, $optionalArgs, $request)->wait(); + } + + /** + * Suggests summary for a conversation based on specific historical messages. + * The range of the messages to be used for summary can be specified in the + * request. + * + * 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 + * Optional. The name of the latest conversation message used as context for + * compiling suggestion. If empty, the latest message of the conversation will + * be used. + * + * Format: `projects//locations//conversations//messages/`. + * @type int $contextSize + * Optional. Max number of messages prior to and including + * [latest_message] to use as context when compiling the + * suggestion. By default 500 and at most 1000. + * @type AssistQueryParameters $assistQueryParams + * Optional. 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..cd065940144e --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/src/V2/Gapic/DocumentsGapicClient.php @@ -0,0 +1,1275 @@ +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. + * + * @deprecated Please use the new service client {@see \Google\Cloud\Dialogflow\V2\Client\DocumentsClient}. + */ +class DocumentsGapicClient +{ + use GapicClientTrait; + + /** The name of the service. */ + const SERVICE_NAME = 'google.cloud.dialogflow.v2.Documents'; + + /** + * The default address of the service. + * + * @deprecated SERVICE_ADDRESS_TEMPLATE should be used instead. + */ + const SERVICE_ADDRESS = 'dialogflow.googleapis.com'; + + /** The address template of the service. */ + private const SERVICE_ADDRESS_TEMPLATE = 'dialogflow.UNIVERSE_DOMAIN'; + + /** The default port of the service. */ + 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/EncryptionSpecServiceGapicClient.php b/owl-bot-staging/Dialogflow/v2/src/V2/Gapic/EncryptionSpecServiceGapicClient.php new file mode 100644 index 000000000000..85239fe35f1c --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/src/V2/Gapic/EncryptionSpecServiceGapicClient.php @@ -0,0 +1,521 @@ +encryptionSpecName('[PROJECT]', '[LOCATION]'); + * $response = $encryptionSpecServiceClient->getEncryptionSpec($formattedName); + * } finally { + * $encryptionSpecServiceClient->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. + * + * @deprecated Please use the new service client {@see \Google\Cloud\Dialogflow\V2\Client\EncryptionSpecServiceClient}. + */ +class EncryptionSpecServiceGapicClient +{ + use GapicClientTrait; + + /** The name of the service. */ + const SERVICE_NAME = 'google.cloud.dialogflow.v2.EncryptionSpecService'; + + /** + * The default address of the service. + * + * @deprecated SERVICE_ADDRESS_TEMPLATE should be used instead. + */ + const SERVICE_ADDRESS = 'dialogflow.googleapis.com'; + + /** The address template of the service. */ + private const SERVICE_ADDRESS_TEMPLATE = 'dialogflow.UNIVERSE_DOMAIN'; + + /** The default port of the service. */ + 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 $encryptionSpecNameTemplate; + + 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/encryption_spec_service_client_config.json', + 'descriptorsConfigPath' => __DIR__ . '/../resources/encryption_spec_service_descriptor_config.php', + 'gcpApiConfigPath' => __DIR__ . '/../resources/encryption_spec_service_grpc_config.json', + 'credentialsConfig' => [ + 'defaultScopes' => self::$serviceScopes, + ], + 'transportConfig' => [ + 'rest' => [ + 'restClientConfigPath' => __DIR__ . '/../resources/encryption_spec_service_rest_client_config.php', + ], + ], + ]; + } + + private static function getEncryptionSpecNameTemplate() + { + if (self::$encryptionSpecNameTemplate == null) { + self::$encryptionSpecNameTemplate = new PathTemplate('projects/{project}/locations/{location}/encryptionSpec'); + } + + return self::$encryptionSpecNameTemplate; + } + + private static function getPathTemplateMap() + { + if (self::$pathTemplateMap == null) { + self::$pathTemplateMap = [ + 'encryptionSpec' => self::getEncryptionSpecNameTemplate(), + ]; + } + + return self::$pathTemplateMap; + } + + /** + * Formats a string containing the fully-qualified path to represent a + * encryption_spec resource. + * + * @param string $project + * @param string $location + * + * @return string The formatted encryption_spec resource. + */ + public static function encryptionSpecName($project, $location) + { + return self::getEncryptionSpecNameTemplate()->render([ + 'project' => $project, + 'location' => $location, + ]); + } + + /** + * Parses a formatted name string and returns an associative array of the components in the name. + * The following name formats are supported: + * Template: Pattern + * - encryptionSpec: projects/{project}/locations/{location}/encryptionSpec + * + * The optional $template argument can be supplied to specify a particular pattern, + * and must match one of the templates listed above. If no $template argument is + * provided, or if the $template argument does not match one of the templates + * listed, then parseName will check each of the supported templates, and return + * the first match. + * + * @param string $formattedName The formatted name string + * @param string $template Optional name of template to match + * + * @return array An associative array from name component IDs to component values. + * + * @throws ValidationException If $formattedName could not be matched. + */ + public static function parseName($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); + } + + /** + * Gets location-level encryption key specification. + * + * Sample code: + * ``` + * $encryptionSpecServiceClient = new EncryptionSpecServiceClient(); + * try { + * $formattedName = $encryptionSpecServiceClient->encryptionSpecName('[PROJECT]', '[LOCATION]'); + * $response = $encryptionSpecServiceClient->getEncryptionSpec($formattedName); + * } finally { + * $encryptionSpecServiceClient->close(); + * } + * ``` + * + * @param string $name Required. The name of the encryption spec resource to get. + * @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\EncryptionSpec + * + * @throws ApiException if the remote call fails + */ + public function getEncryptionSpec($name, array $optionalArgs = []) + { + $request = new GetEncryptionSpecRequest(); + $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('GetEncryptionSpec', EncryptionSpec::class, $optionalArgs, $request)->wait(); + } + + /** + * Initializes a location-level encryption key specification. An error will + * be thrown if the location has resources already created before the + * initialization. Once the encryption specification is initialized at a + * location, it is immutable and all newly created resources under the + * location will be encrypted with the existing specification. + * + * Sample code: + * ``` + * $encryptionSpecServiceClient = new EncryptionSpecServiceClient(); + * try { + * $encryptionSpec = new EncryptionSpec(); + * $operationResponse = $encryptionSpecServiceClient->initializeEncryptionSpec($encryptionSpec); + * $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 = $encryptionSpecServiceClient->initializeEncryptionSpec($encryptionSpec); + * $operationName = $operationResponse->getName(); + * // ... do other work + * $newOperationResponse = $encryptionSpecServiceClient->resumeOperation($operationName, 'initializeEncryptionSpec'); + * while (!$newOperationResponse->isDone()) { + * // ... do other work + * $newOperationResponse->reload(); + * } + * if ($newOperationResponse->operationSucceeded()) { + * $result = $newOperationResponse->getResult(); + * // doSomethingWith($result) + * } else { + * $error = $newOperationResponse->getError(); + * // handleError($error) + * } + * } finally { + * $encryptionSpecServiceClient->close(); + * } + * ``` + * + * @param EncryptionSpec $encryptionSpec Required. The encryption spec used for CMEK encryption. It is required that + * the kms key is in the same region as the endpoint. The same key will be + * used for all provisioned resources, if encryption is available. If the + * kms_key_name is left empty, no encryption will be enforced. + * @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 initializeEncryptionSpec($encryptionSpec, array $optionalArgs = []) + { + $request = new InitializeEncryptionSpecRequest(); + $requestParamHeaders = []; + $request->setEncryptionSpec($encryptionSpec); + $requestParamHeaders['encryption_spec.name'] = $encryptionSpec->getName(); + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startOperationsCall('InitializeEncryptionSpec', $optionalArgs, $request, $this->getOperationsClient())->wait(); + } + + /** + * Gets information about a location. + * + * Sample code: + * ``` + * $encryptionSpecServiceClient = new EncryptionSpecServiceClient(); + * try { + * $response = $encryptionSpecServiceClient->getLocation(); + * } finally { + * $encryptionSpecServiceClient->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: + * ``` + * $encryptionSpecServiceClient = new EncryptionSpecServiceClient(); + * try { + * // Iterate over pages of elements + * $pagedResponse = $encryptionSpecServiceClient->listLocations(); + * foreach ($pagedResponse->iteratePages() as $page) { + * foreach ($page as $element) { + * // doSomethingWith($element); + * } + * } + * // Alternatively: + * // Iterate through all elements + * $pagedResponse = $encryptionSpecServiceClient->listLocations(); + * foreach ($pagedResponse->iterateAllElements() as $element) { + * // doSomethingWith($element); + * } + * } finally { + * $encryptionSpecServiceClient->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..900c5996f0b0 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/src/V2/Gapic/EntityTypesGapicClient.php @@ -0,0 +1,1352 @@ +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. + * + * @deprecated Please use the new service client {@see \Google\Cloud\Dialogflow\V2\Client\EntityTypesClient}. + */ +class EntityTypesGapicClient +{ + use GapicClientTrait; + + /** The name of the service. */ + const SERVICE_NAME = 'google.cloud.dialogflow.v2.EntityTypes'; + + /** + * The default address of the service. + * + * @deprecated SERVICE_ADDRESS_TEMPLATE should be used instead. + */ + const SERVICE_ADDRESS = 'dialogflow.googleapis.com'; + + /** The address template of the service. */ + private const SERVICE_ADDRESS_TEMPLATE = 'dialogflow.UNIVERSE_DOMAIN'; + + /** The default port of the service. */ + 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..983f31317e75 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/src/V2/Gapic/EnvironmentsGapicClient.php @@ -0,0 +1,1060 @@ +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. + * + * @deprecated Please use the new service client {@see \Google\Cloud\Dialogflow\V2\Client\EnvironmentsClient}. + */ +class EnvironmentsGapicClient +{ + use GapicClientTrait; + + /** The name of the service. */ + const SERVICE_NAME = 'google.cloud.dialogflow.v2.Environments'; + + /** + * The default address of the service. + * + * @deprecated SERVICE_ADDRESS_TEMPLATE should be used instead. + */ + const SERVICE_ADDRESS = 'dialogflow.googleapis.com'; + + /** The address template of the service. */ + private const SERVICE_ADDRESS_TEMPLATE = 'dialogflow.UNIVERSE_DOMAIN'; + + /** The default port of the service. */ + 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..cad836e9d04e --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/src/V2/Gapic/FulfillmentsGapicClient.php @@ -0,0 +1,516 @@ +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. + * + * @deprecated Please use the new service client {@see \Google\Cloud\Dialogflow\V2\Client\FulfillmentsClient}. + */ +class FulfillmentsGapicClient +{ + use GapicClientTrait; + + /** The name of the service. */ + const SERVICE_NAME = 'google.cloud.dialogflow.v2.Fulfillments'; + + /** + * The default address of the service. + * + * @deprecated SERVICE_ADDRESS_TEMPLATE should be used instead. + */ + const SERVICE_ADDRESS = 'dialogflow.googleapis.com'; + + /** The address template of the service. */ + private const SERVICE_ADDRESS_TEMPLATE = 'dialogflow.UNIVERSE_DOMAIN'; + + /** The default port of the service. */ + 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/GeneratorsGapicClient.php b/owl-bot-staging/Dialogflow/v2/src/V2/Gapic/GeneratorsGapicClient.php new file mode 100644 index 000000000000..939895b41154 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/src/V2/Gapic/GeneratorsGapicClient.php @@ -0,0 +1,668 @@ +projectName('[PROJECT]'); + * $generator = new Generator(); + * $response = $generatorsClient->createGenerator($formattedParent, $generator); + * } finally { + * $generatorsClient->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. + * + * @deprecated Please use the new service client {@see \Google\Cloud\Dialogflow\V2\Client\GeneratorsClient}. + */ +class GeneratorsGapicClient +{ + use GapicClientTrait; + + /** The name of the service. */ + const SERVICE_NAME = 'google.cloud.dialogflow.v2.Generators'; + + /** + * The default address of the service. + * + * @deprecated SERVICE_ADDRESS_TEMPLATE should be used instead. + */ + const SERVICE_ADDRESS = 'dialogflow.googleapis.com'; + + /** The address template of the service. */ + private const SERVICE_ADDRESS_TEMPLATE = 'dialogflow.UNIVERSE_DOMAIN'; + + /** The default port of the service. */ + 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 $generatorNameTemplate; + + private static $projectNameTemplate; + + private static $pathTemplateMap; + + private static function getClientDefaults() + { + return [ + 'serviceName' => self::SERVICE_NAME, + 'apiEndpoint' => self::SERVICE_ADDRESS . ':' . self::DEFAULT_SERVICE_PORT, + 'clientConfig' => __DIR__ . '/../resources/generators_client_config.json', + 'descriptorsConfigPath' => __DIR__ . '/../resources/generators_descriptor_config.php', + 'gcpApiConfigPath' => __DIR__ . '/../resources/generators_grpc_config.json', + 'credentialsConfig' => [ + 'defaultScopes' => self::$serviceScopes, + ], + 'transportConfig' => [ + 'rest' => [ + 'restClientConfigPath' => __DIR__ . '/../resources/generators_rest_client_config.php', + ], + ], + ]; + } + + private static function getGeneratorNameTemplate() + { + if (self::$generatorNameTemplate == null) { + self::$generatorNameTemplate = new PathTemplate('projects/{project}/locations/{location}/generators/{generator}'); + } + + return self::$generatorNameTemplate; + } + + private static function getProjectNameTemplate() + { + if (self::$projectNameTemplate == null) { + self::$projectNameTemplate = new PathTemplate('projects/{project}'); + } + + return self::$projectNameTemplate; + } + + private static function getPathTemplateMap() + { + if (self::$pathTemplateMap == null) { + self::$pathTemplateMap = [ + 'generator' => self::getGeneratorNameTemplate(), + 'project' => self::getProjectNameTemplate(), + ]; + } + + return self::$pathTemplateMap; + } + + /** + * Formats a string containing the fully-qualified path to represent a generator + * resource. + * + * @param string $project + * @param string $location + * @param string $generator + * + * @return string The formatted generator resource. + */ + public static function generatorName($project, $location, $generator) + { + return self::getGeneratorNameTemplate()->render([ + 'project' => $project, + 'location' => $location, + 'generator' => $generator, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a project + * resource. + * + * @param string $project + * + * @return string The formatted project resource. + */ + public static function projectName($project) + { + return self::getProjectNameTemplate()->render([ + 'project' => $project, + ]); + } + + /** + * Parses a formatted name string and returns an associative array of the components in the name. + * The following name formats are supported: + * Template: Pattern + * - generator: projects/{project}/locations/{location}/generators/{generator} + * - project: projects/{project} + * + * 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 generator. + * + * Sample code: + * ``` + * $generatorsClient = new GeneratorsClient(); + * try { + * $formattedParent = $generatorsClient->projectName('[PROJECT]'); + * $generator = new Generator(); + * $response = $generatorsClient->createGenerator($formattedParent, $generator); + * } finally { + * $generatorsClient->close(); + * } + * ``` + * + * @param string $parent Required. The project/location to create generator for. Format: + * `projects//locations/` + * @param Generator $generator Required. The generator to create. + * @param array $optionalArgs { + * Optional. + * + * @type string $generatorId + * Optional. The ID to use for the generator, which will become the final + * component of the generator's resource name. + * + * The generator ID must be compliant with the regression fomula + * `[a-zA-Z][a-zA-Z0-9_-]*` with the characters length in range of [3,64]. + * If the field is not provided, an Id will be auto-generated. + * If the field is provided, the caller is 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\Generator + * + * @throws ApiException if the remote call fails + */ + public function createGenerator($parent, $generator, array $optionalArgs = []) + { + $request = new CreateGeneratorRequest(); + $requestParamHeaders = []; + $request->setParent($parent); + $request->setGenerator($generator); + $requestParamHeaders['parent'] = $parent; + if (isset($optionalArgs['generatorId'])) { + $request->setGeneratorId($optionalArgs['generatorId']); + } + + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startCall('CreateGenerator', Generator::class, $optionalArgs, $request)->wait(); + } + + /** + * Deletes a generator. + * + * Sample code: + * ``` + * $generatorsClient = new GeneratorsClient(); + * try { + * $formattedName = $generatorsClient->generatorName('[PROJECT]', '[LOCATION]', '[GENERATOR]'); + * $generatorsClient->deleteGenerator($formattedName); + * } finally { + * $generatorsClient->close(); + * } + * ``` + * + * @param string $name Required. The generator resource name to delete. Format: + * `projects//locations//generators/` + * @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 deleteGenerator($name, array $optionalArgs = []) + { + $request = new DeleteGeneratorRequest(); + $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('DeleteGenerator', GPBEmpty::class, $optionalArgs, $request)->wait(); + } + + /** + * Retrieves a generator. + * + * Sample code: + * ``` + * $generatorsClient = new GeneratorsClient(); + * try { + * $formattedName = $generatorsClient->generatorName('[PROJECT]', '[LOCATION]', '[GENERATOR]'); + * $response = $generatorsClient->getGenerator($formattedName); + * } finally { + * $generatorsClient->close(); + * } + * ``` + * + * @param string $name Required. The generator resource name to retrieve. Format: + * `projects//locations/`/generators/` + * @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\Generator + * + * @throws ApiException if the remote call fails + */ + public function getGenerator($name, array $optionalArgs = []) + { + $request = new GetGeneratorRequest(); + $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('GetGenerator', Generator::class, $optionalArgs, $request)->wait(); + } + + /** + * Lists generators. + * + * Sample code: + * ``` + * $generatorsClient = new GeneratorsClient(); + * try { + * $formattedParent = $generatorsClient->projectName('[PROJECT]'); + * // Iterate over pages of elements + * $pagedResponse = $generatorsClient->listGenerators($formattedParent); + * foreach ($pagedResponse->iteratePages() as $page) { + * foreach ($page as $element) { + * // doSomethingWith($element); + * } + * } + * // Alternatively: + * // Iterate through all elements + * $pagedResponse = $generatorsClient->listGenerators($formattedParent); + * foreach ($pagedResponse->iterateAllElements() as $element) { + * // doSomethingWith($element); + * } + * } finally { + * $generatorsClient->close(); + * } + * ``` + * + * @param string $parent Required. The project/location to list generators 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 listGenerators($parent, array $optionalArgs = []) + { + $request = new ListGeneratorsRequest(); + $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('ListGenerators', $optionalArgs, ListGeneratorsResponse::class, $request); + } + + /** + * Updates a generator. + * + * Sample code: + * ``` + * $generatorsClient = new GeneratorsClient(); + * try { + * $generator = new Generator(); + * $response = $generatorsClient->updateGenerator($generator); + * } finally { + * $generatorsClient->close(); + * } + * ``` + * + * @param Generator $generator Required. The generator to update. + * The name field of generator is to identify the generator to update. + * @param array $optionalArgs { + * Optional. + * + * @type FieldMask $updateMask + * Optional. The list of fields to 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\Cloud\Dialogflow\V2\Generator + * + * @throws ApiException if the remote call fails + */ + public function updateGenerator($generator, array $optionalArgs = []) + { + $request = new UpdateGeneratorRequest(); + $requestParamHeaders = []; + $request->setGenerator($generator); + $requestParamHeaders['generator.name'] = $generator->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('UpdateGenerator', Generator::class, $optionalArgs, $request)->wait(); + } + + /** + * Gets information about a location. + * + * Sample code: + * ``` + * $generatorsClient = new GeneratorsClient(); + * try { + * $response = $generatorsClient->getLocation(); + * } finally { + * $generatorsClient->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: + * ``` + * $generatorsClient = new GeneratorsClient(); + * try { + * // Iterate over pages of elements + * $pagedResponse = $generatorsClient->listLocations(); + * foreach ($pagedResponse->iteratePages() as $page) { + * foreach ($page as $element) { + * // doSomethingWith($element); + * } + * } + * // Alternatively: + * // Iterate through all elements + * $pagedResponse = $generatorsClient->listLocations(); + * foreach ($pagedResponse->iterateAllElements() as $element) { + * // doSomethingWith($element); + * } + * } finally { + * $generatorsClient->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..edf60d9fd8ae --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/src/V2/Gapic/IntentsGapicClient.php @@ -0,0 +1,1447 @@ +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. + * + * @deprecated Please use the new service client {@see \Google\Cloud\Dialogflow\V2\Client\IntentsClient}. + */ +class IntentsGapicClient +{ + use GapicClientTrait; + + /** The name of the service. */ + const SERVICE_NAME = 'google.cloud.dialogflow.v2.Intents'; + + /** + * The default address of the service. + * + * @deprecated SERVICE_ADDRESS_TEMPLATE should be used instead. + */ + const SERVICE_ADDRESS = 'dialogflow.googleapis.com'; + + /** The address template of the service. */ + private const SERVICE_ADDRESS_TEMPLATE = 'dialogflow.UNIVERSE_DOMAIN'; + + /** The default port of the service. */ + 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..f6882c6a0759 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/src/V2/Gapic/KnowledgeBasesGapicClient.php @@ -0,0 +1,781 @@ +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. + * + * @deprecated Please use the new service client {@see \Google\Cloud\Dialogflow\V2\Client\KnowledgeBasesClient}. + */ +class KnowledgeBasesGapicClient +{ + use GapicClientTrait; + + /** The name of the service. */ + const SERVICE_NAME = 'google.cloud.dialogflow.v2.KnowledgeBases'; + + /** + * The default address of the service. + * + * @deprecated SERVICE_ADDRESS_TEMPLATE should be used instead. + */ + const SERVICE_ADDRESS = 'dialogflow.googleapis.com'; + + /** The address template of the service. */ + private const SERVICE_ADDRESS_TEMPLATE = 'dialogflow.UNIVERSE_DOMAIN'; + + /** The default port of the service. */ + 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..b50c7943d5d9 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/src/V2/Gapic/ParticipantsGapicClient.php @@ -0,0 +1,1809 @@ +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. + * + * @deprecated Please use the new service client {@see \Google\Cloud\Dialogflow\V2\Client\ParticipantsClient}. + */ +class ParticipantsGapicClient +{ + use GapicClientTrait; + + /** The name of the service. */ + const SERVICE_NAME = 'google.cloud.dialogflow.v2.Participants'; + + /** + * The default address of the service. + * + * @deprecated SERVICE_ADDRESS_TEMPLATE should be used instead. + */ + const SERVICE_ADDRESS = 'dialogflow.googleapis.com'; + + /** The address template of the service. */ + private const SERVICE_ADDRESS_TEMPLATE = 'dialogflow.UNIVERSE_DOMAIN'; + + /** The default port of the service. */ + 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 SuggestionInput $suggestionInput + * An input representing the selection of a suggestion. + * @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['suggestionInput'])) { + $request->setSuggestionInput($optionalArgs['suggestionInput']); + } + + 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 knowledge assist suggestions based on historical messages. + * + * Sample code: + * ``` + * $participantsClient = new ParticipantsClient(); + * try { + * $formattedParent = $participantsClient->participantName('[PROJECT]', '[CONVERSATION]', '[PARTICIPANT]'); + * $response = $participantsClient->suggestKnowledgeAssist($formattedParent); + * } finally { + * $participantsClient->close(); + * } + * ``` + * + * @param string $parent Required. The name of the participant to fetch suggestions for. + * Format: `projects//locations//conversations//participants/`. + * @param array $optionalArgs { + * Optional. + * + * @type string $latestMessage + * Optional. The name of the latest conversation message to compile + * suggestions for. If empty, it will be the latest message of the + * conversation. Format: `projects//locations//conversations//messages/`. + * @type int $contextSize + * Optional. Max number of messages prior to and including + * [latest_message][google.cloud.dialogflow.v2.SuggestKnowledgeAssistRequest.latest_message] + * to use as context when compiling the suggestion. The context size is by + * default 100 and at most 100. + * @type string $previousSuggestedQuery + * Optional. The previously suggested query for the given conversation. This + * helps identify whether the next suggestion we generate is resonably + * different from the previous one. This is useful to avoid similar + * suggestions within the conversation. + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. 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\SuggestKnowledgeAssistResponse + * + * @throws ApiException if the remote call fails + */ + public function suggestKnowledgeAssist($parent, array $optionalArgs = []) + { + $request = new SuggestKnowledgeAssistRequest(); + $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['previousSuggestedQuery'])) { + $request->setPreviousSuggestedQuery($optionalArgs['previousSuggestedQuery']); + } + + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startCall('SuggestKnowledgeAssist', SuggestKnowledgeAssistResponse::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..723714f78ba0 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/src/V2/Gapic/SessionEntityTypesGapicClient.php @@ -0,0 +1,964 @@ +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. + * + * @deprecated Please use the new service client {@see \Google\Cloud\Dialogflow\V2\Client\SessionEntityTypesClient}. + */ +class SessionEntityTypesGapicClient +{ + use GapicClientTrait; + + /** The name of the service. */ + const SERVICE_NAME = 'google.cloud.dialogflow.v2.SessionEntityTypes'; + + /** + * The default address of the service. + * + * @deprecated SERVICE_ADDRESS_TEMPLATE should be used instead. + */ + const SERVICE_ADDRESS = 'dialogflow.googleapis.com'; + + /** The address template of the service. */ + private const SERVICE_ADDRESS_TEMPLATE = 'dialogflow.UNIVERSE_DOMAIN'; + + /** The default port of the service. */ + 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..8c1852e41b29 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/src/V2/Gapic/SessionsGapicClient.php @@ -0,0 +1,1051 @@ +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. + * + * @deprecated Please use the new service client {@see \Google\Cloud\Dialogflow\V2\Client\SessionsClient}. + */ +class SessionsGapicClient +{ + use GapicClientTrait; + + /** The name of the service. */ + const SERVICE_NAME = 'google.cloud.dialogflow.v2.Sessions'; + + /** + * The default address of the service. + * + * @deprecated SERVICE_ADDRESS_TEMPLATE should be used instead. + */ + const SERVICE_ADDRESS = 'dialogflow.googleapis.com'; + + /** The address template of the service. */ + private const SERVICE_ADDRESS_TEMPLATE = 'dialogflow.UNIVERSE_DOMAIN'; + + /** The default port of the service. */ + 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..99ff31ee7c7c --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/src/V2/Gapic/VersionsGapicClient.php @@ -0,0 +1,788 @@ +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. + * + * @deprecated Please use the new service client {@see \Google\Cloud\Dialogflow\V2\Client\VersionsClient}. + */ +class VersionsGapicClient +{ + use GapicClientTrait; + + /** The name of the service. */ + const SERVICE_NAME = 'google.cloud.dialogflow.v2.Versions'; + + /** + * The default address of the service. + * + * @deprecated SERVICE_ADDRESS_TEMPLATE should be used instead. + */ + const SERVICE_ADDRESS = 'dialogflow.googleapis.com'; + + /** The address template of the service. */ + private const SERVICE_ADDRESS_TEMPLATE = 'dialogflow.UNIVERSE_DOMAIN'; + + /** The default port of the service. */ + 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/GeneratorsClient.php b/owl-bot-staging/Dialogflow/v2/src/V2/GeneratorsClient.php new file mode 100644 index 000000000000..05b3a7e977c7 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/src/V2/GeneratorsClient.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..a9de4eed6e81 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/src/V2/resources/agents_rest_client_config.php @@ -0,0 +1,270 @@ + [ + 'google.cloud.dialogflow.v2.Agents' => [ + 'DeleteAgent' => [ + 'method' => 'delete', + 'uriTemplate' => '/v2/{parent=projects/*}/agent', + 'additionalBindings' => [ + [ + 'method' => 'delete', + 'uriTemplate' => '/v2/{parent=projects/*/locations/*}/agent', + ], + ], + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + ], + 'ExportAgent' => [ + 'method' => 'post', + 'uriTemplate' => '/v2/{parent=projects/*}/agent:export', + 'body' => '*', + 'additionalBindings' => [ + [ + 'method' => 'post', + 'uriTemplate' => '/v2/{parent=projects/*/locations/*}/agent:export', + 'body' => '*', + ], + ], + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + ], + 'GetAgent' => [ + 'method' => 'get', + 'uriTemplate' => '/v2/{parent=projects/*}/agent', + 'additionalBindings' => [ + [ + 'method' => 'get', + 'uriTemplate' => '/v2/{parent=projects/*/locations/*}/agent', + ], + ], + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + ], + 'GetValidationResult' => [ + 'method' => 'get', + 'uriTemplate' => '/v2/{parent=projects/*}/agent/validationResult', + 'additionalBindings' => [ + [ + 'method' => 'get', + 'uriTemplate' => '/v2/{parent=projects/*/locations/*}/agent/validationResult', + ], + ], + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + ], + 'ImportAgent' => [ + 'method' => 'post', + 'uriTemplate' => '/v2/{parent=projects/*}/agent:import', + 'body' => '*', + 'additionalBindings' => [ + [ + 'method' => 'post', + 'uriTemplate' => '/v2/{parent=projects/*/locations/*}/agent:import', + 'body' => '*', + ], + ], + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + ], + 'RestoreAgent' => [ + 'method' => 'post', + 'uriTemplate' => '/v2/{parent=projects/*}/agent:restore', + 'body' => '*', + 'additionalBindings' => [ + [ + 'method' => 'post', + 'uriTemplate' => '/v2/{parent=projects/*/locations/*}/agent:restore', + 'body' => '*', + ], + ], + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + ], + 'SearchAgents' => [ + 'method' => 'get', + 'uriTemplate' => '/v2/{parent=projects/*}/agent:search', + 'additionalBindings' => [ + [ + 'method' => 'get', + 'uriTemplate' => '/v2/{parent=projects/*/locations/*}/agent:search', + ], + ], + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + ], + 'SetAgent' => [ + 'method' => 'post', + 'uriTemplate' => '/v2/{agent.parent=projects/*}/agent', + 'body' => 'agent', + 'additionalBindings' => [ + [ + 'method' => 'post', + 'uriTemplate' => '/v2/{agent.parent=projects/*/locations/*}/agent', + 'body' => 'agent', + ], + ], + 'placeholders' => [ + 'agent.parent' => [ + 'getters' => [ + 'getAgent', + 'getParent', + ], + ], + ], + ], + 'TrainAgent' => [ + 'method' => 'post', + 'uriTemplate' => '/v2/{parent=projects/*}/agent:train', + 'body' => '*', + 'additionalBindings' => [ + [ + 'method' => 'post', + 'uriTemplate' => '/v2/{parent=projects/*/locations/*}/agent:train', + 'body' => '*', + ], + ], + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + ], + ], + 'google.cloud.location.Locations' => [ + 'GetLocation' => [ + 'method' => 'get', + 'uriTemplate' => '/v2/{name=projects/*/locations/*}', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'ListLocations' => [ + 'method' => 'get', + 'uriTemplate' => '/v2/{name=projects/*}/locations', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + ], + 'google.longrunning.Operations' => [ + 'CancelOperation' => [ + 'method' => 'post', + 'uriTemplate' => '/v2/{name=projects/*/operations/*}:cancel', + 'additionalBindings' => [ + [ + 'method' => 'post', + 'uriTemplate' => '/v2/{name=projects/*/locations/*/operations/*}:cancel', + ], + ], + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'GetOperation' => [ + 'method' => 'get', + 'uriTemplate' => '/v2/{name=projects/*/operations/*}', + 'additionalBindings' => [ + [ + 'method' => 'get', + 'uriTemplate' => '/v2/{name=projects/*/locations/*/operations/*}', + ], + ], + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'ListOperations' => [ + 'method' => 'get', + 'uriTemplate' => '/v2/{name=projects/*}/operations', + 'additionalBindings' => [ + [ + 'method' => 'get', + 'uriTemplate' => '/v2/{name=projects/*/locations/*}/operations', + ], + ], + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + ], + ], + 'numericEnums' => true, +]; diff --git a/owl-bot-staging/Dialogflow/v2/src/V2/resources/answer_records_client_config.json b/owl-bot-staging/Dialogflow/v2/src/V2/resources/answer_records_client_config.json new file mode 100644 index 000000000000..2114a79c3ccc --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/src/V2/resources/answer_records_client_config.json @@ -0,0 +1,54 @@ +{ + "interfaces": { + "google.cloud.dialogflow.v2.AnswerRecords": { + "retry_codes": { + "no_retry_codes": [], + "retry_policy_1_codes": [ + "UNAVAILABLE" + ] + }, + "retry_params": { + "no_retry_params": { + "initial_retry_delay_millis": 0, + "retry_delay_multiplier": 0.0, + "max_retry_delay_millis": 0, + "initial_rpc_timeout_millis": 0, + "rpc_timeout_multiplier": 1.0, + "max_rpc_timeout_millis": 0, + "total_timeout_millis": 0 + }, + "retry_policy_1_params": { + "initial_retry_delay_millis": 100, + "retry_delay_multiplier": 1.3, + "max_retry_delay_millis": 60000, + "initial_rpc_timeout_millis": 60000, + "rpc_timeout_multiplier": 1.0, + "max_rpc_timeout_millis": 60000, + "total_timeout_millis": 60000 + } + }, + "methods": { + "ListAnswerRecords": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "UpdateAnswerRecord": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "GetLocation": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "ListLocations": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + } + } + } + } +} diff --git a/owl-bot-staging/Dialogflow/v2/src/V2/resources/answer_records_descriptor_config.php b/owl-bot-staging/Dialogflow/v2/src/V2/resources/answer_records_descriptor_config.php new file mode 100644 index 000000000000..6b5eec4ed91a --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/src/V2/resources/answer_records_descriptor_config.php @@ -0,0 +1,118 @@ + [ + 'google.cloud.dialogflow.v2.AnswerRecords' => [ + 'ListAnswerRecords' => [ + 'pageStreaming' => [ + 'requestPageTokenGetMethod' => 'getPageToken', + 'requestPageTokenSetMethod' => 'setPageToken', + 'requestPageSizeGetMethod' => 'getPageSize', + 'requestPageSizeSetMethod' => 'setPageSize', + 'responsePageTokenGetMethod' => 'getNextPageToken', + 'resourcesGetMethod' => 'getAnswerRecords', + ], + 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, + 'responseType' => 'Google\Cloud\Dialogflow\V2\ListAnswerRecordsResponse', + 'headerParams' => [ + [ + 'keyName' => 'parent', + 'fieldAccessors' => [ + 'getParent', + ], + ], + ], + ], + 'UpdateAnswerRecord' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Dialogflow\V2\AnswerRecord', + 'headerParams' => [ + [ + 'keyName' => 'answer_record.name', + 'fieldAccessors' => [ + 'getAnswerRecord', + 'getName', + ], + ], + ], + ], + 'GetLocation' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Location\Location', + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + 'interfaceOverride' => 'google.cloud.location.Locations', + ], + 'ListLocations' => [ + 'pageStreaming' => [ + 'requestPageTokenGetMethod' => 'getPageToken', + 'requestPageTokenSetMethod' => 'setPageToken', + 'requestPageSizeGetMethod' => 'getPageSize', + 'requestPageSizeSetMethod' => 'setPageSize', + 'responsePageTokenGetMethod' => 'getNextPageToken', + 'resourcesGetMethod' => 'getLocations', + ], + 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, + 'responseType' => 'Google\Cloud\Location\ListLocationsResponse', + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + 'interfaceOverride' => 'google.cloud.location.Locations', + ], + 'templateMap' => [ + 'agent' => 'projects/{project}/agent', + 'answerRecord' => 'projects/{project}/answerRecords/{answer_record}', + 'context' => 'projects/{project}/agent/sessions/{session}/contexts/{context}', + 'intent' => 'projects/{project}/agent/intents/{intent}', + 'location' => 'projects/{project}/locations/{location}', + 'project' => 'projects/{project}', + 'projectAgent' => 'projects/{project}/agent', + 'projectAnswerRecord' => 'projects/{project}/answerRecords/{answer_record}', + 'projectEnvironmentUserSession' => 'projects/{project}/agent/environments/{environment}/users/{user}/sessions/{session}', + 'projectEnvironmentUserSessionContext' => 'projects/{project}/agent/environments/{environment}/users/{user}/sessions/{session}/contexts/{context}', + 'projectIntent' => 'projects/{project}/agent/intents/{intent}', + 'projectLocationAgent' => 'projects/{project}/locations/{location}/agent', + 'projectLocationAnswerRecord' => 'projects/{project}/locations/{location}/answerRecords/{answer_record}', + 'projectLocationEnvironmentUserSession' => 'projects/{project}/locations/{location}/agent/environments/{environment}/users/{user}/sessions/{session}', + 'projectLocationEnvironmentUserSessionContext' => 'projects/{project}/locations/{location}/agent/environments/{environment}/users/{user}/sessions/{session}/contexts/{context}', + 'projectLocationIntent' => 'projects/{project}/locations/{location}/agent/intents/{intent}', + 'projectLocationSession' => 'projects/{project}/locations/{location}/agent/sessions/{session}', + 'projectLocationSessionContext' => 'projects/{project}/locations/{location}/agent/sessions/{session}/contexts/{context}', + 'projectSession' => 'projects/{project}/agent/sessions/{session}', + 'projectSessionContext' => 'projects/{project}/agent/sessions/{session}/contexts/{context}', + 'session' => 'projects/{project}/agent/sessions/{session}', + ], + ], + ], +]; 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..2e82c58294e8 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/src/V2/resources/answer_records_rest_client_config.php @@ -0,0 +1,149 @@ + [ + 'google.cloud.dialogflow.v2.AnswerRecords' => [ + 'ListAnswerRecords' => [ + 'method' => 'get', + 'uriTemplate' => '/v2/{parent=projects/*}/answerRecords', + 'additionalBindings' => [ + [ + 'method' => 'get', + 'uriTemplate' => '/v2/{parent=projects/*/locations/*}/answerRecords', + ], + ], + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + ], + 'UpdateAnswerRecord' => [ + 'method' => 'patch', + 'uriTemplate' => '/v2/{answer_record.name=projects/*/answerRecords/*}', + 'body' => 'answer_record', + 'additionalBindings' => [ + [ + 'method' => 'patch', + 'uriTemplate' => '/v2/{answer_record.name=projects/*/locations/*/answerRecords/*}', + 'body' => 'answer_record', + 'queryParams' => [ + 'update_mask', + ], + ], + ], + 'placeholders' => [ + 'answer_record.name' => [ + 'getters' => [ + 'getAnswerRecord', + 'getName', + ], + ], + ], + 'queryParams' => [ + 'update_mask', + ], + ], + ], + 'google.cloud.location.Locations' => [ + 'GetLocation' => [ + 'method' => 'get', + 'uriTemplate' => '/v2/{name=projects/*/locations/*}', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'ListLocations' => [ + 'method' => 'get', + 'uriTemplate' => '/v2/{name=projects/*}/locations', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + ], + 'google.longrunning.Operations' => [ + 'CancelOperation' => [ + 'method' => 'post', + 'uriTemplate' => '/v2/{name=projects/*/operations/*}:cancel', + 'additionalBindings' => [ + [ + 'method' => 'post', + 'uriTemplate' => '/v2/{name=projects/*/locations/*/operations/*}:cancel', + ], + ], + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'GetOperation' => [ + 'method' => 'get', + 'uriTemplate' => '/v2/{name=projects/*/operations/*}', + 'additionalBindings' => [ + [ + 'method' => 'get', + 'uriTemplate' => '/v2/{name=projects/*/locations/*/operations/*}', + ], + ], + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'ListOperations' => [ + 'method' => 'get', + 'uriTemplate' => '/v2/{name=projects/*}/operations', + 'additionalBindings' => [ + [ + 'method' => 'get', + 'uriTemplate' => '/v2/{name=projects/*/locations/*}/operations', + ], + ], + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + ], + ], + 'numericEnums' => true, +]; diff --git a/owl-bot-staging/Dialogflow/v2/src/V2/resources/contexts_client_config.json b/owl-bot-staging/Dialogflow/v2/src/V2/resources/contexts_client_config.json new file mode 100644 index 000000000000..405824724392 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/src/V2/resources/contexts_client_config.json @@ -0,0 +1,74 @@ +{ + "interfaces": { + "google.cloud.dialogflow.v2.Contexts": { + "retry_codes": { + "no_retry_codes": [], + "retry_policy_1_codes": [ + "UNAVAILABLE" + ] + }, + "retry_params": { + "no_retry_params": { + "initial_retry_delay_millis": 0, + "retry_delay_multiplier": 0.0, + "max_retry_delay_millis": 0, + "initial_rpc_timeout_millis": 0, + "rpc_timeout_multiplier": 1.0, + "max_rpc_timeout_millis": 0, + "total_timeout_millis": 0 + }, + "retry_policy_1_params": { + "initial_retry_delay_millis": 100, + "retry_delay_multiplier": 1.3, + "max_retry_delay_millis": 60000, + "initial_rpc_timeout_millis": 60000, + "rpc_timeout_multiplier": 1.0, + "max_rpc_timeout_millis": 60000, + "total_timeout_millis": 60000 + } + }, + "methods": { + "CreateContext": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "DeleteAllContexts": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "DeleteContext": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "GetContext": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "ListContexts": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "UpdateContext": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "GetLocation": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "ListLocations": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + } + } + } + } +} diff --git a/owl-bot-staging/Dialogflow/v2/src/V2/resources/contexts_descriptor_config.php b/owl-bot-staging/Dialogflow/v2/src/V2/resources/contexts_descriptor_config.php new file mode 100644 index 000000000000..a11b9c5d3e3d --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/src/V2/resources/contexts_descriptor_config.php @@ -0,0 +1,155 @@ + [ + 'google.cloud.dialogflow.v2.Contexts' => [ + 'CreateContext' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Dialogflow\V2\Context', + 'headerParams' => [ + [ + 'keyName' => 'parent', + 'fieldAccessors' => [ + 'getParent', + ], + ], + ], + ], + 'DeleteAllContexts' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Protobuf\GPBEmpty', + 'headerParams' => [ + [ + 'keyName' => 'parent', + 'fieldAccessors' => [ + 'getParent', + ], + ], + ], + ], + 'DeleteContext' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Protobuf\GPBEmpty', + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + ], + 'GetContext' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Dialogflow\V2\Context', + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + ], + 'ListContexts' => [ + 'pageStreaming' => [ + 'requestPageTokenGetMethod' => 'getPageToken', + 'requestPageTokenSetMethod' => 'setPageToken', + 'requestPageSizeGetMethod' => 'getPageSize', + 'requestPageSizeSetMethod' => 'setPageSize', + 'responsePageTokenGetMethod' => 'getNextPageToken', + 'resourcesGetMethod' => 'getContexts', + ], + 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, + 'responseType' => 'Google\Cloud\Dialogflow\V2\ListContextsResponse', + 'headerParams' => [ + [ + 'keyName' => 'parent', + 'fieldAccessors' => [ + 'getParent', + ], + ], + ], + ], + 'UpdateContext' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Dialogflow\V2\Context', + 'headerParams' => [ + [ + 'keyName' => 'context.name', + 'fieldAccessors' => [ + 'getContext', + 'getName', + ], + ], + ], + ], + 'GetLocation' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Location\Location', + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + 'interfaceOverride' => 'google.cloud.location.Locations', + ], + 'ListLocations' => [ + 'pageStreaming' => [ + 'requestPageTokenGetMethod' => 'getPageToken', + 'requestPageTokenSetMethod' => 'setPageToken', + 'requestPageSizeGetMethod' => 'getPageSize', + 'requestPageSizeSetMethod' => 'setPageSize', + 'responsePageTokenGetMethod' => 'getNextPageToken', + 'resourcesGetMethod' => 'getLocations', + ], + 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, + 'responseType' => 'Google\Cloud\Location\ListLocationsResponse', + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + 'interfaceOverride' => 'google.cloud.location.Locations', + ], + 'templateMap' => [ + 'context' => 'projects/{project}/agent/sessions/{session}/contexts/{context}', + 'projectEnvironmentUserSession' => 'projects/{project}/agent/environments/{environment}/users/{user}/sessions/{session}', + 'projectEnvironmentUserSessionContext' => 'projects/{project}/agent/environments/{environment}/users/{user}/sessions/{session}/contexts/{context}', + 'projectLocationEnvironmentUserSession' => 'projects/{project}/locations/{location}/agent/environments/{environment}/users/{user}/sessions/{session}', + 'projectLocationEnvironmentUserSessionContext' => 'projects/{project}/locations/{location}/agent/environments/{environment}/users/{user}/sessions/{session}/contexts/{context}', + 'projectLocationSession' => 'projects/{project}/locations/{location}/agent/sessions/{session}', + 'projectLocationSessionContext' => 'projects/{project}/locations/{location}/agent/sessions/{session}/contexts/{context}', + 'projectSession' => 'projects/{project}/agent/sessions/{session}', + 'projectSessionContext' => 'projects/{project}/agent/sessions/{session}/contexts/{context}', + 'session' => 'projects/{project}/agent/sessions/{session}', + ], + ], + ], +]; diff --git a/owl-bot-staging/Dialogflow/v2/src/V2/resources/contexts_rest_client_config.php b/owl-bot-staging/Dialogflow/v2/src/V2/resources/contexts_rest_client_config.php new file mode 100644 index 000000000000..756ffcc0e54c --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/src/V2/resources/contexts_rest_client_config.php @@ -0,0 +1,265 @@ + [ + 'google.cloud.dialogflow.v2.Contexts' => [ + 'CreateContext' => [ + 'method' => 'post', + 'uriTemplate' => '/v2/{parent=projects/*/agent/sessions/*}/contexts', + 'body' => 'context', + 'additionalBindings' => [ + [ + 'method' => 'post', + 'uriTemplate' => '/v2/{parent=projects/*/agent/environments/*/users/*/sessions/*}/contexts', + 'body' => 'context', + ], + [ + 'method' => 'post', + 'uriTemplate' => '/v2/{parent=projects/*/locations/*/agent/sessions/*}/contexts', + 'body' => 'context', + ], + [ + 'method' => 'post', + 'uriTemplate' => '/v2/{parent=projects/*/locations/*/agent/environments/*/users/*/sessions/*}/contexts', + 'body' => 'context', + ], + ], + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + ], + 'DeleteAllContexts' => [ + 'method' => 'delete', + 'uriTemplate' => '/v2/{parent=projects/*/agent/sessions/*}/contexts', + 'additionalBindings' => [ + [ + 'method' => 'delete', + 'uriTemplate' => '/v2/{parent=projects/*/agent/environments/*/users/*/sessions/*}/contexts', + ], + [ + 'method' => 'delete', + 'uriTemplate' => '/v2/{parent=projects/*/locations/*/agent/sessions/*}/contexts', + ], + [ + 'method' => 'delete', + 'uriTemplate' => '/v2/{parent=projects/*/locations/*/agent/environments/*/users/*/sessions/*}/contexts', + ], + ], + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + ], + 'DeleteContext' => [ + 'method' => 'delete', + 'uriTemplate' => '/v2/{name=projects/*/agent/sessions/*/contexts/*}', + 'additionalBindings' => [ + [ + 'method' => 'delete', + 'uriTemplate' => '/v2/{name=projects/*/agent/environments/*/users/*/sessions/*/contexts/*}', + ], + [ + 'method' => 'delete', + 'uriTemplate' => '/v2/{name=projects/*/locations/*/agent/sessions/*/contexts/*}', + ], + [ + 'method' => 'delete', + 'uriTemplate' => '/v2/{name=projects/*/locations/*/agent/environments/*/users/*/sessions/*/contexts/*}', + ], + ], + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'GetContext' => [ + 'method' => 'get', + 'uriTemplate' => '/v2/{name=projects/*/agent/sessions/*/contexts/*}', + 'additionalBindings' => [ + [ + 'method' => 'get', + 'uriTemplate' => '/v2/{name=projects/*/agent/environments/*/users/*/sessions/*/contexts/*}', + ], + [ + 'method' => 'get', + 'uriTemplate' => '/v2/{name=projects/*/locations/*/agent/sessions/*/contexts/*}', + ], + [ + 'method' => 'get', + 'uriTemplate' => '/v2/{name=projects/*/locations/*/agent/environments/*/users/*/sessions/*/contexts/*}', + ], + ], + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'ListContexts' => [ + 'method' => 'get', + 'uriTemplate' => '/v2/{parent=projects/*/agent/sessions/*}/contexts', + 'additionalBindings' => [ + [ + 'method' => 'get', + 'uriTemplate' => '/v2/{parent=projects/*/agent/environments/*/users/*/sessions/*}/contexts', + ], + [ + 'method' => 'get', + 'uriTemplate' => '/v2/{parent=projects/*/locations/*/agent/sessions/*}/contexts', + ], + [ + 'method' => 'get', + 'uriTemplate' => '/v2/{parent=projects/*/locations/*/agent/environments/*/users/*/sessions/*}/contexts', + ], + ], + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + ], + 'UpdateContext' => [ + 'method' => 'patch', + 'uriTemplate' => '/v2/{context.name=projects/*/agent/sessions/*/contexts/*}', + 'body' => 'context', + 'additionalBindings' => [ + [ + 'method' => 'patch', + 'uriTemplate' => '/v2/{context.name=projects/*/agent/environments/*/users/*/sessions/*/contexts/*}', + 'body' => 'context', + ], + [ + 'method' => 'patch', + 'uriTemplate' => '/v2/{context.name=projects/*/locations/*/agent/sessions/*/contexts/*}', + 'body' => 'context', + ], + [ + 'method' => 'patch', + 'uriTemplate' => '/v2/{context.name=projects/*/locations/*/agent/environments/*/users/*/sessions/*/contexts/*}', + 'body' => 'context', + ], + ], + 'placeholders' => [ + 'context.name' => [ + 'getters' => [ + 'getContext', + 'getName', + ], + ], + ], + ], + ], + 'google.cloud.location.Locations' => [ + 'GetLocation' => [ + 'method' => 'get', + 'uriTemplate' => '/v2/{name=projects/*/locations/*}', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'ListLocations' => [ + 'method' => 'get', + 'uriTemplate' => '/v2/{name=projects/*}/locations', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + ], + 'google.longrunning.Operations' => [ + 'CancelOperation' => [ + 'method' => 'post', + 'uriTemplate' => '/v2/{name=projects/*/operations/*}:cancel', + 'additionalBindings' => [ + [ + 'method' => 'post', + 'uriTemplate' => '/v2/{name=projects/*/locations/*/operations/*}:cancel', + ], + ], + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'GetOperation' => [ + 'method' => 'get', + 'uriTemplate' => '/v2/{name=projects/*/operations/*}', + 'additionalBindings' => [ + [ + 'method' => 'get', + 'uriTemplate' => '/v2/{name=projects/*/locations/*/operations/*}', + ], + ], + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'ListOperations' => [ + 'method' => 'get', + 'uriTemplate' => '/v2/{name=projects/*}/operations', + 'additionalBindings' => [ + [ + 'method' => 'get', + 'uriTemplate' => '/v2/{name=projects/*/locations/*}/operations', + ], + ], + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + ], + ], + 'numericEnums' => true, +]; diff --git a/owl-bot-staging/Dialogflow/v2/src/V2/resources/conversation_datasets_client_config.json b/owl-bot-staging/Dialogflow/v2/src/V2/resources/conversation_datasets_client_config.json new file mode 100644 index 000000000000..bbee4eabff14 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/src/V2/resources/conversation_datasets_client_config.json @@ -0,0 +1,69 @@ +{ + "interfaces": { + "google.cloud.dialogflow.v2.ConversationDatasets": { + "retry_codes": { + "no_retry_codes": [], + "retry_policy_1_codes": [ + "UNAVAILABLE" + ] + }, + "retry_params": { + "no_retry_params": { + "initial_retry_delay_millis": 0, + "retry_delay_multiplier": 0.0, + "max_retry_delay_millis": 0, + "initial_rpc_timeout_millis": 0, + "rpc_timeout_multiplier": 1.0, + "max_rpc_timeout_millis": 0, + "total_timeout_millis": 0 + }, + "retry_policy_1_params": { + "initial_retry_delay_millis": 100, + "retry_delay_multiplier": 1.3, + "max_retry_delay_millis": 60000, + "initial_rpc_timeout_millis": 60000, + "rpc_timeout_multiplier": 1.0, + "max_rpc_timeout_millis": 60000, + "total_timeout_millis": 60000 + } + }, + "methods": { + "CreateConversationDataset": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "DeleteConversationDataset": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "GetConversationDataset": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "ImportConversationData": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "ListConversationDatasets": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "GetLocation": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "ListLocations": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + } + } + } + } +} diff --git a/owl-bot-staging/Dialogflow/v2/src/V2/resources/conversation_datasets_descriptor_config.php b/owl-bot-staging/Dialogflow/v2/src/V2/resources/conversation_datasets_descriptor_config.php new file mode 100644 index 000000000000..7bbe37ad295a --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/src/V2/resources/conversation_datasets_descriptor_config.php @@ -0,0 +1,155 @@ + [ + 'google.cloud.dialogflow.v2.ConversationDatasets' => [ + 'CreateConversationDataset' => [ + 'longRunning' => [ + 'operationReturnType' => '\Google\Cloud\Dialogflow\V2\ConversationDataset', + 'metadataReturnType' => '\Google\Cloud\Dialogflow\V2\CreateConversationDatasetOperationMetadata', + 'initialPollDelayMillis' => '500', + 'pollDelayMultiplier' => '1.5', + 'maxPollDelayMillis' => '5000', + 'totalPollTimeoutMillis' => '300000', + ], + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'parent', + 'fieldAccessors' => [ + 'getParent', + ], + ], + ], + ], + 'DeleteConversationDataset' => [ + 'longRunning' => [ + 'operationReturnType' => '\Google\Protobuf\GPBEmpty', + 'metadataReturnType' => '\Google\Cloud\Dialogflow\V2\DeleteConversationDatasetOperationMetadata', + 'initialPollDelayMillis' => '500', + 'pollDelayMultiplier' => '1.5', + 'maxPollDelayMillis' => '5000', + 'totalPollTimeoutMillis' => '300000', + ], + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + ], + 'ImportConversationData' => [ + 'longRunning' => [ + 'operationReturnType' => '\Google\Cloud\Dialogflow\V2\ImportConversationDataOperationResponse', + 'metadataReturnType' => '\Google\Cloud\Dialogflow\V2\ImportConversationDataOperationMetadata', + 'initialPollDelayMillis' => '500', + 'pollDelayMultiplier' => '1.5', + 'maxPollDelayMillis' => '5000', + 'totalPollTimeoutMillis' => '300000', + ], + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + ], + 'GetConversationDataset' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Dialogflow\V2\ConversationDataset', + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + ], + 'ListConversationDatasets' => [ + 'pageStreaming' => [ + 'requestPageTokenGetMethod' => 'getPageToken', + 'requestPageTokenSetMethod' => 'setPageToken', + 'requestPageSizeGetMethod' => 'getPageSize', + 'requestPageSizeSetMethod' => 'setPageSize', + 'responsePageTokenGetMethod' => 'getNextPageToken', + 'resourcesGetMethod' => 'getConversationDatasets', + ], + 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, + 'responseType' => 'Google\Cloud\Dialogflow\V2\ListConversationDatasetsResponse', + 'headerParams' => [ + [ + 'keyName' => 'parent', + 'fieldAccessors' => [ + 'getParent', + ], + ], + ], + ], + 'GetLocation' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Location\Location', + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + 'interfaceOverride' => 'google.cloud.location.Locations', + ], + 'ListLocations' => [ + 'pageStreaming' => [ + 'requestPageTokenGetMethod' => 'getPageToken', + 'requestPageTokenSetMethod' => 'setPageToken', + 'requestPageSizeGetMethod' => 'getPageSize', + 'requestPageSizeSetMethod' => 'setPageSize', + 'responsePageTokenGetMethod' => 'getNextPageToken', + 'resourcesGetMethod' => 'getLocations', + ], + 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, + 'responseType' => 'Google\Cloud\Location\ListLocationsResponse', + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + 'interfaceOverride' => 'google.cloud.location.Locations', + ], + 'templateMap' => [ + 'conversationDataset' => 'projects/{project}/locations/{location}/conversationDatasets/{conversation_dataset}', + 'location' => 'projects/{project}/locations/{location}', + ], + ], + ], +]; diff --git a/owl-bot-staging/Dialogflow/v2/src/V2/resources/conversation_datasets_rest_client_config.php b/owl-bot-staging/Dialogflow/v2/src/V2/resources/conversation_datasets_rest_client_config.php new file mode 100644 index 000000000000..e94c777201ed --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/src/V2/resources/conversation_datasets_rest_client_config.php @@ -0,0 +1,182 @@ + [ + 'google.cloud.dialogflow.v2.ConversationDatasets' => [ + 'CreateConversationDataset' => [ + 'method' => 'post', + 'uriTemplate' => '/v2/{parent=projects/*/locations/*}/conversationDatasets', + 'body' => 'conversation_dataset', + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + ], + 'DeleteConversationDataset' => [ + 'method' => 'delete', + 'uriTemplate' => '/v2/{name=projects/*/locations/*/conversationDatasets/*}', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'GetConversationDataset' => [ + 'method' => 'get', + 'uriTemplate' => '/v2/{name=projects/*/conversationDatasets/*}', + 'additionalBindings' => [ + [ + 'method' => 'get', + 'uriTemplate' => '/v2/{name=projects/*/locations/*/conversationDatasets/*}', + ], + ], + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'ImportConversationData' => [ + 'method' => 'post', + 'uriTemplate' => '/v2/{name=projects/*/conversationDatasets/*}:importConversationData', + 'body' => '*', + 'additionalBindings' => [ + [ + 'method' => 'post', + 'uriTemplate' => '/v2/{name=projects/*/locations/*/conversationDatasets/*}:importConversationData', + 'body' => '*', + ], + ], + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'ListConversationDatasets' => [ + 'method' => 'get', + 'uriTemplate' => '/v2/{parent=projects/*}/conversationDatasets', + 'additionalBindings' => [ + [ + 'method' => 'get', + 'uriTemplate' => '/v2/{parent=projects/*/locations/*}/conversationDatasets', + ], + ], + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + ], + ], + 'google.cloud.location.Locations' => [ + 'GetLocation' => [ + 'method' => 'get', + 'uriTemplate' => '/v2/{name=projects/*/locations/*}', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'ListLocations' => [ + 'method' => 'get', + 'uriTemplate' => '/v2/{name=projects/*}/locations', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + ], + 'google.longrunning.Operations' => [ + 'CancelOperation' => [ + 'method' => 'post', + 'uriTemplate' => '/v2/{name=projects/*/operations/*}:cancel', + 'additionalBindings' => [ + [ + 'method' => 'post', + 'uriTemplate' => '/v2/{name=projects/*/locations/*/operations/*}:cancel', + ], + ], + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'GetOperation' => [ + 'method' => 'get', + 'uriTemplate' => '/v2/{name=projects/*/operations/*}', + 'additionalBindings' => [ + [ + 'method' => 'get', + 'uriTemplate' => '/v2/{name=projects/*/locations/*/operations/*}', + ], + ], + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'ListOperations' => [ + 'method' => 'get', + 'uriTemplate' => '/v2/{name=projects/*}/operations', + 'additionalBindings' => [ + [ + 'method' => 'get', + 'uriTemplate' => '/v2/{name=projects/*/locations/*}/operations', + ], + ], + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + ], + ], + 'numericEnums' => true, +]; diff --git a/owl-bot-staging/Dialogflow/v2/src/V2/resources/conversation_models_client_config.json b/owl-bot-staging/Dialogflow/v2/src/V2/resources/conversation_models_client_config.json new file mode 100644 index 000000000000..ecdf8c5a3de4 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/src/V2/resources/conversation_models_client_config.json @@ -0,0 +1,89 @@ +{ + "interfaces": { + "google.cloud.dialogflow.v2.ConversationModels": { + "retry_codes": { + "no_retry_codes": [], + "retry_policy_1_codes": [ + "UNAVAILABLE" + ] + }, + "retry_params": { + "no_retry_params": { + "initial_retry_delay_millis": 0, + "retry_delay_multiplier": 0.0, + "max_retry_delay_millis": 0, + "initial_rpc_timeout_millis": 0, + "rpc_timeout_multiplier": 1.0, + "max_rpc_timeout_millis": 0, + "total_timeout_millis": 0 + }, + "retry_policy_1_params": { + "initial_retry_delay_millis": 100, + "retry_delay_multiplier": 1.3, + "max_retry_delay_millis": 60000, + "initial_rpc_timeout_millis": 60000, + "rpc_timeout_multiplier": 1.0, + "max_rpc_timeout_millis": 60000, + "total_timeout_millis": 60000 + } + }, + "methods": { + "CreateConversationModel": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "CreateConversationModelEvaluation": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "DeleteConversationModel": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "DeployConversationModel": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "GetConversationModel": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "GetConversationModelEvaluation": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "ListConversationModelEvaluations": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "ListConversationModels": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "UndeployConversationModel": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "GetLocation": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "ListLocations": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + } + } + } + } +} diff --git a/owl-bot-staging/Dialogflow/v2/src/V2/resources/conversation_models_descriptor_config.php b/owl-bot-staging/Dialogflow/v2/src/V2/resources/conversation_models_descriptor_config.php new file mode 100644 index 000000000000..fa73ebcd2d73 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/src/V2/resources/conversation_models_descriptor_config.php @@ -0,0 +1,233 @@ + [ + 'google.cloud.dialogflow.v2.ConversationModels' => [ + 'CreateConversationModel' => [ + 'longRunning' => [ + 'operationReturnType' => '\Google\Cloud\Dialogflow\V2\ConversationModel', + 'metadataReturnType' => '\Google\Cloud\Dialogflow\V2\CreateConversationModelOperationMetadata', + 'initialPollDelayMillis' => '500', + 'pollDelayMultiplier' => '1.5', + 'maxPollDelayMillis' => '5000', + 'totalPollTimeoutMillis' => '300000', + ], + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'parent', + 'fieldAccessors' => [ + 'getParent', + ], + ], + ], + ], + 'CreateConversationModelEvaluation' => [ + 'longRunning' => [ + 'operationReturnType' => '\Google\Cloud\Dialogflow\V2\ConversationModelEvaluation', + 'metadataReturnType' => '\Google\Cloud\Dialogflow\V2\CreateConversationModelEvaluationOperationMetadata', + 'initialPollDelayMillis' => '500', + 'pollDelayMultiplier' => '1.5', + 'maxPollDelayMillis' => '5000', + 'totalPollTimeoutMillis' => '300000', + ], + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'parent', + 'fieldAccessors' => [ + 'getParent', + ], + ], + ], + ], + 'DeleteConversationModel' => [ + 'longRunning' => [ + 'operationReturnType' => '\Google\Protobuf\GPBEmpty', + 'metadataReturnType' => '\Google\Cloud\Dialogflow\V2\DeleteConversationModelOperationMetadata', + 'initialPollDelayMillis' => '500', + 'pollDelayMultiplier' => '1.5', + 'maxPollDelayMillis' => '5000', + 'totalPollTimeoutMillis' => '300000', + ], + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + ], + 'DeployConversationModel' => [ + 'longRunning' => [ + 'operationReturnType' => '\Google\Protobuf\GPBEmpty', + 'metadataReturnType' => '\Google\Cloud\Dialogflow\V2\DeployConversationModelOperationMetadata', + 'initialPollDelayMillis' => '500', + 'pollDelayMultiplier' => '1.5', + 'maxPollDelayMillis' => '5000', + 'totalPollTimeoutMillis' => '300000', + ], + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + ], + 'UndeployConversationModel' => [ + 'longRunning' => [ + 'operationReturnType' => '\Google\Protobuf\GPBEmpty', + 'metadataReturnType' => '\Google\Cloud\Dialogflow\V2\UndeployConversationModelOperationMetadata', + 'initialPollDelayMillis' => '500', + 'pollDelayMultiplier' => '1.5', + 'maxPollDelayMillis' => '5000', + 'totalPollTimeoutMillis' => '300000', + ], + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + ], + 'GetConversationModel' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Dialogflow\V2\ConversationModel', + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + ], + 'GetConversationModelEvaluation' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Dialogflow\V2\ConversationModelEvaluation', + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + ], + 'ListConversationModelEvaluations' => [ + 'pageStreaming' => [ + 'requestPageTokenGetMethod' => 'getPageToken', + 'requestPageTokenSetMethod' => 'setPageToken', + 'requestPageSizeGetMethod' => 'getPageSize', + 'requestPageSizeSetMethod' => 'setPageSize', + 'responsePageTokenGetMethod' => 'getNextPageToken', + 'resourcesGetMethod' => 'getConversationModelEvaluations', + ], + 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, + 'responseType' => 'Google\Cloud\Dialogflow\V2\ListConversationModelEvaluationsResponse', + 'headerParams' => [ + [ + 'keyName' => 'parent', + 'fieldAccessors' => [ + 'getParent', + ], + ], + ], + ], + 'ListConversationModels' => [ + 'pageStreaming' => [ + 'requestPageTokenGetMethod' => 'getPageToken', + 'requestPageTokenSetMethod' => 'setPageToken', + 'requestPageSizeGetMethod' => 'getPageSize', + 'requestPageSizeSetMethod' => 'setPageSize', + 'responsePageTokenGetMethod' => 'getNextPageToken', + 'resourcesGetMethod' => 'getConversationModels', + ], + 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, + 'responseType' => 'Google\Cloud\Dialogflow\V2\ListConversationModelsResponse', + 'headerParams' => [ + [ + 'keyName' => 'parent', + 'fieldAccessors' => [ + 'getParent', + ], + ], + ], + ], + 'GetLocation' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Location\Location', + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + 'interfaceOverride' => 'google.cloud.location.Locations', + ], + 'ListLocations' => [ + 'pageStreaming' => [ + 'requestPageTokenGetMethod' => 'getPageToken', + 'requestPageTokenSetMethod' => 'setPageToken', + 'requestPageSizeGetMethod' => 'getPageSize', + 'requestPageSizeSetMethod' => 'setPageSize', + 'responsePageTokenGetMethod' => 'getNextPageToken', + 'resourcesGetMethod' => 'getLocations', + ], + 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, + 'responseType' => 'Google\Cloud\Location\ListLocationsResponse', + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + 'interfaceOverride' => 'google.cloud.location.Locations', + ], + 'templateMap' => [ + 'conversationDataset' => 'projects/{project}/locations/{location}/conversationDatasets/{conversation_dataset}', + 'conversationModel' => 'projects/{project}/locations/{location}/conversationModels/{conversation_model}', + 'conversationModelEvaluation' => 'projects/{project}/conversationModels/{conversation_model}/evaluations/{evaluation}', + 'document' => 'projects/{project}/knowledgeBases/{knowledge_base}/documents/{document}', + 'projectConversationModel' => 'projects/{project}/conversationModels/{conversation_model}', + 'projectConversationModelEvaluation' => 'projects/{project}/conversationModels/{conversation_model}/evaluations/{evaluation}', + 'projectKnowledgeBaseDocument' => 'projects/{project}/knowledgeBases/{knowledge_base}/documents/{document}', + 'projectLocationConversationModel' => 'projects/{project}/locations/{location}/conversationModels/{conversation_model}', + 'projectLocationConversationModelEvaluation' => 'projects/{project}/locations/{location}/conversationModels/{conversation_model}/evaluations/{evaluation}', + 'projectLocationKnowledgeBaseDocument' => 'projects/{project}/locations/{location}/knowledgeBases/{knowledge_base}/documents/{document}', + ], + ], + ], +]; diff --git a/owl-bot-staging/Dialogflow/v2/src/V2/resources/conversation_models_rest_client_config.php b/owl-bot-staging/Dialogflow/v2/src/V2/resources/conversation_models_rest_client_config.php new file mode 100644 index 000000000000..b05e879c10ca --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/src/V2/resources/conversation_models_rest_client_config.php @@ -0,0 +1,260 @@ + [ + 'google.cloud.dialogflow.v2.ConversationModels' => [ + 'CreateConversationModel' => [ + 'method' => 'post', + 'uriTemplate' => '/v2/{parent=projects/*}/conversationModels', + 'body' => 'conversation_model', + 'additionalBindings' => [ + [ + 'method' => 'post', + 'uriTemplate' => '/v2/{parent=projects/*/locations/*}/conversationModels', + 'body' => 'conversation_model', + ], + ], + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + ], + 'CreateConversationModelEvaluation' => [ + 'method' => 'post', + 'uriTemplate' => '/v2/{parent=projects/*/locations/*/conversationModels/*}/evaluations', + 'body' => '*', + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + ], + 'DeleteConversationModel' => [ + 'method' => 'delete', + 'uriTemplate' => '/v2/{name=projects/*/conversationModels/*}', + 'additionalBindings' => [ + [ + 'method' => 'delete', + 'uriTemplate' => '/v2/{name=projects/*/locations/*/conversationModels/*}', + ], + ], + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'DeployConversationModel' => [ + 'method' => 'post', + 'uriTemplate' => '/v2/{name=projects/*/conversationModels/*}:deploy', + 'body' => '*', + 'additionalBindings' => [ + [ + 'method' => 'post', + 'uriTemplate' => '/v2/{name=projects/*/locations/*/conversationModels/*}:deploy', + 'body' => '*', + ], + ], + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'GetConversationModel' => [ + 'method' => 'get', + 'uriTemplate' => '/v2/{name=projects/*/conversationModels/*}', + 'additionalBindings' => [ + [ + 'method' => 'get', + 'uriTemplate' => '/v2/{name=projects/*/locations/*/conversationModels/*}', + ], + ], + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'GetConversationModelEvaluation' => [ + 'method' => 'get', + 'uriTemplate' => '/v2/{name=projects/*/conversationModels/*/evaluations/*}', + 'additionalBindings' => [ + [ + 'method' => 'get', + 'uriTemplate' => '/v2/{name=projects/*/locations/*/conversationModels/*/evaluations/*}', + ], + ], + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'ListConversationModelEvaluations' => [ + 'method' => 'get', + 'uriTemplate' => '/v2/{parent=projects/*/conversationModels/*}/evaluations', + 'additionalBindings' => [ + [ + 'method' => 'get', + 'uriTemplate' => '/v2/{parent=projects/*/locations/*/conversationModels/*}/evaluations', + ], + ], + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + ], + 'ListConversationModels' => [ + 'method' => 'get', + 'uriTemplate' => '/v2/{parent=projects/*}/conversationModels', + 'additionalBindings' => [ + [ + 'method' => 'get', + 'uriTemplate' => '/v2/{parent=projects/*/locations/*}/conversationModels', + ], + ], + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + ], + 'UndeployConversationModel' => [ + 'method' => 'post', + 'uriTemplate' => '/v2/{name=projects/*/conversationModels/*}:undeploy', + 'body' => '*', + 'additionalBindings' => [ + [ + 'method' => 'post', + 'uriTemplate' => '/v2/{name=projects/*/locations/*/conversationModels/*}:undeploy', + 'body' => '*', + ], + ], + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + ], + 'google.cloud.location.Locations' => [ + 'GetLocation' => [ + 'method' => 'get', + 'uriTemplate' => '/v2/{name=projects/*/locations/*}', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'ListLocations' => [ + 'method' => 'get', + 'uriTemplate' => '/v2/{name=projects/*}/locations', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + ], + 'google.longrunning.Operations' => [ + 'CancelOperation' => [ + 'method' => 'post', + 'uriTemplate' => '/v2/{name=projects/*/operations/*}:cancel', + 'additionalBindings' => [ + [ + 'method' => 'post', + 'uriTemplate' => '/v2/{name=projects/*/locations/*/operations/*}:cancel', + ], + ], + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'GetOperation' => [ + 'method' => 'get', + 'uriTemplate' => '/v2/{name=projects/*/operations/*}', + 'additionalBindings' => [ + [ + 'method' => 'get', + 'uriTemplate' => '/v2/{name=projects/*/locations/*/operations/*}', + ], + ], + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'ListOperations' => [ + 'method' => 'get', + 'uriTemplate' => '/v2/{name=projects/*}/operations', + 'additionalBindings' => [ + [ + 'method' => 'get', + 'uriTemplate' => '/v2/{name=projects/*/locations/*}/operations', + ], + ], + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + ], + ], + 'numericEnums' => true, +]; diff --git a/owl-bot-staging/Dialogflow/v2/src/V2/resources/conversation_profiles_client_config.json b/owl-bot-staging/Dialogflow/v2/src/V2/resources/conversation_profiles_client_config.json new file mode 100644 index 000000000000..2898ad3018aa --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/src/V2/resources/conversation_profiles_client_config.json @@ -0,0 +1,79 @@ +{ + "interfaces": { + "google.cloud.dialogflow.v2.ConversationProfiles": { + "retry_codes": { + "no_retry_codes": [], + "retry_policy_1_codes": [ + "UNAVAILABLE" + ] + }, + "retry_params": { + "no_retry_params": { + "initial_retry_delay_millis": 0, + "retry_delay_multiplier": 0.0, + "max_retry_delay_millis": 0, + "initial_rpc_timeout_millis": 0, + "rpc_timeout_multiplier": 1.0, + "max_rpc_timeout_millis": 0, + "total_timeout_millis": 0 + }, + "retry_policy_1_params": { + "initial_retry_delay_millis": 100, + "retry_delay_multiplier": 1.3, + "max_retry_delay_millis": 60000, + "initial_rpc_timeout_millis": 60000, + "rpc_timeout_multiplier": 1.0, + "max_rpc_timeout_millis": 60000, + "total_timeout_millis": 60000 + } + }, + "methods": { + "ClearSuggestionFeatureConfig": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "CreateConversationProfile": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "DeleteConversationProfile": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "GetConversationProfile": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "ListConversationProfiles": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "SetSuggestionFeatureConfig": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "UpdateConversationProfile": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "GetLocation": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "ListLocations": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + } + } + } + } +} diff --git a/owl-bot-staging/Dialogflow/v2/src/V2/resources/conversation_profiles_descriptor_config.php b/owl-bot-staging/Dialogflow/v2/src/V2/resources/conversation_profiles_descriptor_config.php new file mode 100644 index 000000000000..ce49f95426be --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/src/V2/resources/conversation_profiles_descriptor_config.php @@ -0,0 +1,190 @@ + [ + 'google.cloud.dialogflow.v2.ConversationProfiles' => [ + 'ClearSuggestionFeatureConfig' => [ + 'longRunning' => [ + 'operationReturnType' => '\Google\Cloud\Dialogflow\V2\ConversationProfile', + 'metadataReturnType' => '\Google\Cloud\Dialogflow\V2\ClearSuggestionFeatureConfigOperationMetadata', + 'initialPollDelayMillis' => '500', + 'pollDelayMultiplier' => '1.5', + 'maxPollDelayMillis' => '5000', + 'totalPollTimeoutMillis' => '300000', + ], + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'conversation_profile', + 'fieldAccessors' => [ + 'getConversationProfile', + ], + ], + ], + ], + 'SetSuggestionFeatureConfig' => [ + 'longRunning' => [ + 'operationReturnType' => '\Google\Cloud\Dialogflow\V2\ConversationProfile', + 'metadataReturnType' => '\Google\Cloud\Dialogflow\V2\SetSuggestionFeatureConfigOperationMetadata', + 'initialPollDelayMillis' => '500', + 'pollDelayMultiplier' => '1.5', + 'maxPollDelayMillis' => '5000', + 'totalPollTimeoutMillis' => '300000', + ], + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'conversation_profile', + 'fieldAccessors' => [ + 'getConversationProfile', + ], + ], + ], + ], + 'CreateConversationProfile' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Dialogflow\V2\ConversationProfile', + 'headerParams' => [ + [ + 'keyName' => 'parent', + 'fieldAccessors' => [ + 'getParent', + ], + ], + ], + ], + 'DeleteConversationProfile' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Protobuf\GPBEmpty', + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + ], + 'GetConversationProfile' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Dialogflow\V2\ConversationProfile', + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + ], + 'ListConversationProfiles' => [ + 'pageStreaming' => [ + 'requestPageTokenGetMethod' => 'getPageToken', + 'requestPageTokenSetMethod' => 'setPageToken', + 'requestPageSizeGetMethod' => 'getPageSize', + 'requestPageSizeSetMethod' => 'setPageSize', + 'responsePageTokenGetMethod' => 'getNextPageToken', + 'resourcesGetMethod' => 'getConversationProfiles', + ], + 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, + 'responseType' => 'Google\Cloud\Dialogflow\V2\ListConversationProfilesResponse', + 'headerParams' => [ + [ + 'keyName' => 'parent', + 'fieldAccessors' => [ + 'getParent', + ], + ], + ], + ], + 'UpdateConversationProfile' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Dialogflow\V2\ConversationProfile', + 'headerParams' => [ + [ + 'keyName' => 'conversation_profile.name', + 'fieldAccessors' => [ + 'getConversationProfile', + 'getName', + ], + ], + ], + ], + 'GetLocation' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Location\Location', + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + 'interfaceOverride' => 'google.cloud.location.Locations', + ], + 'ListLocations' => [ + 'pageStreaming' => [ + 'requestPageTokenGetMethod' => 'getPageToken', + 'requestPageTokenSetMethod' => 'setPageToken', + 'requestPageSizeGetMethod' => 'getPageSize', + 'requestPageSizeSetMethod' => 'setPageSize', + 'responsePageTokenGetMethod' => 'getNextPageToken', + 'resourcesGetMethod' => 'getLocations', + ], + 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, + 'responseType' => 'Google\Cloud\Location\ListLocationsResponse', + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + 'interfaceOverride' => 'google.cloud.location.Locations', + ], + 'templateMap' => [ + 'agent' => 'projects/{project}/agent', + 'cXSecuritySettings' => 'projects/{project}/locations/{location}/securitySettings/{security_settings}', + 'conversationModel' => 'projects/{project}/locations/{location}/conversationModels/{conversation_model}', + 'conversationProfile' => 'projects/{project}/conversationProfiles/{conversation_profile}', + 'document' => 'projects/{project}/knowledgeBases/{knowledge_base}/documents/{document}', + 'generator' => 'projects/{project}/locations/{location}/generators/{generator}', + 'knowledgeBase' => 'projects/{project}/knowledgeBases/{knowledge_base}', + 'location' => 'projects/{project}/locations/{location}', + '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..9c3334ecb6b2 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/src/V2/resources/conversation_profiles_rest_client_config.php @@ -0,0 +1,240 @@ + [ + 'google.cloud.dialogflow.v2.ConversationProfiles' => [ + 'ClearSuggestionFeatureConfig' => [ + 'method' => 'post', + 'uriTemplate' => '/v2/{conversation_profile=projects/*/conversationProfiles/*}:clearSuggestionFeatureConfig', + 'body' => '*', + 'additionalBindings' => [ + [ + 'method' => 'post', + 'uriTemplate' => '/v2/{conversation_profile=projects/*/locations/*/conversationProfiles/*}:clearSuggestionFeatureConfig', + 'body' => '*', + ], + ], + 'placeholders' => [ + 'conversation_profile' => [ + 'getters' => [ + 'getConversationProfile', + ], + ], + ], + ], + 'CreateConversationProfile' => [ + 'method' => 'post', + 'uriTemplate' => '/v2/{parent=projects/*}/conversationProfiles', + 'body' => 'conversation_profile', + 'additionalBindings' => [ + [ + 'method' => 'post', + 'uriTemplate' => '/v2/{parent=projects/*/locations/*}/conversationProfiles', + 'body' => 'conversation_profile', + ], + ], + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + ], + 'DeleteConversationProfile' => [ + 'method' => 'delete', + 'uriTemplate' => '/v2/{name=projects/*/conversationProfiles/*}', + 'additionalBindings' => [ + [ + 'method' => 'delete', + 'uriTemplate' => '/v2/{name=projects/*/locations/*/conversationProfiles/*}', + ], + ], + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'GetConversationProfile' => [ + 'method' => 'get', + 'uriTemplate' => '/v2/{name=projects/*/conversationProfiles/*}', + 'additionalBindings' => [ + [ + 'method' => 'get', + 'uriTemplate' => '/v2/{name=projects/*/locations/*/conversationProfiles/*}', + ], + ], + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'ListConversationProfiles' => [ + 'method' => 'get', + 'uriTemplate' => '/v2/{parent=projects/*}/conversationProfiles', + 'additionalBindings' => [ + [ + 'method' => 'get', + 'uriTemplate' => '/v2/{parent=projects/*/locations/*}/conversationProfiles', + ], + ], + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + ], + 'SetSuggestionFeatureConfig' => [ + 'method' => 'post', + 'uriTemplate' => '/v2/{conversation_profile=projects/*/conversationProfiles/*}:setSuggestionFeatureConfig', + 'body' => '*', + 'additionalBindings' => [ + [ + 'method' => 'post', + 'uriTemplate' => '/v2/{conversation_profile=projects/*/locations/*/conversationProfiles/*}:setSuggestionFeatureConfig', + 'body' => '*', + ], + ], + 'placeholders' => [ + 'conversation_profile' => [ + 'getters' => [ + 'getConversationProfile', + ], + ], + ], + ], + 'UpdateConversationProfile' => [ + 'method' => 'patch', + 'uriTemplate' => '/v2/{conversation_profile.name=projects/*/conversationProfiles/*}', + 'body' => 'conversation_profile', + 'additionalBindings' => [ + [ + 'method' => 'patch', + 'uriTemplate' => '/v2/{conversation_profile.name=projects/*/locations/*/conversationProfiles/*}', + 'body' => 'conversation_profile', + 'queryParams' => [ + 'update_mask', + ], + ], + ], + 'placeholders' => [ + 'conversation_profile.name' => [ + 'getters' => [ + 'getConversationProfile', + 'getName', + ], + ], + ], + 'queryParams' => [ + 'update_mask', + ], + ], + ], + 'google.cloud.location.Locations' => [ + 'GetLocation' => [ + 'method' => 'get', + 'uriTemplate' => '/v2/{name=projects/*/locations/*}', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'ListLocations' => [ + 'method' => 'get', + 'uriTemplate' => '/v2/{name=projects/*}/locations', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + ], + 'google.longrunning.Operations' => [ + 'CancelOperation' => [ + 'method' => 'post', + 'uriTemplate' => '/v2/{name=projects/*/operations/*}:cancel', + 'additionalBindings' => [ + [ + 'method' => 'post', + 'uriTemplate' => '/v2/{name=projects/*/locations/*/operations/*}:cancel', + ], + ], + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'GetOperation' => [ + 'method' => 'get', + 'uriTemplate' => '/v2/{name=projects/*/operations/*}', + 'additionalBindings' => [ + [ + 'method' => 'get', + 'uriTemplate' => '/v2/{name=projects/*/locations/*/operations/*}', + ], + ], + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'ListOperations' => [ + 'method' => 'get', + 'uriTemplate' => '/v2/{name=projects/*}/operations', + 'additionalBindings' => [ + [ + 'method' => 'get', + 'uriTemplate' => '/v2/{name=projects/*/locations/*}/operations', + ], + ], + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + ], + ], + 'numericEnums' => true, +]; diff --git a/owl-bot-staging/Dialogflow/v2/src/V2/resources/conversations_client_config.json b/owl-bot-staging/Dialogflow/v2/src/V2/resources/conversations_client_config.json new file mode 100644 index 000000000000..878520b39759 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/src/V2/resources/conversations_client_config.json @@ -0,0 +1,89 @@ +{ + "interfaces": { + "google.cloud.dialogflow.v2.Conversations": { + "retry_codes": { + "no_retry_codes": [], + "retry_policy_1_codes": [ + "UNAVAILABLE" + ] + }, + "retry_params": { + "no_retry_params": { + "initial_retry_delay_millis": 0, + "retry_delay_multiplier": 0.0, + "max_retry_delay_millis": 0, + "initial_rpc_timeout_millis": 0, + "rpc_timeout_multiplier": 1.0, + "max_rpc_timeout_millis": 0, + "total_timeout_millis": 0 + }, + "retry_policy_1_params": { + "initial_retry_delay_millis": 100, + "retry_delay_multiplier": 1.3, + "max_retry_delay_millis": 60000, + "initial_rpc_timeout_millis": 60000, + "rpc_timeout_multiplier": 1.0, + "max_rpc_timeout_millis": 60000, + "total_timeout_millis": 60000 + } + }, + "methods": { + "CompleteConversation": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "CreateConversation": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "GenerateStatelessSuggestion": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "GenerateStatelessSummary": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "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" + }, + "SearchKnowledge": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "SuggestConversationSummary": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "GetLocation": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "ListLocations": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + } + } + } + } +} diff --git a/owl-bot-staging/Dialogflow/v2/src/V2/resources/conversations_descriptor_config.php b/owl-bot-staging/Dialogflow/v2/src/V2/resources/conversations_descriptor_config.php new file mode 100644 index 000000000000..f9b401400daa --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/src/V2/resources/conversations_descriptor_config.php @@ -0,0 +1,220 @@ + [ + 'google.cloud.dialogflow.v2.Conversations' => [ + 'CompleteConversation' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Dialogflow\V2\Conversation', + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + ], + 'CreateConversation' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Dialogflow\V2\Conversation', + 'headerParams' => [ + [ + 'keyName' => 'parent', + 'fieldAccessors' => [ + 'getParent', + ], + ], + ], + ], + 'GenerateStatelessSuggestion' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Dialogflow\V2\GenerateStatelessSuggestionResponse', + 'headerParams' => [ + [ + 'keyName' => 'parent', + 'fieldAccessors' => [ + 'getParent', + ], + ], + ], + ], + 'GenerateStatelessSummary' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Dialogflow\V2\GenerateStatelessSummaryResponse', + 'headerParams' => [ + [ + 'keyName' => 'stateless_conversation.parent', + 'fieldAccessors' => [ + 'getStatelessConversation', + 'getParent', + ], + ], + ], + ], + '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', + ], + ], + ], + ], + 'SearchKnowledge' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Dialogflow\V2\SearchKnowledgeResponse', + 'headerParams' => [ + [ + 'keyName' => 'parent', + 'fieldAccessors' => [ + 'getParent', + ], + ], + [ + 'keyName' => 'conversation', + 'fieldAccessors' => [ + 'getConversation', + ], + ], + ], + ], + 'SuggestConversationSummary' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Dialogflow\V2\SuggestConversationSummaryResponse', + 'headerParams' => [ + [ + 'keyName' => 'conversation', + 'fieldAccessors' => [ + 'getConversation', + ], + ], + ], + ], + 'GetLocation' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Location\Location', + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + 'interfaceOverride' => 'google.cloud.location.Locations', + ], + 'ListLocations' => [ + 'pageStreaming' => [ + 'requestPageTokenGetMethod' => 'getPageToken', + 'requestPageTokenSetMethod' => 'setPageToken', + 'requestPageSizeGetMethod' => 'getPageSize', + 'requestPageSizeSetMethod' => 'setPageSize', + 'responsePageTokenGetMethod' => 'getNextPageToken', + 'resourcesGetMethod' => 'getLocations', + ], + 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, + 'responseType' => 'Google\Cloud\Location\ListLocationsResponse', + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + 'interfaceOverride' => 'google.cloud.location.Locations', + ], + 'templateMap' => [ + 'agent' => 'projects/{project}/agent', + '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}', + 'generator' => 'projects/{project}/locations/{location}/generators/{generator}', + 'knowledgeBase' => 'projects/{project}/knowledgeBases/{knowledge_base}', + 'location' => 'projects/{project}/locations/{location}', + 'message' => 'projects/{project}/conversations/{conversation}/messages/{message}', + '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..a580c91404b4 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/src/V2/resources/conversations_rest_client_config.php @@ -0,0 +1,280 @@ + [ + 'google.cloud.dialogflow.v2.Conversations' => [ + 'CompleteConversation' => [ + 'method' => 'post', + 'uriTemplate' => '/v2/{name=projects/*/conversations/*}:complete', + 'body' => '*', + 'additionalBindings' => [ + [ + 'method' => 'post', + 'uriTemplate' => '/v2/{name=projects/*/locations/*/conversations/*}:complete', + 'body' => '*', + ], + ], + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'CreateConversation' => [ + 'method' => 'post', + 'uriTemplate' => '/v2/{parent=projects/*}/conversations', + 'body' => 'conversation', + 'additionalBindings' => [ + [ + 'method' => 'post', + 'uriTemplate' => '/v2/{parent=projects/*/locations/*}/conversations', + 'body' => 'conversation', + ], + ], + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + ], + 'GenerateStatelessSuggestion' => [ + 'method' => 'post', + 'uriTemplate' => '/v2/{parent=projects/*/locations/*}/statelessSuggestion:generate', + 'body' => '*', + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + ], + 'GenerateStatelessSummary' => [ + 'method' => 'post', + 'uriTemplate' => '/v2/{stateless_conversation.parent=projects/*}/suggestions:generateStatelessSummary', + 'body' => '*', + 'additionalBindings' => [ + [ + 'method' => 'post', + 'uriTemplate' => '/v2/{stateless_conversation.parent=projects/*/locations/*}/suggestions:generateStatelessSummary', + 'body' => '*', + ], + ], + 'placeholders' => [ + 'stateless_conversation.parent' => [ + 'getters' => [ + 'getStatelessConversation', + 'getParent', + ], + ], + ], + ], + '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', + ], + ], + ], + ], + 'SearchKnowledge' => [ + 'method' => 'post', + 'uriTemplate' => '/v2/{parent=projects/*}/suggestions:searchKnowledge', + 'body' => '*', + 'additionalBindings' => [ + [ + 'method' => 'post', + 'uriTemplate' => '/v2/{parent=projects/*/locations/*}/suggestions:searchKnowledge', + 'body' => '*', + ], + [ + 'method' => 'post', + 'uriTemplate' => '/v2/{conversation=projects/*/conversations/*}/suggestions:searchKnowledge', + 'body' => '*', + ], + [ + 'method' => 'post', + 'uriTemplate' => '/v2/{conversation=projects/*/locations/*/conversations/*}/suggestions:searchKnowledge', + 'body' => '*', + ], + ], + 'placeholders' => [ + 'conversation' => [ + 'getters' => [ + 'getConversation', + ], + ], + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + ], + 'SuggestConversationSummary' => [ + 'method' => 'post', + 'uriTemplate' => '/v2/{conversation=projects/*/conversations/*}/suggestions:suggestConversationSummary', + 'body' => '*', + 'additionalBindings' => [ + [ + 'method' => 'post', + 'uriTemplate' => '/v2/{conversation=projects/*/locations/*/conversations/*}/suggestions:suggestConversationSummary', + 'body' => '*', + ], + ], + 'placeholders' => [ + 'conversation' => [ + 'getters' => [ + 'getConversation', + ], + ], + ], + ], + ], + 'google.cloud.location.Locations' => [ + 'GetLocation' => [ + 'method' => 'get', + 'uriTemplate' => '/v2/{name=projects/*/locations/*}', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'ListLocations' => [ + 'method' => 'get', + 'uriTemplate' => '/v2/{name=projects/*}/locations', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + ], + 'google.longrunning.Operations' => [ + 'CancelOperation' => [ + 'method' => 'post', + 'uriTemplate' => '/v2/{name=projects/*/operations/*}:cancel', + 'additionalBindings' => [ + [ + 'method' => 'post', + 'uriTemplate' => '/v2/{name=projects/*/locations/*/operations/*}:cancel', + ], + ], + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'GetOperation' => [ + 'method' => 'get', + 'uriTemplate' => '/v2/{name=projects/*/operations/*}', + 'additionalBindings' => [ + [ + 'method' => 'get', + 'uriTemplate' => '/v2/{name=projects/*/locations/*/operations/*}', + ], + ], + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'ListOperations' => [ + 'method' => 'get', + 'uriTemplate' => '/v2/{name=projects/*}/operations', + 'additionalBindings' => [ + [ + 'method' => 'get', + 'uriTemplate' => '/v2/{name=projects/*/locations/*}/operations', + ], + ], + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + ], + ], + 'numericEnums' => true, +]; diff --git a/owl-bot-staging/Dialogflow/v2/src/V2/resources/documents_client_config.json b/owl-bot-staging/Dialogflow/v2/src/V2/resources/documents_client_config.json new file mode 100644 index 000000000000..aaddca9c9fcc --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/src/V2/resources/documents_client_config.json @@ -0,0 +1,84 @@ +{ + "interfaces": { + "google.cloud.dialogflow.v2.Documents": { + "retry_codes": { + "no_retry_codes": [], + "retry_policy_1_codes": [ + "UNAVAILABLE" + ] + }, + "retry_params": { + "no_retry_params": { + "initial_retry_delay_millis": 0, + "retry_delay_multiplier": 0.0, + "max_retry_delay_millis": 0, + "initial_rpc_timeout_millis": 0, + "rpc_timeout_multiplier": 1.0, + "max_rpc_timeout_millis": 0, + "total_timeout_millis": 0 + }, + "retry_policy_1_params": { + "initial_retry_delay_millis": 100, + "retry_delay_multiplier": 1.3, + "max_retry_delay_millis": 60000, + "initial_rpc_timeout_millis": 60000, + "rpc_timeout_multiplier": 1.0, + "max_rpc_timeout_millis": 60000, + "total_timeout_millis": 60000 + } + }, + "methods": { + "CreateDocument": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "DeleteDocument": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "ExportDocument": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "GetDocument": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "ImportDocuments": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "ListDocuments": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "ReloadDocument": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "UpdateDocument": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "GetLocation": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "ListLocations": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + } + } + } + } +} diff --git a/owl-bot-staging/Dialogflow/v2/src/V2/resources/documents_descriptor_config.php b/owl-bot-staging/Dialogflow/v2/src/V2/resources/documents_descriptor_config.php new file mode 100644 index 000000000000..ddeba0eff1ea --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/src/V2/resources/documents_descriptor_config.php @@ -0,0 +1,217 @@ + [ + 'google.cloud.dialogflow.v2.Documents' => [ + 'CreateDocument' => [ + 'longRunning' => [ + 'operationReturnType' => '\Google\Cloud\Dialogflow\V2\Document', + 'metadataReturnType' => '\Google\Cloud\Dialogflow\V2\KnowledgeOperationMetadata', + 'initialPollDelayMillis' => '500', + 'pollDelayMultiplier' => '1.5', + 'maxPollDelayMillis' => '5000', + 'totalPollTimeoutMillis' => '300000', + ], + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'parent', + 'fieldAccessors' => [ + 'getParent', + ], + ], + ], + ], + 'DeleteDocument' => [ + 'longRunning' => [ + 'operationReturnType' => '\Google\Protobuf\GPBEmpty', + 'metadataReturnType' => '\Google\Cloud\Dialogflow\V2\KnowledgeOperationMetadata', + 'initialPollDelayMillis' => '500', + 'pollDelayMultiplier' => '1.5', + 'maxPollDelayMillis' => '5000', + 'totalPollTimeoutMillis' => '300000', + ], + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + ], + 'ExportDocument' => [ + 'longRunning' => [ + 'operationReturnType' => '\Google\Cloud\Dialogflow\V2\Document', + 'metadataReturnType' => '\Google\Cloud\Dialogflow\V2\KnowledgeOperationMetadata', + 'initialPollDelayMillis' => '500', + 'pollDelayMultiplier' => '1.5', + 'maxPollDelayMillis' => '5000', + 'totalPollTimeoutMillis' => '300000', + ], + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + ], + 'ImportDocuments' => [ + 'longRunning' => [ + 'operationReturnType' => '\Google\Cloud\Dialogflow\V2\ImportDocumentsResponse', + 'metadataReturnType' => '\Google\Cloud\Dialogflow\V2\KnowledgeOperationMetadata', + 'initialPollDelayMillis' => '500', + 'pollDelayMultiplier' => '1.5', + 'maxPollDelayMillis' => '5000', + 'totalPollTimeoutMillis' => '300000', + ], + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'parent', + 'fieldAccessors' => [ + 'getParent', + ], + ], + ], + ], + 'ReloadDocument' => [ + 'longRunning' => [ + 'operationReturnType' => '\Google\Cloud\Dialogflow\V2\Document', + 'metadataReturnType' => '\Google\Cloud\Dialogflow\V2\KnowledgeOperationMetadata', + 'initialPollDelayMillis' => '500', + 'pollDelayMultiplier' => '1.5', + 'maxPollDelayMillis' => '5000', + 'totalPollTimeoutMillis' => '300000', + ], + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + ], + 'UpdateDocument' => [ + 'longRunning' => [ + 'operationReturnType' => '\Google\Cloud\Dialogflow\V2\Document', + 'metadataReturnType' => '\Google\Cloud\Dialogflow\V2\KnowledgeOperationMetadata', + 'initialPollDelayMillis' => '500', + 'pollDelayMultiplier' => '1.5', + 'maxPollDelayMillis' => '5000', + 'totalPollTimeoutMillis' => '300000', + ], + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'document.name', + 'fieldAccessors' => [ + 'getDocument', + 'getName', + ], + ], + ], + ], + 'GetDocument' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Dialogflow\V2\Document', + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + ], + 'ListDocuments' => [ + 'pageStreaming' => [ + 'requestPageTokenGetMethod' => 'getPageToken', + 'requestPageTokenSetMethod' => 'setPageToken', + 'requestPageSizeGetMethod' => 'getPageSize', + 'requestPageSizeSetMethod' => 'setPageSize', + 'responsePageTokenGetMethod' => 'getNextPageToken', + 'resourcesGetMethod' => 'getDocuments', + ], + 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, + 'responseType' => 'Google\Cloud\Dialogflow\V2\ListDocumentsResponse', + 'headerParams' => [ + [ + 'keyName' => 'parent', + 'fieldAccessors' => [ + 'getParent', + ], + ], + ], + ], + 'GetLocation' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Location\Location', + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + 'interfaceOverride' => 'google.cloud.location.Locations', + ], + 'ListLocations' => [ + 'pageStreaming' => [ + 'requestPageTokenGetMethod' => 'getPageToken', + 'requestPageTokenSetMethod' => 'setPageToken', + 'requestPageSizeGetMethod' => 'getPageSize', + 'requestPageSizeSetMethod' => 'setPageSize', + 'responsePageTokenGetMethod' => 'getNextPageToken', + 'resourcesGetMethod' => 'getLocations', + ], + 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, + 'responseType' => 'Google\Cloud\Location\ListLocationsResponse', + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + 'interfaceOverride' => 'google.cloud.location.Locations', + ], + 'templateMap' => [ + 'document' => 'projects/{project}/knowledgeBases/{knowledge_base}/documents/{document}', + 'knowledgeBase' => 'projects/{project}/knowledgeBases/{knowledge_base}', + 'projectKnowledgeBase' => 'projects/{project}/knowledgeBases/{knowledge_base}', + 'projectKnowledgeBaseDocument' => 'projects/{project}/knowledgeBases/{knowledge_base}/documents/{document}', + 'projectLocationKnowledgeBase' => 'projects/{project}/locations/{location}/knowledgeBases/{knowledge_base}', + 'projectLocationKnowledgeBaseDocument' => 'projects/{project}/locations/{location}/knowledgeBases/{knowledge_base}/documents/{document}', + ], + ], + ], +]; diff --git a/owl-bot-staging/Dialogflow/v2/src/V2/resources/documents_rest_client_config.php b/owl-bot-staging/Dialogflow/v2/src/V2/resources/documents_rest_client_config.php new file mode 100644 index 000000000000..22061213478a --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/src/V2/resources/documents_rest_client_config.php @@ -0,0 +1,280 @@ + [ + 'google.cloud.dialogflow.v2.Documents' => [ + 'CreateDocument' => [ + 'method' => 'post', + 'uriTemplate' => '/v2/{parent=projects/*/knowledgeBases/*}/documents', + 'body' => 'document', + 'additionalBindings' => [ + [ + 'method' => 'post', + 'uriTemplate' => '/v2/{parent=projects/*/locations/*/knowledgeBases/*}/documents', + 'body' => 'document', + ], + [ + 'method' => 'post', + 'uriTemplate' => '/v2/{parent=projects/*/agent/knowledgeBases/*}/documents', + 'body' => 'document', + ], + ], + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + ], + 'DeleteDocument' => [ + 'method' => 'delete', + 'uriTemplate' => '/v2/{name=projects/*/knowledgeBases/*/documents/*}', + 'additionalBindings' => [ + [ + 'method' => 'delete', + 'uriTemplate' => '/v2/{name=projects/*/locations/*/knowledgeBases/*/documents/*}', + ], + [ + 'method' => 'delete', + 'uriTemplate' => '/v2/{name=projects/*/agent/knowledgeBases/*/documents/*}', + ], + ], + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'ExportDocument' => [ + 'method' => 'post', + 'uriTemplate' => '/v2/{name=projects/*/knowledgeBases/*/documents/*}:export', + 'body' => '*', + 'additionalBindings' => [ + [ + 'method' => 'post', + 'uriTemplate' => '/v2/{name=projects/*/locations/*/knowledgeBases/*/documents/*}:export', + 'body' => '*', + ], + ], + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'GetDocument' => [ + 'method' => 'get', + 'uriTemplate' => '/v2/{name=projects/*/knowledgeBases/*/documents/*}', + 'additionalBindings' => [ + [ + 'method' => 'get', + 'uriTemplate' => '/v2/{name=projects/*/locations/*/knowledgeBases/*/documents/*}', + ], + [ + 'method' => 'get', + 'uriTemplate' => '/v2/{name=projects/*/agent/knowledgeBases/*/documents/*}', + ], + ], + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'ImportDocuments' => [ + 'method' => 'post', + 'uriTemplate' => '/v2/{parent=projects/*/knowledgeBases/*}/documents:import', + 'body' => '*', + 'additionalBindings' => [ + [ + 'method' => 'post', + 'uriTemplate' => '/v2/{parent=projects/*/locations/*/knowledgeBases/*}/documents:import', + 'body' => '*', + ], + ], + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + ], + 'ListDocuments' => [ + 'method' => 'get', + 'uriTemplate' => '/v2/{parent=projects/*/knowledgeBases/*}/documents', + 'additionalBindings' => [ + [ + 'method' => 'get', + 'uriTemplate' => '/v2/{parent=projects/*/locations/*/knowledgeBases/*}/documents', + ], + [ + 'method' => 'get', + 'uriTemplate' => '/v2/{parent=projects/*/agent/knowledgeBases/*}/documents', + ], + ], + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + ], + 'ReloadDocument' => [ + 'method' => 'post', + 'uriTemplate' => '/v2/{name=projects/*/knowledgeBases/*/documents/*}:reload', + 'body' => '*', + 'additionalBindings' => [ + [ + 'method' => 'post', + 'uriTemplate' => '/v2/{name=projects/*/locations/*/knowledgeBases/*/documents/*}:reload', + 'body' => '*', + ], + [ + 'method' => 'post', + 'uriTemplate' => '/v2/{name=projects/*/agent/knowledgeBases/*/documents/*}:reload', + 'body' => '*', + ], + ], + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'UpdateDocument' => [ + 'method' => 'patch', + 'uriTemplate' => '/v2/{document.name=projects/*/knowledgeBases/*/documents/*}', + 'body' => 'document', + 'additionalBindings' => [ + [ + 'method' => 'patch', + 'uriTemplate' => '/v2/{document.name=projects/*/locations/*/knowledgeBases/*/documents/*}', + 'body' => 'document', + ], + [ + 'method' => 'patch', + 'uriTemplate' => '/v2/{document.name=projects/*/agent/knowledgeBases/*/documents/*}', + 'body' => 'document', + ], + ], + 'placeholders' => [ + 'document.name' => [ + 'getters' => [ + 'getDocument', + 'getName', + ], + ], + ], + ], + ], + 'google.cloud.location.Locations' => [ + 'GetLocation' => [ + 'method' => 'get', + 'uriTemplate' => '/v2/{name=projects/*/locations/*}', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'ListLocations' => [ + 'method' => 'get', + 'uriTemplate' => '/v2/{name=projects/*}/locations', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + ], + 'google.longrunning.Operations' => [ + 'CancelOperation' => [ + 'method' => 'post', + 'uriTemplate' => '/v2/{name=projects/*/operations/*}:cancel', + 'additionalBindings' => [ + [ + 'method' => 'post', + 'uriTemplate' => '/v2/{name=projects/*/locations/*/operations/*}:cancel', + ], + ], + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'GetOperation' => [ + 'method' => 'get', + 'uriTemplate' => '/v2/{name=projects/*/operations/*}', + 'additionalBindings' => [ + [ + 'method' => 'get', + 'uriTemplate' => '/v2/{name=projects/*/locations/*/operations/*}', + ], + ], + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'ListOperations' => [ + 'method' => 'get', + 'uriTemplate' => '/v2/{name=projects/*}/operations', + 'additionalBindings' => [ + [ + 'method' => 'get', + 'uriTemplate' => '/v2/{name=projects/*/locations/*}/operations', + ], + ], + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + ], + ], + 'numericEnums' => true, +]; diff --git a/owl-bot-staging/Dialogflow/v2/src/V2/resources/encryption_spec_service_client_config.json b/owl-bot-staging/Dialogflow/v2/src/V2/resources/encryption_spec_service_client_config.json new file mode 100644 index 000000000000..ad9d113f458b --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/src/V2/resources/encryption_spec_service_client_config.json @@ -0,0 +1,54 @@ +{ + "interfaces": { + "google.cloud.dialogflow.v2.EncryptionSpecService": { + "retry_codes": { + "no_retry_codes": [], + "retry_policy_1_codes": [ + "UNAVAILABLE" + ] + }, + "retry_params": { + "no_retry_params": { + "initial_retry_delay_millis": 0, + "retry_delay_multiplier": 0.0, + "max_retry_delay_millis": 0, + "initial_rpc_timeout_millis": 0, + "rpc_timeout_multiplier": 1.0, + "max_rpc_timeout_millis": 0, + "total_timeout_millis": 0 + }, + "retry_policy_1_params": { + "initial_retry_delay_millis": 100, + "retry_delay_multiplier": 1.3, + "max_retry_delay_millis": 60000, + "initial_rpc_timeout_millis": 60000, + "rpc_timeout_multiplier": 1.0, + "max_rpc_timeout_millis": 60000, + "total_timeout_millis": 60000 + } + }, + "methods": { + "GetEncryptionSpec": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "InitializeEncryptionSpec": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "GetLocation": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "ListLocations": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + } + } + } + } +} diff --git a/owl-bot-staging/Dialogflow/v2/src/V2/resources/encryption_spec_service_descriptor_config.php b/owl-bot-staging/Dialogflow/v2/src/V2/resources/encryption_spec_service_descriptor_config.php new file mode 100644 index 000000000000..64e32d6895fe --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/src/V2/resources/encryption_spec_service_descriptor_config.php @@ -0,0 +1,97 @@ + [ + 'google.cloud.dialogflow.v2.EncryptionSpecService' => [ + 'InitializeEncryptionSpec' => [ + 'longRunning' => [ + 'operationReturnType' => '\Google\Cloud\Dialogflow\V2\InitializeEncryptionSpecResponse', + 'metadataReturnType' => '\Google\Cloud\Dialogflow\V2\InitializeEncryptionSpecMetadata', + 'initialPollDelayMillis' => '500', + 'pollDelayMultiplier' => '1.5', + 'maxPollDelayMillis' => '5000', + 'totalPollTimeoutMillis' => '300000', + ], + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'encryption_spec.name', + 'fieldAccessors' => [ + 'getEncryptionSpec', + 'getName', + ], + ], + ], + ], + 'GetEncryptionSpec' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Dialogflow\V2\EncryptionSpec', + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + ], + 'GetLocation' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Location\Location', + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + 'interfaceOverride' => 'google.cloud.location.Locations', + ], + 'ListLocations' => [ + 'pageStreaming' => [ + 'requestPageTokenGetMethod' => 'getPageToken', + 'requestPageTokenSetMethod' => 'setPageToken', + 'requestPageSizeGetMethod' => 'getPageSize', + 'requestPageSizeSetMethod' => 'setPageSize', + 'responsePageTokenGetMethod' => 'getNextPageToken', + 'resourcesGetMethod' => 'getLocations', + ], + 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, + 'responseType' => 'Google\Cloud\Location\ListLocationsResponse', + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + 'interfaceOverride' => 'google.cloud.location.Locations', + ], + 'templateMap' => [ + 'encryptionSpec' => 'projects/{project}/locations/{location}/encryptionSpec', + ], + ], + ], +]; diff --git a/owl-bot-staging/Dialogflow/v2/src/V2/resources/encryption_spec_service_rest_client_config.php b/owl-bot-staging/Dialogflow/v2/src/V2/resources/encryption_spec_service_rest_client_config.php new file mode 100644 index 000000000000..ecf32803adf1 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/src/V2/resources/encryption_spec_service_rest_client_config.php @@ -0,0 +1,130 @@ + [ + 'google.cloud.dialogflow.v2.EncryptionSpecService' => [ + 'GetEncryptionSpec' => [ + 'method' => 'get', + 'uriTemplate' => '/v2/{name=projects/*/locations/*/encryptionSpec}', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'InitializeEncryptionSpec' => [ + 'method' => 'post', + 'uriTemplate' => '/v2/{encryption_spec.name=projects/*/locations/*/encryptionSpec}:initialize', + 'body' => '*', + 'placeholders' => [ + 'encryption_spec.name' => [ + 'getters' => [ + 'getEncryptionSpec', + 'getName', + ], + ], + ], + ], + ], + 'google.cloud.location.Locations' => [ + 'GetLocation' => [ + 'method' => 'get', + 'uriTemplate' => '/v2/{name=projects/*/locations/*}', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'ListLocations' => [ + 'method' => 'get', + 'uriTemplate' => '/v2/{name=projects/*}/locations', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + ], + 'google.longrunning.Operations' => [ + 'CancelOperation' => [ + 'method' => 'post', + 'uriTemplate' => '/v2/{name=projects/*/operations/*}:cancel', + 'additionalBindings' => [ + [ + 'method' => 'post', + 'uriTemplate' => '/v2/{name=projects/*/locations/*/operations/*}:cancel', + ], + ], + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'GetOperation' => [ + 'method' => 'get', + 'uriTemplate' => '/v2/{name=projects/*/operations/*}', + 'additionalBindings' => [ + [ + 'method' => 'get', + 'uriTemplate' => '/v2/{name=projects/*/locations/*/operations/*}', + ], + ], + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'ListOperations' => [ + 'method' => 'get', + 'uriTemplate' => '/v2/{name=projects/*}/operations', + 'additionalBindings' => [ + [ + 'method' => 'get', + 'uriTemplate' => '/v2/{name=projects/*/locations/*}/operations', + ], + ], + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + ], + ], + 'numericEnums' => true, +]; diff --git a/owl-bot-staging/Dialogflow/v2/src/V2/resources/entity_types_client_config.json b/owl-bot-staging/Dialogflow/v2/src/V2/resources/entity_types_client_config.json new file mode 100644 index 000000000000..0380bfe8f674 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/src/V2/resources/entity_types_client_config.json @@ -0,0 +1,94 @@ +{ + "interfaces": { + "google.cloud.dialogflow.v2.EntityTypes": { + "retry_codes": { + "no_retry_codes": [], + "retry_policy_1_codes": [ + "UNAVAILABLE" + ] + }, + "retry_params": { + "no_retry_params": { + "initial_retry_delay_millis": 0, + "retry_delay_multiplier": 0.0, + "max_retry_delay_millis": 0, + "initial_rpc_timeout_millis": 0, + "rpc_timeout_multiplier": 1.0, + "max_rpc_timeout_millis": 0, + "total_timeout_millis": 0 + }, + "retry_policy_1_params": { + "initial_retry_delay_millis": 100, + "retry_delay_multiplier": 1.3, + "max_retry_delay_millis": 60000, + "initial_rpc_timeout_millis": 60000, + "rpc_timeout_multiplier": 1.0, + "max_rpc_timeout_millis": 60000, + "total_timeout_millis": 60000 + } + }, + "methods": { + "BatchCreateEntities": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "BatchDeleteEntities": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "BatchDeleteEntityTypes": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "BatchUpdateEntities": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "BatchUpdateEntityTypes": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "CreateEntityType": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "DeleteEntityType": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "GetEntityType": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "ListEntityTypes": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "UpdateEntityType": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "GetLocation": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "ListLocations": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + } + } + } + } +} diff --git a/owl-bot-staging/Dialogflow/v2/src/V2/resources/entity_types_descriptor_config.php b/owl-bot-staging/Dialogflow/v2/src/V2/resources/entity_types_descriptor_config.php new file mode 100644 index 000000000000..d9bd29f20e61 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/src/V2/resources/entity_types_descriptor_config.php @@ -0,0 +1,234 @@ + [ + 'google.cloud.dialogflow.v2.EntityTypes' => [ + 'BatchCreateEntities' => [ + 'longRunning' => [ + 'operationReturnType' => '\Google\Protobuf\GPBEmpty', + 'metadataReturnType' => '\Google\Protobuf\Struct', + 'initialPollDelayMillis' => '500', + 'pollDelayMultiplier' => '1.5', + 'maxPollDelayMillis' => '5000', + 'totalPollTimeoutMillis' => '300000', + ], + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'parent', + 'fieldAccessors' => [ + 'getParent', + ], + ], + ], + ], + 'BatchDeleteEntities' => [ + 'longRunning' => [ + 'operationReturnType' => '\Google\Protobuf\GPBEmpty', + 'metadataReturnType' => '\Google\Protobuf\Struct', + 'initialPollDelayMillis' => '500', + 'pollDelayMultiplier' => '1.5', + 'maxPollDelayMillis' => '5000', + 'totalPollTimeoutMillis' => '300000', + ], + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'parent', + 'fieldAccessors' => [ + 'getParent', + ], + ], + ], + ], + 'BatchDeleteEntityTypes' => [ + 'longRunning' => [ + 'operationReturnType' => '\Google\Protobuf\GPBEmpty', + 'metadataReturnType' => '\Google\Protobuf\Struct', + 'initialPollDelayMillis' => '500', + 'pollDelayMultiplier' => '1.5', + 'maxPollDelayMillis' => '5000', + 'totalPollTimeoutMillis' => '300000', + ], + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'parent', + 'fieldAccessors' => [ + 'getParent', + ], + ], + ], + ], + 'BatchUpdateEntities' => [ + 'longRunning' => [ + 'operationReturnType' => '\Google\Protobuf\GPBEmpty', + 'metadataReturnType' => '\Google\Protobuf\Struct', + 'initialPollDelayMillis' => '500', + 'pollDelayMultiplier' => '1.5', + 'maxPollDelayMillis' => '5000', + 'totalPollTimeoutMillis' => '300000', + ], + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'parent', + 'fieldAccessors' => [ + 'getParent', + ], + ], + ], + ], + 'BatchUpdateEntityTypes' => [ + 'longRunning' => [ + 'operationReturnType' => '\Google\Cloud\Dialogflow\V2\BatchUpdateEntityTypesResponse', + 'metadataReturnType' => '\Google\Protobuf\Struct', + 'initialPollDelayMillis' => '500', + 'pollDelayMultiplier' => '1.5', + 'maxPollDelayMillis' => '5000', + 'totalPollTimeoutMillis' => '300000', + ], + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'parent', + 'fieldAccessors' => [ + 'getParent', + ], + ], + ], + ], + 'CreateEntityType' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Dialogflow\V2\EntityType', + 'headerParams' => [ + [ + 'keyName' => 'parent', + 'fieldAccessors' => [ + 'getParent', + ], + ], + ], + ], + 'DeleteEntityType' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Protobuf\GPBEmpty', + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + ], + 'GetEntityType' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Dialogflow\V2\EntityType', + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + ], + 'ListEntityTypes' => [ + 'pageStreaming' => [ + 'requestPageTokenGetMethod' => 'getPageToken', + 'requestPageTokenSetMethod' => 'setPageToken', + 'requestPageSizeGetMethod' => 'getPageSize', + 'requestPageSizeSetMethod' => 'setPageSize', + 'responsePageTokenGetMethod' => 'getNextPageToken', + 'resourcesGetMethod' => 'getEntityTypes', + ], + 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, + 'responseType' => 'Google\Cloud\Dialogflow\V2\ListEntityTypesResponse', + 'headerParams' => [ + [ + 'keyName' => 'parent', + 'fieldAccessors' => [ + 'getParent', + ], + ], + ], + ], + 'UpdateEntityType' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Dialogflow\V2\EntityType', + 'headerParams' => [ + [ + 'keyName' => 'entity_type.name', + 'fieldAccessors' => [ + 'getEntityType', + 'getName', + ], + ], + ], + ], + 'GetLocation' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Location\Location', + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + 'interfaceOverride' => 'google.cloud.location.Locations', + ], + 'ListLocations' => [ + 'pageStreaming' => [ + 'requestPageTokenGetMethod' => 'getPageToken', + 'requestPageTokenSetMethod' => 'setPageToken', + 'requestPageSizeGetMethod' => 'getPageSize', + 'requestPageSizeSetMethod' => 'setPageSize', + 'responsePageTokenGetMethod' => 'getNextPageToken', + 'resourcesGetMethod' => 'getLocations', + ], + 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, + 'responseType' => 'Google\Cloud\Location\ListLocationsResponse', + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + 'interfaceOverride' => 'google.cloud.location.Locations', + ], + 'templateMap' => [ + 'agent' => 'projects/{project}/agent', + 'entityType' => 'projects/{project}/agent/entityTypes/{entity_type}', + 'projectAgent' => 'projects/{project}/agent', + 'projectEntityType' => 'projects/{project}/agent/entityTypes/{entity_type}', + 'projectLocationAgent' => 'projects/{project}/locations/{location}/agent', + 'projectLocationEntityType' => 'projects/{project}/locations/{location}/agent/entityTypes/{entity_type}', + ], + ], + ], +]; diff --git a/owl-bot-staging/Dialogflow/v2/src/V2/resources/entity_types_rest_client_config.php b/owl-bot-staging/Dialogflow/v2/src/V2/resources/entity_types_rest_client_config.php new file mode 100644 index 000000000000..1742fe996aa5 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/src/V2/resources/entity_types_rest_client_config.php @@ -0,0 +1,291 @@ + [ + 'google.cloud.dialogflow.v2.EntityTypes' => [ + 'BatchCreateEntities' => [ + 'method' => 'post', + 'uriTemplate' => '/v2/{parent=projects/*/agent/entityTypes/*}/entities:batchCreate', + 'body' => '*', + 'additionalBindings' => [ + [ + 'method' => 'post', + 'uriTemplate' => '/v2/{parent=projects/*/locations/*/agent/entityTypes/*}/entities:batchCreate', + 'body' => '*', + ], + ], + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + ], + 'BatchDeleteEntities' => [ + 'method' => 'post', + 'uriTemplate' => '/v2/{parent=projects/*/agent/entityTypes/*}/entities:batchDelete', + 'body' => '*', + 'additionalBindings' => [ + [ + 'method' => 'post', + 'uriTemplate' => '/v2/{parent=projects/*/locations/*/agent/entityTypes/*}/entities:batchDelete', + 'body' => '*', + ], + ], + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + ], + 'BatchDeleteEntityTypes' => [ + 'method' => 'post', + 'uriTemplate' => '/v2/{parent=projects/*/agent}/entityTypes:batchDelete', + 'body' => '*', + 'additionalBindings' => [ + [ + 'method' => 'post', + 'uriTemplate' => '/v2/{parent=projects/*/locations/*/agent}/entityTypes:batchDelete', + 'body' => '*', + ], + ], + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + ], + 'BatchUpdateEntities' => [ + 'method' => 'post', + 'uriTemplate' => '/v2/{parent=projects/*/agent/entityTypes/*}/entities:batchUpdate', + 'body' => '*', + 'additionalBindings' => [ + [ + 'method' => 'post', + 'uriTemplate' => '/v2/{parent=projects/*/locations/*/agent/entityTypes/*}/entities:batchUpdate', + 'body' => '*', + ], + ], + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + ], + 'BatchUpdateEntityTypes' => [ + 'method' => 'post', + 'uriTemplate' => '/v2/{parent=projects/*/agent}/entityTypes:batchUpdate', + 'body' => '*', + 'additionalBindings' => [ + [ + 'method' => 'post', + 'uriTemplate' => '/v2/{parent=projects/*/locations/*/agent}/entityTypes:batchUpdate', + 'body' => '*', + ], + ], + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + ], + 'CreateEntityType' => [ + 'method' => 'post', + 'uriTemplate' => '/v2/{parent=projects/*/agent}/entityTypes', + 'body' => 'entity_type', + 'additionalBindings' => [ + [ + 'method' => 'post', + 'uriTemplate' => '/v2/{parent=projects/*/locations/*/agent}/entityTypes', + 'body' => 'entity_type', + ], + ], + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + ], + 'DeleteEntityType' => [ + 'method' => 'delete', + 'uriTemplate' => '/v2/{name=projects/*/agent/entityTypes/*}', + 'additionalBindings' => [ + [ + 'method' => 'delete', + 'uriTemplate' => '/v2/{name=projects/*/locations/*/agent/entityTypes/*}', + ], + ], + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'GetEntityType' => [ + 'method' => 'get', + 'uriTemplate' => '/v2/{name=projects/*/agent/entityTypes/*}', + 'additionalBindings' => [ + [ + 'method' => 'get', + 'uriTemplate' => '/v2/{name=projects/*/locations/*/agent/entityTypes/*}', + ], + ], + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'ListEntityTypes' => [ + 'method' => 'get', + 'uriTemplate' => '/v2/{parent=projects/*/agent}/entityTypes', + 'additionalBindings' => [ + [ + 'method' => 'get', + 'uriTemplate' => '/v2/{parent=projects/*/locations/*/agent}/entityTypes', + ], + ], + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + ], + 'UpdateEntityType' => [ + 'method' => 'patch', + 'uriTemplate' => '/v2/{entity_type.name=projects/*/agent/entityTypes/*}', + 'body' => 'entity_type', + 'additionalBindings' => [ + [ + 'method' => 'patch', + 'uriTemplate' => '/v2/{entity_type.name=projects/*/locations/*/agent/entityTypes/*}', + 'body' => 'entity_type', + ], + ], + 'placeholders' => [ + 'entity_type.name' => [ + 'getters' => [ + 'getEntityType', + 'getName', + ], + ], + ], + ], + ], + 'google.cloud.location.Locations' => [ + 'GetLocation' => [ + 'method' => 'get', + 'uriTemplate' => '/v2/{name=projects/*/locations/*}', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'ListLocations' => [ + 'method' => 'get', + 'uriTemplate' => '/v2/{name=projects/*}/locations', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + ], + 'google.longrunning.Operations' => [ + 'CancelOperation' => [ + 'method' => 'post', + 'uriTemplate' => '/v2/{name=projects/*/operations/*}:cancel', + 'additionalBindings' => [ + [ + 'method' => 'post', + 'uriTemplate' => '/v2/{name=projects/*/locations/*/operations/*}:cancel', + ], + ], + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'GetOperation' => [ + 'method' => 'get', + 'uriTemplate' => '/v2/{name=projects/*/operations/*}', + 'additionalBindings' => [ + [ + 'method' => 'get', + 'uriTemplate' => '/v2/{name=projects/*/locations/*/operations/*}', + ], + ], + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'ListOperations' => [ + 'method' => 'get', + 'uriTemplate' => '/v2/{name=projects/*}/operations', + 'additionalBindings' => [ + [ + 'method' => 'get', + 'uriTemplate' => '/v2/{name=projects/*/locations/*}/operations', + ], + ], + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + ], + ], + 'numericEnums' => true, +]; diff --git a/owl-bot-staging/Dialogflow/v2/src/V2/resources/environments_client_config.json b/owl-bot-staging/Dialogflow/v2/src/V2/resources/environments_client_config.json new file mode 100644 index 000000000000..00d6f74b6016 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/src/V2/resources/environments_client_config.json @@ -0,0 +1,74 @@ +{ + "interfaces": { + "google.cloud.dialogflow.v2.Environments": { + "retry_codes": { + "no_retry_codes": [], + "retry_policy_1_codes": [ + "UNAVAILABLE" + ] + }, + "retry_params": { + "no_retry_params": { + "initial_retry_delay_millis": 0, + "retry_delay_multiplier": 0.0, + "max_retry_delay_millis": 0, + "initial_rpc_timeout_millis": 0, + "rpc_timeout_multiplier": 1.0, + "max_rpc_timeout_millis": 0, + "total_timeout_millis": 0 + }, + "retry_policy_1_params": { + "initial_retry_delay_millis": 100, + "retry_delay_multiplier": 1.3, + "max_retry_delay_millis": 60000, + "initial_rpc_timeout_millis": 60000, + "rpc_timeout_multiplier": 1.0, + "max_rpc_timeout_millis": 60000, + "total_timeout_millis": 60000 + } + }, + "methods": { + "CreateEnvironment": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "DeleteEnvironment": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "GetEnvironment": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "GetEnvironmentHistory": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "ListEnvironments": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "UpdateEnvironment": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "GetLocation": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "ListLocations": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + } + } + } + } +} diff --git a/owl-bot-staging/Dialogflow/v2/src/V2/resources/environments_descriptor_config.php b/owl-bot-staging/Dialogflow/v2/src/V2/resources/environments_descriptor_config.php new file mode 100644 index 000000000000..18a5fd82ab95 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/src/V2/resources/environments_descriptor_config.php @@ -0,0 +1,165 @@ + [ + 'google.cloud.dialogflow.v2.Environments' => [ + 'CreateEnvironment' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Dialogflow\V2\Environment', + 'headerParams' => [ + [ + 'keyName' => 'parent', + 'fieldAccessors' => [ + 'getParent', + ], + ], + ], + ], + 'DeleteEnvironment' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Protobuf\GPBEmpty', + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + ], + 'GetEnvironment' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Dialogflow\V2\Environment', + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + ], + 'GetEnvironmentHistory' => [ + 'pageStreaming' => [ + 'requestPageTokenGetMethod' => 'getPageToken', + 'requestPageTokenSetMethod' => 'setPageToken', + 'requestPageSizeGetMethod' => 'getPageSize', + 'requestPageSizeSetMethod' => 'setPageSize', + 'responsePageTokenGetMethod' => 'getNextPageToken', + 'resourcesGetMethod' => 'getEntries', + ], + 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, + 'responseType' => 'Google\Cloud\Dialogflow\V2\EnvironmentHistory', + 'headerParams' => [ + [ + 'keyName' => 'parent', + 'fieldAccessors' => [ + 'getParent', + ], + ], + ], + ], + 'ListEnvironments' => [ + 'pageStreaming' => [ + 'requestPageTokenGetMethod' => 'getPageToken', + 'requestPageTokenSetMethod' => 'setPageToken', + 'requestPageSizeGetMethod' => 'getPageSize', + 'requestPageSizeSetMethod' => 'setPageSize', + 'responsePageTokenGetMethod' => 'getNextPageToken', + 'resourcesGetMethod' => 'getEnvironments', + ], + 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, + 'responseType' => 'Google\Cloud\Dialogflow\V2\ListEnvironmentsResponse', + 'headerParams' => [ + [ + 'keyName' => 'parent', + 'fieldAccessors' => [ + 'getParent', + ], + ], + ], + ], + 'UpdateEnvironment' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Dialogflow\V2\Environment', + 'headerParams' => [ + [ + 'keyName' => 'environment.name', + 'fieldAccessors' => [ + 'getEnvironment', + 'getName', + ], + ], + ], + ], + 'GetLocation' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Location\Location', + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + 'interfaceOverride' => 'google.cloud.location.Locations', + ], + 'ListLocations' => [ + 'pageStreaming' => [ + 'requestPageTokenGetMethod' => 'getPageToken', + 'requestPageTokenSetMethod' => 'setPageToken', + 'requestPageSizeGetMethod' => 'getPageSize', + 'requestPageSizeSetMethod' => 'setPageSize', + 'responsePageTokenGetMethod' => 'getNextPageToken', + 'resourcesGetMethod' => 'getLocations', + ], + 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, + 'responseType' => 'Google\Cloud\Location\ListLocationsResponse', + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + 'interfaceOverride' => 'google.cloud.location.Locations', + ], + 'templateMap' => [ + 'agent' => 'projects/{project}/agent', + 'environment' => 'projects/{project}/agent/environments/{environment}', + 'fulfillment' => 'projects/{project}/agent/fulfillment', + 'projectAgent' => 'projects/{project}/agent', + 'projectEnvironment' => 'projects/{project}/agent/environments/{environment}', + 'projectFulfillment' => 'projects/{project}/agent/fulfillment', + 'projectLocationAgent' => 'projects/{project}/locations/{location}/agent', + 'projectLocationEnvironment' => 'projects/{project}/locations/{location}/agent/environments/{environment}', + 'projectLocationFulfillment' => 'projects/{project}/locations/{location}/agent/fulfillment', + 'projectLocationVersion' => 'projects/{project}/locations/{location}/agent/versions/{version}', + 'projectVersion' => 'projects/{project}/agent/versions/{version}', + 'version' => 'projects/{project}/agent/versions/{version}', + ], + ], + ], +]; diff --git a/owl-bot-staging/Dialogflow/v2/src/V2/resources/environments_rest_client_config.php b/owl-bot-staging/Dialogflow/v2/src/V2/resources/environments_rest_client_config.php new file mode 100644 index 000000000000..2b1284121a19 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/src/V2/resources/environments_rest_client_config.php @@ -0,0 +1,225 @@ + [ + 'google.cloud.dialogflow.v2.Environments' => [ + 'CreateEnvironment' => [ + 'method' => 'post', + 'uriTemplate' => '/v2/{parent=projects/*/agent}/environments', + 'body' => 'environment', + 'additionalBindings' => [ + [ + 'method' => 'post', + 'uriTemplate' => '/v2/{parent=projects/*/locations/*/agent}/environments', + 'body' => 'environment', + 'queryParams' => [ + 'environment_id', + ], + ], + ], + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + 'queryParams' => [ + 'environment_id', + ], + ], + 'DeleteEnvironment' => [ + 'method' => 'delete', + 'uriTemplate' => '/v2/{name=projects/*/agent/environments/*}', + 'additionalBindings' => [ + [ + 'method' => 'delete', + 'uriTemplate' => '/v2/{name=projects/*/locations/*/agent/environments/*}', + ], + ], + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'GetEnvironment' => [ + 'method' => 'get', + 'uriTemplate' => '/v2/{name=projects/*/agent/environments/*}', + 'additionalBindings' => [ + [ + 'method' => 'get', + 'uriTemplate' => '/v2/{name=projects/*/locations/*/agent/environments/*}', + ], + ], + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'GetEnvironmentHistory' => [ + 'method' => 'get', + 'uriTemplate' => '/v2/{parent=projects/*/agent/environments/*}/history', + 'additionalBindings' => [ + [ + 'method' => 'get', + 'uriTemplate' => '/v2/{parent=projects/*/locations/*/agent/environments/*}/history', + ], + ], + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + ], + 'ListEnvironments' => [ + 'method' => 'get', + 'uriTemplate' => '/v2/{parent=projects/*/agent}/environments', + 'additionalBindings' => [ + [ + 'method' => 'get', + 'uriTemplate' => '/v2/{parent=projects/*/locations/*/agent}/environments', + ], + ], + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + ], + 'UpdateEnvironment' => [ + 'method' => 'patch', + 'uriTemplate' => '/v2/{environment.name=projects/*/agent/environments/*}', + 'body' => 'environment', + 'additionalBindings' => [ + [ + 'method' => 'patch', + 'uriTemplate' => '/v2/{environment.name=projects/*/locations/*/agent/environments/*}', + 'body' => 'environment', + 'queryParams' => [ + 'update_mask', + ], + ], + ], + 'placeholders' => [ + 'environment.name' => [ + 'getters' => [ + 'getEnvironment', + 'getName', + ], + ], + ], + 'queryParams' => [ + 'update_mask', + ], + ], + ], + 'google.cloud.location.Locations' => [ + 'GetLocation' => [ + 'method' => 'get', + 'uriTemplate' => '/v2/{name=projects/*/locations/*}', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'ListLocations' => [ + 'method' => 'get', + 'uriTemplate' => '/v2/{name=projects/*}/locations', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + ], + 'google.longrunning.Operations' => [ + 'CancelOperation' => [ + 'method' => 'post', + 'uriTemplate' => '/v2/{name=projects/*/operations/*}:cancel', + 'additionalBindings' => [ + [ + 'method' => 'post', + 'uriTemplate' => '/v2/{name=projects/*/locations/*/operations/*}:cancel', + ], + ], + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'GetOperation' => [ + 'method' => 'get', + 'uriTemplate' => '/v2/{name=projects/*/operations/*}', + 'additionalBindings' => [ + [ + 'method' => 'get', + 'uriTemplate' => '/v2/{name=projects/*/locations/*/operations/*}', + ], + ], + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'ListOperations' => [ + 'method' => 'get', + 'uriTemplate' => '/v2/{name=projects/*}/operations', + 'additionalBindings' => [ + [ + 'method' => 'get', + 'uriTemplate' => '/v2/{name=projects/*/locations/*}/operations', + ], + ], + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + ], + ], + 'numericEnums' => true, +]; diff --git a/owl-bot-staging/Dialogflow/v2/src/V2/resources/fulfillments_client_config.json b/owl-bot-staging/Dialogflow/v2/src/V2/resources/fulfillments_client_config.json new file mode 100644 index 000000000000..8e6cc14bb9c3 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/src/V2/resources/fulfillments_client_config.json @@ -0,0 +1,54 @@ +{ + "interfaces": { + "google.cloud.dialogflow.v2.Fulfillments": { + "retry_codes": { + "no_retry_codes": [], + "retry_policy_1_codes": [ + "UNAVAILABLE" + ] + }, + "retry_params": { + "no_retry_params": { + "initial_retry_delay_millis": 0, + "retry_delay_multiplier": 0.0, + "max_retry_delay_millis": 0, + "initial_rpc_timeout_millis": 0, + "rpc_timeout_multiplier": 1.0, + "max_rpc_timeout_millis": 0, + "total_timeout_millis": 0 + }, + "retry_policy_1_params": { + "initial_retry_delay_millis": 100, + "retry_delay_multiplier": 1.3, + "max_retry_delay_millis": 60000, + "initial_rpc_timeout_millis": 60000, + "rpc_timeout_multiplier": 1.0, + "max_rpc_timeout_millis": 60000, + "total_timeout_millis": 60000 + } + }, + "methods": { + "GetFulfillment": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "UpdateFulfillment": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "GetLocation": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "ListLocations": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + } + } + } + } +} diff --git a/owl-bot-staging/Dialogflow/v2/src/V2/resources/fulfillments_descriptor_config.php b/owl-bot-staging/Dialogflow/v2/src/V2/resources/fulfillments_descriptor_config.php new file mode 100644 index 000000000000..934288f83f2a --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/src/V2/resources/fulfillments_descriptor_config.php @@ -0,0 +1,92 @@ + [ + 'google.cloud.dialogflow.v2.Fulfillments' => [ + 'GetFulfillment' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Dialogflow\V2\Fulfillment', + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + ], + 'UpdateFulfillment' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Dialogflow\V2\Fulfillment', + 'headerParams' => [ + [ + 'keyName' => 'fulfillment.name', + 'fieldAccessors' => [ + 'getFulfillment', + 'getName', + ], + ], + ], + ], + 'GetLocation' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Location\Location', + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + 'interfaceOverride' => 'google.cloud.location.Locations', + ], + 'ListLocations' => [ + 'pageStreaming' => [ + 'requestPageTokenGetMethod' => 'getPageToken', + 'requestPageTokenSetMethod' => 'setPageToken', + 'requestPageSizeGetMethod' => 'getPageSize', + 'requestPageSizeSetMethod' => 'setPageSize', + 'responsePageTokenGetMethod' => 'getNextPageToken', + 'resourcesGetMethod' => 'getLocations', + ], + 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, + 'responseType' => 'Google\Cloud\Location\ListLocationsResponse', + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + 'interfaceOverride' => 'google.cloud.location.Locations', + ], + 'templateMap' => [ + 'fulfillment' => 'projects/{project}/agent/fulfillment', + 'projectFulfillment' => 'projects/{project}/agent/fulfillment', + 'projectLocationFulfillment' => 'projects/{project}/locations/{location}/agent/fulfillment', + ], + ], + ], +]; diff --git a/owl-bot-staging/Dialogflow/v2/src/V2/resources/fulfillments_rest_client_config.php b/owl-bot-staging/Dialogflow/v2/src/V2/resources/fulfillments_rest_client_config.php new file mode 100644 index 000000000000..3ea8dacb34df --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/src/V2/resources/fulfillments_rest_client_config.php @@ -0,0 +1,149 @@ + [ + 'google.cloud.dialogflow.v2.Fulfillments' => [ + 'GetFulfillment' => [ + 'method' => 'get', + 'uriTemplate' => '/v2/{name=projects/*/agent/fulfillment}', + 'additionalBindings' => [ + [ + 'method' => 'get', + 'uriTemplate' => '/v2/{name=projects/*/locations/*/agent/fulfillment}', + ], + ], + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'UpdateFulfillment' => [ + 'method' => 'patch', + 'uriTemplate' => '/v2/{fulfillment.name=projects/*/agent/fulfillment}', + 'body' => 'fulfillment', + 'additionalBindings' => [ + [ + 'method' => 'patch', + 'uriTemplate' => '/v2/{fulfillment.name=projects/*/locations/*/agent/fulfillment}', + 'body' => 'fulfillment', + 'queryParams' => [ + 'update_mask', + ], + ], + ], + 'placeholders' => [ + 'fulfillment.name' => [ + 'getters' => [ + 'getFulfillment', + 'getName', + ], + ], + ], + 'queryParams' => [ + 'update_mask', + ], + ], + ], + 'google.cloud.location.Locations' => [ + 'GetLocation' => [ + 'method' => 'get', + 'uriTemplate' => '/v2/{name=projects/*/locations/*}', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'ListLocations' => [ + 'method' => 'get', + 'uriTemplate' => '/v2/{name=projects/*}/locations', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + ], + 'google.longrunning.Operations' => [ + 'CancelOperation' => [ + 'method' => 'post', + 'uriTemplate' => '/v2/{name=projects/*/operations/*}:cancel', + 'additionalBindings' => [ + [ + 'method' => 'post', + 'uriTemplate' => '/v2/{name=projects/*/locations/*/operations/*}:cancel', + ], + ], + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'GetOperation' => [ + 'method' => 'get', + 'uriTemplate' => '/v2/{name=projects/*/operations/*}', + 'additionalBindings' => [ + [ + 'method' => 'get', + 'uriTemplate' => '/v2/{name=projects/*/locations/*/operations/*}', + ], + ], + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'ListOperations' => [ + 'method' => 'get', + 'uriTemplate' => '/v2/{name=projects/*}/operations', + 'additionalBindings' => [ + [ + 'method' => 'get', + 'uriTemplate' => '/v2/{name=projects/*/locations/*}/operations', + ], + ], + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + ], + ], + 'numericEnums' => true, +]; diff --git a/owl-bot-staging/Dialogflow/v2/src/V2/resources/generators_client_config.json b/owl-bot-staging/Dialogflow/v2/src/V2/resources/generators_client_config.json new file mode 100644 index 000000000000..d4ccea7d4677 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/src/V2/resources/generators_client_config.json @@ -0,0 +1,69 @@ +{ + "interfaces": { + "google.cloud.dialogflow.v2.Generators": { + "retry_codes": { + "no_retry_codes": [], + "retry_policy_1_codes": [ + "UNAVAILABLE" + ] + }, + "retry_params": { + "no_retry_params": { + "initial_retry_delay_millis": 0, + "retry_delay_multiplier": 0.0, + "max_retry_delay_millis": 0, + "initial_rpc_timeout_millis": 0, + "rpc_timeout_multiplier": 1.0, + "max_rpc_timeout_millis": 0, + "total_timeout_millis": 0 + }, + "retry_policy_1_params": { + "initial_retry_delay_millis": 100, + "retry_delay_multiplier": 1.3, + "max_retry_delay_millis": 60000, + "initial_rpc_timeout_millis": 60000, + "rpc_timeout_multiplier": 1.0, + "max_rpc_timeout_millis": 60000, + "total_timeout_millis": 60000 + } + }, + "methods": { + "CreateGenerator": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "DeleteGenerator": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "GetGenerator": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "ListGenerators": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "UpdateGenerator": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "GetLocation": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "ListLocations": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + } + } + } + } +} diff --git a/owl-bot-staging/Dialogflow/v2/src/V2/resources/generators_descriptor_config.php b/owl-bot-staging/Dialogflow/v2/src/V2/resources/generators_descriptor_config.php new file mode 100644 index 000000000000..5ef029130280 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/src/V2/resources/generators_descriptor_config.php @@ -0,0 +1,135 @@ + [ + 'google.cloud.dialogflow.v2.Generators' => [ + 'CreateGenerator' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Dialogflow\V2\Generator', + 'headerParams' => [ + [ + 'keyName' => 'parent', + 'fieldAccessors' => [ + 'getParent', + ], + ], + ], + ], + 'DeleteGenerator' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Protobuf\GPBEmpty', + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + ], + 'GetGenerator' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Dialogflow\V2\Generator', + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + ], + 'ListGenerators' => [ + 'pageStreaming' => [ + 'requestPageTokenGetMethod' => 'getPageToken', + 'requestPageTokenSetMethod' => 'setPageToken', + 'requestPageSizeGetMethod' => 'getPageSize', + 'requestPageSizeSetMethod' => 'setPageSize', + 'responsePageTokenGetMethod' => 'getNextPageToken', + 'resourcesGetMethod' => 'getGenerators', + ], + 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, + 'responseType' => 'Google\Cloud\Dialogflow\V2\ListGeneratorsResponse', + 'headerParams' => [ + [ + 'keyName' => 'parent', + 'fieldAccessors' => [ + 'getParent', + ], + ], + ], + ], + 'UpdateGenerator' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Dialogflow\V2\Generator', + 'headerParams' => [ + [ + 'keyName' => 'generator.name', + 'fieldAccessors' => [ + 'getGenerator', + 'getName', + ], + ], + ], + ], + 'GetLocation' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Location\Location', + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + 'interfaceOverride' => 'google.cloud.location.Locations', + ], + 'ListLocations' => [ + 'pageStreaming' => [ + 'requestPageTokenGetMethod' => 'getPageToken', + 'requestPageTokenSetMethod' => 'setPageToken', + 'requestPageSizeGetMethod' => 'getPageSize', + 'requestPageSizeSetMethod' => 'setPageSize', + 'responsePageTokenGetMethod' => 'getNextPageToken', + 'resourcesGetMethod' => 'getLocations', + ], + 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, + 'responseType' => 'Google\Cloud\Location\ListLocationsResponse', + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + 'interfaceOverride' => 'google.cloud.location.Locations', + ], + 'templateMap' => [ + 'generator' => 'projects/{project}/locations/{location}/generators/{generator}', + 'project' => 'projects/{project}', + ], + ], + ], +]; diff --git a/owl-bot-staging/Dialogflow/v2/src/V2/resources/generators_rest_client_config.php b/owl-bot-staging/Dialogflow/v2/src/V2/resources/generators_rest_client_config.php new file mode 100644 index 000000000000..f6ffa3f376c6 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/src/V2/resources/generators_rest_client_config.php @@ -0,0 +1,177 @@ + [ + 'google.cloud.dialogflow.v2.Generators' => [ + 'CreateGenerator' => [ + 'method' => 'post', + 'uriTemplate' => '/v2/{parent=projects/*/locations/*}/generators', + 'body' => 'generator', + 'additionalBindings' => [ + [ + 'method' => 'post', + 'uriTemplate' => '/v2/{parent=projects/*}/generators', + 'body' => 'generator', + ], + ], + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + ], + 'DeleteGenerator' => [ + 'method' => 'delete', + 'uriTemplate' => '/v2/{name=projects/*/locations/*/generators/*}', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'GetGenerator' => [ + 'method' => 'get', + 'uriTemplate' => '/v2/{name=projects/*/locations/*/generators/*}', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'ListGenerators' => [ + 'method' => 'get', + 'uriTemplate' => '/v2/{parent=projects/*/locations/*}/generators', + 'additionalBindings' => [ + [ + 'method' => 'get', + 'uriTemplate' => '/v2/{parent=projects/*}/generators', + ], + ], + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + ], + 'UpdateGenerator' => [ + 'method' => 'patch', + 'uriTemplate' => '/v2/{generator.name=projects/*/locations/*/generators/*}', + 'body' => 'generator', + 'placeholders' => [ + 'generator.name' => [ + 'getters' => [ + 'getGenerator', + 'getName', + ], + ], + ], + ], + ], + 'google.cloud.location.Locations' => [ + 'GetLocation' => [ + 'method' => 'get', + 'uriTemplate' => '/v2/{name=projects/*/locations/*}', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'ListLocations' => [ + 'method' => 'get', + 'uriTemplate' => '/v2/{name=projects/*}/locations', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + ], + 'google.longrunning.Operations' => [ + 'CancelOperation' => [ + 'method' => 'post', + 'uriTemplate' => '/v2/{name=projects/*/operations/*}:cancel', + 'additionalBindings' => [ + [ + 'method' => 'post', + 'uriTemplate' => '/v2/{name=projects/*/locations/*/operations/*}:cancel', + ], + ], + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'GetOperation' => [ + 'method' => 'get', + 'uriTemplate' => '/v2/{name=projects/*/operations/*}', + 'additionalBindings' => [ + [ + 'method' => 'get', + 'uriTemplate' => '/v2/{name=projects/*/locations/*/operations/*}', + ], + ], + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'ListOperations' => [ + 'method' => 'get', + 'uriTemplate' => '/v2/{name=projects/*}/operations', + 'additionalBindings' => [ + [ + 'method' => 'get', + 'uriTemplate' => '/v2/{name=projects/*/locations/*}/operations', + ], + ], + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + ], + ], + 'numericEnums' => true, +]; diff --git a/owl-bot-staging/Dialogflow/v2/src/V2/resources/intents_client_config.json b/owl-bot-staging/Dialogflow/v2/src/V2/resources/intents_client_config.json new file mode 100644 index 000000000000..f6d3f00e1293 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/src/V2/resources/intents_client_config.json @@ -0,0 +1,79 @@ +{ + "interfaces": { + "google.cloud.dialogflow.v2.Intents": { + "retry_codes": { + "no_retry_codes": [], + "retry_policy_1_codes": [ + "UNAVAILABLE" + ] + }, + "retry_params": { + "no_retry_params": { + "initial_retry_delay_millis": 0, + "retry_delay_multiplier": 0.0, + "max_retry_delay_millis": 0, + "initial_rpc_timeout_millis": 0, + "rpc_timeout_multiplier": 1.0, + "max_rpc_timeout_millis": 0, + "total_timeout_millis": 0 + }, + "retry_policy_1_params": { + "initial_retry_delay_millis": 100, + "retry_delay_multiplier": 1.3, + "max_retry_delay_millis": 60000, + "initial_rpc_timeout_millis": 60000, + "rpc_timeout_multiplier": 1.0, + "max_rpc_timeout_millis": 60000, + "total_timeout_millis": 60000 + } + }, + "methods": { + "BatchDeleteIntents": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "BatchUpdateIntents": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "CreateIntent": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "DeleteIntent": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "GetIntent": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "ListIntents": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "UpdateIntent": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "GetLocation": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "ListLocations": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + } + } + } + } +} diff --git a/owl-bot-staging/Dialogflow/v2/src/V2/resources/intents_descriptor_config.php b/owl-bot-staging/Dialogflow/v2/src/V2/resources/intents_descriptor_config.php new file mode 100644 index 000000000000..d43f5884a84a --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/src/V2/resources/intents_descriptor_config.php @@ -0,0 +1,187 @@ + [ + 'google.cloud.dialogflow.v2.Intents' => [ + 'BatchDeleteIntents' => [ + 'longRunning' => [ + 'operationReturnType' => '\Google\Protobuf\GPBEmpty', + 'metadataReturnType' => '\Google\Protobuf\Struct', + 'initialPollDelayMillis' => '500', + 'pollDelayMultiplier' => '1.5', + 'maxPollDelayMillis' => '5000', + 'totalPollTimeoutMillis' => '300000', + ], + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'parent', + 'fieldAccessors' => [ + 'getParent', + ], + ], + ], + ], + 'BatchUpdateIntents' => [ + 'longRunning' => [ + 'operationReturnType' => '\Google\Cloud\Dialogflow\V2\BatchUpdateIntentsResponse', + 'metadataReturnType' => '\Google\Protobuf\Struct', + 'initialPollDelayMillis' => '500', + 'pollDelayMultiplier' => '1.5', + 'maxPollDelayMillis' => '5000', + 'totalPollTimeoutMillis' => '300000', + ], + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'parent', + 'fieldAccessors' => [ + 'getParent', + ], + ], + ], + ], + 'CreateIntent' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Dialogflow\V2\Intent', + 'headerParams' => [ + [ + 'keyName' => 'parent', + 'fieldAccessors' => [ + 'getParent', + ], + ], + ], + ], + 'DeleteIntent' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Protobuf\GPBEmpty', + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + ], + 'GetIntent' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Dialogflow\V2\Intent', + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + ], + 'ListIntents' => [ + 'pageStreaming' => [ + 'requestPageTokenGetMethod' => 'getPageToken', + 'requestPageTokenSetMethod' => 'setPageToken', + 'requestPageSizeGetMethod' => 'getPageSize', + 'requestPageSizeSetMethod' => 'setPageSize', + 'responsePageTokenGetMethod' => 'getNextPageToken', + 'resourcesGetMethod' => 'getIntents', + ], + 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, + 'responseType' => 'Google\Cloud\Dialogflow\V2\ListIntentsResponse', + 'headerParams' => [ + [ + 'keyName' => 'parent', + 'fieldAccessors' => [ + 'getParent', + ], + ], + ], + ], + 'UpdateIntent' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Dialogflow\V2\Intent', + 'headerParams' => [ + [ + 'keyName' => 'intent.name', + 'fieldAccessors' => [ + 'getIntent', + 'getName', + ], + ], + ], + ], + 'GetLocation' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Location\Location', + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + 'interfaceOverride' => 'google.cloud.location.Locations', + ], + 'ListLocations' => [ + 'pageStreaming' => [ + 'requestPageTokenGetMethod' => 'getPageToken', + 'requestPageTokenSetMethod' => 'setPageToken', + 'requestPageSizeGetMethod' => 'getPageSize', + 'requestPageSizeSetMethod' => 'setPageSize', + 'responsePageTokenGetMethod' => 'getNextPageToken', + 'resourcesGetMethod' => 'getLocations', + ], + 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, + 'responseType' => 'Google\Cloud\Location\ListLocationsResponse', + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + 'interfaceOverride' => 'google.cloud.location.Locations', + ], + 'templateMap' => [ + 'agent' => 'projects/{project}/agent', + 'context' => 'projects/{project}/agent/sessions/{session}/contexts/{context}', + 'intent' => 'projects/{project}/agent/intents/{intent}', + 'projectAgent' => 'projects/{project}/agent', + 'projectEnvironmentUserSession' => 'projects/{project}/agent/environments/{environment}/users/{user}/sessions/{session}', + 'projectEnvironmentUserSessionContext' => 'projects/{project}/agent/environments/{environment}/users/{user}/sessions/{session}/contexts/{context}', + 'projectIntent' => 'projects/{project}/agent/intents/{intent}', + 'projectLocationAgent' => 'projects/{project}/locations/{location}/agent', + 'projectLocationEnvironmentUserSession' => 'projects/{project}/locations/{location}/agent/environments/{environment}/users/{user}/sessions/{session}', + 'projectLocationEnvironmentUserSessionContext' => 'projects/{project}/locations/{location}/agent/environments/{environment}/users/{user}/sessions/{session}/contexts/{context}', + 'projectLocationIntent' => 'projects/{project}/locations/{location}/agent/intents/{intent}', + 'projectLocationSession' => 'projects/{project}/locations/{location}/agent/sessions/{session}', + 'projectLocationSessionContext' => 'projects/{project}/locations/{location}/agent/sessions/{session}/contexts/{context}', + 'projectSession' => 'projects/{project}/agent/sessions/{session}', + 'projectSessionContext' => 'projects/{project}/agent/sessions/{session}/contexts/{context}', + 'session' => 'projects/{project}/agent/sessions/{session}', + ], + ], + ], +]; diff --git a/owl-bot-staging/Dialogflow/v2/src/V2/resources/intents_rest_client_config.php b/owl-bot-staging/Dialogflow/v2/src/V2/resources/intents_rest_client_config.php new file mode 100644 index 000000000000..c6f9537e7696 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/src/V2/resources/intents_rest_client_config.php @@ -0,0 +1,242 @@ + [ + 'google.cloud.dialogflow.v2.Intents' => [ + 'BatchDeleteIntents' => [ + 'method' => 'post', + 'uriTemplate' => '/v2/{parent=projects/*/agent}/intents:batchDelete', + 'body' => '*', + 'additionalBindings' => [ + [ + 'method' => 'post', + 'uriTemplate' => '/v2/{parent=projects/*/locations/*/agent}/intents:batchDelete', + 'body' => '*', + ], + ], + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + ], + 'BatchUpdateIntents' => [ + 'method' => 'post', + 'uriTemplate' => '/v2/{parent=projects/*/agent}/intents:batchUpdate', + 'body' => '*', + 'additionalBindings' => [ + [ + 'method' => 'post', + 'uriTemplate' => '/v2/{parent=projects/*/locations/*/agent}/intents:batchUpdate', + 'body' => '*', + ], + ], + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + ], + 'CreateIntent' => [ + 'method' => 'post', + 'uriTemplate' => '/v2/{parent=projects/*/agent}/intents', + 'body' => 'intent', + 'additionalBindings' => [ + [ + 'method' => 'post', + 'uriTemplate' => '/v2/{parent=projects/*/locations/*/agent}/intents', + 'body' => 'intent', + ], + ], + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + ], + 'DeleteIntent' => [ + 'method' => 'delete', + 'uriTemplate' => '/v2/{name=projects/*/agent/intents/*}', + 'additionalBindings' => [ + [ + 'method' => 'delete', + 'uriTemplate' => '/v2/{name=projects/*/locations/*/agent/intents/*}', + ], + ], + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'GetIntent' => [ + 'method' => 'get', + 'uriTemplate' => '/v2/{name=projects/*/agent/intents/*}', + 'additionalBindings' => [ + [ + 'method' => 'get', + 'uriTemplate' => '/v2/{name=projects/*/locations/*/agent/intents/*}', + ], + ], + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'ListIntents' => [ + 'method' => 'get', + 'uriTemplate' => '/v2/{parent=projects/*/agent}/intents', + 'additionalBindings' => [ + [ + 'method' => 'get', + 'uriTemplate' => '/v2/{parent=projects/*/locations/*/agent}/intents', + ], + [ + 'method' => 'get', + 'uriTemplate' => '/v2/{parent=projects/*/agent/environments/*}/intents', + ], + [ + 'method' => 'get', + 'uriTemplate' => '/v2/{parent=projects/*/locations/*/agent/environments/*}/intents', + ], + ], + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + ], + 'UpdateIntent' => [ + 'method' => 'patch', + 'uriTemplate' => '/v2/{intent.name=projects/*/agent/intents/*}', + 'body' => 'intent', + 'additionalBindings' => [ + [ + 'method' => 'patch', + 'uriTemplate' => '/v2/{intent.name=projects/*/locations/*/agent/intents/*}', + 'body' => 'intent', + ], + ], + 'placeholders' => [ + 'intent.name' => [ + 'getters' => [ + 'getIntent', + 'getName', + ], + ], + ], + ], + ], + 'google.cloud.location.Locations' => [ + 'GetLocation' => [ + 'method' => 'get', + 'uriTemplate' => '/v2/{name=projects/*/locations/*}', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'ListLocations' => [ + 'method' => 'get', + 'uriTemplate' => '/v2/{name=projects/*}/locations', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + ], + 'google.longrunning.Operations' => [ + 'CancelOperation' => [ + 'method' => 'post', + 'uriTemplate' => '/v2/{name=projects/*/operations/*}:cancel', + 'additionalBindings' => [ + [ + 'method' => 'post', + 'uriTemplate' => '/v2/{name=projects/*/locations/*/operations/*}:cancel', + ], + ], + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'GetOperation' => [ + 'method' => 'get', + 'uriTemplate' => '/v2/{name=projects/*/operations/*}', + 'additionalBindings' => [ + [ + 'method' => 'get', + 'uriTemplate' => '/v2/{name=projects/*/locations/*/operations/*}', + ], + ], + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'ListOperations' => [ + 'method' => 'get', + 'uriTemplate' => '/v2/{name=projects/*}/operations', + 'additionalBindings' => [ + [ + 'method' => 'get', + 'uriTemplate' => '/v2/{name=projects/*/locations/*}/operations', + ], + ], + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + ], + ], + 'numericEnums' => true, +]; diff --git a/owl-bot-staging/Dialogflow/v2/src/V2/resources/knowledge_bases_client_config.json b/owl-bot-staging/Dialogflow/v2/src/V2/resources/knowledge_bases_client_config.json new file mode 100644 index 000000000000..8b18c4c682f0 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/src/V2/resources/knowledge_bases_client_config.json @@ -0,0 +1,69 @@ +{ + "interfaces": { + "google.cloud.dialogflow.v2.KnowledgeBases": { + "retry_codes": { + "no_retry_codes": [], + "retry_policy_1_codes": [ + "UNAVAILABLE" + ] + }, + "retry_params": { + "no_retry_params": { + "initial_retry_delay_millis": 0, + "retry_delay_multiplier": 0.0, + "max_retry_delay_millis": 0, + "initial_rpc_timeout_millis": 0, + "rpc_timeout_multiplier": 1.0, + "max_rpc_timeout_millis": 0, + "total_timeout_millis": 0 + }, + "retry_policy_1_params": { + "initial_retry_delay_millis": 100, + "retry_delay_multiplier": 1.3, + "max_retry_delay_millis": 60000, + "initial_rpc_timeout_millis": 60000, + "rpc_timeout_multiplier": 1.0, + "max_rpc_timeout_millis": 60000, + "total_timeout_millis": 60000 + } + }, + "methods": { + "CreateKnowledgeBase": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "DeleteKnowledgeBase": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "GetKnowledgeBase": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "ListKnowledgeBases": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "UpdateKnowledgeBase": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "GetLocation": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "ListLocations": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + } + } + } + } +} diff --git a/owl-bot-staging/Dialogflow/v2/src/V2/resources/knowledge_bases_descriptor_config.php b/owl-bot-staging/Dialogflow/v2/src/V2/resources/knowledge_bases_descriptor_config.php new file mode 100644 index 000000000000..9844957becbc --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/src/V2/resources/knowledge_bases_descriptor_config.php @@ -0,0 +1,138 @@ + [ + 'google.cloud.dialogflow.v2.KnowledgeBases' => [ + 'CreateKnowledgeBase' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Dialogflow\V2\KnowledgeBase', + 'headerParams' => [ + [ + 'keyName' => 'parent', + 'fieldAccessors' => [ + 'getParent', + ], + ], + ], + ], + 'DeleteKnowledgeBase' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Protobuf\GPBEmpty', + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + ], + 'GetKnowledgeBase' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Dialogflow\V2\KnowledgeBase', + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + ], + 'ListKnowledgeBases' => [ + 'pageStreaming' => [ + 'requestPageTokenGetMethod' => 'getPageToken', + 'requestPageTokenSetMethod' => 'setPageToken', + 'requestPageSizeGetMethod' => 'getPageSize', + 'requestPageSizeSetMethod' => 'setPageSize', + 'responsePageTokenGetMethod' => 'getNextPageToken', + 'resourcesGetMethod' => 'getKnowledgeBases', + ], + 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, + 'responseType' => 'Google\Cloud\Dialogflow\V2\ListKnowledgeBasesResponse', + 'headerParams' => [ + [ + 'keyName' => 'parent', + 'fieldAccessors' => [ + 'getParent', + ], + ], + ], + ], + 'UpdateKnowledgeBase' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Dialogflow\V2\KnowledgeBase', + 'headerParams' => [ + [ + 'keyName' => 'knowledge_base.name', + 'fieldAccessors' => [ + 'getKnowledgeBase', + 'getName', + ], + ], + ], + ], + 'GetLocation' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Location\Location', + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + 'interfaceOverride' => 'google.cloud.location.Locations', + ], + 'ListLocations' => [ + 'pageStreaming' => [ + 'requestPageTokenGetMethod' => 'getPageToken', + 'requestPageTokenSetMethod' => 'setPageToken', + 'requestPageSizeGetMethod' => 'getPageSize', + 'requestPageSizeSetMethod' => 'setPageSize', + 'responsePageTokenGetMethod' => 'getNextPageToken', + 'resourcesGetMethod' => 'getLocations', + ], + 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, + 'responseType' => 'Google\Cloud\Location\ListLocationsResponse', + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + 'interfaceOverride' => 'google.cloud.location.Locations', + ], + 'templateMap' => [ + 'knowledgeBase' => 'projects/{project}/knowledgeBases/{knowledge_base}', + 'location' => 'projects/{project}/locations/{location}', + 'project' => 'projects/{project}', + 'projectKnowledgeBase' => 'projects/{project}/knowledgeBases/{knowledge_base}', + 'projectLocationKnowledgeBase' => 'projects/{project}/locations/{location}/knowledgeBases/{knowledge_base}', + ], + ], + ], +]; diff --git a/owl-bot-staging/Dialogflow/v2/src/V2/resources/knowledge_bases_rest_client_config.php b/owl-bot-staging/Dialogflow/v2/src/V2/resources/knowledge_bases_rest_client_config.php new file mode 100644 index 000000000000..0c7772592b29 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/src/V2/resources/knowledge_bases_rest_client_config.php @@ -0,0 +1,218 @@ + [ + 'google.cloud.dialogflow.v2.KnowledgeBases' => [ + 'CreateKnowledgeBase' => [ + 'method' => 'post', + 'uriTemplate' => '/v2/{parent=projects/*}/knowledgeBases', + 'body' => 'knowledge_base', + 'additionalBindings' => [ + [ + 'method' => 'post', + 'uriTemplate' => '/v2/{parent=projects/*/locations/*}/knowledgeBases', + 'body' => 'knowledge_base', + ], + [ + 'method' => 'post', + 'uriTemplate' => '/v2/{parent=projects/*/agent}/knowledgeBases', + 'body' => 'knowledge_base', + ], + ], + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + ], + 'DeleteKnowledgeBase' => [ + 'method' => 'delete', + 'uriTemplate' => '/v2/{name=projects/*/knowledgeBases/*}', + 'additionalBindings' => [ + [ + 'method' => 'delete', + 'uriTemplate' => '/v2/{name=projects/*/locations/*/knowledgeBases/*}', + ], + [ + 'method' => 'delete', + 'uriTemplate' => '/v2/{name=projects/*/agent/knowledgeBases/*}', + ], + ], + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'GetKnowledgeBase' => [ + 'method' => 'get', + 'uriTemplate' => '/v2/{name=projects/*/knowledgeBases/*}', + 'additionalBindings' => [ + [ + 'method' => 'get', + 'uriTemplate' => '/v2/{name=projects/*/locations/*/knowledgeBases/*}', + ], + [ + 'method' => 'get', + 'uriTemplate' => '/v2/{name=projects/*/agent/knowledgeBases/*}', + ], + ], + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'ListKnowledgeBases' => [ + 'method' => 'get', + 'uriTemplate' => '/v2/{parent=projects/*}/knowledgeBases', + 'additionalBindings' => [ + [ + 'method' => 'get', + 'uriTemplate' => '/v2/{parent=projects/*/locations/*}/knowledgeBases', + ], + [ + 'method' => 'get', + 'uriTemplate' => '/v2/{parent=projects/*/agent}/knowledgeBases', + ], + ], + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + ], + 'UpdateKnowledgeBase' => [ + 'method' => 'patch', + 'uriTemplate' => '/v2/{knowledge_base.name=projects/*/knowledgeBases/*}', + 'body' => 'knowledge_base', + 'additionalBindings' => [ + [ + 'method' => 'patch', + 'uriTemplate' => '/v2/{knowledge_base.name=projects/*/locations/*/knowledgeBases/*}', + 'body' => 'knowledge_base', + ], + [ + 'method' => 'patch', + 'uriTemplate' => '/v2/{knowledge_base.name=projects/*/agent/knowledgeBases/*}', + 'body' => 'knowledge_base', + ], + ], + 'placeholders' => [ + 'knowledge_base.name' => [ + 'getters' => [ + 'getKnowledgeBase', + 'getName', + ], + ], + ], + ], + ], + 'google.cloud.location.Locations' => [ + 'GetLocation' => [ + 'method' => 'get', + 'uriTemplate' => '/v2/{name=projects/*/locations/*}', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'ListLocations' => [ + 'method' => 'get', + 'uriTemplate' => '/v2/{name=projects/*}/locations', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + ], + 'google.longrunning.Operations' => [ + 'CancelOperation' => [ + 'method' => 'post', + 'uriTemplate' => '/v2/{name=projects/*/operations/*}:cancel', + 'additionalBindings' => [ + [ + 'method' => 'post', + 'uriTemplate' => '/v2/{name=projects/*/locations/*/operations/*}:cancel', + ], + ], + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'GetOperation' => [ + 'method' => 'get', + 'uriTemplate' => '/v2/{name=projects/*/operations/*}', + 'additionalBindings' => [ + [ + 'method' => 'get', + 'uriTemplate' => '/v2/{name=projects/*/locations/*/operations/*}', + ], + ], + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'ListOperations' => [ + 'method' => 'get', + 'uriTemplate' => '/v2/{name=projects/*}/operations', + 'additionalBindings' => [ + [ + 'method' => 'get', + 'uriTemplate' => '/v2/{name=projects/*/locations/*}/operations', + ], + ], + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + ], + ], + 'numericEnums' => true, +]; diff --git a/owl-bot-staging/Dialogflow/v2/src/V2/resources/participants_client_config.json b/owl-bot-staging/Dialogflow/v2/src/V2/resources/participants_client_config.json new file mode 100644 index 000000000000..a96ad60c9a82 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/src/V2/resources/participants_client_config.json @@ -0,0 +1,114 @@ +{ + "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" + }, + "SuggestKnowledgeAssist": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "SuggestSmartReplies": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "UpdateParticipant": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "GetLocation": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "ListLocations": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + } + } + } + } +} diff --git a/owl-bot-staging/Dialogflow/v2/src/V2/resources/participants_descriptor_config.php b/owl-bot-staging/Dialogflow/v2/src/V2/resources/participants_descriptor_config.php new file mode 100644 index 000000000000..5a2033395861 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/src/V2/resources/participants_descriptor_config.php @@ -0,0 +1,212 @@ + [ + 'google.cloud.dialogflow.v2.Participants' => [ + 'AnalyzeContent' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Dialogflow\V2\AnalyzeContentResponse', + 'headerParams' => [ + [ + 'keyName' => 'participant', + 'fieldAccessors' => [ + 'getParticipant', + ], + ], + ], + ], + 'CreateParticipant' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Dialogflow\V2\Participant', + 'headerParams' => [ + [ + 'keyName' => 'parent', + 'fieldAccessors' => [ + 'getParent', + ], + ], + ], + ], + 'GetParticipant' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Dialogflow\V2\Participant', + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + ], + 'ListParticipants' => [ + 'pageStreaming' => [ + 'requestPageTokenGetMethod' => 'getPageToken', + 'requestPageTokenSetMethod' => 'setPageToken', + 'requestPageSizeGetMethod' => 'getPageSize', + 'requestPageSizeSetMethod' => 'setPageSize', + 'responsePageTokenGetMethod' => 'getNextPageToken', + 'resourcesGetMethod' => 'getParticipants', + ], + 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, + 'responseType' => 'Google\Cloud\Dialogflow\V2\ListParticipantsResponse', + 'headerParams' => [ + [ + 'keyName' => 'parent', + 'fieldAccessors' => [ + 'getParent', + ], + ], + ], + ], + 'StreamingAnalyzeContent' => [ + 'grpcStreaming' => [ + 'grpcStreamingType' => 'BidiStreaming', + ], + 'callType' => \Google\ApiCore\Call::BIDI_STREAMING_CALL, + 'responseType' => 'Google\Cloud\Dialogflow\V2\StreamingAnalyzeContentResponse', + ], + 'SuggestArticles' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Dialogflow\V2\SuggestArticlesResponse', + 'headerParams' => [ + [ + 'keyName' => 'parent', + 'fieldAccessors' => [ + 'getParent', + ], + ], + ], + ], + 'SuggestFaqAnswers' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Dialogflow\V2\SuggestFaqAnswersResponse', + 'headerParams' => [ + [ + 'keyName' => 'parent', + 'fieldAccessors' => [ + 'getParent', + ], + ], + ], + ], + 'SuggestKnowledgeAssist' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Dialogflow\V2\SuggestKnowledgeAssistResponse', + 'headerParams' => [ + [ + 'keyName' => 'parent', + 'fieldAccessors' => [ + 'getParent', + ], + ], + ], + ], + 'SuggestSmartReplies' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Dialogflow\V2\SuggestSmartRepliesResponse', + 'headerParams' => [ + [ + 'keyName' => 'parent', + 'fieldAccessors' => [ + 'getParent', + ], + ], + ], + ], + 'UpdateParticipant' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Dialogflow\V2\Participant', + 'headerParams' => [ + [ + 'keyName' => 'participant.name', + 'fieldAccessors' => [ + 'getParticipant', + 'getName', + ], + ], + ], + ], + 'GetLocation' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Location\Location', + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + 'interfaceOverride' => 'google.cloud.location.Locations', + ], + 'ListLocations' => [ + 'pageStreaming' => [ + 'requestPageTokenGetMethod' => 'getPageToken', + 'requestPageTokenSetMethod' => 'setPageToken', + 'requestPageSizeGetMethod' => 'getPageSize', + 'requestPageSizeSetMethod' => 'setPageSize', + 'responsePageTokenGetMethod' => 'getNextPageToken', + 'resourcesGetMethod' => 'getLocations', + ], + 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, + 'responseType' => 'Google\Cloud\Location\ListLocationsResponse', + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + 'interfaceOverride' => 'google.cloud.location.Locations', + ], + 'templateMap' => [ + 'context' => 'projects/{project}/agent/sessions/{session}/contexts/{context}', + 'conversation' => 'projects/{project}/conversations/{conversation}', + 'message' => 'projects/{project}/conversations/{conversation}/messages/{message}', + 'participant' => 'projects/{project}/conversations/{conversation}/participants/{participant}', + '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..05c4a24dffe5 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/src/V2/resources/participants_rest_client_config.php @@ -0,0 +1,280 @@ + [ + 'google.cloud.dialogflow.v2.Participants' => [ + 'AnalyzeContent' => [ + 'method' => 'post', + 'uriTemplate' => '/v2/{participant=projects/*/conversations/*/participants/*}:analyzeContent', + 'body' => '*', + 'additionalBindings' => [ + [ + 'method' => 'post', + 'uriTemplate' => '/v2/{participant=projects/*/locations/*/conversations/*/participants/*}:analyzeContent', + 'body' => '*', + ], + ], + 'placeholders' => [ + 'participant' => [ + 'getters' => [ + 'getParticipant', + ], + ], + ], + ], + 'CreateParticipant' => [ + 'method' => 'post', + 'uriTemplate' => '/v2/{parent=projects/*/conversations/*}/participants', + 'body' => 'participant', + 'additionalBindings' => [ + [ + 'method' => 'post', + 'uriTemplate' => '/v2/{parent=projects/*/locations/*/conversations/*}/participants', + 'body' => 'participant', + ], + ], + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + ], + 'GetParticipant' => [ + 'method' => 'get', + 'uriTemplate' => '/v2/{name=projects/*/conversations/*/participants/*}', + 'additionalBindings' => [ + [ + 'method' => 'get', + 'uriTemplate' => '/v2/{name=projects/*/locations/*/conversations/*/participants/*}', + ], + ], + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'ListParticipants' => [ + 'method' => 'get', + 'uriTemplate' => '/v2/{parent=projects/*/conversations/*}/participants', + 'additionalBindings' => [ + [ + 'method' => 'get', + 'uriTemplate' => '/v2/{parent=projects/*/locations/*/conversations/*}/participants', + ], + ], + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + ], + 'SuggestArticles' => [ + 'method' => 'post', + 'uriTemplate' => '/v2/{parent=projects/*/conversations/*/participants/*}/suggestions:suggestArticles', + 'body' => '*', + 'additionalBindings' => [ + [ + 'method' => 'post', + 'uriTemplate' => '/v2/{parent=projects/*/locations/*/conversations/*/participants/*}/suggestions:suggestArticles', + 'body' => '*', + ], + ], + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + ], + 'SuggestFaqAnswers' => [ + 'method' => 'post', + 'uriTemplate' => '/v2/{parent=projects/*/conversations/*/participants/*}/suggestions:suggestFaqAnswers', + 'body' => '*', + 'additionalBindings' => [ + [ + 'method' => 'post', + 'uriTemplate' => '/v2/{parent=projects/*/locations/*/conversations/*/participants/*}/suggestions:suggestFaqAnswers', + 'body' => '*', + ], + ], + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + ], + 'SuggestKnowledgeAssist' => [ + 'method' => 'post', + 'uriTemplate' => '/v2/{parent=projects/*/conversations/*/participants/*}/suggestions:suggestKnowledgeAssist', + 'body' => '*', + 'additionalBindings' => [ + [ + 'method' => 'post', + 'uriTemplate' => '/v2/{parent=projects/*/locations/*/conversations/*/participants/*}/suggestions:suggestKnowledgeAssist', + 'body' => '*', + ], + ], + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + ], + 'SuggestSmartReplies' => [ + 'method' => 'post', + 'uriTemplate' => '/v2/{parent=projects/*/conversations/*/participants/*}/suggestions:suggestSmartReplies', + 'body' => '*', + 'additionalBindings' => [ + [ + 'method' => 'post', + 'uriTemplate' => '/v2/{parent=projects/*/locations/*/conversations/*/participants/*}/suggestions:suggestSmartReplies', + 'body' => '*', + ], + ], + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + ], + 'UpdateParticipant' => [ + 'method' => 'patch', + 'uriTemplate' => '/v2/{participant.name=projects/*/conversations/*/participants/*}', + 'body' => 'participant', + 'additionalBindings' => [ + [ + 'method' => 'patch', + 'uriTemplate' => '/v2/{participant.name=projects/*/locations/*/conversations/*/participants/*}', + 'body' => 'participant', + 'queryParams' => [ + 'update_mask', + ], + ], + ], + 'placeholders' => [ + 'participant.name' => [ + 'getters' => [ + 'getParticipant', + 'getName', + ], + ], + ], + 'queryParams' => [ + 'update_mask', + ], + ], + ], + 'google.cloud.location.Locations' => [ + 'GetLocation' => [ + 'method' => 'get', + 'uriTemplate' => '/v2/{name=projects/*/locations/*}', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'ListLocations' => [ + 'method' => 'get', + 'uriTemplate' => '/v2/{name=projects/*}/locations', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + ], + 'google.longrunning.Operations' => [ + 'CancelOperation' => [ + 'method' => 'post', + 'uriTemplate' => '/v2/{name=projects/*/operations/*}:cancel', + 'additionalBindings' => [ + [ + 'method' => 'post', + 'uriTemplate' => '/v2/{name=projects/*/locations/*/operations/*}:cancel', + ], + ], + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'GetOperation' => [ + 'method' => 'get', + 'uriTemplate' => '/v2/{name=projects/*/operations/*}', + 'additionalBindings' => [ + [ + 'method' => 'get', + 'uriTemplate' => '/v2/{name=projects/*/locations/*/operations/*}', + ], + ], + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'ListOperations' => [ + 'method' => 'get', + 'uriTemplate' => '/v2/{name=projects/*}/operations', + 'additionalBindings' => [ + [ + 'method' => 'get', + 'uriTemplate' => '/v2/{name=projects/*/locations/*}/operations', + ], + ], + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + ], + ], + 'numericEnums' => true, +]; diff --git a/owl-bot-staging/Dialogflow/v2/src/V2/resources/session_entity_types_client_config.json b/owl-bot-staging/Dialogflow/v2/src/V2/resources/session_entity_types_client_config.json new file mode 100644 index 000000000000..521ba47be243 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/src/V2/resources/session_entity_types_client_config.json @@ -0,0 +1,69 @@ +{ + "interfaces": { + "google.cloud.dialogflow.v2.SessionEntityTypes": { + "retry_codes": { + "no_retry_codes": [], + "retry_policy_1_codes": [ + "UNAVAILABLE" + ] + }, + "retry_params": { + "no_retry_params": { + "initial_retry_delay_millis": 0, + "retry_delay_multiplier": 0.0, + "max_retry_delay_millis": 0, + "initial_rpc_timeout_millis": 0, + "rpc_timeout_multiplier": 1.0, + "max_rpc_timeout_millis": 0, + "total_timeout_millis": 0 + }, + "retry_policy_1_params": { + "initial_retry_delay_millis": 100, + "retry_delay_multiplier": 1.3, + "max_retry_delay_millis": 60000, + "initial_rpc_timeout_millis": 60000, + "rpc_timeout_multiplier": 1.0, + "max_rpc_timeout_millis": 60000, + "total_timeout_millis": 60000 + } + }, + "methods": { + "CreateSessionEntityType": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "DeleteSessionEntityType": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "GetSessionEntityType": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "ListSessionEntityTypes": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "UpdateSessionEntityType": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "GetLocation": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "ListLocations": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + } + } + } + } +} diff --git a/owl-bot-staging/Dialogflow/v2/src/V2/resources/session_entity_types_descriptor_config.php b/owl-bot-staging/Dialogflow/v2/src/V2/resources/session_entity_types_descriptor_config.php new file mode 100644 index 000000000000..4a3ab70206be --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/src/V2/resources/session_entity_types_descriptor_config.php @@ -0,0 +1,143 @@ + [ + 'google.cloud.dialogflow.v2.SessionEntityTypes' => [ + 'CreateSessionEntityType' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Dialogflow\V2\SessionEntityType', + 'headerParams' => [ + [ + 'keyName' => 'parent', + 'fieldAccessors' => [ + 'getParent', + ], + ], + ], + ], + 'DeleteSessionEntityType' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Protobuf\GPBEmpty', + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + ], + 'GetSessionEntityType' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Dialogflow\V2\SessionEntityType', + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + ], + 'ListSessionEntityTypes' => [ + 'pageStreaming' => [ + 'requestPageTokenGetMethod' => 'getPageToken', + 'requestPageTokenSetMethod' => 'setPageToken', + 'requestPageSizeGetMethod' => 'getPageSize', + 'requestPageSizeSetMethod' => 'setPageSize', + 'responsePageTokenGetMethod' => 'getNextPageToken', + 'resourcesGetMethod' => 'getSessionEntityTypes', + ], + 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, + 'responseType' => 'Google\Cloud\Dialogflow\V2\ListSessionEntityTypesResponse', + 'headerParams' => [ + [ + 'keyName' => 'parent', + 'fieldAccessors' => [ + 'getParent', + ], + ], + ], + ], + 'UpdateSessionEntityType' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Dialogflow\V2\SessionEntityType', + 'headerParams' => [ + [ + 'keyName' => 'session_entity_type.name', + 'fieldAccessors' => [ + 'getSessionEntityType', + 'getName', + ], + ], + ], + ], + 'GetLocation' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Location\Location', + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + 'interfaceOverride' => 'google.cloud.location.Locations', + ], + 'ListLocations' => [ + 'pageStreaming' => [ + 'requestPageTokenGetMethod' => 'getPageToken', + 'requestPageTokenSetMethod' => 'setPageToken', + 'requestPageSizeGetMethod' => 'getPageSize', + 'requestPageSizeSetMethod' => 'setPageSize', + 'responsePageTokenGetMethod' => 'getNextPageToken', + 'resourcesGetMethod' => 'getLocations', + ], + 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, + 'responseType' => 'Google\Cloud\Location\ListLocationsResponse', + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + 'interfaceOverride' => 'google.cloud.location.Locations', + ], + 'templateMap' => [ + 'projectEnvironmentUserSession' => 'projects/{project}/agent/environments/{environment}/users/{user}/sessions/{session}', + 'projectEnvironmentUserSessionEntityType' => 'projects/{project}/agent/environments/{environment}/users/{user}/sessions/{session}/entityTypes/{entity_type}', + 'projectLocationEnvironmentUserSession' => 'projects/{project}/locations/{location}/agent/environments/{environment}/users/{user}/sessions/{session}', + 'projectLocationEnvironmentUserSessionEntityType' => 'projects/{project}/locations/{location}/agent/environments/{environment}/users/{user}/sessions/{session}/entityTypes/{entity_type}', + 'projectLocationSession' => 'projects/{project}/locations/{location}/agent/sessions/{session}', + 'projectLocationSessionEntityType' => 'projects/{project}/locations/{location}/agent/sessions/{session}/entityTypes/{entity_type}', + 'projectSession' => 'projects/{project}/agent/sessions/{session}', + 'projectSessionEntityType' => 'projects/{project}/agent/sessions/{session}/entityTypes/{entity_type}', + 'session' => 'projects/{project}/agent/sessions/{session}', + 'sessionEntityType' => 'projects/{project}/agent/sessions/{session}/entityTypes/{entity_type}', + ], + ], + ], +]; diff --git a/owl-bot-staging/Dialogflow/v2/src/V2/resources/session_entity_types_rest_client_config.php b/owl-bot-staging/Dialogflow/v2/src/V2/resources/session_entity_types_rest_client_config.php new file mode 100644 index 000000000000..ab800d609729 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/src/V2/resources/session_entity_types_rest_client_config.php @@ -0,0 +1,240 @@ + [ + 'google.cloud.dialogflow.v2.SessionEntityTypes' => [ + 'CreateSessionEntityType' => [ + 'method' => 'post', + 'uriTemplate' => '/v2/{parent=projects/*/agent/sessions/*}/entityTypes', + 'body' => 'session_entity_type', + 'additionalBindings' => [ + [ + 'method' => 'post', + 'uriTemplate' => '/v2/{parent=projects/*/agent/environments/*/users/*/sessions/*}/entityTypes', + 'body' => 'session_entity_type', + ], + [ + 'method' => 'post', + 'uriTemplate' => '/v2/{parent=projects/*/locations/*/agent/sessions/*}/entityTypes', + 'body' => 'session_entity_type', + ], + [ + 'method' => 'post', + 'uriTemplate' => '/v2/{parent=projects/*/locations/*/agent/environments/*/users/*/sessions/*}/entityTypes', + 'body' => 'session_entity_type', + ], + ], + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + ], + 'DeleteSessionEntityType' => [ + 'method' => 'delete', + 'uriTemplate' => '/v2/{name=projects/*/agent/sessions/*/entityTypes/*}', + 'additionalBindings' => [ + [ + 'method' => 'delete', + 'uriTemplate' => '/v2/{name=projects/*/agent/environments/*/users/*/sessions/*/entityTypes/*}', + ], + [ + 'method' => 'delete', + 'uriTemplate' => '/v2/{name=projects/*/locations/*/agent/sessions/*/entityTypes/*}', + ], + [ + 'method' => 'delete', + 'uriTemplate' => '/v2/{name=projects/*/locations/*/agent/environments/*/users/*/sessions/*/entityTypes/*}', + ], + ], + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'GetSessionEntityType' => [ + 'method' => 'get', + 'uriTemplate' => '/v2/{name=projects/*/agent/sessions/*/entityTypes/*}', + 'additionalBindings' => [ + [ + 'method' => 'get', + 'uriTemplate' => '/v2/{name=projects/*/agent/environments/*/users/*/sessions/*/entityTypes/*}', + ], + [ + 'method' => 'get', + 'uriTemplate' => '/v2/{name=projects/*/locations/*/agent/sessions/*/entityTypes/*}', + ], + [ + 'method' => 'get', + 'uriTemplate' => '/v2/{name=projects/*/locations/*/agent/environments/*/users/*/sessions/*/entityTypes/*}', + ], + ], + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'ListSessionEntityTypes' => [ + 'method' => 'get', + 'uriTemplate' => '/v2/{parent=projects/*/agent/sessions/*}/entityTypes', + 'additionalBindings' => [ + [ + 'method' => 'get', + 'uriTemplate' => '/v2/{parent=projects/*/agent/environments/*/users/*/sessions/*}/entityTypes', + ], + [ + 'method' => 'get', + 'uriTemplate' => '/v2/{parent=projects/*/locations/*/agent/sessions/*}/entityTypes', + ], + [ + 'method' => 'get', + 'uriTemplate' => '/v2/{parent=projects/*/locations/*/agent/environments/*/users/*/sessions/*}/entityTypes', + ], + ], + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + ], + 'UpdateSessionEntityType' => [ + 'method' => 'patch', + 'uriTemplate' => '/v2/{session_entity_type.name=projects/*/agent/sessions/*/entityTypes/*}', + 'body' => 'session_entity_type', + 'additionalBindings' => [ + [ + 'method' => 'patch', + 'uriTemplate' => '/v2/{session_entity_type.name=projects/*/agent/environments/*/users/*/sessions/*/entityTypes/*}', + 'body' => 'session_entity_type', + ], + [ + 'method' => 'patch', + 'uriTemplate' => '/v2/{session_entity_type.name=projects/*/locations/*/agent/sessions/*/entityTypes/*}', + 'body' => 'session_entity_type', + ], + [ + 'method' => 'patch', + 'uriTemplate' => '/v2/{session_entity_type.name=projects/*/locations/*/agent/environments/*/users/*/sessions/*/entityTypes/*}', + 'body' => 'session_entity_type', + ], + ], + 'placeholders' => [ + 'session_entity_type.name' => [ + 'getters' => [ + 'getSessionEntityType', + 'getName', + ], + ], + ], + ], + ], + 'google.cloud.location.Locations' => [ + 'GetLocation' => [ + 'method' => 'get', + 'uriTemplate' => '/v2/{name=projects/*/locations/*}', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'ListLocations' => [ + 'method' => 'get', + 'uriTemplate' => '/v2/{name=projects/*}/locations', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + ], + 'google.longrunning.Operations' => [ + 'CancelOperation' => [ + 'method' => 'post', + 'uriTemplate' => '/v2/{name=projects/*/operations/*}:cancel', + 'additionalBindings' => [ + [ + 'method' => 'post', + 'uriTemplate' => '/v2/{name=projects/*/locations/*/operations/*}:cancel', + ], + ], + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'GetOperation' => [ + 'method' => 'get', + 'uriTemplate' => '/v2/{name=projects/*/operations/*}', + 'additionalBindings' => [ + [ + 'method' => 'get', + 'uriTemplate' => '/v2/{name=projects/*/locations/*/operations/*}', + ], + ], + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'ListOperations' => [ + 'method' => 'get', + 'uriTemplate' => '/v2/{name=projects/*}/operations', + 'additionalBindings' => [ + [ + 'method' => 'get', + 'uriTemplate' => '/v2/{name=projects/*/locations/*}/operations', + ], + ], + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + ], + ], + 'numericEnums' => true, +]; diff --git a/owl-bot-staging/Dialogflow/v2/src/V2/resources/sessions_client_config.json b/owl-bot-staging/Dialogflow/v2/src/V2/resources/sessions_client_config.json new file mode 100644 index 000000000000..4967706e6ba8 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/src/V2/resources/sessions_client_config.json @@ -0,0 +1,74 @@ +{ + "interfaces": { + "google.cloud.dialogflow.v2.Sessions": { + "retry_codes": { + "no_retry_codes": [], + "retry_policy_1_codes": [ + "UNAVAILABLE" + ], + "retry_policy_2_codes": [ + "UNAVAILABLE" + ], + "no_retry_1_codes": [] + }, + "retry_params": { + "no_retry_params": { + "initial_retry_delay_millis": 0, + "retry_delay_multiplier": 0.0, + "max_retry_delay_millis": 0, + "initial_rpc_timeout_millis": 0, + "rpc_timeout_multiplier": 1.0, + "max_rpc_timeout_millis": 0, + "total_timeout_millis": 0 + }, + "retry_policy_1_params": { + "initial_retry_delay_millis": 100, + "retry_delay_multiplier": 1.3, + "max_retry_delay_millis": 60000, + "initial_rpc_timeout_millis": 60000, + "rpc_timeout_multiplier": 1.0, + "max_rpc_timeout_millis": 60000, + "total_timeout_millis": 60000 + }, + "retry_policy_2_params": { + "initial_retry_delay_millis": 100, + "retry_delay_multiplier": 1.3, + "max_retry_delay_millis": 60000, + "initial_rpc_timeout_millis": 220000, + "rpc_timeout_multiplier": 1.0, + "max_rpc_timeout_millis": 220000, + "total_timeout_millis": 220000 + }, + "no_retry_1_params": { + "initial_retry_delay_millis": 0, + "retry_delay_multiplier": 0.0, + "max_retry_delay_millis": 0, + "initial_rpc_timeout_millis": 220000, + "rpc_timeout_multiplier": 1.0, + "max_rpc_timeout_millis": 220000, + "total_timeout_millis": 220000 + } + }, + "methods": { + "DetectIntent": { + "timeout_millis": 220000, + "retry_codes_name": "retry_policy_2_codes", + "retry_params_name": "retry_policy_2_params" + }, + "StreamingDetectIntent": { + "timeout_millis": 220000 + }, + "GetLocation": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "ListLocations": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + } + } + } + } +} diff --git a/owl-bot-staging/Dialogflow/v2/src/V2/resources/sessions_descriptor_config.php b/owl-bot-staging/Dialogflow/v2/src/V2/resources/sessions_descriptor_config.php new file mode 100644 index 000000000000..9841d3d32655 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/src/V2/resources/sessions_descriptor_config.php @@ -0,0 +1,98 @@ + [ + '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..cb68ff256c1b --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/src/V2/resources/sessions_rest_client_config.php @@ -0,0 +1,135 @@ + [ + 'google.cloud.dialogflow.v2.Sessions' => [ + 'DetectIntent' => [ + 'method' => 'post', + 'uriTemplate' => '/v2/{session=projects/*/agent/sessions/*}:detectIntent', + 'body' => '*', + 'additionalBindings' => [ + [ + 'method' => 'post', + 'uriTemplate' => '/v2/{session=projects/*/agent/environments/*/users/*/sessions/*}:detectIntent', + 'body' => '*', + ], + [ + 'method' => 'post', + 'uriTemplate' => '/v2/{session=projects/*/locations/*/agent/sessions/*}:detectIntent', + 'body' => '*', + ], + [ + 'method' => 'post', + 'uriTemplate' => '/v2/{session=projects/*/locations/*/agent/environments/*/users/*/sessions/*}:detectIntent', + 'body' => '*', + ], + ], + 'placeholders' => [ + 'session' => [ + 'getters' => [ + 'getSession', + ], + ], + ], + ], + ], + 'google.cloud.location.Locations' => [ + 'GetLocation' => [ + 'method' => 'get', + 'uriTemplate' => '/v2/{name=projects/*/locations/*}', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'ListLocations' => [ + 'method' => 'get', + 'uriTemplate' => '/v2/{name=projects/*}/locations', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + ], + 'google.longrunning.Operations' => [ + 'CancelOperation' => [ + 'method' => 'post', + 'uriTemplate' => '/v2/{name=projects/*/operations/*}:cancel', + 'additionalBindings' => [ + [ + 'method' => 'post', + 'uriTemplate' => '/v2/{name=projects/*/locations/*/operations/*}:cancel', + ], + ], + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'GetOperation' => [ + 'method' => 'get', + 'uriTemplate' => '/v2/{name=projects/*/operations/*}', + 'additionalBindings' => [ + [ + 'method' => 'get', + 'uriTemplate' => '/v2/{name=projects/*/locations/*/operations/*}', + ], + ], + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'ListOperations' => [ + 'method' => 'get', + 'uriTemplate' => '/v2/{name=projects/*}/operations', + 'additionalBindings' => [ + [ + 'method' => 'get', + 'uriTemplate' => '/v2/{name=projects/*/locations/*}/operations', + ], + ], + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + ], + ], + 'numericEnums' => true, +]; diff --git a/owl-bot-staging/Dialogflow/v2/src/V2/resources/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..9d7753d6ddbf --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/src/V2/resources/versions_descriptor_config.php @@ -0,0 +1,139 @@ + [ + 'google.cloud.dialogflow.v2.Versions' => [ + 'CreateVersion' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Dialogflow\V2\Version', + 'headerParams' => [ + [ + 'keyName' => 'parent', + 'fieldAccessors' => [ + 'getParent', + ], + ], + ], + ], + 'DeleteVersion' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Protobuf\GPBEmpty', + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + ], + 'GetVersion' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Dialogflow\V2\Version', + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + ], + 'ListVersions' => [ + 'pageStreaming' => [ + 'requestPageTokenGetMethod' => 'getPageToken', + 'requestPageTokenSetMethod' => 'setPageToken', + 'requestPageSizeGetMethod' => 'getPageSize', + 'requestPageSizeSetMethod' => 'setPageSize', + 'responsePageTokenGetMethod' => 'getNextPageToken', + 'resourcesGetMethod' => 'getVersions', + ], + 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, + 'responseType' => 'Google\Cloud\Dialogflow\V2\ListVersionsResponse', + 'headerParams' => [ + [ + 'keyName' => 'parent', + 'fieldAccessors' => [ + 'getParent', + ], + ], + ], + ], + 'UpdateVersion' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Dialogflow\V2\Version', + 'headerParams' => [ + [ + 'keyName' => 'version.name', + 'fieldAccessors' => [ + 'getVersion', + 'getName', + ], + ], + ], + ], + 'GetLocation' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Location\Location', + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + 'interfaceOverride' => 'google.cloud.location.Locations', + ], + 'ListLocations' => [ + 'pageStreaming' => [ + 'requestPageTokenGetMethod' => 'getPageToken', + 'requestPageTokenSetMethod' => 'setPageToken', + 'requestPageSizeGetMethod' => 'getPageSize', + 'requestPageSizeSetMethod' => 'setPageSize', + 'responsePageTokenGetMethod' => 'getNextPageToken', + 'resourcesGetMethod' => 'getLocations', + ], + 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, + 'responseType' => 'Google\Cloud\Location\ListLocationsResponse', + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + 'interfaceOverride' => 'google.cloud.location.Locations', + ], + 'templateMap' => [ + 'agent' => 'projects/{project}/agent', + 'projectAgent' => 'projects/{project}/agent', + 'projectLocationAgent' => 'projects/{project}/locations/{location}/agent', + 'projectLocationVersion' => 'projects/{project}/locations/{location}/agent/versions/{version}', + 'projectVersion' => 'projects/{project}/agent/versions/{version}', + 'version' => 'projects/{project}/agent/versions/{version}', + ], + ], + ], +]; diff --git a/owl-bot-staging/Dialogflow/v2/src/V2/resources/versions_rest_client_config.php b/owl-bot-staging/Dialogflow/v2/src/V2/resources/versions_rest_client_config.php new file mode 100644 index 000000000000..d10527947441 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/src/V2/resources/versions_rest_client_config.php @@ -0,0 +1,202 @@ + [ + 'google.cloud.dialogflow.v2.Versions' => [ + 'CreateVersion' => [ + 'method' => 'post', + 'uriTemplate' => '/v2/{parent=projects/*/agent}/versions', + 'body' => 'version', + 'additionalBindings' => [ + [ + 'method' => 'post', + 'uriTemplate' => '/v2/{parent=projects/*/locations/*/agent}/versions', + 'body' => 'version', + ], + ], + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + ], + 'DeleteVersion' => [ + 'method' => 'delete', + 'uriTemplate' => '/v2/{name=projects/*/agent/versions/*}', + 'additionalBindings' => [ + [ + 'method' => 'delete', + 'uriTemplate' => '/v2/{name=projects/*/locations/*/agent/versions/*}', + ], + ], + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'GetVersion' => [ + 'method' => 'get', + 'uriTemplate' => '/v2/{name=projects/*/agent/versions/*}', + 'additionalBindings' => [ + [ + 'method' => 'get', + 'uriTemplate' => '/v2/{name=projects/*/locations/*/agent/versions/*}', + ], + ], + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'ListVersions' => [ + 'method' => 'get', + 'uriTemplate' => '/v2/{parent=projects/*/agent}/versions', + 'additionalBindings' => [ + [ + 'method' => 'get', + 'uriTemplate' => '/v2/{parent=projects/*/locations/*/agent}/versions', + ], + ], + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + ], + 'UpdateVersion' => [ + 'method' => 'patch', + 'uriTemplate' => '/v2/{version.name=projects/*/agent/versions/*}', + 'body' => 'version', + 'additionalBindings' => [ + [ + 'method' => 'patch', + 'uriTemplate' => '/v2/{version.name=projects/*/locations/*/agent/versions/*}', + 'body' => 'version', + 'queryParams' => [ + 'update_mask', + ], + ], + ], + 'placeholders' => [ + 'version.name' => [ + 'getters' => [ + 'getVersion', + 'getName', + ], + ], + ], + 'queryParams' => [ + 'update_mask', + ], + ], + ], + 'google.cloud.location.Locations' => [ + 'GetLocation' => [ + 'method' => 'get', + 'uriTemplate' => '/v2/{name=projects/*/locations/*}', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'ListLocations' => [ + 'method' => 'get', + 'uriTemplate' => '/v2/{name=projects/*}/locations', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + ], + 'google.longrunning.Operations' => [ + 'CancelOperation' => [ + 'method' => 'post', + 'uriTemplate' => '/v2/{name=projects/*/operations/*}:cancel', + 'additionalBindings' => [ + [ + 'method' => 'post', + 'uriTemplate' => '/v2/{name=projects/*/locations/*/operations/*}:cancel', + ], + ], + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'GetOperation' => [ + 'method' => 'get', + 'uriTemplate' => '/v2/{name=projects/*/operations/*}', + 'additionalBindings' => [ + [ + 'method' => 'get', + 'uriTemplate' => '/v2/{name=projects/*/locations/*/operations/*}', + ], + ], + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'ListOperations' => [ + 'method' => 'get', + 'uriTemplate' => '/v2/{name=projects/*}/operations', + 'additionalBindings' => [ + [ + 'method' => 'get', + 'uriTemplate' => '/v2/{name=projects/*/locations/*}/operations', + ], + ], + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + ], + ], + 'numericEnums' => true, +]; diff --git a/owl-bot-staging/Dialogflow/v2/tests/Unit/V2/AgentsClientTest.php b/owl-bot-staging/Dialogflow/v2/tests/Unit/V2/AgentsClientTest.php new file mode 100644 index 000000000000..0e50edb9b689 --- /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..e150a76137bd --- /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..e1deb6232bdb --- /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..afe99defe2a5 --- /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..26450e1422cf --- /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..ad973c022732 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/tests/Unit/V2/Client/ConversationDatasetsClientTest.php @@ -0,0 +1,825 @@ +getMockBuilder(CredentialsWrapper::class)->disableOriginalConstructor()->getMock(); + } + + /** @return ConversationDatasetsClient */ + private function createClient(array $options = []) + { + $options += [ + 'credentials' => $this->createCredentials(), + ]; + return new ConversationDatasetsClient($options); + } + + /** @test */ + public function createConversationDatasetTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/createConversationDatasetTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $name = 'name3373707'; + $displayName = 'displayName1615086568'; + $description = 'description-1724546052'; + $conversationCount = 1994187347; + $satisfiesPzi = false; + $satisfiesPzs = false; + $expectedResponse = new ConversationDataset(); + $expectedResponse->setName($name); + $expectedResponse->setDisplayName($displayName); + $expectedResponse->setDescription($description); + $expectedResponse->setConversationCount($conversationCount); + $expectedResponse->setSatisfiesPzi($satisfiesPzi); + $expectedResponse->setSatisfiesPzs($satisfiesPzs); + $anyResponse = new Any(); + $anyResponse->setValue($expectedResponse->serializeToString()); + $completeOperation = new Operation(); + $completeOperation->setName('operations/createConversationDatasetTest'); + $completeOperation->setDone(true); + $completeOperation->setResponse($anyResponse); + $operationsTransport->addResponse($completeOperation); + // Mock request + $parent = 'parent-995424086'; + $conversationDataset = new ConversationDataset(); + $conversationDatasetDisplayName = 'conversationDatasetDisplayName-925930312'; + $conversationDataset->setDisplayName($conversationDatasetDisplayName); + $request = (new CreateConversationDatasetRequest()) + ->setParent($parent) + ->setConversationDataset($conversationDataset); + $response = $gapicClient->createConversationDataset($request); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $apiRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($apiRequests)); + $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); + $this->assertSame(0, count($operationsRequestsEmpty)); + $actualApiFuncCall = $apiRequests[0]->getFuncCall(); + $actualApiRequestObject = $apiRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.dialogflow.v2.ConversationDatasets/CreateConversationDataset', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getParent(); + $this->assertProtobufEquals($parent, $actualValue); + $actualValue = $actualApiRequestObject->getConversationDataset(); + $this->assertProtobufEquals($conversationDataset, $actualValue); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/createConversationDatasetTest'); + $response->pollUntilComplete([ + 'initialPollDelayMillis' => 1, + ]); + $this->assertTrue($response->isDone()); + $this->assertEquals($expectedResponse, $response->getResult()); + $apiRequestsEmpty = $transport->popReceivedCalls(); + $this->assertSame(0, count($apiRequestsEmpty)); + $operationsRequests = $operationsTransport->popReceivedCalls(); + $this->assertSame(1, count($operationsRequests)); + $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); + $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); + $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); + $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function createConversationDatasetExceptionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/createConversationDatasetTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $operationsTransport->addResponse(null, $status); + // Mock request + $parent = 'parent-995424086'; + $conversationDataset = new ConversationDataset(); + $conversationDatasetDisplayName = 'conversationDatasetDisplayName-925930312'; + $conversationDataset->setDisplayName($conversationDatasetDisplayName); + $request = (new CreateConversationDatasetRequest()) + ->setParent($parent) + ->setConversationDataset($conversationDataset); + $response = $gapicClient->createConversationDataset($request); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/createConversationDatasetTest'); + try { + $response->pollUntilComplete([ + 'initialPollDelayMillis' => 1, + ]); + // If the pollUntilComplete() method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stubs are exhausted + $transport->popReceivedCalls(); + $operationsTransport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function deleteConversationDatasetTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/deleteConversationDatasetTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $expectedResponse = new GPBEmpty(); + $anyResponse = new Any(); + $anyResponse->setValue($expectedResponse->serializeToString()); + $completeOperation = new Operation(); + $completeOperation->setName('operations/deleteConversationDatasetTest'); + $completeOperation->setDone(true); + $completeOperation->setResponse($anyResponse); + $operationsTransport->addResponse($completeOperation); + // Mock request + $formattedName = $gapicClient->conversationDatasetName('[PROJECT]', '[LOCATION]', '[CONVERSATION_DATASET]'); + $request = (new DeleteConversationDatasetRequest()) + ->setName($formattedName); + $response = $gapicClient->deleteConversationDataset($request); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $apiRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($apiRequests)); + $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); + $this->assertSame(0, count($operationsRequestsEmpty)); + $actualApiFuncCall = $apiRequests[0]->getFuncCall(); + $actualApiRequestObject = $apiRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.dialogflow.v2.ConversationDatasets/DeleteConversationDataset', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/deleteConversationDatasetTest'); + $response->pollUntilComplete([ + 'initialPollDelayMillis' => 1, + ]); + $this->assertTrue($response->isDone()); + $this->assertEquals($expectedResponse, $response->getResult()); + $apiRequestsEmpty = $transport->popReceivedCalls(); + $this->assertSame(0, count($apiRequestsEmpty)); + $operationsRequests = $operationsTransport->popReceivedCalls(); + $this->assertSame(1, count($operationsRequests)); + $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); + $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); + $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); + $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function deleteConversationDatasetExceptionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/deleteConversationDatasetTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $operationsTransport->addResponse(null, $status); + // Mock request + $formattedName = $gapicClient->conversationDatasetName('[PROJECT]', '[LOCATION]', '[CONVERSATION_DATASET]'); + $request = (new DeleteConversationDatasetRequest()) + ->setName($formattedName); + $response = $gapicClient->deleteConversationDataset($request); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/deleteConversationDatasetTest'); + try { + $response->pollUntilComplete([ + 'initialPollDelayMillis' => 1, + ]); + // If the pollUntilComplete() method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stubs are exhausted + $transport->popReceivedCalls(); + $operationsTransport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function getConversationDatasetTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name2 = 'name2-1052831874'; + $displayName = 'displayName1615086568'; + $description = 'description-1724546052'; + $conversationCount = 1994187347; + $satisfiesPzi = false; + $satisfiesPzs = false; + $expectedResponse = new ConversationDataset(); + $expectedResponse->setName($name2); + $expectedResponse->setDisplayName($displayName); + $expectedResponse->setDescription($description); + $expectedResponse->setConversationCount($conversationCount); + $expectedResponse->setSatisfiesPzi($satisfiesPzi); + $expectedResponse->setSatisfiesPzs($satisfiesPzs); + $transport->addResponse($expectedResponse); + // Mock request + $formattedName = $gapicClient->conversationDatasetName('[PROJECT]', '[LOCATION]', '[CONVERSATION_DATASET]'); + $request = (new GetConversationDatasetRequest()) + ->setName($formattedName); + $response = $gapicClient->getConversationDataset($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.dialogflow.v2.ConversationDatasets/GetConversationDataset', $actualFuncCall); + $actualValue = $actualRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getConversationDatasetExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $formattedName = $gapicClient->conversationDatasetName('[PROJECT]', '[LOCATION]', '[CONVERSATION_DATASET]'); + $request = (new GetConversationDatasetRequest()) + ->setName($formattedName); + try { + $gapicClient->getConversationDataset($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function importConversationDataTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/importConversationDataTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $conversationDataset = 'conversationDataset1344013500'; + $importCount = 1721296907; + $expectedResponse = new ImportConversationDataOperationResponse(); + $expectedResponse->setConversationDataset($conversationDataset); + $expectedResponse->setImportCount($importCount); + $anyResponse = new Any(); + $anyResponse->setValue($expectedResponse->serializeToString()); + $completeOperation = new Operation(); + $completeOperation->setName('operations/importConversationDataTest'); + $completeOperation->setDone(true); + $completeOperation->setResponse($anyResponse); + $operationsTransport->addResponse($completeOperation); + // Mock request + $formattedName = $gapicClient->conversationDatasetName('[PROJECT]', '[LOCATION]', '[CONVERSATION_DATASET]'); + $inputConfig = new InputConfig(); + $request = (new ImportConversationDataRequest()) + ->setName($formattedName) + ->setInputConfig($inputConfig); + $response = $gapicClient->importConversationData($request); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $apiRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($apiRequests)); + $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); + $this->assertSame(0, count($operationsRequestsEmpty)); + $actualApiFuncCall = $apiRequests[0]->getFuncCall(); + $actualApiRequestObject = $apiRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.dialogflow.v2.ConversationDatasets/ImportConversationData', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $actualValue = $actualApiRequestObject->getInputConfig(); + $this->assertProtobufEquals($inputConfig, $actualValue); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/importConversationDataTest'); + $response->pollUntilComplete([ + 'initialPollDelayMillis' => 1, + ]); + $this->assertTrue($response->isDone()); + $this->assertEquals($expectedResponse, $response->getResult()); + $apiRequestsEmpty = $transport->popReceivedCalls(); + $this->assertSame(0, count($apiRequestsEmpty)); + $operationsRequests = $operationsTransport->popReceivedCalls(); + $this->assertSame(1, count($operationsRequests)); + $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); + $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); + $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); + $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function importConversationDataExceptionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/importConversationDataTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $operationsTransport->addResponse(null, $status); + // Mock request + $formattedName = $gapicClient->conversationDatasetName('[PROJECT]', '[LOCATION]', '[CONVERSATION_DATASET]'); + $inputConfig = new InputConfig(); + $request = (new ImportConversationDataRequest()) + ->setName($formattedName) + ->setInputConfig($inputConfig); + $response = $gapicClient->importConversationData($request); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/importConversationDataTest'); + try { + $response->pollUntilComplete([ + 'initialPollDelayMillis' => 1, + ]); + // If the pollUntilComplete() method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stubs are exhausted + $transport->popReceivedCalls(); + $operationsTransport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function listConversationDatasetsTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $nextPageToken = ''; + $conversationDatasetsElement = new ConversationDataset(); + $conversationDatasets = [ + $conversationDatasetsElement, + ]; + $expectedResponse = new ListConversationDatasetsResponse(); + $expectedResponse->setNextPageToken($nextPageToken); + $expectedResponse->setConversationDatasets($conversationDatasets); + $transport->addResponse($expectedResponse); + // Mock request + $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); + $request = (new ListConversationDatasetsRequest()) + ->setParent($formattedParent); + $response = $gapicClient->listConversationDatasets($request); + $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); + $resources = iterator_to_array($response->iterateAllElements()); + $this->assertSame(1, count($resources)); + $this->assertEquals($expectedResponse->getConversationDatasets()[0], $resources[0]); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.dialogflow.v2.ConversationDatasets/ListConversationDatasets', $actualFuncCall); + $actualValue = $actualRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listConversationDatasetsExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); + $request = (new ListConversationDatasetsRequest()) + ->setParent($formattedParent); + try { + $gapicClient->listConversationDatasets($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getLocationTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name2 = 'name2-1052831874'; + $locationId = 'locationId552319461'; + $displayName = 'displayName1615086568'; + $expectedResponse = new Location(); + $expectedResponse->setName($name2); + $expectedResponse->setLocationId($locationId); + $expectedResponse->setDisplayName($displayName); + $transport->addResponse($expectedResponse); + $request = new GetLocationRequest(); + $response = $gapicClient->getLocation($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.location.Locations/GetLocation', $actualFuncCall); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getLocationExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + $request = new GetLocationRequest(); + try { + $gapicClient->getLocation($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listLocationsTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $nextPageToken = ''; + $locationsElement = new Location(); + $locations = [ + $locationsElement, + ]; + $expectedResponse = new ListLocationsResponse(); + $expectedResponse->setNextPageToken($nextPageToken); + $expectedResponse->setLocations($locations); + $transport->addResponse($expectedResponse); + $request = new ListLocationsRequest(); + $response = $gapicClient->listLocations($request); + $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); + $resources = iterator_to_array($response->iterateAllElements()); + $this->assertSame(1, count($resources)); + $this->assertEquals($expectedResponse->getLocations()[0], $resources[0]); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.location.Locations/ListLocations', $actualFuncCall); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listLocationsExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + $request = new ListLocationsRequest(); + try { + $gapicClient->listLocations($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function createConversationDatasetAsyncTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/createConversationDatasetTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $name = 'name3373707'; + $displayName = 'displayName1615086568'; + $description = 'description-1724546052'; + $conversationCount = 1994187347; + $satisfiesPzi = false; + $satisfiesPzs = false; + $expectedResponse = new ConversationDataset(); + $expectedResponse->setName($name); + $expectedResponse->setDisplayName($displayName); + $expectedResponse->setDescription($description); + $expectedResponse->setConversationCount($conversationCount); + $expectedResponse->setSatisfiesPzi($satisfiesPzi); + $expectedResponse->setSatisfiesPzs($satisfiesPzs); + $anyResponse = new Any(); + $anyResponse->setValue($expectedResponse->serializeToString()); + $completeOperation = new Operation(); + $completeOperation->setName('operations/createConversationDatasetTest'); + $completeOperation->setDone(true); + $completeOperation->setResponse($anyResponse); + $operationsTransport->addResponse($completeOperation); + // Mock request + $parent = 'parent-995424086'; + $conversationDataset = new ConversationDataset(); + $conversationDatasetDisplayName = 'conversationDatasetDisplayName-925930312'; + $conversationDataset->setDisplayName($conversationDatasetDisplayName); + $request = (new CreateConversationDatasetRequest()) + ->setParent($parent) + ->setConversationDataset($conversationDataset); + $response = $gapicClient->createConversationDatasetAsync($request)->wait(); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $apiRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($apiRequests)); + $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); + $this->assertSame(0, count($operationsRequestsEmpty)); + $actualApiFuncCall = $apiRequests[0]->getFuncCall(); + $actualApiRequestObject = $apiRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.dialogflow.v2.ConversationDatasets/CreateConversationDataset', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getParent(); + $this->assertProtobufEquals($parent, $actualValue); + $actualValue = $actualApiRequestObject->getConversationDataset(); + $this->assertProtobufEquals($conversationDataset, $actualValue); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/createConversationDatasetTest'); + $response->pollUntilComplete([ + 'initialPollDelayMillis' => 1, + ]); + $this->assertTrue($response->isDone()); + $this->assertEquals($expectedResponse, $response->getResult()); + $apiRequestsEmpty = $transport->popReceivedCalls(); + $this->assertSame(0, count($apiRequestsEmpty)); + $operationsRequests = $operationsTransport->popReceivedCalls(); + $this->assertSame(1, count($operationsRequests)); + $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); + $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); + $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); + $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } +} diff --git a/owl-bot-staging/Dialogflow/v2/tests/Unit/V2/Client/ConversationModelsClientTest.php b/owl-bot-staging/Dialogflow/v2/tests/Unit/V2/Client/ConversationModelsClientTest.php new file mode 100644 index 000000000000..7ac5c6a4d083 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/tests/Unit/V2/Client/ConversationModelsClientTest.php @@ -0,0 +1,1203 @@ +getMockBuilder(CredentialsWrapper::class)->disableOriginalConstructor()->getMock(); + } + + /** @return ConversationModelsClient */ + private function createClient(array $options = []) + { + $options += [ + 'credentials' => $this->createCredentials(), + ]; + return new ConversationModelsClient($options); + } + + /** @test */ + public function createConversationModelTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/createConversationModelTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $name = 'name3373707'; + $displayName = 'displayName1615086568'; + $languageCode = 'languageCode-412800396'; + $satisfiesPzs = false; + $satisfiesPzi = false; + $expectedResponse = new ConversationModel(); + $expectedResponse->setName($name); + $expectedResponse->setDisplayName($displayName); + $expectedResponse->setLanguageCode($languageCode); + $expectedResponse->setSatisfiesPzs($satisfiesPzs); + $expectedResponse->setSatisfiesPzi($satisfiesPzi); + $anyResponse = new Any(); + $anyResponse->setValue($expectedResponse->serializeToString()); + $completeOperation = new Operation(); + $completeOperation->setName('operations/createConversationModelTest'); + $completeOperation->setDone(true); + $completeOperation->setResponse($anyResponse); + $operationsTransport->addResponse($completeOperation); + // Mock request + $conversationModel = new ConversationModel(); + $conversationModelDisplayName = 'conversationModelDisplayName-1078928857'; + $conversationModel->setDisplayName($conversationModelDisplayName); + $conversationModelDatasets = []; + $conversationModel->setDatasets($conversationModelDatasets); + $request = (new CreateConversationModelRequest()) + ->setConversationModel($conversationModel); + $response = $gapicClient->createConversationModel($request); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $apiRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($apiRequests)); + $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); + $this->assertSame(0, count($operationsRequestsEmpty)); + $actualApiFuncCall = $apiRequests[0]->getFuncCall(); + $actualApiRequestObject = $apiRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.dialogflow.v2.ConversationModels/CreateConversationModel', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getConversationModel(); + $this->assertProtobufEquals($conversationModel, $actualValue); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/createConversationModelTest'); + $response->pollUntilComplete([ + 'initialPollDelayMillis' => 1, + ]); + $this->assertTrue($response->isDone()); + $this->assertEquals($expectedResponse, $response->getResult()); + $apiRequestsEmpty = $transport->popReceivedCalls(); + $this->assertSame(0, count($apiRequestsEmpty)); + $operationsRequests = $operationsTransport->popReceivedCalls(); + $this->assertSame(1, count($operationsRequests)); + $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); + $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); + $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); + $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function createConversationModelExceptionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/createConversationModelTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $operationsTransport->addResponse(null, $status); + // Mock request + $conversationModel = new ConversationModel(); + $conversationModelDisplayName = 'conversationModelDisplayName-1078928857'; + $conversationModel->setDisplayName($conversationModelDisplayName); + $conversationModelDatasets = []; + $conversationModel->setDatasets($conversationModelDatasets); + $request = (new CreateConversationModelRequest()) + ->setConversationModel($conversationModel); + $response = $gapicClient->createConversationModel($request); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/createConversationModelTest'); + try { + $response->pollUntilComplete([ + 'initialPollDelayMillis' => 1, + ]); + // If the pollUntilComplete() method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stubs are exhausted + $transport->popReceivedCalls(); + $operationsTransport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function createConversationModelEvaluationTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/createConversationModelEvaluationTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $name = 'name3373707'; + $displayName = 'displayName1615086568'; + $rawHumanEvalTemplateCsv = 'rawHumanEvalTemplateCsv-1393080869'; + $expectedResponse = new ConversationModelEvaluation(); + $expectedResponse->setName($name); + $expectedResponse->setDisplayName($displayName); + $expectedResponse->setRawHumanEvalTemplateCsv($rawHumanEvalTemplateCsv); + $anyResponse = new Any(); + $anyResponse->setValue($expectedResponse->serializeToString()); + $completeOperation = new Operation(); + $completeOperation->setName('operations/createConversationModelEvaluationTest'); + $completeOperation->setDone(true); + $completeOperation->setResponse($anyResponse); + $operationsTransport->addResponse($completeOperation); + // Mock request + $formattedParent = $gapicClient->conversationModelName('[PROJECT]', '[LOCATION]', '[CONVERSATION_MODEL]'); + $conversationModelEvaluation = new ConversationModelEvaluation(); + $request = (new CreateConversationModelEvaluationRequest()) + ->setParent($formattedParent) + ->setConversationModelEvaluation($conversationModelEvaluation); + $response = $gapicClient->createConversationModelEvaluation($request); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $apiRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($apiRequests)); + $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); + $this->assertSame(0, count($operationsRequestsEmpty)); + $actualApiFuncCall = $apiRequests[0]->getFuncCall(); + $actualApiRequestObject = $apiRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.dialogflow.v2.ConversationModels/CreateConversationModelEvaluation', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $actualValue = $actualApiRequestObject->getConversationModelEvaluation(); + $this->assertProtobufEquals($conversationModelEvaluation, $actualValue); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/createConversationModelEvaluationTest'); + $response->pollUntilComplete([ + 'initialPollDelayMillis' => 1, + ]); + $this->assertTrue($response->isDone()); + $this->assertEquals($expectedResponse, $response->getResult()); + $apiRequestsEmpty = $transport->popReceivedCalls(); + $this->assertSame(0, count($apiRequestsEmpty)); + $operationsRequests = $operationsTransport->popReceivedCalls(); + $this->assertSame(1, count($operationsRequests)); + $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); + $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); + $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); + $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function createConversationModelEvaluationExceptionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/createConversationModelEvaluationTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $operationsTransport->addResponse(null, $status); + // Mock request + $formattedParent = $gapicClient->conversationModelName('[PROJECT]', '[LOCATION]', '[CONVERSATION_MODEL]'); + $conversationModelEvaluation = new ConversationModelEvaluation(); + $request = (new CreateConversationModelEvaluationRequest()) + ->setParent($formattedParent) + ->setConversationModelEvaluation($conversationModelEvaluation); + $response = $gapicClient->createConversationModelEvaluation($request); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/createConversationModelEvaluationTest'); + try { + $response->pollUntilComplete([ + 'initialPollDelayMillis' => 1, + ]); + // If the pollUntilComplete() method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stubs are exhausted + $transport->popReceivedCalls(); + $operationsTransport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function deleteConversationModelTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/deleteConversationModelTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $expectedResponse = new GPBEmpty(); + $anyResponse = new Any(); + $anyResponse->setValue($expectedResponse->serializeToString()); + $completeOperation = new Operation(); + $completeOperation->setName('operations/deleteConversationModelTest'); + $completeOperation->setDone(true); + $completeOperation->setResponse($anyResponse); + $operationsTransport->addResponse($completeOperation); + // Mock request + $name = 'name3373707'; + $request = (new DeleteConversationModelRequest()) + ->setName($name); + $response = $gapicClient->deleteConversationModel($request); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $apiRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($apiRequests)); + $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); + $this->assertSame(0, count($operationsRequestsEmpty)); + $actualApiFuncCall = $apiRequests[0]->getFuncCall(); + $actualApiRequestObject = $apiRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.dialogflow.v2.ConversationModels/DeleteConversationModel', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getName(); + $this->assertProtobufEquals($name, $actualValue); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/deleteConversationModelTest'); + $response->pollUntilComplete([ + 'initialPollDelayMillis' => 1, + ]); + $this->assertTrue($response->isDone()); + $this->assertEquals($expectedResponse, $response->getResult()); + $apiRequestsEmpty = $transport->popReceivedCalls(); + $this->assertSame(0, count($apiRequestsEmpty)); + $operationsRequests = $operationsTransport->popReceivedCalls(); + $this->assertSame(1, count($operationsRequests)); + $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); + $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); + $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); + $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function deleteConversationModelExceptionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/deleteConversationModelTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $operationsTransport->addResponse(null, $status); + // Mock request + $name = 'name3373707'; + $request = (new DeleteConversationModelRequest()) + ->setName($name); + $response = $gapicClient->deleteConversationModel($request); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/deleteConversationModelTest'); + try { + $response->pollUntilComplete([ + 'initialPollDelayMillis' => 1, + ]); + // If the pollUntilComplete() method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stubs are exhausted + $transport->popReceivedCalls(); + $operationsTransport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function deployConversationModelTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/deployConversationModelTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $expectedResponse = new GPBEmpty(); + $anyResponse = new Any(); + $anyResponse->setValue($expectedResponse->serializeToString()); + $completeOperation = new Operation(); + $completeOperation->setName('operations/deployConversationModelTest'); + $completeOperation->setDone(true); + $completeOperation->setResponse($anyResponse); + $operationsTransport->addResponse($completeOperation); + // Mock request + $name = 'name3373707'; + $request = (new DeployConversationModelRequest()) + ->setName($name); + $response = $gapicClient->deployConversationModel($request); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $apiRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($apiRequests)); + $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); + $this->assertSame(0, count($operationsRequestsEmpty)); + $actualApiFuncCall = $apiRequests[0]->getFuncCall(); + $actualApiRequestObject = $apiRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.dialogflow.v2.ConversationModels/DeployConversationModel', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getName(); + $this->assertProtobufEquals($name, $actualValue); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/deployConversationModelTest'); + $response->pollUntilComplete([ + 'initialPollDelayMillis' => 1, + ]); + $this->assertTrue($response->isDone()); + $this->assertEquals($expectedResponse, $response->getResult()); + $apiRequestsEmpty = $transport->popReceivedCalls(); + $this->assertSame(0, count($apiRequestsEmpty)); + $operationsRequests = $operationsTransport->popReceivedCalls(); + $this->assertSame(1, count($operationsRequests)); + $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); + $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); + $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); + $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function deployConversationModelExceptionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/deployConversationModelTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $operationsTransport->addResponse(null, $status); + // Mock request + $name = 'name3373707'; + $request = (new DeployConversationModelRequest()) + ->setName($name); + $response = $gapicClient->deployConversationModel($request); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/deployConversationModelTest'); + try { + $response->pollUntilComplete([ + 'initialPollDelayMillis' => 1, + ]); + // If the pollUntilComplete() method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stubs are exhausted + $transport->popReceivedCalls(); + $operationsTransport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function getConversationModelTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name2 = 'name2-1052831874'; + $displayName = 'displayName1615086568'; + $languageCode = 'languageCode-412800396'; + $satisfiesPzs = false; + $satisfiesPzi = false; + $expectedResponse = new ConversationModel(); + $expectedResponse->setName($name2); + $expectedResponse->setDisplayName($displayName); + $expectedResponse->setLanguageCode($languageCode); + $expectedResponse->setSatisfiesPzs($satisfiesPzs); + $expectedResponse->setSatisfiesPzi($satisfiesPzi); + $transport->addResponse($expectedResponse); + // Mock request + $name = 'name3373707'; + $request = (new GetConversationModelRequest()) + ->setName($name); + $response = $gapicClient->getConversationModel($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.dialogflow.v2.ConversationModels/GetConversationModel', $actualFuncCall); + $actualValue = $actualRequestObject->getName(); + $this->assertProtobufEquals($name, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getConversationModelExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $name = 'name3373707'; + $request = (new GetConversationModelRequest()) + ->setName($name); + try { + $gapicClient->getConversationModel($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getConversationModelEvaluationTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name2 = 'name2-1052831874'; + $displayName = 'displayName1615086568'; + $rawHumanEvalTemplateCsv = 'rawHumanEvalTemplateCsv-1393080869'; + $expectedResponse = new ConversationModelEvaluation(); + $expectedResponse->setName($name2); + $expectedResponse->setDisplayName($displayName); + $expectedResponse->setRawHumanEvalTemplateCsv($rawHumanEvalTemplateCsv); + $transport->addResponse($expectedResponse); + // Mock request + $name = 'name3373707'; + $request = (new GetConversationModelEvaluationRequest()) + ->setName($name); + $response = $gapicClient->getConversationModelEvaluation($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.dialogflow.v2.ConversationModels/GetConversationModelEvaluation', $actualFuncCall); + $actualValue = $actualRequestObject->getName(); + $this->assertProtobufEquals($name, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getConversationModelEvaluationExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $name = 'name3373707'; + $request = (new GetConversationModelEvaluationRequest()) + ->setName($name); + try { + $gapicClient->getConversationModelEvaluation($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listConversationModelEvaluationsTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $nextPageToken = ''; + $conversationModelEvaluationsElement = new ConversationModelEvaluation(); + $conversationModelEvaluations = [ + $conversationModelEvaluationsElement, + ]; + $expectedResponse = new ListConversationModelEvaluationsResponse(); + $expectedResponse->setNextPageToken($nextPageToken); + $expectedResponse->setConversationModelEvaluations($conversationModelEvaluations); + $transport->addResponse($expectedResponse); + // Mock request + $parent = 'parent-995424086'; + $request = (new ListConversationModelEvaluationsRequest()) + ->setParent($parent); + $response = $gapicClient->listConversationModelEvaluations($request); + $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); + $resources = iterator_to_array($response->iterateAllElements()); + $this->assertSame(1, count($resources)); + $this->assertEquals($expectedResponse->getConversationModelEvaluations()[0], $resources[0]); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.dialogflow.v2.ConversationModels/ListConversationModelEvaluations', $actualFuncCall); + $actualValue = $actualRequestObject->getParent(); + $this->assertProtobufEquals($parent, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listConversationModelEvaluationsExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $parent = 'parent-995424086'; + $request = (new ListConversationModelEvaluationsRequest()) + ->setParent($parent); + try { + $gapicClient->listConversationModelEvaluations($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listConversationModelsTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $nextPageToken = ''; + $conversationModelsElement = new ConversationModel(); + $conversationModels = [ + $conversationModelsElement, + ]; + $expectedResponse = new ListConversationModelsResponse(); + $expectedResponse->setNextPageToken($nextPageToken); + $expectedResponse->setConversationModels($conversationModels); + $transport->addResponse($expectedResponse); + // Mock request + $parent = 'parent-995424086'; + $request = (new ListConversationModelsRequest()) + ->setParent($parent); + $response = $gapicClient->listConversationModels($request); + $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); + $resources = iterator_to_array($response->iterateAllElements()); + $this->assertSame(1, count($resources)); + $this->assertEquals($expectedResponse->getConversationModels()[0], $resources[0]); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.dialogflow.v2.ConversationModels/ListConversationModels', $actualFuncCall); + $actualValue = $actualRequestObject->getParent(); + $this->assertProtobufEquals($parent, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listConversationModelsExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $parent = 'parent-995424086'; + $request = (new ListConversationModelsRequest()) + ->setParent($parent); + try { + $gapicClient->listConversationModels($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function undeployConversationModelTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/undeployConversationModelTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $expectedResponse = new GPBEmpty(); + $anyResponse = new Any(); + $anyResponse->setValue($expectedResponse->serializeToString()); + $completeOperation = new Operation(); + $completeOperation->setName('operations/undeployConversationModelTest'); + $completeOperation->setDone(true); + $completeOperation->setResponse($anyResponse); + $operationsTransport->addResponse($completeOperation); + // Mock request + $name = 'name3373707'; + $request = (new UndeployConversationModelRequest()) + ->setName($name); + $response = $gapicClient->undeployConversationModel($request); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $apiRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($apiRequests)); + $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); + $this->assertSame(0, count($operationsRequestsEmpty)); + $actualApiFuncCall = $apiRequests[0]->getFuncCall(); + $actualApiRequestObject = $apiRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.dialogflow.v2.ConversationModels/UndeployConversationModel', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getName(); + $this->assertProtobufEquals($name, $actualValue); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/undeployConversationModelTest'); + $response->pollUntilComplete([ + 'initialPollDelayMillis' => 1, + ]); + $this->assertTrue($response->isDone()); + $this->assertEquals($expectedResponse, $response->getResult()); + $apiRequestsEmpty = $transport->popReceivedCalls(); + $this->assertSame(0, count($apiRequestsEmpty)); + $operationsRequests = $operationsTransport->popReceivedCalls(); + $this->assertSame(1, count($operationsRequests)); + $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); + $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); + $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); + $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function undeployConversationModelExceptionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/undeployConversationModelTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $operationsTransport->addResponse(null, $status); + // Mock request + $name = 'name3373707'; + $request = (new UndeployConversationModelRequest()) + ->setName($name); + $response = $gapicClient->undeployConversationModel($request); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/undeployConversationModelTest'); + try { + $response->pollUntilComplete([ + 'initialPollDelayMillis' => 1, + ]); + // If the pollUntilComplete() method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stubs are exhausted + $transport->popReceivedCalls(); + $operationsTransport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function getLocationTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name2 = 'name2-1052831874'; + $locationId = 'locationId552319461'; + $displayName = 'displayName1615086568'; + $expectedResponse = new Location(); + $expectedResponse->setName($name2); + $expectedResponse->setLocationId($locationId); + $expectedResponse->setDisplayName($displayName); + $transport->addResponse($expectedResponse); + $request = new GetLocationRequest(); + $response = $gapicClient->getLocation($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.location.Locations/GetLocation', $actualFuncCall); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getLocationExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + $request = new GetLocationRequest(); + try { + $gapicClient->getLocation($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listLocationsTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $nextPageToken = ''; + $locationsElement = new Location(); + $locations = [ + $locationsElement, + ]; + $expectedResponse = new ListLocationsResponse(); + $expectedResponse->setNextPageToken($nextPageToken); + $expectedResponse->setLocations($locations); + $transport->addResponse($expectedResponse); + $request = new ListLocationsRequest(); + $response = $gapicClient->listLocations($request); + $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); + $resources = iterator_to_array($response->iterateAllElements()); + $this->assertSame(1, count($resources)); + $this->assertEquals($expectedResponse->getLocations()[0], $resources[0]); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.location.Locations/ListLocations', $actualFuncCall); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listLocationsExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + $request = new ListLocationsRequest(); + try { + $gapicClient->listLocations($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function createConversationModelAsyncTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/createConversationModelTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $name = 'name3373707'; + $displayName = 'displayName1615086568'; + $languageCode = 'languageCode-412800396'; + $satisfiesPzs = false; + $satisfiesPzi = false; + $expectedResponse = new ConversationModel(); + $expectedResponse->setName($name); + $expectedResponse->setDisplayName($displayName); + $expectedResponse->setLanguageCode($languageCode); + $expectedResponse->setSatisfiesPzs($satisfiesPzs); + $expectedResponse->setSatisfiesPzi($satisfiesPzi); + $anyResponse = new Any(); + $anyResponse->setValue($expectedResponse->serializeToString()); + $completeOperation = new Operation(); + $completeOperation->setName('operations/createConversationModelTest'); + $completeOperation->setDone(true); + $completeOperation->setResponse($anyResponse); + $operationsTransport->addResponse($completeOperation); + // Mock request + $conversationModel = new ConversationModel(); + $conversationModelDisplayName = 'conversationModelDisplayName-1078928857'; + $conversationModel->setDisplayName($conversationModelDisplayName); + $conversationModelDatasets = []; + $conversationModel->setDatasets($conversationModelDatasets); + $request = (new CreateConversationModelRequest()) + ->setConversationModel($conversationModel); + $response = $gapicClient->createConversationModelAsync($request)->wait(); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $apiRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($apiRequests)); + $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); + $this->assertSame(0, count($operationsRequestsEmpty)); + $actualApiFuncCall = $apiRequests[0]->getFuncCall(); + $actualApiRequestObject = $apiRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.dialogflow.v2.ConversationModels/CreateConversationModel', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getConversationModel(); + $this->assertProtobufEquals($conversationModel, $actualValue); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/createConversationModelTest'); + $response->pollUntilComplete([ + 'initialPollDelayMillis' => 1, + ]); + $this->assertTrue($response->isDone()); + $this->assertEquals($expectedResponse, $response->getResult()); + $apiRequestsEmpty = $transport->popReceivedCalls(); + $this->assertSame(0, count($apiRequestsEmpty)); + $operationsRequests = $operationsTransport->popReceivedCalls(); + $this->assertSame(1, count($operationsRequests)); + $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); + $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); + $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); + $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } +} diff --git a/owl-bot-staging/Dialogflow/v2/tests/Unit/V2/Client/ConversationProfilesClientTest.php b/owl-bot-staging/Dialogflow/v2/tests/Unit/V2/Client/ConversationProfilesClientTest.php new file mode 100644 index 000000000000..5df2196def3a --- /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..732aadc5d072 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/tests/Unit/V2/Client/ConversationsClientTest.php @@ -0,0 +1,881 @@ +getMockBuilder(CredentialsWrapper::class)->disableOriginalConstructor()->getMock(); + } + + /** @return ConversationsClient */ + private function createClient(array $options = []) + { + $options += [ + 'credentials' => $this->createCredentials(), + ]; + return new ConversationsClient($options); + } + + /** @test */ + public function completeConversationTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name2 = 'name2-1052831874'; + $conversationProfile = 'conversationProfile-408626707'; + $expectedResponse = new Conversation(); + $expectedResponse->setName($name2); + $expectedResponse->setConversationProfile($conversationProfile); + $transport->addResponse($expectedResponse); + // Mock request + $formattedName = $gapicClient->conversationName('[PROJECT]', '[CONVERSATION]'); + $request = (new CompleteConversationRequest()) + ->setName($formattedName); + $response = $gapicClient->completeConversation($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.dialogflow.v2.Conversations/CompleteConversation', $actualFuncCall); + $actualValue = $actualRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function completeConversationExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $formattedName = $gapicClient->conversationName('[PROJECT]', '[CONVERSATION]'); + $request = (new CompleteConversationRequest()) + ->setName($formattedName); + try { + $gapicClient->completeConversation($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function createConversationTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name = 'name3373707'; + $conversationProfile = 'conversationProfile-408626707'; + $expectedResponse = new Conversation(); + $expectedResponse->setName($name); + $expectedResponse->setConversationProfile($conversationProfile); + $transport->addResponse($expectedResponse); + // Mock request + $formattedParent = $gapicClient->projectName('[PROJECT]'); + $conversation = new Conversation(); + $conversationConversationProfile = $gapicClient->conversationProfileName('[PROJECT]', '[CONVERSATION_PROFILE]'); + $conversation->setConversationProfile($conversationConversationProfile); + $request = (new CreateConversationRequest()) + ->setParent($formattedParent) + ->setConversation($conversation); + $response = $gapicClient->createConversation($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.dialogflow.v2.Conversations/CreateConversation', $actualFuncCall); + $actualValue = $actualRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $actualValue = $actualRequestObject->getConversation(); + $this->assertProtobufEquals($conversation, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function createConversationExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $formattedParent = $gapicClient->projectName('[PROJECT]'); + $conversation = new Conversation(); + $conversationConversationProfile = $gapicClient->conversationProfileName('[PROJECT]', '[CONVERSATION_PROFILE]'); + $conversation->setConversationProfile($conversationConversationProfile); + $request = (new CreateConversationRequest()) + ->setParent($formattedParent) + ->setConversation($conversation); + try { + $gapicClient->createConversation($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function generateStatelessSuggestionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $expectedResponse = new GenerateStatelessSuggestionResponse(); + $transport->addResponse($expectedResponse); + // Mock request + $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); + $request = (new GenerateStatelessSuggestionRequest()) + ->setParent($formattedParent); + $response = $gapicClient->generateStatelessSuggestion($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.dialogflow.v2.Conversations/GenerateStatelessSuggestion', $actualFuncCall); + $actualValue = $actualRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function generateStatelessSuggestionExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); + $request = (new GenerateStatelessSuggestionRequest()) + ->setParent($formattedParent); + try { + $gapicClient->generateStatelessSuggestion($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function generateStatelessSummaryTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $latestMessage2 = 'latestMessage2-440913086'; + $contextSize = 1116903569; + $expectedResponse = new GenerateStatelessSummaryResponse(); + $expectedResponse->setLatestMessage($latestMessage2); + $expectedResponse->setContextSize($contextSize); + $transport->addResponse($expectedResponse); + // Mock request + $statelessConversation = new MinimalConversation(); + $statelessConversationMessages = []; + $statelessConversation->setMessages($statelessConversationMessages); + $statelessConversationParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); + $statelessConversation->setParent($statelessConversationParent); + $conversationProfile = new ConversationProfile(); + $conversationProfileDisplayName = 'conversationProfileDisplayName-203415833'; + $conversationProfile->setDisplayName($conversationProfileDisplayName); + $request = (new GenerateStatelessSummaryRequest()) + ->setStatelessConversation($statelessConversation) + ->setConversationProfile($conversationProfile); + $response = $gapicClient->generateStatelessSummary($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.dialogflow.v2.Conversations/GenerateStatelessSummary', $actualFuncCall); + $actualValue = $actualRequestObject->getStatelessConversation(); + $this->assertProtobufEquals($statelessConversation, $actualValue); + $actualValue = $actualRequestObject->getConversationProfile(); + $this->assertProtobufEquals($conversationProfile, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function generateStatelessSummaryExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $statelessConversation = new MinimalConversation(); + $statelessConversationMessages = []; + $statelessConversation->setMessages($statelessConversationMessages); + $statelessConversationParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); + $statelessConversation->setParent($statelessConversationParent); + $conversationProfile = new ConversationProfile(); + $conversationProfileDisplayName = 'conversationProfileDisplayName-203415833'; + $conversationProfile->setDisplayName($conversationProfileDisplayName); + $request = (new GenerateStatelessSummaryRequest()) + ->setStatelessConversation($statelessConversation) + ->setConversationProfile($conversationProfile); + try { + $gapicClient->generateStatelessSummary($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function 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 searchKnowledgeTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $rewrittenQuery = 'rewrittenQuery-1113584563'; + $expectedResponse = new SearchKnowledgeResponse(); + $expectedResponse->setRewrittenQuery($rewrittenQuery); + $transport->addResponse($expectedResponse); + // Mock request + $query = new TextInput(); + $queryText = 'queryText-1806881259'; + $query->setText($queryText); + $queryLanguageCode = 'queryLanguageCode66898509'; + $query->setLanguageCode($queryLanguageCode); + $formattedConversationProfile = $gapicClient->conversationProfileName('[PROJECT]', '[CONVERSATION_PROFILE]'); + $request = (new SearchKnowledgeRequest()) + ->setQuery($query) + ->setConversationProfile($formattedConversationProfile); + $response = $gapicClient->searchKnowledge($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.dialogflow.v2.Conversations/SearchKnowledge', $actualFuncCall); + $actualValue = $actualRequestObject->getQuery(); + $this->assertProtobufEquals($query, $actualValue); + $actualValue = $actualRequestObject->getConversationProfile(); + $this->assertProtobufEquals($formattedConversationProfile, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function searchKnowledgeExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $query = new TextInput(); + $queryText = 'queryText-1806881259'; + $query->setText($queryText); + $queryLanguageCode = 'queryLanguageCode66898509'; + $query->setLanguageCode($queryLanguageCode); + $formattedConversationProfile = $gapicClient->conversationProfileName('[PROJECT]', '[CONVERSATION_PROFILE]'); + $request = (new SearchKnowledgeRequest()) + ->setQuery($query) + ->setConversationProfile($formattedConversationProfile); + try { + $gapicClient->searchKnowledge($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function suggestConversationSummaryTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $latestMessage2 = 'latestMessage2-440913086'; + $contextSize2 = 397491196; + $expectedResponse = new SuggestConversationSummaryResponse(); + $expectedResponse->setLatestMessage($latestMessage2); + $expectedResponse->setContextSize($contextSize2); + $transport->addResponse($expectedResponse); + // Mock request + $formattedConversation = $gapicClient->conversationName('[PROJECT]', '[CONVERSATION]'); + $request = (new SuggestConversationSummaryRequest()) + ->setConversation($formattedConversation); + $response = $gapicClient->suggestConversationSummary($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.dialogflow.v2.Conversations/SuggestConversationSummary', $actualFuncCall); + $actualValue = $actualRequestObject->getConversation(); + $this->assertProtobufEquals($formattedConversation, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function suggestConversationSummaryExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $formattedConversation = $gapicClient->conversationName('[PROJECT]', '[CONVERSATION]'); + $request = (new SuggestConversationSummaryRequest()) + ->setConversation($formattedConversation); + try { + $gapicClient->suggestConversationSummary($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getLocationTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name2 = 'name2-1052831874'; + $locationId = 'locationId552319461'; + $displayName = 'displayName1615086568'; + $expectedResponse = new Location(); + $expectedResponse->setName($name2); + $expectedResponse->setLocationId($locationId); + $expectedResponse->setDisplayName($displayName); + $transport->addResponse($expectedResponse); + $request = new GetLocationRequest(); + $response = $gapicClient->getLocation($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.location.Locations/GetLocation', $actualFuncCall); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getLocationExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + $request = new GetLocationRequest(); + try { + $gapicClient->getLocation($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listLocationsTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $nextPageToken = ''; + $locationsElement = new Location(); + $locations = [ + $locationsElement, + ]; + $expectedResponse = new ListLocationsResponse(); + $expectedResponse->setNextPageToken($nextPageToken); + $expectedResponse->setLocations($locations); + $transport->addResponse($expectedResponse); + $request = new ListLocationsRequest(); + $response = $gapicClient->listLocations($request); + $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); + $resources = iterator_to_array($response->iterateAllElements()); + $this->assertSame(1, count($resources)); + $this->assertEquals($expectedResponse->getLocations()[0], $resources[0]); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.location.Locations/ListLocations', $actualFuncCall); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listLocationsExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + $request = new ListLocationsRequest(); + try { + $gapicClient->listLocations($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function completeConversationAsyncTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name2 = 'name2-1052831874'; + $conversationProfile = 'conversationProfile-408626707'; + $expectedResponse = new Conversation(); + $expectedResponse->setName($name2); + $expectedResponse->setConversationProfile($conversationProfile); + $transport->addResponse($expectedResponse); + // Mock request + $formattedName = $gapicClient->conversationName('[PROJECT]', '[CONVERSATION]'); + $request = (new CompleteConversationRequest()) + ->setName($formattedName); + $response = $gapicClient->completeConversationAsync($request)->wait(); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.dialogflow.v2.Conversations/CompleteConversation', $actualFuncCall); + $actualValue = $actualRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $this->assertTrue($transport->isExhausted()); + } +} diff --git a/owl-bot-staging/Dialogflow/v2/tests/Unit/V2/Client/DocumentsClientTest.php b/owl-bot-staging/Dialogflow/v2/tests/Unit/V2/Client/DocumentsClientTest.php new file mode 100644 index 000000000000..adee77d94af1 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/tests/Unit/V2/Client/DocumentsClientTest.php @@ -0,0 +1,1243 @@ +getMockBuilder(CredentialsWrapper::class)->disableOriginalConstructor()->getMock(); + } + + /** @return DocumentsClient */ + private function createClient(array $options = []) + { + $options += [ + 'credentials' => $this->createCredentials(), + ]; + return new DocumentsClient($options); + } + + /** @test */ + public function createDocumentTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/createDocumentTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $name = 'name3373707'; + $displayName = 'displayName1615086568'; + $mimeType = 'mimeType-196041627'; + $contentUri = 'contentUri-388807514'; + $enableAutoReload = false; + $expectedResponse = new Document(); + $expectedResponse->setName($name); + $expectedResponse->setDisplayName($displayName); + $expectedResponse->setMimeType($mimeType); + $expectedResponse->setContentUri($contentUri); + $expectedResponse->setEnableAutoReload($enableAutoReload); + $anyResponse = new Any(); + $anyResponse->setValue($expectedResponse->serializeToString()); + $completeOperation = new Operation(); + $completeOperation->setName('operations/createDocumentTest'); + $completeOperation->setDone(true); + $completeOperation->setResponse($anyResponse); + $operationsTransport->addResponse($completeOperation); + // Mock request + $formattedParent = $gapicClient->knowledgeBaseName('[PROJECT]', '[KNOWLEDGE_BASE]'); + $document = new Document(); + $documentDisplayName = 'documentDisplayName-59212206'; + $document->setDisplayName($documentDisplayName); + $documentMimeType = 'documentMimeType1242814409'; + $document->setMimeType($documentMimeType); + $documentKnowledgeTypes = []; + $document->setKnowledgeTypes($documentKnowledgeTypes); + $request = (new CreateDocumentRequest()) + ->setParent($formattedParent) + ->setDocument($document); + $response = $gapicClient->createDocument($request); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $apiRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($apiRequests)); + $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); + $this->assertSame(0, count($operationsRequestsEmpty)); + $actualApiFuncCall = $apiRequests[0]->getFuncCall(); + $actualApiRequestObject = $apiRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.dialogflow.v2.Documents/CreateDocument', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $actualValue = $actualApiRequestObject->getDocument(); + $this->assertProtobufEquals($document, $actualValue); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/createDocumentTest'); + $response->pollUntilComplete([ + 'initialPollDelayMillis' => 1, + ]); + $this->assertTrue($response->isDone()); + $this->assertEquals($expectedResponse, $response->getResult()); + $apiRequestsEmpty = $transport->popReceivedCalls(); + $this->assertSame(0, count($apiRequestsEmpty)); + $operationsRequests = $operationsTransport->popReceivedCalls(); + $this->assertSame(1, count($operationsRequests)); + $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); + $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); + $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); + $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function createDocumentExceptionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/createDocumentTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $operationsTransport->addResponse(null, $status); + // Mock request + $formattedParent = $gapicClient->knowledgeBaseName('[PROJECT]', '[KNOWLEDGE_BASE]'); + $document = new Document(); + $documentDisplayName = 'documentDisplayName-59212206'; + $document->setDisplayName($documentDisplayName); + $documentMimeType = 'documentMimeType1242814409'; + $document->setMimeType($documentMimeType); + $documentKnowledgeTypes = []; + $document->setKnowledgeTypes($documentKnowledgeTypes); + $request = (new CreateDocumentRequest()) + ->setParent($formattedParent) + ->setDocument($document); + $response = $gapicClient->createDocument($request); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/createDocumentTest'); + try { + $response->pollUntilComplete([ + 'initialPollDelayMillis' => 1, + ]); + // If the pollUntilComplete() method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stubs are exhausted + $transport->popReceivedCalls(); + $operationsTransport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function deleteDocumentTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/deleteDocumentTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $expectedResponse = new GPBEmpty(); + $anyResponse = new Any(); + $anyResponse->setValue($expectedResponse->serializeToString()); + $completeOperation = new Operation(); + $completeOperation->setName('operations/deleteDocumentTest'); + $completeOperation->setDone(true); + $completeOperation->setResponse($anyResponse); + $operationsTransport->addResponse($completeOperation); + // Mock request + $formattedName = $gapicClient->documentName('[PROJECT]', '[KNOWLEDGE_BASE]', '[DOCUMENT]'); + $request = (new DeleteDocumentRequest()) + ->setName($formattedName); + $response = $gapicClient->deleteDocument($request); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $apiRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($apiRequests)); + $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); + $this->assertSame(0, count($operationsRequestsEmpty)); + $actualApiFuncCall = $apiRequests[0]->getFuncCall(); + $actualApiRequestObject = $apiRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.dialogflow.v2.Documents/DeleteDocument', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/deleteDocumentTest'); + $response->pollUntilComplete([ + 'initialPollDelayMillis' => 1, + ]); + $this->assertTrue($response->isDone()); + $this->assertEquals($expectedResponse, $response->getResult()); + $apiRequestsEmpty = $transport->popReceivedCalls(); + $this->assertSame(0, count($apiRequestsEmpty)); + $operationsRequests = $operationsTransport->popReceivedCalls(); + $this->assertSame(1, count($operationsRequests)); + $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); + $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); + $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); + $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function deleteDocumentExceptionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/deleteDocumentTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $operationsTransport->addResponse(null, $status); + // Mock request + $formattedName = $gapicClient->documentName('[PROJECT]', '[KNOWLEDGE_BASE]', '[DOCUMENT]'); + $request = (new DeleteDocumentRequest()) + ->setName($formattedName); + $response = $gapicClient->deleteDocument($request); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/deleteDocumentTest'); + try { + $response->pollUntilComplete([ + 'initialPollDelayMillis' => 1, + ]); + // If the pollUntilComplete() method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stubs are exhausted + $transport->popReceivedCalls(); + $operationsTransport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function exportDocumentTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/exportDocumentTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $name2 = 'name2-1052831874'; + $displayName = 'displayName1615086568'; + $mimeType = 'mimeType-196041627'; + $contentUri = 'contentUri-388807514'; + $enableAutoReload = false; + $expectedResponse = new Document(); + $expectedResponse->setName($name2); + $expectedResponse->setDisplayName($displayName); + $expectedResponse->setMimeType($mimeType); + $expectedResponse->setContentUri($contentUri); + $expectedResponse->setEnableAutoReload($enableAutoReload); + $anyResponse = new Any(); + $anyResponse->setValue($expectedResponse->serializeToString()); + $completeOperation = new Operation(); + $completeOperation->setName('operations/exportDocumentTest'); + $completeOperation->setDone(true); + $completeOperation->setResponse($anyResponse); + $operationsTransport->addResponse($completeOperation); + // Mock request + $formattedName = $gapicClient->documentName('[PROJECT]', '[KNOWLEDGE_BASE]', '[DOCUMENT]'); + $request = (new ExportDocumentRequest()) + ->setName($formattedName); + $response = $gapicClient->exportDocument($request); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $apiRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($apiRequests)); + $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); + $this->assertSame(0, count($operationsRequestsEmpty)); + $actualApiFuncCall = $apiRequests[0]->getFuncCall(); + $actualApiRequestObject = $apiRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.dialogflow.v2.Documents/ExportDocument', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/exportDocumentTest'); + $response->pollUntilComplete([ + 'initialPollDelayMillis' => 1, + ]); + $this->assertTrue($response->isDone()); + $this->assertEquals($expectedResponse, $response->getResult()); + $apiRequestsEmpty = $transport->popReceivedCalls(); + $this->assertSame(0, count($apiRequestsEmpty)); + $operationsRequests = $operationsTransport->popReceivedCalls(); + $this->assertSame(1, count($operationsRequests)); + $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); + $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); + $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); + $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function exportDocumentExceptionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/exportDocumentTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $operationsTransport->addResponse(null, $status); + // Mock request + $formattedName = $gapicClient->documentName('[PROJECT]', '[KNOWLEDGE_BASE]', '[DOCUMENT]'); + $request = (new ExportDocumentRequest()) + ->setName($formattedName); + $response = $gapicClient->exportDocument($request); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/exportDocumentTest'); + try { + $response->pollUntilComplete([ + 'initialPollDelayMillis' => 1, + ]); + // If the pollUntilComplete() method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stubs are exhausted + $transport->popReceivedCalls(); + $operationsTransport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function getDocumentTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name2 = 'name2-1052831874'; + $displayName = 'displayName1615086568'; + $mimeType = 'mimeType-196041627'; + $contentUri = 'contentUri-388807514'; + $enableAutoReload = false; + $expectedResponse = new Document(); + $expectedResponse->setName($name2); + $expectedResponse->setDisplayName($displayName); + $expectedResponse->setMimeType($mimeType); + $expectedResponse->setContentUri($contentUri); + $expectedResponse->setEnableAutoReload($enableAutoReload); + $transport->addResponse($expectedResponse); + // Mock request + $formattedName = $gapicClient->documentName('[PROJECT]', '[KNOWLEDGE_BASE]', '[DOCUMENT]'); + $request = (new GetDocumentRequest()) + ->setName($formattedName); + $response = $gapicClient->getDocument($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.dialogflow.v2.Documents/GetDocument', $actualFuncCall); + $actualValue = $actualRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getDocumentExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $formattedName = $gapicClient->documentName('[PROJECT]', '[KNOWLEDGE_BASE]', '[DOCUMENT]'); + $request = (new GetDocumentRequest()) + ->setName($formattedName); + try { + $gapicClient->getDocument($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function importDocumentsTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/importDocumentsTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $expectedResponse = new ImportDocumentsResponse(); + $anyResponse = new Any(); + $anyResponse->setValue($expectedResponse->serializeToString()); + $completeOperation = new Operation(); + $completeOperation->setName('operations/importDocumentsTest'); + $completeOperation->setDone(true); + $completeOperation->setResponse($anyResponse); + $operationsTransport->addResponse($completeOperation); + // Mock request + $formattedParent = $gapicClient->knowledgeBaseName('[PROJECT]', '[KNOWLEDGE_BASE]'); + $documentTemplate = new ImportDocumentTemplate(); + $documentTemplateMimeType = 'documentTemplateMimeType-1300921501'; + $documentTemplate->setMimeType($documentTemplateMimeType); + $documentTemplateKnowledgeTypes = []; + $documentTemplate->setKnowledgeTypes($documentTemplateKnowledgeTypes); + $request = (new ImportDocumentsRequest()) + ->setParent($formattedParent) + ->setDocumentTemplate($documentTemplate); + $response = $gapicClient->importDocuments($request); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $apiRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($apiRequests)); + $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); + $this->assertSame(0, count($operationsRequestsEmpty)); + $actualApiFuncCall = $apiRequests[0]->getFuncCall(); + $actualApiRequestObject = $apiRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.dialogflow.v2.Documents/ImportDocuments', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $actualValue = $actualApiRequestObject->getDocumentTemplate(); + $this->assertProtobufEquals($documentTemplate, $actualValue); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/importDocumentsTest'); + $response->pollUntilComplete([ + 'initialPollDelayMillis' => 1, + ]); + $this->assertTrue($response->isDone()); + $this->assertEquals($expectedResponse, $response->getResult()); + $apiRequestsEmpty = $transport->popReceivedCalls(); + $this->assertSame(0, count($apiRequestsEmpty)); + $operationsRequests = $operationsTransport->popReceivedCalls(); + $this->assertSame(1, count($operationsRequests)); + $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); + $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); + $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); + $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function importDocumentsExceptionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/importDocumentsTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $operationsTransport->addResponse(null, $status); + // Mock request + $formattedParent = $gapicClient->knowledgeBaseName('[PROJECT]', '[KNOWLEDGE_BASE]'); + $documentTemplate = new ImportDocumentTemplate(); + $documentTemplateMimeType = 'documentTemplateMimeType-1300921501'; + $documentTemplate->setMimeType($documentTemplateMimeType); + $documentTemplateKnowledgeTypes = []; + $documentTemplate->setKnowledgeTypes($documentTemplateKnowledgeTypes); + $request = (new ImportDocumentsRequest()) + ->setParent($formattedParent) + ->setDocumentTemplate($documentTemplate); + $response = $gapicClient->importDocuments($request); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/importDocumentsTest'); + try { + $response->pollUntilComplete([ + 'initialPollDelayMillis' => 1, + ]); + // If the pollUntilComplete() method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stubs are exhausted + $transport->popReceivedCalls(); + $operationsTransport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function listDocumentsTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $nextPageToken = ''; + $documentsElement = new Document(); + $documents = [ + $documentsElement, + ]; + $expectedResponse = new ListDocumentsResponse(); + $expectedResponse->setNextPageToken($nextPageToken); + $expectedResponse->setDocuments($documents); + $transport->addResponse($expectedResponse); + // Mock request + $formattedParent = $gapicClient->knowledgeBaseName('[PROJECT]', '[KNOWLEDGE_BASE]'); + $request = (new ListDocumentsRequest()) + ->setParent($formattedParent); + $response = $gapicClient->listDocuments($request); + $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); + $resources = iterator_to_array($response->iterateAllElements()); + $this->assertSame(1, count($resources)); + $this->assertEquals($expectedResponse->getDocuments()[0], $resources[0]); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.dialogflow.v2.Documents/ListDocuments', $actualFuncCall); + $actualValue = $actualRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listDocumentsExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $formattedParent = $gapicClient->knowledgeBaseName('[PROJECT]', '[KNOWLEDGE_BASE]'); + $request = (new ListDocumentsRequest()) + ->setParent($formattedParent); + try { + $gapicClient->listDocuments($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function reloadDocumentTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/reloadDocumentTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $name2 = 'name2-1052831874'; + $displayName = 'displayName1615086568'; + $mimeType = 'mimeType-196041627'; + $contentUri2 = 'contentUri218136793'; + $enableAutoReload = false; + $expectedResponse = new Document(); + $expectedResponse->setName($name2); + $expectedResponse->setDisplayName($displayName); + $expectedResponse->setMimeType($mimeType); + $expectedResponse->setContentUri($contentUri2); + $expectedResponse->setEnableAutoReload($enableAutoReload); + $anyResponse = new Any(); + $anyResponse->setValue($expectedResponse->serializeToString()); + $completeOperation = new Operation(); + $completeOperation->setName('operations/reloadDocumentTest'); + $completeOperation->setDone(true); + $completeOperation->setResponse($anyResponse); + $operationsTransport->addResponse($completeOperation); + // Mock request + $formattedName = $gapicClient->documentName('[PROJECT]', '[KNOWLEDGE_BASE]', '[DOCUMENT]'); + $request = (new ReloadDocumentRequest()) + ->setName($formattedName); + $response = $gapicClient->reloadDocument($request); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $apiRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($apiRequests)); + $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); + $this->assertSame(0, count($operationsRequestsEmpty)); + $actualApiFuncCall = $apiRequests[0]->getFuncCall(); + $actualApiRequestObject = $apiRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.dialogflow.v2.Documents/ReloadDocument', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/reloadDocumentTest'); + $response->pollUntilComplete([ + 'initialPollDelayMillis' => 1, + ]); + $this->assertTrue($response->isDone()); + $this->assertEquals($expectedResponse, $response->getResult()); + $apiRequestsEmpty = $transport->popReceivedCalls(); + $this->assertSame(0, count($apiRequestsEmpty)); + $operationsRequests = $operationsTransport->popReceivedCalls(); + $this->assertSame(1, count($operationsRequests)); + $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); + $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); + $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); + $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function reloadDocumentExceptionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/reloadDocumentTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $operationsTransport->addResponse(null, $status); + // Mock request + $formattedName = $gapicClient->documentName('[PROJECT]', '[KNOWLEDGE_BASE]', '[DOCUMENT]'); + $request = (new ReloadDocumentRequest()) + ->setName($formattedName); + $response = $gapicClient->reloadDocument($request); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/reloadDocumentTest'); + try { + $response->pollUntilComplete([ + 'initialPollDelayMillis' => 1, + ]); + // If the pollUntilComplete() method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stubs are exhausted + $transport->popReceivedCalls(); + $operationsTransport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function updateDocumentTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/updateDocumentTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $name = 'name3373707'; + $displayName = 'displayName1615086568'; + $mimeType = 'mimeType-196041627'; + $contentUri = 'contentUri-388807514'; + $enableAutoReload = false; + $expectedResponse = new Document(); + $expectedResponse->setName($name); + $expectedResponse->setDisplayName($displayName); + $expectedResponse->setMimeType($mimeType); + $expectedResponse->setContentUri($contentUri); + $expectedResponse->setEnableAutoReload($enableAutoReload); + $anyResponse = new Any(); + $anyResponse->setValue($expectedResponse->serializeToString()); + $completeOperation = new Operation(); + $completeOperation->setName('operations/updateDocumentTest'); + $completeOperation->setDone(true); + $completeOperation->setResponse($anyResponse); + $operationsTransport->addResponse($completeOperation); + // Mock request + $document = new Document(); + $documentDisplayName = 'documentDisplayName-59212206'; + $document->setDisplayName($documentDisplayName); + $documentMimeType = 'documentMimeType1242814409'; + $document->setMimeType($documentMimeType); + $documentKnowledgeTypes = []; + $document->setKnowledgeTypes($documentKnowledgeTypes); + $request = (new UpdateDocumentRequest()) + ->setDocument($document); + $response = $gapicClient->updateDocument($request); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $apiRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($apiRequests)); + $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); + $this->assertSame(0, count($operationsRequestsEmpty)); + $actualApiFuncCall = $apiRequests[0]->getFuncCall(); + $actualApiRequestObject = $apiRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.dialogflow.v2.Documents/UpdateDocument', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getDocument(); + $this->assertProtobufEquals($document, $actualValue); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/updateDocumentTest'); + $response->pollUntilComplete([ + 'initialPollDelayMillis' => 1, + ]); + $this->assertTrue($response->isDone()); + $this->assertEquals($expectedResponse, $response->getResult()); + $apiRequestsEmpty = $transport->popReceivedCalls(); + $this->assertSame(0, count($apiRequestsEmpty)); + $operationsRequests = $operationsTransport->popReceivedCalls(); + $this->assertSame(1, count($operationsRequests)); + $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); + $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); + $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); + $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function updateDocumentExceptionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/updateDocumentTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $operationsTransport->addResponse(null, $status); + // Mock request + $document = new Document(); + $documentDisplayName = 'documentDisplayName-59212206'; + $document->setDisplayName($documentDisplayName); + $documentMimeType = 'documentMimeType1242814409'; + $document->setMimeType($documentMimeType); + $documentKnowledgeTypes = []; + $document->setKnowledgeTypes($documentKnowledgeTypes); + $request = (new UpdateDocumentRequest()) + ->setDocument($document); + $response = $gapicClient->updateDocument($request); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/updateDocumentTest'); + try { + $response->pollUntilComplete([ + 'initialPollDelayMillis' => 1, + ]); + // If the pollUntilComplete() method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stubs are exhausted + $transport->popReceivedCalls(); + $operationsTransport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function getLocationTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name2 = 'name2-1052831874'; + $locationId = 'locationId552319461'; + $displayName = 'displayName1615086568'; + $expectedResponse = new Location(); + $expectedResponse->setName($name2); + $expectedResponse->setLocationId($locationId); + $expectedResponse->setDisplayName($displayName); + $transport->addResponse($expectedResponse); + $request = new GetLocationRequest(); + $response = $gapicClient->getLocation($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.location.Locations/GetLocation', $actualFuncCall); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getLocationExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + $request = new GetLocationRequest(); + try { + $gapicClient->getLocation($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listLocationsTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $nextPageToken = ''; + $locationsElement = new Location(); + $locations = [ + $locationsElement, + ]; + $expectedResponse = new ListLocationsResponse(); + $expectedResponse->setNextPageToken($nextPageToken); + $expectedResponse->setLocations($locations); + $transport->addResponse($expectedResponse); + $request = new ListLocationsRequest(); + $response = $gapicClient->listLocations($request); + $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); + $resources = iterator_to_array($response->iterateAllElements()); + $this->assertSame(1, count($resources)); + $this->assertEquals($expectedResponse->getLocations()[0], $resources[0]); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.location.Locations/ListLocations', $actualFuncCall); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listLocationsExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + $request = new ListLocationsRequest(); + try { + $gapicClient->listLocations($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function createDocumentAsyncTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/createDocumentTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $name = 'name3373707'; + $displayName = 'displayName1615086568'; + $mimeType = 'mimeType-196041627'; + $contentUri = 'contentUri-388807514'; + $enableAutoReload = false; + $expectedResponse = new Document(); + $expectedResponse->setName($name); + $expectedResponse->setDisplayName($displayName); + $expectedResponse->setMimeType($mimeType); + $expectedResponse->setContentUri($contentUri); + $expectedResponse->setEnableAutoReload($enableAutoReload); + $anyResponse = new Any(); + $anyResponse->setValue($expectedResponse->serializeToString()); + $completeOperation = new Operation(); + $completeOperation->setName('operations/createDocumentTest'); + $completeOperation->setDone(true); + $completeOperation->setResponse($anyResponse); + $operationsTransport->addResponse($completeOperation); + // Mock request + $formattedParent = $gapicClient->knowledgeBaseName('[PROJECT]', '[KNOWLEDGE_BASE]'); + $document = new Document(); + $documentDisplayName = 'documentDisplayName-59212206'; + $document->setDisplayName($documentDisplayName); + $documentMimeType = 'documentMimeType1242814409'; + $document->setMimeType($documentMimeType); + $documentKnowledgeTypes = []; + $document->setKnowledgeTypes($documentKnowledgeTypes); + $request = (new CreateDocumentRequest()) + ->setParent($formattedParent) + ->setDocument($document); + $response = $gapicClient->createDocumentAsync($request)->wait(); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $apiRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($apiRequests)); + $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); + $this->assertSame(0, count($operationsRequestsEmpty)); + $actualApiFuncCall = $apiRequests[0]->getFuncCall(); + $actualApiRequestObject = $apiRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.dialogflow.v2.Documents/CreateDocument', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $actualValue = $actualApiRequestObject->getDocument(); + $this->assertProtobufEquals($document, $actualValue); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/createDocumentTest'); + $response->pollUntilComplete([ + 'initialPollDelayMillis' => 1, + ]); + $this->assertTrue($response->isDone()); + $this->assertEquals($expectedResponse, $response->getResult()); + $apiRequestsEmpty = $transport->popReceivedCalls(); + $this->assertSame(0, count($apiRequestsEmpty)); + $operationsRequests = $operationsTransport->popReceivedCalls(); + $this->assertSame(1, count($operationsRequests)); + $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); + $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); + $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); + $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } +} diff --git a/owl-bot-staging/Dialogflow/v2/tests/Unit/V2/Client/EncryptionSpecServiceClientTest.php b/owl-bot-staging/Dialogflow/v2/tests/Unit/V2/Client/EncryptionSpecServiceClientTest.php new file mode 100644 index 000000000000..f114bab199fa --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/tests/Unit/V2/Client/EncryptionSpecServiceClientTest.php @@ -0,0 +1,418 @@ +getMockBuilder(CredentialsWrapper::class)->disableOriginalConstructor()->getMock(); + } + + /** @return EncryptionSpecServiceClient */ + private function createClient(array $options = []) + { + $options += [ + 'credentials' => $this->createCredentials(), + ]; + return new EncryptionSpecServiceClient($options); + } + + /** @test */ + public function getEncryptionSpecTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name2 = 'name2-1052831874'; + $kmsKey = 'kmsKey-591635343'; + $expectedResponse = new EncryptionSpec(); + $expectedResponse->setName($name2); + $expectedResponse->setKmsKey($kmsKey); + $transport->addResponse($expectedResponse); + // Mock request + $formattedName = $gapicClient->encryptionSpecName('[PROJECT]', '[LOCATION]'); + $request = (new GetEncryptionSpecRequest()) + ->setName($formattedName); + $response = $gapicClient->getEncryptionSpec($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.dialogflow.v2.EncryptionSpecService/GetEncryptionSpec', $actualFuncCall); + $actualValue = $actualRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getEncryptionSpecExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $formattedName = $gapicClient->encryptionSpecName('[PROJECT]', '[LOCATION]'); + $request = (new GetEncryptionSpecRequest()) + ->setName($formattedName); + try { + $gapicClient->getEncryptionSpec($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function initializeEncryptionSpecTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/initializeEncryptionSpecTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $expectedResponse = new InitializeEncryptionSpecResponse(); + $anyResponse = new Any(); + $anyResponse->setValue($expectedResponse->serializeToString()); + $completeOperation = new Operation(); + $completeOperation->setName('operations/initializeEncryptionSpecTest'); + $completeOperation->setDone(true); + $completeOperation->setResponse($anyResponse); + $operationsTransport->addResponse($completeOperation); + // Mock request + $encryptionSpec = new EncryptionSpec(); + $encryptionSpecKmsKey = 'encryptionSpecKmsKey627607756'; + $encryptionSpec->setKmsKey($encryptionSpecKmsKey); + $request = (new InitializeEncryptionSpecRequest()) + ->setEncryptionSpec($encryptionSpec); + $response = $gapicClient->initializeEncryptionSpec($request); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $apiRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($apiRequests)); + $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); + $this->assertSame(0, count($operationsRequestsEmpty)); + $actualApiFuncCall = $apiRequests[0]->getFuncCall(); + $actualApiRequestObject = $apiRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.dialogflow.v2.EncryptionSpecService/InitializeEncryptionSpec', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getEncryptionSpec(); + $this->assertProtobufEquals($encryptionSpec, $actualValue); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/initializeEncryptionSpecTest'); + $response->pollUntilComplete([ + 'initialPollDelayMillis' => 1, + ]); + $this->assertTrue($response->isDone()); + $this->assertEquals($expectedResponse, $response->getResult()); + $apiRequestsEmpty = $transport->popReceivedCalls(); + $this->assertSame(0, count($apiRequestsEmpty)); + $operationsRequests = $operationsTransport->popReceivedCalls(); + $this->assertSame(1, count($operationsRequests)); + $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); + $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); + $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); + $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function initializeEncryptionSpecExceptionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/initializeEncryptionSpecTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $operationsTransport->addResponse(null, $status); + // Mock request + $encryptionSpec = new EncryptionSpec(); + $encryptionSpecKmsKey = 'encryptionSpecKmsKey627607756'; + $encryptionSpec->setKmsKey($encryptionSpecKmsKey); + $request = (new InitializeEncryptionSpecRequest()) + ->setEncryptionSpec($encryptionSpec); + $response = $gapicClient->initializeEncryptionSpec($request); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/initializeEncryptionSpecTest'); + try { + $response->pollUntilComplete([ + 'initialPollDelayMillis' => 1, + ]); + // If the pollUntilComplete() method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stubs are exhausted + $transport->popReceivedCalls(); + $operationsTransport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function getLocationTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name2 = 'name2-1052831874'; + $locationId = 'locationId552319461'; + $displayName = 'displayName1615086568'; + $expectedResponse = new Location(); + $expectedResponse->setName($name2); + $expectedResponse->setLocationId($locationId); + $expectedResponse->setDisplayName($displayName); + $transport->addResponse($expectedResponse); + $request = new GetLocationRequest(); + $response = $gapicClient->getLocation($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.location.Locations/GetLocation', $actualFuncCall); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getLocationExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + $request = new GetLocationRequest(); + try { + $gapicClient->getLocation($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listLocationsTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $nextPageToken = ''; + $locationsElement = new Location(); + $locations = [ + $locationsElement, + ]; + $expectedResponse = new ListLocationsResponse(); + $expectedResponse->setNextPageToken($nextPageToken); + $expectedResponse->setLocations($locations); + $transport->addResponse($expectedResponse); + $request = new ListLocationsRequest(); + $response = $gapicClient->listLocations($request); + $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); + $resources = iterator_to_array($response->iterateAllElements()); + $this->assertSame(1, count($resources)); + $this->assertEquals($expectedResponse->getLocations()[0], $resources[0]); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.location.Locations/ListLocations', $actualFuncCall); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listLocationsExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + $request = new ListLocationsRequest(); + try { + $gapicClient->listLocations($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getEncryptionSpecAsyncTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name2 = 'name2-1052831874'; + $kmsKey = 'kmsKey-591635343'; + $expectedResponse = new EncryptionSpec(); + $expectedResponse->setName($name2); + $expectedResponse->setKmsKey($kmsKey); + $transport->addResponse($expectedResponse); + // Mock request + $formattedName = $gapicClient->encryptionSpecName('[PROJECT]', '[LOCATION]'); + $request = (new GetEncryptionSpecRequest()) + ->setName($formattedName); + $response = $gapicClient->getEncryptionSpecAsync($request)->wait(); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.dialogflow.v2.EncryptionSpecService/GetEncryptionSpec', $actualFuncCall); + $actualValue = $actualRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $this->assertTrue($transport->isExhausted()); + } +} diff --git a/owl-bot-staging/Dialogflow/v2/tests/Unit/V2/Client/EntityTypesClientTest.php b/owl-bot-staging/Dialogflow/v2/tests/Unit/V2/Client/EntityTypesClientTest.php new file mode 100644 index 000000000000..39c6839204a7 --- /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..44caad5a6589 --- /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..b07d23c50e32 --- /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/GeneratorsClientTest.php b/owl-bot-staging/Dialogflow/v2/tests/Unit/V2/Client/GeneratorsClientTest.php new file mode 100644 index 000000000000..4e08b32cbebd --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/tests/Unit/V2/Client/GeneratorsClientTest.php @@ -0,0 +1,568 @@ +getMockBuilder(CredentialsWrapper::class)->disableOriginalConstructor()->getMock(); + } + + /** @return GeneratorsClient */ + private function createClient(array $options = []) + { + $options += [ + 'credentials' => $this->createCredentials(), + ]; + return new GeneratorsClient($options); + } + + /** @test */ + public function createGeneratorTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name = 'name3373707'; + $description = 'description-1724546052'; + $expectedResponse = new Generator(); + $expectedResponse->setName($name); + $expectedResponse->setDescription($description); + $transport->addResponse($expectedResponse); + // Mock request + $formattedParent = $gapicClient->projectName('[PROJECT]'); + $generator = new Generator(); + $request = (new CreateGeneratorRequest()) + ->setParent($formattedParent) + ->setGenerator($generator); + $response = $gapicClient->createGenerator($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.dialogflow.v2.Generators/CreateGenerator', $actualFuncCall); + $actualValue = $actualRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $actualValue = $actualRequestObject->getGenerator(); + $this->assertProtobufEquals($generator, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function createGeneratorExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $formattedParent = $gapicClient->projectName('[PROJECT]'); + $generator = new Generator(); + $request = (new CreateGeneratorRequest()) + ->setParent($formattedParent) + ->setGenerator($generator); + try { + $gapicClient->createGenerator($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function deleteGeneratorTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $expectedResponse = new GPBEmpty(); + $transport->addResponse($expectedResponse); + // Mock request + $formattedName = $gapicClient->generatorName('[PROJECT]', '[LOCATION]', '[GENERATOR]'); + $request = (new DeleteGeneratorRequest()) + ->setName($formattedName); + $gapicClient->deleteGenerator($request); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.dialogflow.v2.Generators/DeleteGenerator', $actualFuncCall); + $actualValue = $actualRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function deleteGeneratorExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $formattedName = $gapicClient->generatorName('[PROJECT]', '[LOCATION]', '[GENERATOR]'); + $request = (new DeleteGeneratorRequest()) + ->setName($formattedName); + try { + $gapicClient->deleteGenerator($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getGeneratorTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name2 = 'name2-1052831874'; + $description = 'description-1724546052'; + $expectedResponse = new Generator(); + $expectedResponse->setName($name2); + $expectedResponse->setDescription($description); + $transport->addResponse($expectedResponse); + // Mock request + $formattedName = $gapicClient->generatorName('[PROJECT]', '[LOCATION]', '[GENERATOR]'); + $request = (new GetGeneratorRequest()) + ->setName($formattedName); + $response = $gapicClient->getGenerator($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.dialogflow.v2.Generators/GetGenerator', $actualFuncCall); + $actualValue = $actualRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getGeneratorExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $formattedName = $gapicClient->generatorName('[PROJECT]', '[LOCATION]', '[GENERATOR]'); + $request = (new GetGeneratorRequest()) + ->setName($formattedName); + try { + $gapicClient->getGenerator($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listGeneratorsTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $nextPageToken = ''; + $generatorsElement = new Generator(); + $generators = [ + $generatorsElement, + ]; + $expectedResponse = new ListGeneratorsResponse(); + $expectedResponse->setNextPageToken($nextPageToken); + $expectedResponse->setGenerators($generators); + $transport->addResponse($expectedResponse); + // Mock request + $formattedParent = $gapicClient->projectName('[PROJECT]'); + $request = (new ListGeneratorsRequest()) + ->setParent($formattedParent); + $response = $gapicClient->listGenerators($request); + $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); + $resources = iterator_to_array($response->iterateAllElements()); + $this->assertSame(1, count($resources)); + $this->assertEquals($expectedResponse->getGenerators()[0], $resources[0]); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.dialogflow.v2.Generators/ListGenerators', $actualFuncCall); + $actualValue = $actualRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listGeneratorsExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $formattedParent = $gapicClient->projectName('[PROJECT]'); + $request = (new ListGeneratorsRequest()) + ->setParent($formattedParent); + try { + $gapicClient->listGenerators($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function updateGeneratorTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name = 'name3373707'; + $description = 'description-1724546052'; + $expectedResponse = new Generator(); + $expectedResponse->setName($name); + $expectedResponse->setDescription($description); + $transport->addResponse($expectedResponse); + // Mock request + $generator = new Generator(); + $request = (new UpdateGeneratorRequest()) + ->setGenerator($generator); + $response = $gapicClient->updateGenerator($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.dialogflow.v2.Generators/UpdateGenerator', $actualFuncCall); + $actualValue = $actualRequestObject->getGenerator(); + $this->assertProtobufEquals($generator, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function updateGeneratorExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $generator = new Generator(); + $request = (new UpdateGeneratorRequest()) + ->setGenerator($generator); + try { + $gapicClient->updateGenerator($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getLocationTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name2 = 'name2-1052831874'; + $locationId = 'locationId552319461'; + $displayName = 'displayName1615086568'; + $expectedResponse = new Location(); + $expectedResponse->setName($name2); + $expectedResponse->setLocationId($locationId); + $expectedResponse->setDisplayName($displayName); + $transport->addResponse($expectedResponse); + $request = new GetLocationRequest(); + $response = $gapicClient->getLocation($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.location.Locations/GetLocation', $actualFuncCall); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getLocationExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + $request = new GetLocationRequest(); + try { + $gapicClient->getLocation($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listLocationsTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $nextPageToken = ''; + $locationsElement = new Location(); + $locations = [ + $locationsElement, + ]; + $expectedResponse = new ListLocationsResponse(); + $expectedResponse->setNextPageToken($nextPageToken); + $expectedResponse->setLocations($locations); + $transport->addResponse($expectedResponse); + $request = new ListLocationsRequest(); + $response = $gapicClient->listLocations($request); + $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); + $resources = iterator_to_array($response->iterateAllElements()); + $this->assertSame(1, count($resources)); + $this->assertEquals($expectedResponse->getLocations()[0], $resources[0]); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.location.Locations/ListLocations', $actualFuncCall); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listLocationsExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + $request = new ListLocationsRequest(); + try { + $gapicClient->listLocations($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function createGeneratorAsyncTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name = 'name3373707'; + $description = 'description-1724546052'; + $expectedResponse = new Generator(); + $expectedResponse->setName($name); + $expectedResponse->setDescription($description); + $transport->addResponse($expectedResponse); + // Mock request + $formattedParent = $gapicClient->projectName('[PROJECT]'); + $generator = new Generator(); + $request = (new CreateGeneratorRequest()) + ->setParent($formattedParent) + ->setGenerator($generator); + $response = $gapicClient->createGeneratorAsync($request)->wait(); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.dialogflow.v2.Generators/CreateGenerator', $actualFuncCall); + $actualValue = $actualRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $actualValue = $actualRequestObject->getGenerator(); + $this->assertProtobufEquals($generator, $actualValue); + $this->assertTrue($transport->isExhausted()); + } +} diff --git a/owl-bot-staging/Dialogflow/v2/tests/Unit/V2/Client/IntentsClientTest.php b/owl-bot-staging/Dialogflow/v2/tests/Unit/V2/Client/IntentsClientTest.php new file mode 100644 index 000000000000..c3aa8aa588d8 --- /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..5eafe51a8c4f --- /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..9ec47f786ad8 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/tests/Unit/V2/Client/ParticipantsClientTest.php @@ -0,0 +1,953 @@ +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 suggestKnowledgeAssistTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $latestMessage2 = 'latestMessage2-440913086'; + $contextSize2 = 397491196; + $expectedResponse = new SuggestKnowledgeAssistResponse(); + $expectedResponse->setLatestMessage($latestMessage2); + $expectedResponse->setContextSize($contextSize2); + $transport->addResponse($expectedResponse); + // Mock request + $formattedParent = $gapicClient->participantName('[PROJECT]', '[CONVERSATION]', '[PARTICIPANT]'); + $request = (new SuggestKnowledgeAssistRequest()) + ->setParent($formattedParent); + $response = $gapicClient->suggestKnowledgeAssist($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.dialogflow.v2.Participants/SuggestKnowledgeAssist', $actualFuncCall); + $actualValue = $actualRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function suggestKnowledgeAssistExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $formattedParent = $gapicClient->participantName('[PROJECT]', '[CONVERSATION]', '[PARTICIPANT]'); + $request = (new SuggestKnowledgeAssistRequest()) + ->setParent($formattedParent); + try { + $gapicClient->suggestKnowledgeAssist($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function suggestSmartRepliesTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $latestMessage2 = 'latestMessage2-440913086'; + $contextSize2 = 397491196; + $expectedResponse = new SuggestSmartRepliesResponse(); + $expectedResponse->setLatestMessage($latestMessage2); + $expectedResponse->setContextSize($contextSize2); + $transport->addResponse($expectedResponse); + // Mock request + $formattedParent = $gapicClient->participantName('[PROJECT]', '[CONVERSATION]', '[PARTICIPANT]'); + $request = (new SuggestSmartRepliesRequest()) + ->setParent($formattedParent); + $response = $gapicClient->suggestSmartReplies($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.dialogflow.v2.Participants/SuggestSmartReplies', $actualFuncCall); + $actualValue = $actualRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function suggestSmartRepliesExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $formattedParent = $gapicClient->participantName('[PROJECT]', '[CONVERSATION]', '[PARTICIPANT]'); + $request = (new SuggestSmartRepliesRequest()) + ->setParent($formattedParent); + try { + $gapicClient->suggestSmartReplies($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function updateParticipantTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name = 'name3373707'; + $sipRecordingMediaLabel = 'sipRecordingMediaLabel-1522741274'; + $obfuscatedExternalUserId = 'obfuscatedExternalUserId-263618122'; + $expectedResponse = new Participant(); + $expectedResponse->setName($name); + $expectedResponse->setSipRecordingMediaLabel($sipRecordingMediaLabel); + $expectedResponse->setObfuscatedExternalUserId($obfuscatedExternalUserId); + $transport->addResponse($expectedResponse); + // Mock request + $participant = new Participant(); + $updateMask = new FieldMask(); + $request = (new UpdateParticipantRequest()) + ->setParticipant($participant) + ->setUpdateMask($updateMask); + $response = $gapicClient->updateParticipant($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.dialogflow.v2.Participants/UpdateParticipant', $actualFuncCall); + $actualValue = $actualRequestObject->getParticipant(); + $this->assertProtobufEquals($participant, $actualValue); + $actualValue = $actualRequestObject->getUpdateMask(); + $this->assertProtobufEquals($updateMask, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function updateParticipantExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $participant = new Participant(); + $updateMask = new FieldMask(); + $request = (new UpdateParticipantRequest()) + ->setParticipant($participant) + ->setUpdateMask($updateMask); + try { + $gapicClient->updateParticipant($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getLocationTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name2 = 'name2-1052831874'; + $locationId = 'locationId552319461'; + $displayName = 'displayName1615086568'; + $expectedResponse = new Location(); + $expectedResponse->setName($name2); + $expectedResponse->setLocationId($locationId); + $expectedResponse->setDisplayName($displayName); + $transport->addResponse($expectedResponse); + $request = new GetLocationRequest(); + $response = $gapicClient->getLocation($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.location.Locations/GetLocation', $actualFuncCall); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getLocationExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + $request = new GetLocationRequest(); + try { + $gapicClient->getLocation($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listLocationsTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $nextPageToken = ''; + $locationsElement = new Location(); + $locations = [ + $locationsElement, + ]; + $expectedResponse = new ListLocationsResponse(); + $expectedResponse->setNextPageToken($nextPageToken); + $expectedResponse->setLocations($locations); + $transport->addResponse($expectedResponse); + $request = new ListLocationsRequest(); + $response = $gapicClient->listLocations($request); + $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); + $resources = iterator_to_array($response->iterateAllElements()); + $this->assertSame(1, count($resources)); + $this->assertEquals($expectedResponse->getLocations()[0], $resources[0]); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.location.Locations/ListLocations', $actualFuncCall); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listLocationsExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + $request = new ListLocationsRequest(); + try { + $gapicClient->listLocations($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function analyzeContentAsyncTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $replyText = 'replyText-549180062'; + $expectedResponse = new AnalyzeContentResponse(); + $expectedResponse->setReplyText($replyText); + $transport->addResponse($expectedResponse); + // Mock request + $formattedParticipant = $gapicClient->participantName('[PROJECT]', '[CONVERSATION]', '[PARTICIPANT]'); + $request = (new AnalyzeContentRequest()) + ->setParticipant($formattedParticipant); + $response = $gapicClient->analyzeContentAsync($request)->wait(); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.dialogflow.v2.Participants/AnalyzeContent', $actualFuncCall); + $actualValue = $actualRequestObject->getParticipant(); + $this->assertProtobufEquals($formattedParticipant, $actualValue); + $this->assertTrue($transport->isExhausted()); + } +} diff --git a/owl-bot-staging/Dialogflow/v2/tests/Unit/V2/Client/SessionEntityTypesClientTest.php b/owl-bot-staging/Dialogflow/v2/tests/Unit/V2/Client/SessionEntityTypesClientTest.php new file mode 100644 index 000000000000..1b65b70e6be7 --- /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..124fc46599e3 --- /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..060994e96bde --- /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..f29bd75ef538 --- /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..154c4bf93341 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/tests/Unit/V2/ConversationDatasetsClientTest.php @@ -0,0 +1,708 @@ +getMockBuilder(CredentialsWrapper::class)->disableOriginalConstructor()->getMock(); + } + + /** @return ConversationDatasetsClient */ + private function createClient(array $options = []) + { + $options += [ + 'credentials' => $this->createCredentials(), + ]; + return new ConversationDatasetsClient($options); + } + + /** @test */ + public function createConversationDatasetTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/createConversationDatasetTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $name = 'name3373707'; + $displayName = 'displayName1615086568'; + $description = 'description-1724546052'; + $conversationCount = 1994187347; + $satisfiesPzi = false; + $satisfiesPzs = false; + $expectedResponse = new ConversationDataset(); + $expectedResponse->setName($name); + $expectedResponse->setDisplayName($displayName); + $expectedResponse->setDescription($description); + $expectedResponse->setConversationCount($conversationCount); + $expectedResponse->setSatisfiesPzi($satisfiesPzi); + $expectedResponse->setSatisfiesPzs($satisfiesPzs); + $anyResponse = new Any(); + $anyResponse->setValue($expectedResponse->serializeToString()); + $completeOperation = new Operation(); + $completeOperation->setName('operations/createConversationDatasetTest'); + $completeOperation->setDone(true); + $completeOperation->setResponse($anyResponse); + $operationsTransport->addResponse($completeOperation); + // Mock request + $parent = 'parent-995424086'; + $conversationDataset = new ConversationDataset(); + $conversationDatasetDisplayName = 'conversationDatasetDisplayName-925930312'; + $conversationDataset->setDisplayName($conversationDatasetDisplayName); + $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; + $satisfiesPzi = false; + $satisfiesPzs = false; + $expectedResponse = new ConversationDataset(); + $expectedResponse->setName($name2); + $expectedResponse->setDisplayName($displayName); + $expectedResponse->setDescription($description); + $expectedResponse->setConversationCount($conversationCount); + $expectedResponse->setSatisfiesPzi($satisfiesPzi); + $expectedResponse->setSatisfiesPzs($satisfiesPzs); + $transport->addResponse($expectedResponse); + // Mock request + $formattedName = $gapicClient->conversationDatasetName('[PROJECT]', '[LOCATION]', '[CONVERSATION_DATASET]'); + $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..a6137c3f8b87 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/tests/Unit/V2/ConversationModelsClientTest.php @@ -0,0 +1,1072 @@ +getMockBuilder(CredentialsWrapper::class)->disableOriginalConstructor()->getMock(); + } + + /** @return ConversationModelsClient */ + private function createClient(array $options = []) + { + $options += [ + 'credentials' => $this->createCredentials(), + ]; + return new ConversationModelsClient($options); + } + + /** @test */ + public function createConversationModelTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/createConversationModelTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $name = 'name3373707'; + $displayName = 'displayName1615086568'; + $languageCode = 'languageCode-412800396'; + $satisfiesPzs = false; + $satisfiesPzi = false; + $expectedResponse = new ConversationModel(); + $expectedResponse->setName($name); + $expectedResponse->setDisplayName($displayName); + $expectedResponse->setLanguageCode($languageCode); + $expectedResponse->setSatisfiesPzs($satisfiesPzs); + $expectedResponse->setSatisfiesPzi($satisfiesPzi); + $anyResponse = new Any(); + $anyResponse->setValue($expectedResponse->serializeToString()); + $completeOperation = new Operation(); + $completeOperation->setName('operations/createConversationModelTest'); + $completeOperation->setDone(true); + $completeOperation->setResponse($anyResponse); + $operationsTransport->addResponse($completeOperation); + // Mock request + $conversationModel = new ConversationModel(); + $conversationModelDisplayName = 'conversationModelDisplayName-1078928857'; + $conversationModel->setDisplayName($conversationModelDisplayName); + $conversationModelDatasets = []; + $conversationModel->setDatasets($conversationModelDatasets); + $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'; + $satisfiesPzs = false; + $satisfiesPzi = false; + $expectedResponse = new ConversationModel(); + $expectedResponse->setName($name2); + $expectedResponse->setDisplayName($displayName); + $expectedResponse->setLanguageCode($languageCode); + $expectedResponse->setSatisfiesPzs($satisfiesPzs); + $expectedResponse->setSatisfiesPzi($satisfiesPzi); + $transport->addResponse($expectedResponse); + // Mock request + $name = 'name3373707'; + $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..5310fb3e408e --- /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..2d77ced38b89 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/tests/Unit/V2/ConversationsClientTest.php @@ -0,0 +1,793 @@ +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 generateStatelessSuggestionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $expectedResponse = new GenerateStatelessSuggestionResponse(); + $transport->addResponse($expectedResponse); + // Mock request + $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); + $response = $gapicClient->generateStatelessSuggestion($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.Conversations/GenerateStatelessSuggestion', $actualFuncCall); + $actualValue = $actualRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function generateStatelessSuggestionExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); + try { + $gapicClient->generateStatelessSuggestion($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 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 searchKnowledgeTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $rewrittenQuery = 'rewrittenQuery-1113584563'; + $expectedResponse = new SearchKnowledgeResponse(); + $expectedResponse->setRewrittenQuery($rewrittenQuery); + $transport->addResponse($expectedResponse); + // Mock request + $query = new TextInput(); + $queryText = 'queryText-1806881259'; + $query->setText($queryText); + $queryLanguageCode = 'queryLanguageCode66898509'; + $query->setLanguageCode($queryLanguageCode); + $formattedConversationProfile = $gapicClient->conversationProfileName('[PROJECT]', '[CONVERSATION_PROFILE]'); + $response = $gapicClient->searchKnowledge($query, $formattedConversationProfile); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.dialogflow.v2.Conversations/SearchKnowledge', $actualFuncCall); + $actualValue = $actualRequestObject->getQuery(); + $this->assertProtobufEquals($query, $actualValue); + $actualValue = $actualRequestObject->getConversationProfile(); + $this->assertProtobufEquals($formattedConversationProfile, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function searchKnowledgeExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $query = new TextInput(); + $queryText = 'queryText-1806881259'; + $query->setText($queryText); + $queryLanguageCode = 'queryLanguageCode66898509'; + $query->setLanguageCode($queryLanguageCode); + $formattedConversationProfile = $gapicClient->conversationProfileName('[PROJECT]', '[CONVERSATION_PROFILE]'); + try { + $gapicClient->searchKnowledge($query, $formattedConversationProfile); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $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..405650dfbecc --- /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/EncryptionSpecServiceClientTest.php b/owl-bot-staging/Dialogflow/v2/tests/Unit/V2/EncryptionSpecServiceClientTest.php new file mode 100644 index 000000000000..8d1849ab0231 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/tests/Unit/V2/EncryptionSpecServiceClientTest.php @@ -0,0 +1,371 @@ +getMockBuilder(CredentialsWrapper::class)->disableOriginalConstructor()->getMock(); + } + + /** @return EncryptionSpecServiceClient */ + private function createClient(array $options = []) + { + $options += [ + 'credentials' => $this->createCredentials(), + ]; + return new EncryptionSpecServiceClient($options); + } + + /** @test */ + public function getEncryptionSpecTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name2 = 'name2-1052831874'; + $kmsKey = 'kmsKey-591635343'; + $expectedResponse = new EncryptionSpec(); + $expectedResponse->setName($name2); + $expectedResponse->setKmsKey($kmsKey); + $transport->addResponse($expectedResponse); + // Mock request + $formattedName = $gapicClient->encryptionSpecName('[PROJECT]', '[LOCATION]'); + $response = $gapicClient->getEncryptionSpec($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.EncryptionSpecService/GetEncryptionSpec', $actualFuncCall); + $actualValue = $actualRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getEncryptionSpecExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $formattedName = $gapicClient->encryptionSpecName('[PROJECT]', '[LOCATION]'); + try { + $gapicClient->getEncryptionSpec($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 initializeEncryptionSpecTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/initializeEncryptionSpecTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $expectedResponse = new InitializeEncryptionSpecResponse(); + $anyResponse = new Any(); + $anyResponse->setValue($expectedResponse->serializeToString()); + $completeOperation = new Operation(); + $completeOperation->setName('operations/initializeEncryptionSpecTest'); + $completeOperation->setDone(true); + $completeOperation->setResponse($anyResponse); + $operationsTransport->addResponse($completeOperation); + // Mock request + $encryptionSpec = new EncryptionSpec(); + $encryptionSpecKmsKey = 'encryptionSpecKmsKey627607756'; + $encryptionSpec->setKmsKey($encryptionSpecKmsKey); + $response = $gapicClient->initializeEncryptionSpec($encryptionSpec); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $apiRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($apiRequests)); + $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); + $this->assertSame(0, count($operationsRequestsEmpty)); + $actualApiFuncCall = $apiRequests[0]->getFuncCall(); + $actualApiRequestObject = $apiRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.dialogflow.v2.EncryptionSpecService/InitializeEncryptionSpec', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getEncryptionSpec(); + $this->assertProtobufEquals($encryptionSpec, $actualValue); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/initializeEncryptionSpecTest'); + $response->pollUntilComplete([ + 'initialPollDelayMillis' => 1, + ]); + $this->assertTrue($response->isDone()); + $this->assertEquals($expectedResponse, $response->getResult()); + $apiRequestsEmpty = $transport->popReceivedCalls(); + $this->assertSame(0, count($apiRequestsEmpty)); + $operationsRequests = $operationsTransport->popReceivedCalls(); + $this->assertSame(1, count($operationsRequests)); + $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); + $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); + $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); + $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function initializeEncryptionSpecExceptionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/initializeEncryptionSpecTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $operationsTransport->addResponse(null, $status); + // Mock request + $encryptionSpec = new EncryptionSpec(); + $encryptionSpecKmsKey = 'encryptionSpecKmsKey627607756'; + $encryptionSpec->setKmsKey($encryptionSpecKmsKey); + $response = $gapicClient->initializeEncryptionSpec($encryptionSpec); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/initializeEncryptionSpecTest'); + try { + $response->pollUntilComplete([ + 'initialPollDelayMillis' => 1, + ]); + // If the pollUntilComplete() method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stubs are exhausted + $transport->popReceivedCalls(); + $operationsTransport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function getLocationTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name2 = 'name2-1052831874'; + $locationId = 'locationId552319461'; + $displayName = 'displayName1615086568'; + $expectedResponse = new Location(); + $expectedResponse->setName($name2); + $expectedResponse->setLocationId($locationId); + $expectedResponse->setDisplayName($displayName); + $transport->addResponse($expectedResponse); + $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..0bba9dc857d5 --- /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..eb6575d0d997 --- /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..e92d68b15866 --- /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/GeneratorsClientTest.php b/owl-bot-staging/Dialogflow/v2/tests/Unit/V2/GeneratorsClientTest.php new file mode 100644 index 000000000000..e2fb8335acd0 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/tests/Unit/V2/GeneratorsClientTest.php @@ -0,0 +1,500 @@ +getMockBuilder(CredentialsWrapper::class)->disableOriginalConstructor()->getMock(); + } + + /** @return GeneratorsClient */ + private function createClient(array $options = []) + { + $options += [ + 'credentials' => $this->createCredentials(), + ]; + return new GeneratorsClient($options); + } + + /** @test */ + public function createGeneratorTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name = 'name3373707'; + $description = 'description-1724546052'; + $expectedResponse = new Generator(); + $expectedResponse->setName($name); + $expectedResponse->setDescription($description); + $transport->addResponse($expectedResponse); + // Mock request + $formattedParent = $gapicClient->projectName('[PROJECT]'); + $generator = new Generator(); + $response = $gapicClient->createGenerator($formattedParent, $generator); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.dialogflow.v2.Generators/CreateGenerator', $actualFuncCall); + $actualValue = $actualRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $actualValue = $actualRequestObject->getGenerator(); + $this->assertProtobufEquals($generator, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function createGeneratorExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $formattedParent = $gapicClient->projectName('[PROJECT]'); + $generator = new Generator(); + try { + $gapicClient->createGenerator($formattedParent, $generator); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function deleteGeneratorTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $expectedResponse = new GPBEmpty(); + $transport->addResponse($expectedResponse); + // Mock request + $formattedName = $gapicClient->generatorName('[PROJECT]', '[LOCATION]', '[GENERATOR]'); + $gapicClient->deleteGenerator($formattedName); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.dialogflow.v2.Generators/DeleteGenerator', $actualFuncCall); + $actualValue = $actualRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function deleteGeneratorExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $formattedName = $gapicClient->generatorName('[PROJECT]', '[LOCATION]', '[GENERATOR]'); + try { + $gapicClient->deleteGenerator($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 getGeneratorTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name2 = 'name2-1052831874'; + $description = 'description-1724546052'; + $expectedResponse = new Generator(); + $expectedResponse->setName($name2); + $expectedResponse->setDescription($description); + $transport->addResponse($expectedResponse); + // Mock request + $formattedName = $gapicClient->generatorName('[PROJECT]', '[LOCATION]', '[GENERATOR]'); + $response = $gapicClient->getGenerator($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.Generators/GetGenerator', $actualFuncCall); + $actualValue = $actualRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getGeneratorExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $formattedName = $gapicClient->generatorName('[PROJECT]', '[LOCATION]', '[GENERATOR]'); + try { + $gapicClient->getGenerator($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 listGeneratorsTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $nextPageToken = ''; + $generatorsElement = new Generator(); + $generators = [ + $generatorsElement, + ]; + $expectedResponse = new ListGeneratorsResponse(); + $expectedResponse->setNextPageToken($nextPageToken); + $expectedResponse->setGenerators($generators); + $transport->addResponse($expectedResponse); + // Mock request + $formattedParent = $gapicClient->projectName('[PROJECT]'); + $response = $gapicClient->listGenerators($formattedParent); + $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); + $resources = iterator_to_array($response->iterateAllElements()); + $this->assertSame(1, count($resources)); + $this->assertEquals($expectedResponse->getGenerators()[0], $resources[0]); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.dialogflow.v2.Generators/ListGenerators', $actualFuncCall); + $actualValue = $actualRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listGeneratorsExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $formattedParent = $gapicClient->projectName('[PROJECT]'); + try { + $gapicClient->listGenerators($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 updateGeneratorTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name = 'name3373707'; + $description = 'description-1724546052'; + $expectedResponse = new Generator(); + $expectedResponse->setName($name); + $expectedResponse->setDescription($description); + $transport->addResponse($expectedResponse); + // Mock request + $generator = new Generator(); + $response = $gapicClient->updateGenerator($generator); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.dialogflow.v2.Generators/UpdateGenerator', $actualFuncCall); + $actualValue = $actualRequestObject->getGenerator(); + $this->assertProtobufEquals($generator, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function updateGeneratorExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $generator = new Generator(); + try { + $gapicClient->updateGenerator($generator); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $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..1e34c1edc994 --- /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..37bd4468424b --- /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..0d6385ee7512 --- /dev/null +++ b/owl-bot-staging/Dialogflow/v2/tests/Unit/V2/ParticipantsClientTest.php @@ -0,0 +1,869 @@ +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 suggestKnowledgeAssistTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $latestMessage2 = 'latestMessage2-440913086'; + $contextSize2 = 397491196; + $expectedResponse = new SuggestKnowledgeAssistResponse(); + $expectedResponse->setLatestMessage($latestMessage2); + $expectedResponse->setContextSize($contextSize2); + $transport->addResponse($expectedResponse); + // Mock request + $formattedParent = $gapicClient->participantName('[PROJECT]', '[CONVERSATION]', '[PARTICIPANT]'); + $response = $gapicClient->suggestKnowledgeAssist($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/SuggestKnowledgeAssist', $actualFuncCall); + $actualValue = $actualRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function suggestKnowledgeAssistExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $formattedParent = $gapicClient->participantName('[PROJECT]', '[CONVERSATION]', '[PARTICIPANT]'); + try { + $gapicClient->suggestKnowledgeAssist($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..fc6b9e1423a9 --- /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..f325f10f819e --- /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..3f455f70882d --- /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 021794b80f3fab7f537840fad3932d111a8076d9 Mon Sep 17 00:00:00 2001 From: Owl Bot Date: Wed, 25 Sep 2024 13:04:13 +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 --- Dialogflow/metadata/V2/AudioConfig.php | Bin 3889 -> 3946 bytes .../metadata/V2/ConversationDataset.php | Bin 5192 -> 5294 bytes Dialogflow/src/V2/AudioEncoding.php | 7 + Dialogflow/src/V2/ConversationDataset.php | 96 + Dialogflow/src/V2/OutputAudioEncoding.php | 7 + .../Client/ConversationDatasetsClientTest.php | 12 + .../V2/ConversationDatasetsClientTest.php | 8 + .../Google/Cloud/Dialogflow/V2/Agent.php | Bin 5894 -> 0 bytes .../Cloud/Dialogflow/V2/AnswerRecord.php | Bin 5068 -> 0 bytes .../Cloud/Dialogflow/V2/AudioConfig.php | Bin 3946 -> 0 bytes .../Google/Cloud/Dialogflow/V2/Context.php | 70 - .../Cloud/Dialogflow/V2/Conversation.php | Bin 9333 -> 0 bytes .../Dialogflow/V2/ConversationDataset.php | Bin 5294 -> 0 bytes .../Cloud/Dialogflow/V2/ConversationEvent.php | Bin 1358 -> 0 bytes .../Cloud/Dialogflow/V2/ConversationModel.php | Bin 9285 -> 0 bytes .../Dialogflow/V2/ConversationProfile.php | Bin 12254 -> 0 bytes .../Google/Cloud/Dialogflow/V2/Document.php | Bin 7758 -> 0 bytes .../Cloud/Dialogflow/V2/EncryptionSpec.php | 48 - .../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 - .../Google/Cloud/Dialogflow/V2/Generator.php | Bin 5854 -> 0 bytes .../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 14108 -> 0 bytes .../Google/Cloud/Dialogflow/V2/Session.php | Bin 7761 -> 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 | 331 --- .../AnswerRelevance.php | 64 - .../DocumentCorrectness.php | 64 - .../DocumentEfficiency.php | 64 - .../KnowledgeAssistFeedback.php | 132 -- .../KnowledgeSearchFeedback.php | 132 -- .../SummarizationFeedback.php | 192 -- .../Dialogflow/V2/AgentAssistantRecord.php | 141 -- .../Dialogflow/V2/AnalyzeContentRequest.php | 470 ----- .../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 | 125 -- .../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 | 750 ------- .../V2/CompleteConversationRequest.php | 92 - .../Google/Cloud/Dialogflow/V2/Context.php | 261 --- .../Cloud/Dialogflow/V2/Conversation.php | 380 ---- .../V2/Conversation/ConversationStage.php | 69 - .../V2/Conversation/LifecycleState.php | 64 - .../Dialogflow/V2/ConversationContext.php | 67 - .../Dialogflow/V2/ConversationDataset.php | 412 ---- .../Cloud/Dialogflow/V2/ConversationEvent.php | 200 -- .../Dialogflow/V2/ConversationEvent/Type.php | 96 - .../Cloud/Dialogflow/V2/ConversationInfo.php | 75 - .../Cloud/Dialogflow/V2/ConversationModel.php | 442 ---- .../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/CreateGeneratorRequest.php | 209 -- .../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/DeleteGeneratorRequest.php | 86 - .../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 --- .../Dialogflow/V2/DialogflowAssistAnswer.php | 150 -- .../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 - .../Cloud/Dialogflow/V2/EncryptionSpec.php | 126 -- .../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 | 221 -- .../Dialogflow/V2/ExportAgentRequest.php | 153 -- .../Dialogflow/V2/ExportAgentResponse.php | 112 - .../Dialogflow/V2/ExportDocumentRequest.php | 194 -- .../Dialogflow/V2/ExportOperationMetadata.php | 77 - .../Google/Cloud/Dialogflow/V2/FaqAnswer.php | 269 --- .../Cloud/Dialogflow/V2/FewShotExample.php | 207 -- .../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/GenerateStatelessSuggestionRequest.php | 235 --- .../GenerateStatelessSuggestionResponse.php | 78 - .../V2/GenerateStatelessSummaryRequest.php | 222 -- .../MinimalConversation.php | 125 -- .../V2/GenerateStatelessSummaryResponse.php | 166 -- .../Summary.php | 150 -- .../Google/Cloud/Dialogflow/V2/Generator.php | 317 --- .../Dialogflow/V2/GeneratorSuggestion.php | 75 - .../Cloud/Dialogflow/V2/GetAgentRequest.php | 87 - .../Cloud/Dialogflow/V2/GetContextRequest.php | 107 - .../V2/GetConversationDatasetRequest.php | 92 - .../GetConversationModelEvaluationRequest.php | 91 - .../V2/GetConversationModelRequest.php | 86 - .../V2/GetConversationProfileRequest.php | 92 - .../Dialogflow/V2/GetConversationRequest.php | 92 - .../Dialogflow/V2/GetDocumentRequest.php | 92 - .../V2/GetEncryptionSpecRequest.php | 81 - .../Dialogflow/V2/GetEntityTypeRequest.php | 158 -- .../V2/GetEnvironmentHistoryRequest.php | 160 -- .../Dialogflow/V2/GetEnvironmentRequest.php | 88 - .../Dialogflow/V2/GetFulfillmentRequest.php | 87 - .../Dialogflow/V2/GetGeneratorRequest.php | 86 - .../Cloud/Dialogflow/V2/GetIntentRequest.php | 192 -- .../Dialogflow/V2/GetKnowledgeBaseRequest.php | 92 - .../Dialogflow/V2/GetParticipantRequest.php | 92 - .../V2/GetSessionEntityTypeRequest.php | 112 - .../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 | 236 --- .../SuggestionFeatureConfig.php | 466 ----- .../SuggestionQueryConfig.php | 374 ---- .../ContextFilterSettings.php | 143 -- .../DialogflowQuerySource.php | 127 -- .../HumanAgentSideConfig.php | 79 - .../DocumentQuerySource.php | 83 - .../KnowledgeBaseQuerySource.php | 83 - .../SuggestionQueryConfig/Sections.php | 85 - .../Sections/SectionType.php | 103 - .../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 - .../Dialogflow/V2/InferenceParameter.php | 277 --- .../V2/InitializeEncryptionSpecMetadata.php | 77 - .../V2/InitializeEncryptionSpecRequest.php | 105 - .../V2/InitializeEncryptionSpecResponse.php | 33 - .../Cloud/Dialogflow/V2/InputAudioConfig.php | 614 ------ .../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 - .../Cloud/Dialogflow/V2/IntentSuggestion.php | 153 -- .../Google/Cloud/Dialogflow/V2/IntentView.php | 56 - .../Dialogflow/V2/KnowledgeAssistAnswer.php | 171 -- .../KnowledgeAssistAnswer/KnowledgeAnswer.php | 146 -- .../KnowledgeAnswer/FaqSource.php | 70 - .../KnowledgeAnswer/GenerativeSource.php | 74 - .../GenerativeSource/Snippet.php | 138 -- .../KnowledgeAssistAnswer/SuggestedQuery.php | 70 - .../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 | 213 -- .../V2/ListConversationsResponse.php | 110 - .../Dialogflow/V2/ListDocumentsRequest.php | 254 --- .../Dialogflow/V2/ListDocumentsResponse.php | 106 - .../Dialogflow/V2/ListEntityTypesRequest.php | 230 --- .../Dialogflow/V2/ListEntityTypesResponse.php | 110 - .../Dialogflow/V2/ListEnvironmentsRequest.php | 170 -- .../V2/ListEnvironmentsResponse.php | 110 - .../Dialogflow/V2/ListGeneratorsRequest.php | 158 -- .../Dialogflow/V2/ListGeneratorsResponse.php | 105 - .../Dialogflow/V2/ListIntentsRequest.php | 308 --- .../Dialogflow/V2/ListIntentsResponse.php | 110 - .../V2/ListKnowledgeBasesRequest.php | 265 --- .../V2/ListKnowledgeBasesResponse.php | 106 - .../Dialogflow/V2/ListMessagesRequest.php | 222 -- .../Dialogflow/V2/ListMessagesResponse.php | 114 -- .../Dialogflow/V2/ListParticipantsRequest.php | 164 -- .../V2/ListParticipantsResponse.php | 110 - .../V2/ListSessionEntityTypesRequest.php | 179 -- .../V2/ListSessionEntityTypesResponse.php | 110 - .../Dialogflow/V2/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 - .../Cloud/Dialogflow/V2/MessageEntry.php | 187 -- .../Cloud/Dialogflow/V2/MessageEntry/Role.php | 72 - .../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 | 93 - .../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 | 461 ----- .../Cloud/Dialogflow/V2/QueryResult.php | 847 -------- .../Dialogflow/V2/ReloadDocumentRequest.php | 225 -- .../Dialogflow/V2/RestoreAgentRequest.php | 165 -- .../Dialogflow/V2/SearchAgentsRequest.php | 159 -- .../Dialogflow/V2/SearchAgentsResponse.php | 110 - .../Dialogflow/V2/SearchKnowledgeAnswer.php | 181 -- .../V2/SearchKnowledgeAnswer/AnswerSource.php | 138 -- .../V2/SearchKnowledgeAnswer/AnswerType.php | 71 - .../Dialogflow/V2/SearchKnowledgeRequest.php | 308 --- .../Dialogflow/V2/SearchKnowledgeResponse.php | 106 - .../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 | 432 ---- .../Cloud/Dialogflow/V2/SpeechWordInfo.php | 225 -- .../Cloud/Dialogflow/V2/SsmlVoiceGender.php | 70 - .../V2/StreamingAnalyzeContentRequest.php | 693 ------- .../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 | 232 --- .../V2/SuggestConversationSummaryResponse.php | 170 -- .../Summary.php | 188 -- .../V2/SuggestFaqAnswersRequest.php | 224 -- .../V2/SuggestFaqAnswersResponse.php | 168 -- .../V2/SuggestKnowledgeAssistRequest.php | 214 -- .../V2/SuggestKnowledgeAssistResponse.php | 170 -- .../V2/SuggestSmartRepliesRequest.php | 232 --- .../V2/SuggestSmartRepliesResponse.php | 176 -- .../Cloud/Dialogflow/V2/SuggestionFeature.php | 69 - .../Dialogflow/V2/SuggestionFeature/Type.php | 85 - .../Cloud/Dialogflow/V2/SuggestionInput.php | 87 - .../Cloud/Dialogflow/V2/SuggestionResult.php | 213 -- .../Dialogflow/V2/SummarizationContext.php | 185 -- .../Dialogflow/V2/SummarizationSection.php | 139 -- .../V2/SummarizationSection/Type.php | 109 - .../V2/SummarizationSectionList.php | 67 - .../Cloud/Dialogflow/V2/SummarySuggestion.php | 67 - .../V2/SummarySuggestion/SummarySection.php | 104 - .../Dialogflow/V2/SynthesizeSpeechConfig.php | 269 --- .../Cloud/Dialogflow/V2/TelephonyDtmf.php | 160 -- .../Dialogflow/V2/TelephonyDtmfEvents.php | 67 - .../Google/Cloud/Dialogflow/V2/TextInput.php | 118 -- .../Dialogflow/V2/TextToSpeechSettings.php | 197 -- .../Cloud/Dialogflow/V2/TrainAgentRequest.php | 87 - .../Cloud/Dialogflow/V2/TriggerEvent.php | 63 - ...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/UpdateGeneratorRequest.php | 141 -- .../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 | 70 - .../samples/V2/AgentsClient/export_agent.php | 105 - .../v2/samples/V2/AgentsClient/get_agent.php | 72 - .../samples/V2/AgentsClient/get_location.php | 57 - .../V2/AgentsClient/get_validation_result.php | 73 - .../samples/V2/AgentsClient/import_agent.php | 107 - .../V2/AgentsClient/list_locations.php | 62 - .../samples/V2/AgentsClient/restore_agent.php | 105 - .../samples/V2/AgentsClient/search_agents.php | 83 - .../v2/samples/V2/AgentsClient/set_agent.php | 102 - .../samples/V2/AgentsClient/train_agent.php | 94 - .../V2/AnswerRecordsClient/get_location.php | 57 - .../list_answer_records.php | 79 - .../V2/AnswerRecordsClient/list_locations.php | 62 - .../update_answer_record.php | 65 - .../V2/ContextsClient/create_context.php | 99 - .../V2/ContextsClient/delete_all_contexts.php | 74 - .../V2/ContextsClient/delete_context.php | 74 - .../samples/V2/ContextsClient/get_context.php | 76 - .../V2/ContextsClient/get_location.php | 57 - .../V2/ContextsClient/list_contexts.php | 81 - .../V2/ContextsClient/list_locations.php | 62 - .../V2/ContextsClient/update_context.php | 88 - .../create_conversation_dataset.php | 99 - .../delete_conversation_dataset.php | 95 - .../get_conversation_dataset.php | 77 - .../get_location.php | 57 - .../import_conversation_data.php | 103 - .../list_conversation_datasets.php | 78 - .../list_locations.php | 62 - .../create_conversation_model.php | 112 - .../create_conversation_model_evaluation.php | 91 - .../delete_conversation_model.php | 89 - .../deploy_conversation_model.php | 92 - .../get_conversation_model.php | 71 - .../get_conversation_model_evaluation.php | 72 - .../ConversationModelsClient/get_location.php | 57 - .../list_conversation_model_evaluations.php | 76 - .../list_conversation_models.php | 76 - .../list_locations.php | 62 - .../undeploy_conversation_model.php | 92 - .../clear_suggestion_feature_config.php | 110 - .../create_conversation_profile.php | 84 - .../delete_conversation_profile.php | 74 - .../get_conversation_profile.php | 76 - .../get_location.php | 57 - .../list_conversation_profiles.php | 77 - .../list_locations.php | 62 - .../set_suggestion_feature_config.php | 111 - .../update_conversation_profile.php | 80 - .../complete_conversation.php | 74 - .../create_conversation.php | 106 - .../generate_stateless_suggestion.php | 73 - .../generate_stateless_summary.php | 99 - .../ConversationsClient/get_conversation.php | 73 - .../V2/ConversationsClient/get_location.php | 57 - .../list_conversations.php | 77 - .../V2/ConversationsClient/list_locations.php | 62 - .../V2/ConversationsClient/list_messages.php | 82 - .../ConversationsClient/search_knowledge.php | 92 - .../suggest_conversation_summary.php | 75 - .../V2/DocumentsClient/create_document.php | 116 -- .../V2/DocumentsClient/delete_document.php | 91 - .../V2/DocumentsClient/export_document.php | 94 - .../V2/DocumentsClient/get_document.php | 73 - .../V2/DocumentsClient/get_location.php | 57 - .../V2/DocumentsClient/import_documents.php | 114 -- .../V2/DocumentsClient/list_documents.php | 78 - .../V2/DocumentsClient/list_locations.php | 62 - .../V2/DocumentsClient/reload_document.php | 99 - .../V2/DocumentsClient/update_document.php | 104 - .../get_encryption_spec.php | 71 - .../get_location.php | 57 - .../initialize_encryption_spec.php | 93 - .../list_locations.php | 62 - .../batch_create_entities.php | 125 -- .../batch_delete_entities.php | 100 - .../batch_delete_entity_types.php | 101 - .../batch_update_entities.php | 128 -- .../batch_update_entity_types.php | 97 - .../EntityTypesClient/create_entity_type.php | 88 - .../EntityTypesClient/delete_entity_type.php | 74 - .../V2/EntityTypesClient/get_entity_type.php | 72 - .../V2/EntityTypesClient/get_location.php | 57 - .../EntityTypesClient/list_entity_types.php | 77 - .../V2/EntityTypesClient/list_locations.php | 62 - .../EntityTypesClient/update_entity_type.php | 80 - .../EnvironmentsClient/create_environment.php | 80 - .../EnvironmentsClient/delete_environment.php | 76 - .../V2/EnvironmentsClient/get_environment.php | 78 - .../get_environment_history.php | 83 - .../V2/EnvironmentsClient/get_location.php | 57 - .../EnvironmentsClient/list_environments.php | 80 - .../V2/EnvironmentsClient/list_locations.php | 62 - .../EnvironmentsClient/update_environment.php | 73 - .../V2/FulfillmentsClient/get_fulfillment.php | 72 - .../V2/FulfillmentsClient/get_location.php | 57 - .../V2/FulfillmentsClient/list_locations.php | 62 - .../FulfillmentsClient/update_fulfillment.php | 81 - .../V2/GeneratorsClient/create_generator.php | 74 - .../V2/GeneratorsClient/delete_generator.php | 70 - .../V2/GeneratorsClient/get_generator.php | 72 - .../V2/GeneratorsClient/get_location.php | 57 - .../V2/GeneratorsClient/list_generators.php | 77 - .../V2/GeneratorsClient/list_locations.php | 62 - .../V2/GeneratorsClient/update_generator.php | 59 - .../V2/IntentsClient/batch_delete_intents.php | 101 - .../V2/IntentsClient/batch_update_intents.php | 97 - .../V2/IntentsClient/create_intent.php | 81 - .../V2/IntentsClient/delete_intent.php | 75 - .../samples/V2/IntentsClient/get_intent.php | 72 - .../samples/V2/IntentsClient/get_location.php | 57 - .../samples/V2/IntentsClient/list_intents.php | 85 - .../V2/IntentsClient/list_locations.php | 62 - .../V2/IntentsClient/update_intent.php | 76 - .../create_knowledge_base.php | 80 - .../delete_knowledge_base.php | 71 - .../get_knowledge_base.php | 73 - .../V2/KnowledgeBasesClient/get_location.php | 57 - .../list_knowledge_bases.php | 77 - .../KnowledgeBasesClient/list_locations.php | 62 - .../update_knowledge_base.php | 73 - .../V2/ParticipantsClient/analyze_content.php | 82 - .../ParticipantsClient/create_participant.php | 75 - .../V2/ParticipantsClient/get_location.php | 57 - .../V2/ParticipantsClient/get_participant.php | 77 - .../V2/ParticipantsClient/list_locations.php | 62 - .../ParticipantsClient/list_participants.php | 78 - .../streaming_analyze_content.php | 97 - .../ParticipantsClient/suggest_articles.php | 78 - .../suggest_faq_answers.php | 78 - .../suggest_knowledge_assist.php | 77 - .../suggest_smart_replies.php | 78 - .../ParticipantsClient/update_participant.php | 62 - .../create_session_entity_type.php | 141 -- .../delete_session_entity_type.php | 83 - .../SessionEntityTypesClient/get_location.php | 57 - .../get_session_entity_type.php | 85 - .../list_locations.php | 62 - .../list_session_entity_types.php | 85 - .../update_session_entity_type.php | 127 -- .../V2/SessionsClient/detect_intent.php | 104 - .../V2/SessionsClient/get_location.php | 57 - .../V2/SessionsClient/list_locations.php | 62 - .../streaming_detect_intent.php | 109 - .../V2/VersionsClient/create_version.php | 79 - .../V2/VersionsClient/delete_version.php | 74 - .../V2/VersionsClient/get_location.php | 57 - .../samples/V2/VersionsClient/get_version.php | 76 - .../V2/VersionsClient/list_locations.php | 62 - .../V2/VersionsClient/list_versions.php | 80 - .../V2/VersionsClient/update_version.php | 66 - .../Dialogflow/v2/src/V2/AgentsClient.php | 34 - .../v2/src/V2/AnswerRecordsClient.php | 34 - .../v2/src/V2/Client/AgentsClient.php | 705 ------- .../v2/src/V2/Client/AnswerRecordsClient.php | 718 ------- .../v2/src/V2/Client/ContextsClient.php | 630 ------ .../V2/Client/ConversationDatasetsClient.php | 505 ----- .../V2/Client/ConversationModelsClient.php | 795 -------- .../V2/Client/ConversationProfilesClient.php | 882 -------- .../v2/src/V2/Client/ConversationsClient.php | 1013 --------- .../v2/src/V2/Client/DocumentsClient.php | 689 ------- .../V2/Client/EncryptionSpecServiceClient.php | 365 ---- .../v2/src/V2/Client/EntityTypesClient.php | 752 ------- .../v2/src/V2/Client/EnvironmentsClient.php | 639 ------ .../v2/src/V2/Client/FulfillmentsClient.php | 356 ---- .../v2/src/V2/Client/GeneratorsClient.php | 428 ---- .../v2/src/V2/Client/IntentsClient.php | 839 -------- .../v2/src/V2/Client/KnowledgeBasesClient.php | 479 ----- .../v2/src/V2/Client/ParticipantsClient.php | 1057 ---------- .../V2/Client/SessionEntityTypesClient.php | 631 ------ .../v2/src/V2/Client/SessionsClient.php | 656 ------ .../v2/src/V2/Client/VersionsClient.php | 500 ----- .../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/EncryptionSpecServiceClient.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 | 1167 ----------- .../src/V2/Gapic/AnswerRecordsGapicClient.php | 1147 ----------- .../v2/src/V2/Gapic/ContextsGapicClient.php | 983 --------- .../Gapic/ConversationDatasetsGapicClient.php | 822 -------- .../Gapic/ConversationModelsGapicClient.php | 1332 ------------ .../Gapic/ConversationProfilesGapicClient.php | 1426 ------------- .../src/V2/Gapic/ConversationsGapicClient.php | 1753 ---------------- .../v2/src/V2/Gapic/DocumentsGapicClient.php | 1275 ------------ .../EncryptionSpecServiceGapicClient.php | 521 ----- .../src/V2/Gapic/EntityTypesGapicClient.php | 1352 ------------ .../src/V2/Gapic/EnvironmentsGapicClient.php | 1060 ---------- .../src/V2/Gapic/FulfillmentsGapicClient.php | 516 ----- .../v2/src/V2/Gapic/GeneratorsGapicClient.php | 668 ------ .../v2/src/V2/Gapic/IntentsGapicClient.php | 1447 ------------- .../V2/Gapic/KnowledgeBasesGapicClient.php | 781 ------- .../src/V2/Gapic/ParticipantsGapicClient.php | 1809 ----------------- .../Gapic/SessionEntityTypesGapicClient.php | 964 --------- .../v2/src/V2/Gapic/SessionsGapicClient.php | 1051 ---------- .../v2/src/V2/Gapic/VersionsGapicClient.php | 788 ------- .../Dialogflow/v2/src/V2/GeneratorsClient.php | 34 - .../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 | 940 --------- .../V2/resources/agents_client_config.json | 89 - .../V2/resources/agents_descriptor_config.php | 214 -- .../resources/agents_rest_client_config.php | 270 --- .../answer_records_client_config.json | 54 - .../answer_records_descriptor_config.php | 118 -- .../answer_records_rest_client_config.php | 149 -- .../V2/resources/contexts_client_config.json | 74 - .../resources/contexts_descriptor_config.php | 155 -- .../resources/contexts_rest_client_config.php | 265 --- .../conversation_datasets_client_config.json | 69 - ...onversation_datasets_descriptor_config.php | 155 -- ...nversation_datasets_rest_client_config.php | 182 -- .../conversation_models_client_config.json | 89 - .../conversation_models_descriptor_config.php | 233 --- ...conversation_models_rest_client_config.php | 260 --- .../conversation_profiles_client_config.json | 79 - ...onversation_profiles_descriptor_config.php | 190 -- ...nversation_profiles_rest_client_config.php | 240 --- .../conversations_client_config.json | 89 - .../conversations_descriptor_config.php | 220 -- .../conversations_rest_client_config.php | 280 --- .../V2/resources/documents_client_config.json | 84 - .../resources/documents_descriptor_config.php | 217 -- .../documents_rest_client_config.php | 280 --- ...encryption_spec_service_client_config.json | 54 - ...ryption_spec_service_descriptor_config.php | 97 - ...yption_spec_service_rest_client_config.php | 130 -- .../resources/entity_types_client_config.json | 94 - .../entity_types_descriptor_config.php | 234 --- .../entity_types_rest_client_config.php | 291 --- .../resources/environments_client_config.json | 74 - .../environments_descriptor_config.php | 165 -- .../environments_rest_client_config.php | 225 -- .../resources/fulfillments_client_config.json | 54 - .../fulfillments_descriptor_config.php | 92 - .../fulfillments_rest_client_config.php | 149 -- .../resources/generators_client_config.json | 69 - .../generators_descriptor_config.php | 135 -- .../generators_rest_client_config.php | 177 -- .../V2/resources/intents_client_config.json | 79 - .../resources/intents_descriptor_config.php | 187 -- .../resources/intents_rest_client_config.php | 242 --- .../knowledge_bases_client_config.json | 69 - .../knowledge_bases_descriptor_config.php | 138 -- .../knowledge_bases_rest_client_config.php | 218 -- .../resources/participants_client_config.json | 114 -- .../participants_descriptor_config.php | 212 -- .../participants_rest_client_config.php | 280 --- .../session_entity_types_client_config.json | 69 - ...session_entity_types_descriptor_config.php | 143 -- ...ession_entity_types_rest_client_config.php | 240 --- .../V2/resources/sessions_client_config.json | 74 - .../resources/sessions_descriptor_config.php | 98 - .../resources/sessions_rest_client_config.php | 135 -- .../V2/resources/versions_client_config.json | 69 - .../resources/versions_descriptor_config.php | 139 -- .../resources/versions_rest_client_config.php | 202 -- .../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 | 825 -------- .../Client/ConversationModelsClientTest.php | 1203 ----------- .../Client/ConversationProfilesClientTest.php | 943 --------- .../V2/Client/ConversationsClientTest.php | 881 -------- .../Unit/V2/Client/DocumentsClientTest.php | 1243 ----------- .../EncryptionSpecServiceClientTest.php | 418 ---- .../Unit/V2/Client/EntityTypesClientTest.php | 1263 ------------ .../Unit/V2/Client/EnvironmentsClientTest.php | 670 ------ .../Unit/V2/Client/FulfillmentsClientTest.php | 371 ---- .../Unit/V2/Client/GeneratorsClientTest.php | 568 ------ .../Unit/V2/Client/IntentsClientTest.php | 918 --------- .../V2/Client/KnowledgeBasesClientTest.php | 586 ------ .../Unit/V2/Client/ParticipantsClientTest.php | 953 --------- .../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 | 708 ------- .../Unit/V2/ConversationModelsClientTest.php | 1072 ---------- .../V2/ConversationProfilesClientTest.php | 808 -------- .../tests/Unit/V2/ConversationsClientTest.php | 793 -------- .../v2/tests/Unit/V2/DocumentsClientTest.php | 1109 ---------- .../V2/EncryptionSpecServiceClientTest.php | 371 ---- .../tests/Unit/V2/EntityTypesClientTest.php | 1129 ---------- .../tests/Unit/V2/EnvironmentsClientTest.php | 587 ------ .../tests/Unit/V2/FulfillmentsClientTest.php | 320 --- .../v2/tests/Unit/V2/GeneratorsClientTest.php | 500 ----- .../v2/tests/Unit/V2/IntentsClientTest.php | 805 -------- .../Unit/V2/KnowledgeBasesClientTest.php | 514 ----- .../tests/Unit/V2/ParticipantsClientTest.php | 869 -------- .../Unit/V2/SessionEntityTypesClientTest.php | 519 ----- .../v2/tests/Unit/V2/SessionsClientTest.php | 365 ---- .../v2/tests/Unit/V2/VersionsClientTest.php | 511 ----- 709 files changed, 130 insertions(+), 144343 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/EncryptionSpec.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/Generator.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/KnowledgeAssistFeedback.php delete mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/AgentAssistantFeedback/KnowledgeSearchFeedback.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/ConversationContext.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/CreateGeneratorRequest.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/DeleteGeneratorRequest.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/DialogflowAssistAnswer.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/EncryptionSpec.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/FewShotExample.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/GenerateStatelessSuggestionRequest.php delete mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/GenerateStatelessSuggestionResponse.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/Generator.php delete mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/GeneratorSuggestion.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/GetEncryptionSpecRequest.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/GetGeneratorRequest.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/DialogflowQuerySource/HumanAgentSideConfig.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/SuggestionQueryConfig/Sections.php delete mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/HumanAgentAssistantConfig/SuggestionQueryConfig/Sections/SectionType.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/InferenceParameter.php delete mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/InitializeEncryptionSpecMetadata.php delete mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/InitializeEncryptionSpecRequest.php delete mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/InitializeEncryptionSpecResponse.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/IntentSuggestion.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/KnowledgeAssistAnswer.php delete mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/KnowledgeAssistAnswer/KnowledgeAnswer.php delete mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/KnowledgeAssistAnswer/KnowledgeAnswer/FaqSource.php delete mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/KnowledgeAssistAnswer/KnowledgeAnswer/GenerativeSource.php delete mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/KnowledgeAssistAnswer/KnowledgeAnswer/GenerativeSource/Snippet.php delete mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/KnowledgeAssistAnswer/SuggestedQuery.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/ListGeneratorsRequest.php delete mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/ListGeneratorsResponse.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/MessageEntry.php delete mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/MessageEntry/Role.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/SearchKnowledgeAnswer.php delete mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/SearchKnowledgeAnswer/AnswerSource.php delete mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/SearchKnowledgeAnswer/AnswerType.php delete mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/SearchKnowledgeRequest.php delete mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/SearchKnowledgeResponse.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/SuggestKnowledgeAssistRequest.php delete mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/SuggestKnowledgeAssistResponse.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/SuggestionInput.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/SummarizationContext.php delete mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/SummarizationSection.php delete mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/SummarizationSection/Type.php delete mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/SummarizationSectionList.php delete mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/SummarySuggestion.php delete mode 100644 owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/SummarySuggestion/SummarySection.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/TriggerEvent.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/UpdateGeneratorRequest.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_suggestion.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/search_knowledge.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/EncryptionSpecServiceClient/get_encryption_spec.php delete mode 100644 owl-bot-staging/Dialogflow/v2/samples/V2/EncryptionSpecServiceClient/get_location.php delete mode 100644 owl-bot-staging/Dialogflow/v2/samples/V2/EncryptionSpecServiceClient/initialize_encryption_spec.php delete mode 100644 owl-bot-staging/Dialogflow/v2/samples/V2/EncryptionSpecServiceClient/list_locations.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/GeneratorsClient/create_generator.php delete mode 100644 owl-bot-staging/Dialogflow/v2/samples/V2/GeneratorsClient/delete_generator.php delete mode 100644 owl-bot-staging/Dialogflow/v2/samples/V2/GeneratorsClient/get_generator.php delete mode 100644 owl-bot-staging/Dialogflow/v2/samples/V2/GeneratorsClient/get_location.php delete mode 100644 owl-bot-staging/Dialogflow/v2/samples/V2/GeneratorsClient/list_generators.php delete mode 100644 owl-bot-staging/Dialogflow/v2/samples/V2/GeneratorsClient/list_locations.php delete mode 100644 owl-bot-staging/Dialogflow/v2/samples/V2/GeneratorsClient/update_generator.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_knowledge_assist.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/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/EncryptionSpecServiceClient.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/GeneratorsClient.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/EncryptionSpecServiceClient.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/EncryptionSpecServiceGapicClient.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/GeneratorsGapicClient.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/GeneratorsClient.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/encryption_spec_service_client_config.json delete mode 100644 owl-bot-staging/Dialogflow/v2/src/V2/resources/encryption_spec_service_descriptor_config.php delete mode 100644 owl-bot-staging/Dialogflow/v2/src/V2/resources/encryption_spec_service_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/generators_client_config.json delete mode 100644 owl-bot-staging/Dialogflow/v2/src/V2/resources/generators_descriptor_config.php delete mode 100644 owl-bot-staging/Dialogflow/v2/src/V2/resources/generators_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/EncryptionSpecServiceClientTest.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/GeneratorsClientTest.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/EncryptionSpecServiceClientTest.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/GeneratorsClientTest.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/AudioConfig.php b/Dialogflow/metadata/V2/AudioConfig.php index e76fe515261e0b611796bfa78f7fa954c8d90d33..2731adb42d263e121ca9b4aace317f6fb330907e 100644 GIT binary patch delta 86 zcmdle_eyTVBqo-Ll3cnIy>&MqX1c=8G=*vMOs?OOLgHM)j-f7|{_(DU&i*c*e(v#( oK91o69Gj;aRw4D7SS4W}P&=n9G@I1vgMfeI$evUh7b32^bnqnLvsQmoX?$fYnj MkXK>zS@vok0HWS4WB>pF delta 43 zcmV+`0M!4kDaa_G1O)pZ3N@3g1RJv-1hoMK(E|z-lOYWgv+D&i0h3<`i?a?0pbRsC B4NCw3 diff --git a/Dialogflow/src/V2/AudioEncoding.php b/Dialogflow/src/V2/AudioEncoding.php index ee0084582a04..e630d149e731 100644 --- a/Dialogflow/src/V2/AudioEncoding.php +++ b/Dialogflow/src/V2/AudioEncoding.php @@ -83,6 +83,12 @@ class AudioEncoding * Generated from protobuf enum AUDIO_ENCODING_SPEEX_WITH_HEADER_BYTE = 7; */ const AUDIO_ENCODING_SPEEX_WITH_HEADER_BYTE = 7; + /** + * 8-bit samples that compand 13-bit audio samples using G.711 PCMU/a-law. + * + * Generated from protobuf enum AUDIO_ENCODING_ALAW = 8; + */ + const AUDIO_ENCODING_ALAW = 8; private static $valueToName = [ self::AUDIO_ENCODING_UNSPECIFIED => 'AUDIO_ENCODING_UNSPECIFIED', @@ -93,6 +99,7 @@ class AudioEncoding self::AUDIO_ENCODING_AMR_WB => 'AUDIO_ENCODING_AMR_WB', self::AUDIO_ENCODING_OGG_OPUS => 'AUDIO_ENCODING_OGG_OPUS', self::AUDIO_ENCODING_SPEEX_WITH_HEADER_BYTE => 'AUDIO_ENCODING_SPEEX_WITH_HEADER_BYTE', + self::AUDIO_ENCODING_ALAW => 'AUDIO_ENCODING_ALAW', ]; public static function name($value) diff --git a/Dialogflow/src/V2/ConversationDataset.php b/Dialogflow/src/V2/ConversationDataset.php index 8a069cc231a1..8b57a60a7f3b 100644 --- a/Dialogflow/src/V2/ConversationDataset.php +++ b/Dialogflow/src/V2/ConversationDataset.php @@ -63,6 +63,20 @@ class ConversationDataset extends \Google\Protobuf\Internal\Message * Generated from protobuf field int64 conversation_count = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ private $conversation_count = 0; + /** + * Output only. A read only boolean field reflecting Zone Isolation status of + * the dataset. + * + * Generated from protobuf field optional bool satisfies_pzi = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + private $satisfies_pzi = null; + /** + * Output only. A read only boolean field reflecting Zone Separation status of + * the dataset. + * + * Generated from protobuf field optional bool satisfies_pzs = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + private $satisfies_pzs = null; /** * Constructor. @@ -87,6 +101,12 @@ class ConversationDataset extends \Google\Protobuf\Internal\Message * @type int|string $conversation_count * Output only. The number of conversations this conversation dataset * contains. + * @type bool $satisfies_pzi + * Output only. A read only boolean field reflecting Zone Isolation status of + * the dataset. + * @type bool $satisfies_pzs + * Output only. A read only boolean field reflecting Zone Separation status of + * the dataset. * } */ public function __construct($data = NULL) { @@ -312,5 +332,81 @@ public function setConversationCount($var) return $this; } + /** + * Output only. A read only boolean field reflecting Zone Isolation status of + * the dataset. + * + * Generated from protobuf field optional bool satisfies_pzi = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return bool + */ + public function getSatisfiesPzi() + { + return isset($this->satisfies_pzi) ? $this->satisfies_pzi : false; + } + + public function hasSatisfiesPzi() + { + return isset($this->satisfies_pzi); + } + + public function clearSatisfiesPzi() + { + unset($this->satisfies_pzi); + } + + /** + * Output only. A read only boolean field reflecting Zone Isolation status of + * the dataset. + * + * Generated from protobuf field optional bool satisfies_pzi = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param bool $var + * @return $this + */ + public function setSatisfiesPzi($var) + { + GPBUtil::checkBool($var); + $this->satisfies_pzi = $var; + + return $this; + } + + /** + * Output only. A read only boolean field reflecting Zone Separation status of + * the dataset. + * + * Generated from protobuf field optional bool satisfies_pzs = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return bool + */ + public function getSatisfiesPzs() + { + return isset($this->satisfies_pzs) ? $this->satisfies_pzs : false; + } + + public function hasSatisfiesPzs() + { + return isset($this->satisfies_pzs); + } + + public function clearSatisfiesPzs() + { + unset($this->satisfies_pzs); + } + + /** + * Output only. A read only boolean field reflecting Zone Separation status of + * the dataset. + * + * Generated from protobuf field optional bool satisfies_pzs = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param bool $var + * @return $this + */ + public function setSatisfiesPzs($var) + { + GPBUtil::checkBool($var); + $this->satisfies_pzs = $var; + + return $this; + } + } diff --git a/Dialogflow/src/V2/OutputAudioEncoding.php b/Dialogflow/src/V2/OutputAudioEncoding.php index b8821bce4def..5ddca3f8b2c8 100644 --- a/Dialogflow/src/V2/OutputAudioEncoding.php +++ b/Dialogflow/src/V2/OutputAudioEncoding.php @@ -53,6 +53,12 @@ class OutputAudioEncoding * Generated from protobuf enum OUTPUT_AUDIO_ENCODING_MULAW = 5; */ const OUTPUT_AUDIO_ENCODING_MULAW = 5; + /** + * 8-bit samples that compand 13-bit audio samples using G.711 PCMU/a-law. + * + * Generated from protobuf enum OUTPUT_AUDIO_ENCODING_ALAW = 6; + */ + const OUTPUT_AUDIO_ENCODING_ALAW = 6; private static $valueToName = [ self::OUTPUT_AUDIO_ENCODING_UNSPECIFIED => 'OUTPUT_AUDIO_ENCODING_UNSPECIFIED', @@ -61,6 +67,7 @@ class OutputAudioEncoding self::OUTPUT_AUDIO_ENCODING_MP3_64_KBPS => 'OUTPUT_AUDIO_ENCODING_MP3_64_KBPS', self::OUTPUT_AUDIO_ENCODING_OGG_OPUS => 'OUTPUT_AUDIO_ENCODING_OGG_OPUS', self::OUTPUT_AUDIO_ENCODING_MULAW => 'OUTPUT_AUDIO_ENCODING_MULAW', + self::OUTPUT_AUDIO_ENCODING_ALAW => 'OUTPUT_AUDIO_ENCODING_ALAW', ]; public static function name($value) diff --git a/Dialogflow/tests/Unit/V2/Client/ConversationDatasetsClientTest.php b/Dialogflow/tests/Unit/V2/Client/ConversationDatasetsClientTest.php index 29e8ce86a2ce..a287e5040f93 100644 --- a/Dialogflow/tests/Unit/V2/Client/ConversationDatasetsClientTest.php +++ b/Dialogflow/tests/Unit/V2/Client/ConversationDatasetsClientTest.php @@ -101,11 +101,15 @@ public function createConversationDatasetTest() $displayName = 'displayName1615086568'; $description = 'description-1724546052'; $conversationCount = 1994187347; + $satisfiesPzi = false; + $satisfiesPzs = false; $expectedResponse = new ConversationDataset(); $expectedResponse->setName($name); $expectedResponse->setDisplayName($displayName); $expectedResponse->setDescription($description); $expectedResponse->setConversationCount($conversationCount); + $expectedResponse->setSatisfiesPzi($satisfiesPzi); + $expectedResponse->setSatisfiesPzs($satisfiesPzs); $anyResponse = new Any(); $anyResponse->setValue($expectedResponse->serializeToString()); $completeOperation = new Operation(); @@ -349,11 +353,15 @@ public function getConversationDatasetTest() $displayName = 'displayName1615086568'; $description = 'description-1724546052'; $conversationCount = 1994187347; + $satisfiesPzi = false; + $satisfiesPzs = false; $expectedResponse = new ConversationDataset(); $expectedResponse->setName($name2); $expectedResponse->setDisplayName($displayName); $expectedResponse->setDescription($description); $expectedResponse->setConversationCount($conversationCount); + $expectedResponse->setSatisfiesPzi($satisfiesPzi); + $expectedResponse->setSatisfiesPzs($satisfiesPzs); $transport->addResponse($expectedResponse); // Mock request $formattedName = $gapicClient->conversationDatasetName('[PROJECT]', '[LOCATION]', '[CONVERSATION_DATASET]'); @@ -758,11 +766,15 @@ public function createConversationDatasetAsyncTest() $displayName = 'displayName1615086568'; $description = 'description-1724546052'; $conversationCount = 1994187347; + $satisfiesPzi = false; + $satisfiesPzs = false; $expectedResponse = new ConversationDataset(); $expectedResponse->setName($name); $expectedResponse->setDisplayName($displayName); $expectedResponse->setDescription($description); $expectedResponse->setConversationCount($conversationCount); + $expectedResponse->setSatisfiesPzi($satisfiesPzi); + $expectedResponse->setSatisfiesPzs($satisfiesPzs); $anyResponse = new Any(); $anyResponse->setValue($expectedResponse->serializeToString()); $completeOperation = new Operation(); diff --git a/Dialogflow/tests/Unit/V2/ConversationDatasetsClientTest.php b/Dialogflow/tests/Unit/V2/ConversationDatasetsClientTest.php index dad31af1cf44..ff246344e4d4 100644 --- a/Dialogflow/tests/Unit/V2/ConversationDatasetsClientTest.php +++ b/Dialogflow/tests/Unit/V2/ConversationDatasetsClientTest.php @@ -94,11 +94,15 @@ public function createConversationDatasetTest() $displayName = 'displayName1615086568'; $description = 'description-1724546052'; $conversationCount = 1994187347; + $satisfiesPzi = false; + $satisfiesPzs = false; $expectedResponse = new ConversationDataset(); $expectedResponse->setName($name); $expectedResponse->setDisplayName($displayName); $expectedResponse->setDescription($description); $expectedResponse->setConversationCount($conversationCount); + $expectedResponse->setSatisfiesPzi($satisfiesPzi); + $expectedResponse->setSatisfiesPzs($satisfiesPzs); $anyResponse = new Any(); $anyResponse->setValue($expectedResponse->serializeToString()); $completeOperation = new Operation(); @@ -332,11 +336,15 @@ public function getConversationDatasetTest() $displayName = 'displayName1615086568'; $description = 'description-1724546052'; $conversationCount = 1994187347; + $satisfiesPzi = false; + $satisfiesPzs = false; $expectedResponse = new ConversationDataset(); $expectedResponse->setName($name2); $expectedResponse->setDisplayName($displayName); $expectedResponse->setDescription($description); $expectedResponse->setConversationCount($conversationCount); + $expectedResponse->setSatisfiesPzi($satisfiesPzi); + $expectedResponse->setSatisfiesPzs($satisfiesPzs); $transport->addResponse($expectedResponse); // Mock request $formattedName = $gapicClient->conversationDatasetName('[PROJECT]', '[LOCATION]', '[CONVERSATION_DATASET]'); 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 578e828cb08634edc5277219828dd6558d9d2496..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 5894 zcmb_gOLN=S6*eeKv9D}PzVd^nlLm(ESbhkMnMV^kP6rezi5)#S6r&ldoT4CjNg@FO z1h|x6<1RYwFUTh8CNrJMCd+IxlVz4!W!hb)i!QRtE~|9fEOPF}gCGTwlp}9U;huBu zch3FJcOUQk&gnSls<=ul;%byM#l~Zic8KV>Hnnxz6dS!(i@2h0cOAndt}KehEpcSc=(*V4>- zk$AdmIMjA4V4Baj35|-!zAWAhre)!bmbmC+%;)!kyf0F>N8+=KqDyGcweE4;EWoqq zS3RLxieuCj%d%M&Y|G2%`#JSP9OSrc8c@%}`K%bkY!*mI+cRwUaIRGn5M^SJ30$b} zzzPFjAX|vnGY3M{ zKOkSu+NF1mfTK#Y8BuZtnszZF5u?-%^!0W0%4FS&Grpb7yISsdwY-BTikFSS6Dt-0>n&$F^m(h%)xloI=APS2o3$Oi0 zN&Qb*LbrKBVX|G#0!?&fKPVK?lR;p!K$Q21PVpsls%dzRsXbPiTBcJx)D(om5<1@` zEe(=aP0eceAdITpO_HAK+gwL!uje?n3wl0i<)x2{Q-BIW3HSm!NsTU1pV$^jPxsx^ zXto)M9JEM!CL9s)MTE3HP-|E1xkmbh{=j8)hFDs|Br2$W8(J)V0tQd`^Q<7$)u`T4 zyA0<^7&w!=9i*N_ESXnQ-e5i(;8K`Q3k)x$#Ww<@W$3(nRoa1qc5JhmMi4a>PB#k$ zRriSNG5BZre0Rpr2V%P8`}lF*M#rf^-1Hm|@XGiAHL&Kc(hfQqp~o3?VMD1cuc;eb z#gh8o=60pDTwW=ciu1?td2}{5w)UV_M1DDR_}W4bcb z5q?vpp)Xluc-g1HuV?<50xu*P)WUP zXpFxFnLMjl!n0y+Io@d?X;x1_5a7pJg%5d6IFvHO;k9c7)6OW=vW5YTK)Q?VRs zaKialjv0oDT?p+X&E{8yed};*+&bJk#5(+2K&Rr`iL)V!B-C-s5caE+JNV)w8H2>y z#n+N~6A&x!@r`9ShhI&$OIj1(2mdS})R%3%Gzx3qE==vE&^&fIkfZyb^r`TTl11nJ zQ-^<;hr5ByR}Ehn{_Nku22=lIK+OY5N!gZ@7jEso9?){1Wm58?7ycxLW@GX{nvyZY z2@CKQ6krX7MM@&fK+It8nW!>3mFIP?Bgg^vXE8+e@< zQQHFIhnWhys8odAcYPTN)RR4IwC(tdFaU#7NPh;WaWDSIe+A(msZ??0^HgS)zY5FC q>{VDUMz6y1POdS-x7gQiL~mPn{O8oz>+69puiVmqA$^9PA@mE12)-o% 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 bf8f8f4ac09d90b7c24b91c990b1ec9ce487c408..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 5068 zcmbtY&2JmW70*(UEIxf%6MslVTW=UAkqu|*(kW2TwbLcJwAsouL&-MmvRJH^Lu#w# z?s|7AMKN^gztEyR^wa>o6v&~+BL6{-=`E)mdJ2$3Z$*m&eKWJWTz;6A99_hnnfH5d z-p6m=%+EgZ_C0tRP;NZj zm9=Vp_iYpn+<|Y>lH7CMo=pp;?G8GHj%CpnGIzoT$y0LSRl zz%xuL-)oj1(9q}@q0zp_QQ8%T(yk^b?Z?I20H$pOfvj@076*eDAmg7m*t0ED4niZu ze^;$Qw;U@(Y3ozm(jB>L*a1a=$+g{qV}_RN$V}j&W74f_vcP0(uX--J;Eo)d)nr~l zkF@JfNPWk!+f^EvzU76k-^8V*Qjdm-FWJb}wMZ?4v%2z@u(4E{F!GKZ`U9HQF3Ua* z2flNg+syz@l3(p9PE$RrtvZg&yx=-PsWjZv5aMNm72Bdtcs7}uMeRz_@u zMWehqwUJX&qTMun47lYPXR$m9A~*km5geS}^h9>o!t4!=zBgT#C(Z|Vttd^@PAAEV z8kW&k5=R!*_u+q6Ksj6ekepbr@Oo2*^`;yabC)A5!?Um+SzJZY<*uYAx-5A5UKG7( z!DecKAB8BIx)DuHD{yZZhiG+72fWy^VhTcCAH6+hOR^%2T`Csj|CNE|bgh$Rc$1OF zh9pZ{S#lrNB3|iI+SxPAgN+PMEETUuuAJr?MF7?!iSpbxYKA<4OGXc!q$9gn7*zZv zsA}U)4tR4WAd^&MLBUE4cJBTgrN2nus(+T?y;O9B6EQG>f|Obq+22ic#c!w?289>V zuak&61uTw7I~L}h5N(Qt?V6(g3oqiIuYf5p!h%4|eSE-YZ6 zal0Y{Wd)u0A9ahIc7GRPp=;SloIFt3^8AMMjVh5#koD02dVplTF^3+XXa1AOWdJ@N zx(C$Zp~&)y{2^>ku`%$F^C1gqagaub%LApx@R zDv-Pf=O;G)HvF*iu+`EkyA5q;N8i>SYuoyx#!geK)N6IEdY&1-gq@KdEjurfi?H5Q zTf232d;4iJoIx8`YLC)GbLDkd8*^j+zW|riseU2`oKJEMBWqya62-QBcCSYvZ_x-z zRG$SGI<7hBGhR$363@uhV(m55R3o^QXN9UByp^b;-7X&J)G?2F{8x+G_t2yzU_wzJ zE(L>r-|($ZIYkarRuKLD*U+_-28FmXY-uNl0#TwU+8n*+Xu)4>@Vsf~&@#(b*)b>v1qxr@ZN42#KECjSK9 zno|7aD&SqR^5}uqNH~*I>nN$NK(^i(QtA?%i$5~?r$A!hVXc#Q;7Wq4)oS%hU29aH zj#-RcU2nv*%w*Iv{LJKkpMeXb>?@iuvICpE+qJQ#2fZFPMtIrM1szA{)3uq2#;z=O z)IzYl!A=po7U&w!V-!)R@6JN08P7$OVuWA8#<0zdI@uWS951|?2lDW$EplfBoHdAI zgT>G1VMWXdcLd}+3DzgtG4kOo<0qC!Jyh-|XOt2>U;f~0HR?=%`;UMAF4Jz4ciFSU z3(>9KNt)#AV~y~$Tja;n7Z&2yIVg+^k-uetOtyh!rtOpK<1L@MFU|j5`dZx-VTkT0 zH&U%4-}xV;;w`?Rk!1?IHKn{TcB#02Qi^Ft+yb68iyxf=CFP=5A?7~$Qr#S;XB6f5 z7W9?+bUzHepj0Rv9UYBL7K}l-FJ6^Cz^*Rrx_`hClCU08G ilyBjQU#I`wRa_(e%lG^wrWlBzWHXJ{JG$RCmu zX-w(ZA*G>1BdcWDrbEXghkjSOESJp4vZ*no?#Lb&xn}^^oRYvZheWD(DlHP4mKmBC zb?)S%%A8y%sgsMd@@s&hV+MgFGiO!q3w{6ze_k|j?4cBdW{7{!?ZB{IJ49pqdrat! zG%}rlp#8G$C~}9POrRL>0Brz82Yvs zQon<$CnsYPrbx1xqvK>*=FT2TM{$fNCrd%TkwQNrH&>S=pM;U`zUFZ=2UqFW#R|-1 z&%UVH#IY)5VqV(RKRLP1>e|U|rd^V3|N#IN&(EYbFE`|Mm;1^6!PXu{VDN{IEkq}j*GHz zz*G-Ccz8zbA?Xo^@RrvxeRCR!_u&rf#C+QmMyrquf~jMSk#WT5yO=M3z7_^l=iafh z(IhT{e`Mgp-a8i$lK|68p~oXYL^fdh=I;vctj1uz`(j0VM{S=tFU=pp$cqXvebDUI^mvzG( zQC`}KE$;UHJDIo=e%2f|#Sa$y7c1!FU;-~O93WyQfQ^Lw~fX4<_xNCV7 zI~nV;hl8&t=iQD!1HE{uOth(^t&SLrr%XzFa1`8d}`j)<*slqU96+^+lnA?SmsU{ z28-NR8k(WDtD4ei*B4;<7zzvWCI%{ZjbFS%m_C9B3({Ist|DRuc(@>F^_%iJV)r44 z3lh1-K-`B9mgkN03Ih5FK3WiI^}3;T`aQ(=7(QJP;;yP+8|MxE)HqdTMeQ1uZ*&!* zUyfF0F>SxNoR!twiSryJ=Bj#Xv@}I+8fS91A-DAffH0qaPcO~xPr zcG)~`L|c)&3SyGXsO?j^T}94qy!c}V?)Bz-y!Z?r_j)Z{O>0zDqpr4D0`pWozyn}O zr6u!aale*jHI+-V;$zrfmbTTt-j$me&mXezU_}$fqI;(G^-do%T*sA9;OT0$o0P#2 zRx7nSUm{4iE`?&_)h~_TR60Fm%ON~j?ImT#hWHd7t=5UDxXHM`T7lDItMacbJi+(b zn*LuAZe05Ky}gt9_HBH(o86x2v^1tSA8vSO#<$z`ecBtmzB%|$CiB;9R;m3xdr;@E zwjzJE6|Y}y#k2B{avvV?D~ywbhhBpsMqA<>7GL3+{abc;mwrgTu1XFa@>>qh%|5S6 z{K&u={(tqOJb9iLv4U diff --git a/owl-bot-staging/Dialogflow/v2/proto/src/GPBMetadata/Google/Cloud/Dialogflow/V2/Context.php b/owl-bot-staging/Dialogflow/v2/proto/src/GPBMetadata/Google/Cloud/Dialogflow/V2/Context.php deleted file mode 100644 index e24ba7316fec..000000000000 --- a/owl-bot-staging/Dialogflow/v2/proto/src/GPBMetadata/Google/Cloud/Dialogflow/V2/Context.php +++ /dev/null @@ -1,70 +0,0 @@ -internalAddGeneratedFile( - ' -" -(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"¨ÚAparent‚Ó䓘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‰ - -GetContext-.google.cloud.dialogflow.v2.GetContextRequest#.google.cloud.dialogflow.v2.Context"¦ÚAname‚Ó䓘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/*}½ - CreateContext0.google.cloud.dialogflow.v2.CreateContextRequest#.google.cloud.dialogflow.v2.Context"ÔÚAparent,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â - UpdateContext0.google.cloud.dialogflow.v2.UpdateContextRequest#.google.cloud.dialogflow.v2.Context"ùÚAcontext,update_mask‚Óä“Ü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‚ - DeleteContext0.google.cloud.dialogflow.v2.DeleteContextRequest.google.protobuf.Empty"¦ÚAname‚Ó䓘*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/*}Œ -DeleteAllContexts4.google.cloud.dialogflow.v2.DeleteAllContextsRequest.google.protobuf.Empty"¨ÚAparent‚Ó䓘*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/*}/contextsxÊ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 d1e672c0b266ae41bcb224a7171576859e589ced..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 9333 zcmcIqO>7%k9p9O>N%K#dw6EDDbzwW5?nhc$d+Tfk>wfLTak9~-P8vH|nvG;8_KP#r zo-s4yq@l_IByM{HaX=h^<4PcLN2|SX;mArH3Wy$n1Be@6s)WSCa^sVMU+ zN`9rNK|EQ+w%D*)sR2?dYyynMuwW zz|`y1Y3OCDEUwPor>9(;IQ@ERs?8T!`RYH(_$!CrjyCEZECaVMVPG_)O3$WvtZC#WsdIZ zdxm8nk93WSu<2XLh>+L{h64I#2LrT!HKG^_-yO%AC^oCQje%%1^y45J#i&3X2YuPU zQLP9q8kktI3GA*ix3izZi+`-U`+ifVf|r&BFL`B zkX5~+XxZZIwV1Pww#&uonV8d#=T~vkHybtMZDY6dZHDiaC56U%KVuglI%XnZc{pF;mOO!W~LB`2tpT5Az=aB6HDZoTI zP;-3%rw6$3o6j`)xt4W?ItUN#&z zsJ`>E^q+*`28L?M!KsQXf0C&rktqQFf7g0M&44!K91LQm#Yu^0_b@-LHsO4PhE4+~ z7E10xr+*OX0W1rBV}!bloAj|;3Mj-%;IO&@lZ&(i7ax|}9kondD#IWD|?rFwep9heG+a-iyy^PvXfbtBfW)E~-lsnDzy!GH0yQUKJfiMA4*5B zmmbsqM1!#!)(gii3ByGKpi89Z+GXg&C1?qzw9CSlrxt64BDD%|4zD~I0VOO!_5p^q zt=ApV-fqM}t8uaij0&ewoE0z)9WMj_H2`WHJi?bB!jR)3#_QckdLd5U(F~IUf2^Zn z$asp*z1b&T6Cu2q=T9bnEW?m5VH8d`^J$ zYD5&Q#KCq1^W=TJlGgQFFsHq?w$@|DWRWqFPQ}R#GF$a#dynT!NX;+8nY#X%!Qe#@ z>wN9>Oni*>Il?58d7(1sY2B{vURH?O4ww7^#}Qz(#_MG<1gSqA0HwDFL|U(h(|SG* z+@sk2pOgBxQm>@0hm%_7NxkthjEP9;-s#A~;RVz2&oZbH0Q1I$neI2Lc0_nBs{e?< zKpd|6msl}xzR?Flmi_)KWE#d=v?YGqr_gHDU*YpY{CMktxK*Ysc(HVbguva9wJ8QXn`NWMu=qayMk8!#qVdV5p{m0||oeNnCjzQrf6hDR6fj>Ih(^@NLKI9s@e zTN4W?f^$dHHh6&<#*M^~V;YSHbp=p)fPm%~U`opuKFqC^iVs)AONSvCSkNBel3@%0 zmkzl#+)r%e&d3B{a4BEJHN=^L^yjE#Fo+!Tu?(d9-cD}Dfzf?l8W=PV~9e$NI(0IsN|V{z{6NPS8nf0f`ugt7ju zhr|YE455$my<@t_7mTl@`4U?Ffa9D~-{W9(;Tf{p-<1?v_XYe2!26g2F(p46fbq~Y z7vGvfhkdJJ-;8z92upr0b5lN%)!ArU4m;DY^Pa*&VqU!$O&LO=WjrQvH%S6o@lHJcm3F@88vWPW!(G>HIGI#xe}7*DT5A!bH{D(D`$J?UjejveX*f?Xtcdp}I9xl6FYgO93>%DIDU-9A#*QynK0gn3N9NHGt*uE9~ z6Iq^L_(V=D@~>}_S^my`zV-D@awEMxi1Vv!&A!$8FyNZ^y-MKo7FLjqa>S=C N{G|5@${`#A{1?<|n^yn; diff --git a/owl-bot-staging/Dialogflow/v2/proto/src/GPBMetadata/Google/Cloud/Dialogflow/V2/ConversationDataset.php b/owl-bot-staging/Dialogflow/v2/proto/src/GPBMetadata/Google/Cloud/Dialogflow/V2/ConversationDataset.php deleted file mode 100644 index 647e421711bd6d09e85f6d461164a14afdbbc307..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 5294 zcmcgw&2QX96t6dJXeTYS)341|C4*a$bd}oDLM3pTqWx&oNTpe&p%T?fE5|##adB+p z87EDn<$yR;LP#J^T#(>|xN?BMp+}H7fv+0@^_7sF_E9maZ8oF6q zUVDwH636!ptf7wMbS$hImgBe7mZ@7#r)@dg>Q+fL9D56UM5m@>H(NT@38qT00|2(Z ziHWNl7%kN+?_#R+^~O?QtWo908nxJ1<9=xY0K?J=LDhuOT4)pO0>u7Yf88<-L@3+P zK$lI@G;NbIBj#fk;38`47QxKUplsW>4eli33M;mO=dPg8CYQbJIt-9S6nR(Y7%_Yr z%QnTHty_&6CWdFa)bZ*}RMR?`#>nz7b63Q++??4)bD@u#HsItUqMnbFyCdXb>U;J= z;5RqWjej*#uq(S}qiov_N5Qd)ruAa#naEPCS|+yXcsjRCY_%$QL*FtTZ#>miEUIW^ zCsQh;v1E)90wNLd;cXZuV*J#{h zDfKf#4Qll24O3KPxz&mb@D}6mTwF4|fM&t(2wZzE;=)3xrUZOfdVE*5N`>>nr0$xm zAMi>F*u`yl$Pzb0}J4UrQ01}@8G84v~XTR(%iAi z#BXIueh*A7+pbTUQrqmn>j1DgnjsScxvA3YO6Y1D%nGabdqMLhw+~g0g2_-*{_!w4 zo%BOAM|cVx=FPU}!33NJ$6F?GEq$jMEaf8Saxf33TB4gVV&o^H6$!oxrVJ0WVbSEs z8 z2A1ZB8A`&z(-K;n0kF@S;rKSqzr@TMEbM*i3F}D_z@u09AwBrnt3=KlE9fRj`U@{#QuaoJqQ@Gdx;20dZvnRpKD znK!T4_z`U;TnhSv+ySVDEllx$os#b)aB+Flb-aP3LuZ|Xx^ zxBSHj(Xqo@Scoq^x-)EO1a-is2Jg+>;Un@#pqSaD{s+wEc~H#c!NC5dUyp+`DTE>L zha8yBj00Ye(w8 z<+u0+a5t1&jOSW0G0%$Wb4*JeDDWQ%oJ*ey@a-t*G|19*BD}^OQ1bR(IXF!PQ9gw8 zL6rOqm5eb7OFW*7-3J;BQQ0pa4R)dy(?@%;3qQ|+eAY;S3&Rk|(uyz`T5;LRA^GK< zy|OqK^g%L^`1EAQkPOHlTqy7fBT^i8=M&ZQ5d;p|A)84-kM420E#r(irMMxK{JC4DW))p6LRg%e|c%hjafgEe_2 z)zS#O%eGp0^t3#kdA|R-{Qd@|F40tVdwW~ZGd}$5KHUgk%&xLa7;QV==KMk8y{#(W zNZ?g=hZsWoN`5~M?CGt}->vG>gBxL=jBc3hGSYF9FL%sM*1LQAx$6tbfBu%FZ*#fY zt?zS%rQo?vsq*JKr4~QeDfdh3lL0B-n2jGE=EIk*#6uXrM4Lv+BUm6AK2~)>7l3~O D+B-ww 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 1754064115e48208b0272104f4c7e322121c8e28..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 9285 zcmcgyO>7%k9q%|FO~5<0de4fxFOIA^?-OE^JUM6_UD~5i6EL(O|LzlWn z3u!sZ9{^qMBHNS|#IJ6a){!H(WJhkUQdZ3}Vb!eoteOuC_W@8e*|zy|h~+xr2%Z8S z|Czl#O;vc?!NL^&rfN&7t~!{7`UD%d%(rFDMwm-515J{X&3O?Qx`%UZL7Y{gPd$FMf>)?%@P93NHk%i^1^Si(+i^NUQ!VlkrR zGVfSD6qe5O7IJ!)exK@17##bbnlZ?UrrH#B-5@9!x?L;=HU%t_2+Nv^bZ0c06%}c% z655v!RKpsLbPKr=bYdmf483FZbY0au%?*>p?Px~&zQf2>yQXt=a)o`;hKd8%k-KI* zEe)4D@2YNah^>|%3oAH{7Jcs#U)}=$`VzQ%iu{3DMwFvTmkW|EcTmV)bs5U0ij$JK zlqFsEwa`MF_)Xe#9p`SC4{fkq@3>2^yGvT&g1q6oz}r3S5k2H#`T%Nv)XUcy4hT&VzF;)iyQxNTR=H$gicbzla(5c`&0`2$wR6FrFL3 zD>H>`j;X{%V3l&d{|MC>d;q3M<*|`t&yDkAm}Jo-iNQ8k)6Je!VFXO(8 z4mw*hpV)KrnA;RJ`#tX490vzBsB_t1Lk4dUzR!UPiWR&JE^ar(MpfFWZ*Nx1wUt`6 zGJ6Jx$y9l(DmH5M)maW+0AQzHscx=q?Bdl7JP)SXH?llNHv5a?@D(uQZ6?bTY8r&VaL<)p~_&n-V%;ni|?TG7-#zE9)DT>YCKp-5k_S01Mme;#Nc2 z!W!*Ll^tnn#b0vZGodtRQH?X)&fx}~j|3Ln zz-jgsq&Rl|sr%_TuNexfnE9vP$K$>hP0hg+N~p)OKsbiQ7>40}DYT_oaG^_DwI5F8 z7pX5KBEP7@@5jNlh+)+OS?f_NPFfi_xCSmFpA6@g-c~zvlQf`jr=?6F3#)-?NWgNZ ztTP{gOMTge97|Q~xe2Ppoir^%X~l?G-kgDp;F={LO8dR8tV_f|$-(tjBNb4w4`@xG zrE#qI0te719Jn_^00p+g?bCZcAK;F|D)@2?_hXoPL5a6|A5R>giIPgw;4H3_1a0Am z<6t&0j5)Qh1B{)f1AH04uxs7;BAscbu$<=EK~-{rtC?=NDofy1#+=OIhD}-n4c~Ff z{=w+%%Z!gFAbS922gSlNfU<^1culn(sbwg=E*>IS2QD>ly%28#Avu&P?tXY3%y#9+ zxSiNN&B1#2Fb{&t1PS0w_A!7|aGyf|7ty7w;4-U6wuuzAttu|6!b5N_+~MI0IO|Ra zuJ!k@<}buNxRY!@M%F*`xRZkL6fC6oU)+5!IhKs4b-m-ZUI(`oI>lTlyp`tWusm9X zbM!yyO0-}J4!9b4n67zUKS?U7jV~+pV-7d!U?N}{h}&E!vJ?XYg~uI=Z3b?F^NwLk z_@L+(#|+KJFQyqEk&tT`W*yr{@|{S->Ee6CjX^RQj%63YOnB=w;B>0T1RfqHEu`QC zpwXHUzQKWoGMy|VP;a5H_3%VSNKD!ClLXcW1k-4v>}Cq7#Xcf|=8EuHaBUSikws7Z z#qf;GC=j^5hO;+9VtX`~`c@CukV$^2>KLvxU;9J~qu{oOIXigX&3w6k!+H!(Iz za%>ZyKoNW&TvEbLpjg-#Ycgz)1_svS6&*cxq>wW71R&f63l*dx2Sp6_?2W;Q5}BHD zGz!r@!0+fSJmro?Rs?Uvc`#@JDS8^9c`Fv=fck&z)}L@-akxa+!4g=AI+zY5Y*6!j zJz5nDY)kg~pRt+=nHi9Kz^)Gj{4y=&Z^2VeMGCl{YPFl~r!|^o@yD4&1O59CznBkJ zJ63eqxp~(+rIK{HP56#yg6%!Yr82}Ev5&0hE5 z4c!Xne7_3+;GT)gad&!2McXI!YT9#gp3POaqqX+KKmPRxneTGK5_!<@lxlR|EUk%waVb>VI-7V#MN-18Sfu_8Q( zr5ui8hztCA1}wzY;9wSjVj7s~v>u|VEg;gi1KGm&xNvHI$icT`ZH_~$?_Lzw_!U@* zr5%RX03Z094B%r+aGj-{1&<)pf#W-u*iH#P;pVn zK7J<7CtlG0LEPPU9Mdl5^M{9rZgBZe(&V1A&t7G@Lms8H4Xb;5*!DnF=|}iJ4BynJ zgly?bB-1y^D`mek*)i_k@?S)_&0abQy`w^&XRAug`zdrMdynK890TxQTGoX{ 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 5c981767f87ee1a0f8b86c32f444183cc2806bfe..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 12254 zcmeHNO>7)z8D`gUYQK(u@+FSfo21=rTJlq8w`?dXPSY^^W5>jQ^={fG7!Bju+4Usj znPFzut`j1m!U4enBqSsx4ycF=;>Hcc&!Iw9Z@?`l4jfQ8v^P*BD&FsBW@qi0&3a`d z4)juI=X-y?_kF(ieZHU9Z`hkQoX^Z_rsgP~R?lqgX1q-;V>^~-sg{x1Xf+y|lTocL zTQ@W(m&ue@GRrHqOr^X~JBOmK)pAsAHq*4MrlI9k!)n#@bzL#6X2Y;{^4o>HYMI-b z<0_tRnKEi_pr#zN0AMOxnrkbnmYH8IE@_@pS3G5Xo+(=|QDy7pK-v0Rg=+w+p}20Q z6jHj%b;3i);D2^&!_d`?>!Cq4^P=v`x~Y4pM1O!2yq;+&hO42T{bL&~Q>9L3sKAP; zY8NkMxK29uMccxFT+jI4p;gbq_^dCOp5~Z}v0m0()zNLwa#nHZ>}*r>g2>WeE?yF5 zsXD!pxyXH-o!#f;^^E7Vw6OI|#?ic%V_su^Qw5KLzt$sSC)xVCWSSO@f@Qk1v+X&x zRm2IF3|%w5gUQV4no%!mo65FsIR_J6(*%lob}|AP>r$((TL_DW-t66cl%iF|LFDMR za*z-#T4vK}nWk)1nhqBB08Ql?+DuLp}_4lBXM0LB#57vR&|@M>ShgrvDxj@6)Cy9VX93+XALQn7Wc zQ54<00;OLFeP~b!%Nqj2V!(80fFpn^K3x%?n87_oPoZd(vGgGv#qgOf!|gWa#OU*4 zw9y7u-U@&v20bqZ*`gNZ>jFLE`{}*kHHr`M(XZKoFrWVxqCkxBgA?#vtN_+*W$omr6l=0jHr%=tw*M+QzQ6gq>#>W zx4984vAFu<}jCtXqwS@A4p1eYH2$ zH@U1(d<#xsU(g%6%3HF^K$<$rH0HW#Tn>o|WfF{Gt8Zf2^F4cx>ABQR&mxx)D!vLY znc9wwMa0Fd$l5l|Oq7R1eR)^}aJ?Ya!_U@HwKYxMtXVbfT|d#2Fls1fvqk+=t-6*1 zR5MJD!!U)d{J=7`)EN6|5stf>+H!PnS9Uee!@#(yQTnO)xu;SNWb)(V{g-2mt%Zv+ipqs~f}F?oGzWx6_P03a z5-Z#h&iR%ODGh6IGAeW|BL|Nh>pR(BqW`y93+dv2oMGD4`ZOGBU9``NIqYwE0UzV; zHX&2i49(NJczY;${Z;}_Mz*>yz#uM#U`4H8U`y&8ybxbfBs!j4g%KAkJF;Qf^9<2y zr+v6%gzZ2W?I%6rawOZqwPPkh}zEHB;Fze9Ez*xJV4!+F9m@$VE7f?3ImU zD?r8`#ImW6cFv08R$O~|+fW`xES ztK$X$mU(*KVL5K<2)Z#`d>KplQ|To*AKx41eHro^yzDQpO})7(8@N3))m>T4(3Ra? zQz3N0>$%ep-m&Dv^rI{cb-M8F1WdJ)(dh)={3?g)L~vx= z>Bb2d*;3x67-|_FMGK|WXBfR}=ygmxZs<4h>!xMYS*DZZJ@g#cokzJY9vtIIYrA~$ zb$+Ox;|imu@L&op1>NgD4B@7Zo#>_bLa!ZWxNzIYbh9p!u0tvgOynkvcjB7wABKy0 zM#nC}`h|9yg^R)dvO{aS1}7r0LaxKGk5ymyWv2T@$i}PoHKl)-gvoML_DSCa@+XLZ z4u*zE@vAP!?)G6OBhvd^yA4*+Jg>t%UCVGX>SNS=u_!*9FsHX+G8%W$`xqHb73p)LKQVqMo^xHMt}$mnw^kT<{2n zWwLa;T3cDFtjSgUu{tO84B}DdP-VHcP+O=}Cyo}!d}_lxN%{dyVX`6#!wnc@tc0a! zxcJIb=?ZOi{>|9l)wxd%c^*#D)@A6XCUbs6?cmOY)u7?@HJA}V?OI4-4; zSXwDnY2gNr0%0({z7CU-Jf37A<N_@=tt8^Agg<`z-gDpQ8>K*EVVw*_Zh#n9Y_g}0M3 zGsnrh$|))Dygl-zPHWXbFSW}yxxU$S9wzoWgTNb8R2F*KY;A2I`)8-(w0b1d$W*3d z6(ab@EvKoN`U8GatJg!aBn_i=%{HuEmH_-lCne6+Pr>j;%kwb2_&cqV;&;@Dn=RYI z+ZefyN8!53x-kD*9EVXJCET5E>#COheF8|tq3%rAoCb%~$9WUXp5iioq}puCA@rR zufk~OX)}^qAH1HT-mg29R|dN|8mgh}pAvAqP4fgPCSQUhv=*{Sj}^Kf!v@=aA)I5y z?ExI2|0gG5BBGd`0wS%|7D|g1xq5qkzETxc?Kv2jlitLVHjbrn35UpQmDR;N69ZJw zt>u-s7b|6qNwp%am2OUqb^a<aFcG?~ zk{!$7hofVKnQr+G-Kyr+P=?_j*Xgty#LDOVo!!01MY`wuBy{r9v8iEZvmYnme96!h z=YK35@4!?>T$^rl8}nK3nACK)rUAKQJK9pwcsYN%XMOR|%cfk=ShN2~ek2v6UlkpMz&w^B7v*E=Mi^iIvY*+@XlEj5 z7z*O%k|Fw!iR|04u~4vCG5}|~5gu~G&sJ2jyGiz# z?vF9u<>+)DjETi2{CeLBr@Wh``=dnmPEQF5n+n%1waZ?ECj4Gj>q&nv34eyI^t&HP z)3L`;f0piSdYyYvsM##-{24wZv*LzsiqZvb%|~wr)%4@H?D>M@vlVU{baH{_lsnDp1m*6 zmFWBOT)BND_g3MF^o;{P(OSf+z4wt+J58ZSPI#Wmo`qqBWUs>V5B*<)8;wUBM^T$+ cUA+)Iik;yv!9x$nV;_yPk^FJ@BX|VxAFd_M8~^|S diff --git a/owl-bot-staging/Dialogflow/v2/proto/src/GPBMetadata/Google/Cloud/Dialogflow/V2/Document.php b/owl-bot-staging/Dialogflow/v2/proto/src/GPBMetadata/Google/Cloud/Dialogflow/V2/Document.php deleted file mode 100644 index b2730819a57abbe45c0449cb982a3f133d08222f..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 7758 zcmb_hPjK5<8L#Z5b)K6veY9KG3tgejv}x$t;KESc?H?spykS$vb=~~^R!N#Iq0lV2c25zpmV=+9igtFxvp3X9HD1Ogn#yM%h0=` z>uDbRx1hVKZt5P))V~jz+z_`l!zD0zzwP$W?0ULoigdz;*(HmYMc*g2U9c_4{D#Ow zYEm!&h|Zen5y#YwPK~%-N4Gu8X@Y6B+9zHJA$_uVIarpu)3?P%KgMcxUywIM&l!^F z>Z0fnZ|IoUS=`jYUihms0WjItJF;n76a~w4tJP6XBNqovTrqUmn8VFk)rrwtCXciy zy5$^hYKsJPNgd<_I&|vYLu9#bnSEzyn!4HVY}l0LheIjce1KjV*xqjXjKir6u{)ak z_y}{`Iuwhi4ea!DTXwgz33M1902AZ)8#ncU&2q07l6Mt~d@-aOCEq3Vx2x!K>gvWt z-?YRUL21+oN>3`qbAcPp)}c{Q=J_q5_*!IOo6<|&3iuTmoR1hd0f~a4g=jnId z!0PqD${5k1Y=v|Pj9v|lSf7G|FB7`q!65H&;h-Pr0Jb%-;8}zg9^bpbfamYn-7@V6 z!yr28gB;57=7vwBDcT_mf+#G`ENA~N3-~-b+0$Ly&~{Zel;J}e{0f>Gz%r`0Ym-8D z^t_2qJvOZ!gY^3Tpj(&{vx{?;O3BZ1(hik)5T&>I+&1{7L1ge*lI>fNFULg;oIX|a1I%B|*<9flE>LXG( z2`2f<*HT5dd{vN;7v45Ln4J)h-j{|lqw<` z3&Sg0>~zq{Xn=STO;JX$jm=kz+#jb)DJ*p?q2mD>bf@zb%x!@=B|qI_8O_Fm#(9)| zOm=M&i zl}1}#l~>jpb#?O&n5iwLx&B~&O6sC%h7hpk^k!RbkFR(VMF(rjy27SSSN|ydQ~texq)7AeDGzLYdo8FFq35q zEv~4uWK|kncj$W7Kn+_r^$!4nR^%*!2st;pGuWhA_vgyZDw zOR=VX_%416or^n$f(@!<0p)fyhbmoOBoodJ=`K23BL>+|{G<1fccGZ>+3*&(ub83* zLHFh`1%bbg@?0?Li*e}_$}9njqjM<*lbMS9 z3cBD9G{*y)yRO!UeS*H^&=*$K&y#5?Umiuc|8Gc0c^d5tyhR^9AqAbHW!HnVLpRwO z6~LRQa-cK7n=hXMxxb3OKv-nz_Rugw4M_3H;fpELokjUb98w>h^Ro@#)_BF>byV<| zBR$qNBGUp!hGdw(&`7m_0}a zD!+#J4qjg_{y2kXV<$KMYEr;4(}2vyM8!Wg!*6)fZ-r0gK&1TeFaLNi^O1ln^up?%4N+~+{IW7pIrc1?*B;EK0`C7-V2B{_~+ ztQa5OUh+vgJ}U{SxQFVJPt9=;Xx@?1qBNdyBGRKWe7ISuCp$_Fe#GgWik$2;#eR(3;m?5garK?NGjZFLJM-RQc4nT! zeI;^p$-A`QEDpCB4!dxSHjDB3>Gxpdt0vuIdob=R4fLTG{0o5Imx5fFB|{&#O$q%c z&~j3qkMX8Fo?9~MeLej7;2ioYK7B5qKk!oU&+>yuo@cw&a(QQGCr}CDjUilOKk`3r zzCo`)wk>CH=&h1lrF z)$mKHy>&hM$7h1@%S@)W`m0Q_&OWV{R_LeIQZ1ZNx?kBk&Q6W1m%?v8SNso>k?)uE UCR*=K_;$%G{cntWXb++P19bpRNdN!< diff --git a/owl-bot-staging/Dialogflow/v2/proto/src/GPBMetadata/Google/Cloud/Dialogflow/V2/EncryptionSpec.php b/owl-bot-staging/Dialogflow/v2/proto/src/GPBMetadata/Google/Cloud/Dialogflow/V2/EncryptionSpec.php deleted file mode 100644 index 5b0a502d93fc..000000000000 --- a/owl-bot-staging/Dialogflow/v2/proto/src/GPBMetadata/Google/Cloud/Dialogflow/V2/EncryptionSpec.php +++ /dev/null @@ -1,48 +0,0 @@ -internalAddGeneratedFile( - ' -‘ -0google/cloud/dialogflow/v2/encryption_spec.protogoogle.cloud.dialogflow.v2google/api/client.protogoogle/api/field_behavior.protogoogle/api/resource.proto#google/longrunning/operations.proto"Z -GetEncryptionSpecRequest> -name ( B0àAúA* -(dialogflow.googleapis.com/EncryptionSpec"à -EncryptionSpec -name ( BàA -kms_key ( BàA:‡êAƒ -(dialogflow.googleapis.com/EncryptionSpec6projects/{project}/locations/{location}/encryptionSpec*encryptionSpecs2encryptionSpec"k -InitializeEncryptionSpecRequestH -encryption_spec ( 2*.google.cloud.dialogflow.v2.EncryptionSpecBàA"" - InitializeEncryptionSpecResponse"u - InitializeEncryptionSpecMetadataQ -request ( 2;.google.cloud.dialogflow.v2.InitializeEncryptionSpecRequestBàA2õ -EncryptionSpecService¶ -GetEncryptionSpec4.google.cloud.dialogflow.v2.GetEncryptionSpecRequest*.google.cloud.dialogflow.v2.EncryptionSpec"?ÚAname‚Óä“20/v2/{name=projects/*/locations/*/encryptionSpec}¨ -InitializeEncryptionSpec;.google.cloud.dialogflow.v2.InitializeEncryptionSpecRequest.google.longrunning.Operation"¯ÊAD - InitializeEncryptionSpecResponse InitializeEncryptionSpecMetadataÚAencryption_spec‚Óä“P"K/v2/{encryption_spec.name=projects/*/locations/*/encryptionSpec}:initialize:*xÊAdialogflow.googleapis.comÒAYhttps://www.googleapis.com/auth/cloud-platform,https://www.googleapis.com/auth/dialogflowBœ -com.google.cloud.dialogflow.v2BEncryptionSpecProtoPZ>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/EntityType.php b/owl-bot-staging/Dialogflow/v2/proto/src/GPBMetadata/Google/Cloud/Dialogflow/V2/EntityType.php deleted file mode 100644 index 9f17127dc61814f08934636a2046f174e848dcb4..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 7509 zcmds6O>7&-70%K>u}5~KjBWievAtOviLAB)25UK`783dg?K!qUfP-W_FjuU6NY; zTv}f&&c65Nz3+YRz1i7Ue`4?0=$gDtOyX!BX~?yX?ClWQb}Y}TTZUX~H=D$f>(;KV z8^p=Ta-k%zmp0{MVP*3~GJVLi+~$YqJ?>0YPm zb!?Jhh7mHgUEM-H4SQ$zrb%8Ka`$JC5Ufw*-?w>`@#gJ?eAB3_6iU75Y%Z%fVTO?j64n9s+Y zyd!%~n~1y1vO~PKW8P+dQv==bugU<(R9mm8rfE?WEYr>BdolG)3{zY*bV$*`be42t zG#1E?_CU9sgQ?ylK4%g;xoVj$r)`?L*{YOm%G84e8Ria!p!svGxH#qp7Jee zwho0$Nxu8FYTFoHUX8X~j4tVN0 z8f${nPlA_cm{j@}I?a_ZMyDQVM%%}ZM|laIaXY4Ec6QzA6nMhHQ+|q0QY7$2H1WpD zdZD_tzELhNt}Lw-3lmR34$iREHMKk;;q&M$`?b2Vu{n{#<7kZiyjNT<{=7VKLU{{4 z9fJX1Ls!+U%~BOa)b)*((t35RR47LFxr&|{BvdFasava?6H@*U(m&PTOX#{#2t3VD z18xS!T(*~5oC5~_lGHsn``G`ho7Gy72Y;l|F$B+GA((GnygWe1uJWgiEB?rTT^ zFDF-Z*X#M?-Xm|fiR+AU|Y`Vg?V7_zt!h)vZ&JNyrG$`HbhdbQ-X#iAmK@L z)~4$&Oixw^r#Nw@5Mt||b)T4w(JbwfVxy^;ldcUTh=7;p1Y}(BmD2Y4WVFRoXxs#P zR)uYupNfetE)xNj0F=B~<^d!L6FmYFewEjk2FN4-o0dmb$juc0vkAeM&2`0!ec z`Au7wpP4^_-&;1Es|NTT*_n36qwXw_=tVTvW*b*&%Vsnh%cX<72VFfAPE~e@>yx3z}EoiDGd~)pQkI5|UW0(XFa&N9R@b`V+W>rsD#-Y3L@eu(70* zhD8AeV@an2h9@0Ipg+YDyC3um7tqr&7nNV2E5mR*jsjP@eqN$UKc>7~>5qxMaESBj zGYO?xd_rx*aNVb}6ZR8vTGJVMm}#AgCt9fP?*sP*TL163ALS`!aDo=`VGy*ynPUqY z%E~VScH|KcHzPAqLgU5orIa!1Xp=AZ-3%J*S#GZ7w z>F^p?el6{({$XQJy~s};^L@vM_rCeZN2vzBLErQrbAdbI8EB55m%8GCY5QgT(h%X` zbmV3SDPkb~`M%kYe>f_pKG6V$gy#?C0|=bGH|(jHHjfcO)5o!p#fY5gNFVYgpU1G3v*#lmE(&8V0l+b&V{^q0@^Mpha*Ox75o6L%aN4<&F*7K zd2PtNAJpRb`~%~hw>&zE^v{&lA!cH{jm*$tCVQX@6CfGr{R;nYp!4XC74*;~{!hSk zp$8-by(}Sa~KU(=K!Jev!bnjI8^09M1>BO2O*@G4cNAKc2) z_Fdlif7U}23OdB+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*eFCq+*}KmFs+FB45T zL%&S-xvDO7ci0)e9e4Wni`=Ii7lJ>e4pjP|n{|R6`q^vNuK_T;_WBg2DARh|ZBlNHkljJ|KRW*JIR3ANJO_b#hec_yhY^R%nNA;w%@6X6jNEZy4y8h0NcbD!MM&o3 z>k=~e>vGy37c!&l{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^%;JNB{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 a5475852da0faf1b79da7c4cc42e562b13ea5571..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=HrgOmFLGas`T|=9j#)3RrX~GwxZu70yW;JUru|Zf@+dd) zCpr{{>L8w}`XTc~5$DMASK*a*Go!MlOsRP0KL|>kPR2-jGYe`~y8AoI15U|V7-!RS z0internalAddGeneratedFile( - ' -ž -$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/Generator.php b/owl-bot-staging/Dialogflow/v2/proto/src/GPBMetadata/Google/Cloud/Dialogflow/V2/Generator.php deleted file mode 100644 index a1a6f9d89f77600952f433bb04b027cea171eec7..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 5854 zcmcIo&2!sm8L#Yo)K5|;Rns)}&VttMve|5F7wF190I22QCc5!0d$sGo1JbIB^4RJup3R;>d~N#PhzdB+HKDI(+03S$e)d ze$Vs1kH2ak+HgnOA|`P(k94GiQ^`9dlI>WY)wT@jpx^BhM`~L~wr&t7BT1#Iv{!9P zN~zL(2U%UK@3cu?>RDFLAlbHI^*h;)t{GOZYgi}Q<6O4KrCUyhi3KpVBjVaxn@C%= z!Y=W&j^=6mTTH@!kxJMvg%b9k<{kmG4b61}J1qxZf`or||G?1OlIv+6{=2KYs&48Y zvg)6qFPl0OSetP`VCAcxwqZaJ4@trNdsrZzH+ zJ$kMj+1}~&3PV}b@FK+BP9`Et%wnr$$uLv?S6ESS=BQj46cwE~Kk18^_7{@*1iPT49%~jE`WU&jhQq z-2Ku@1*H|#dnQC07VGp6W3aeOTo?18n4WVgehp?E%i!gb%-s+8$Mkn5%9p7l6HniD znDH>6%z^}em4a)AX7>6t+ij~uB1sj|?l$W;mA2yA40HUv-66_xyK68*HHs^+T(9mZ zYHP1iQ;L;xMJX*`5tm?LyR|Ftsq&Vx*IX9F8?Yp|n$=yosg(SeF>w*DDtjfh)lllo z@$|RgM$s~liQ}>tqX z#(MjTSb{mL@7aBCZJx=Q=yeE&jef6(LjY4oEsUieKyuh{aRK7b$tlNK@fyq?Yet{r zS|T6&SSX0FteY9I6nu9=%`FYY^Bk-(z2Ezr-mVAiv2^*PI}&lih)uvx459C7?mSOF2SV?=Es z35#k(PvI)ep+zV-e6rKOi^0mch>OdSnDERZxOYgGZNZiq#fWW$jZ>RLLo)Z3%O*F| zL}sQU{c8bc=r0Nm%};8h;BXBRjY_j6H!IaWga&{)xyYVlViKUPG^#r-_B$@V1-I&o z+^FuUfOR-VKan5RIA%@9TMcVNY@ z*kQ1z?aBv1`WG{h2wMsR6J1T_UdvZs%W-iH7CQdng(_gfn5+E;+#E)Q0KTrVMxGuf z{ZJzq;L?P!#rqFe0KWnKDU_KMm-B7QjV!@691{o@j!KT{vN(&zC36$UMUyiql%7i& znTl7LgKwCMaXL%=9e~Z!#8h1Q@BUr>&QuGb_ypGoy2ZNLm;TdP*09?ASeJbnJf00s z)JPdFW@j6bB`r5tg9{0m_cNLPtpL|KlAI0@SNtX{^TeNyj>gB6QglvGCV0c=D-Crl z^%#=Fudy!Y{R!-E&6JM4WmEceP?NEApKjgka>8;V7S})wEe1bpIhOlD0wDCp6~7mQrIE9cn41*v5n}(ekecp*lm3bDN`9N4u@zW4ojExe)E;g z(2)7~K;%BsliLLzMtf}IO#G_=$>GD1_~l8d8m0|wotWKG7Jl|hlUK5TE@q}b^-Z5T zJoAhw}H!d6hKcRUe2fNAUjSvUsP1!5$ zSMtq4k3I(I5X5gkQyCrSflLsV#QXn<>(p-b^XH>CHUN9n7(^`S88)+Uy>`9*x|l QUU-wrDEW=&8Jq$98internalAddGeneratedFile( - ' - -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 72082f6ab81031b4d51a3b497e54e2caee6a8994..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 12742 zcmds8OKcm*8SYZ=pE6C4WSd&&!O%(U7!KLcc{p*l@8PBx<%wrbdE zMianLwpFXC)Yar-Ik%+RN<*=g>LOcSoukXE^WO66t?U(mx~^DOvcSl|eMsWJX1k_q z^`vDhHvadlX33hN*|<*o5T&@9Tvv2U#ihM-*V{(j)=VQw7nF>;dj5qZr%C5N+cZ(? zt4WukGF1dBp-Oje8H!$=SFL(WYuaY3j8kW4H&okGAN}V13(mHboVK1k&v~4k?P2n2 z(r&fY;O@y}OSRiA;|k-O5_sT!s`gQr)YPhyVVG14reV#_`ZD<>_FFioYiO2mYZf$B zZ{*ZXWk)kx;g+tb4patavJV)lb0*s1gAiO7O=F|gHVn55t0RYvX-)`Ew zgG=o#Wm;QOtgS<=T}6!4_mP)@^~Gz{zbG`NM#Dqm0($Ft4?7e|=io>0LiOB$eo90> zG0hx0?K^aOCo7(Ih$u}B9iF0yJGc0BU|^j>MXotmaVE?JCbS$tI78>1p?(ph&aLju zJnPKVebZ)4&$P~@GtMLyb9*)Qf z7^V>|AtZ(K6S<+kO9GjJ$%bY%b!As(LlJiWQ>G~ceD zw$ps0^liRwl`iA^oP_aa3;j^DcN0TMXM}&9fGCDT41jt~sc$8Qab(;Z+16#`O{wW> zBQfQVJPkzGc2rr}Kx4|AiqSCF*AvtJgeTy*YBVs&BGeQXKNBbY(IiZ1Mzd|pj-i;` zR$?qUd9x*@Jd*A`Pc|24VTeoH8w~0AHl@W;cy4l*c633Bh zEPH8is_C+`mXm)TW?H6c%j>3&slDA~a6r5;l*e6#50SHQ1{Fe))OY3yI+MHu)7_(* zv2G>^6aAF|m|Sq!;OZ>kV#?-__@4;GI>A9EgI-DsFl_HO)dY3SSoYNcw(2C8uHb6A zSA@I`BPc4udWf-o2wI2&o6~vZA zM@?f4kUg0k+!GkVdPt$XdA@+Lscoq(8BwAc7z6z1kh%iHR4y_N@yeZYUS3;XE$8P7 z3x)iA{2L?+WBGTarE)PJ7f2k&D|!4ZRr2wO7#SDDhXPC>bKD8K)IHrV9unkkN737A zkUJ5Mx$xy^(%ZiQbeihN{gF6oK$nT3<;oyn#!(jDvbnHel&a9 zWyZ~^XDw0Jt3+cWMP*W_eE;CW6 z{i4~ILr~1o#g05n5VhJH7Wo?7i1r|0k4$!s7q6=AH_wrwm~Fe%X*FpT$6Cek^!oRunK7DoA> z0mXT#gci=GWwY|w=S;i_vCbfayvC@~W!sdkrmEIAot%pq*s`{DuF7D&&rIYCC2qm- zPLdYZJ-yLTU;>A6xK669eh|Mu1QT9N3ulrTEf5tOJ3z880-1MH7fr*5NL|bn>kln`=5%F6P^=DY5)R})cAi~6SpBU$F9!~V+4)P?#8#KiktP8^H zcJJUC!Lp8t;JHLZ{3HV4XNx|92xJ*SVyk$%pm8BwO7|(J3rK=7PJ&@0;7NbNP(vqS z_8VsB1j=`~B*l{xCE}hHBECev(6pjPEwLsa_KJe_>0@yS@wa$B!GIM=m}JFOA~*cC z5Mb@33B_Cy!o<%^!B2JOY_1h_V(Ewhr1YogFPEa$`;!O3lHE4vE=u z^(;KSl3y*CmRIxg65dKka-Y-d1dK>)^Mz7e5WgA)(pyuKdZ!0gLYS(TTDtcu7Q5PT zk{4?3>D6rV^9Hp`EPL~4o3dhXo}Y_LoG{D4;zz@9Y9Eg7_vT9;SZhb)rT=zLBGq{! zC0_1ku>88?F2UyDI<~LWmV+zWtQEfy+(hnj#S*#hRC+(eVMHS9t;n0${$%MOmNmY9 z^`zHYIz{+(+?Cleg@@F@cbLs*)>euf?$-;;m9CCW3;_EzvNTsIl$Nn+a~z`d@43=) zCBIyWM^Za5)dw=EBvJ}iD7feG&b=7WG0A|2^J5Usq-dz3hZ z$MO?+soCB(Wb9Jlje$*@Dg3k%rYN0bG|CL%TZl}sXk-mSx823Gz-#PK36K;;10K1M2~XB%op?MiA(5l zV=#21a3elUU2^pXHgV%41pO41kdKejFK-ocsGTwNvJ*TmtjeWjd9hSl#J=u0M#$s* zvwU4zUM#IuR^!p!1dMI-O9t^aklv;{d7`(I?_Y^M>N0@&c*=&!;Qba2ZMXBe>nN_g zTEQ-JmpW$PWan^xS;`eL=m^-De7^6Hj9Qgfi=~RZP$)7~L}q^`{9F350Lj4ZCclTn zi%lzyZyqxIYJt3f;er)%nfuPC2N`x%=DcmNGWRh^qoX_^*ZNG=%{sq!&fIrD?zcYm zsQ`qYi}=pgiu!&VPizD)9Pyrkx*~Jb+f+jr?MVtHJxwPEY+U zyeedT%R8ES&q;01KiU~?;cO0lY&|t8WeeY3u;S0Tggi~}#PECD+)|A|zD?C(szW^9 z&Lx+y5zjbrT{87(F34#(ZqW8jU?&czUt_FWR2?0KFPYxyGhj!vq6;Z>QTC`O?LExkU_QE#OE5K$2i0yF4+*{0rxBRR zDRzA`sJO=x6XK5F*C=(?H)h(yliUKm%crqS=3|Lg}VlWvLE_D;ce)>H^P)hw&aBLO?!eg-6Wj{jlPTQc4lFC7} zz%0r{JyfW@@FoDKK|?<|1E=x4L94M_h5YTVDq&mvw+sK$=gGFicmtNqP#uMI|_LSQ_u~%B|%T!t9 zdl8rn=23DWNP;uNi1{%B>6n8bzWJWyymh(A|L!BXo*E2QvrgW=dnFYfUG8G?F)AXM zE)G^iaAp`q{2moC-B02@2_M$d^wFt^i-B~^eC@;RMFwgyo>HWWoyo_~@P!{f9<8xf7V;5k< z4E~}4Il~&k-=bN&68z%}LHJc9GQaSfh`7jp)R3N|KWa$Ndp~MO-^$iTnJ-*A=RMKB X$bSqF`0c>HzZ+mP`TPC{@BrX{jj0+$ diff --git a/owl-bot-staging/Dialogflow/v2/proto/src/GPBMetadata/Google/Cloud/Dialogflow/V2/KnowledgeBase.php b/owl-bot-staging/Dialogflow/v2/proto/src/GPBMetadata/Google/Cloud/Dialogflow/V2/KnowledgeBase.php deleted file mode 100644 index fff5b5a3ad57..000000000000 --- a/owl-bot-staging/Dialogflow/v2/proto/src/GPBMetadata/Google/Cloud/Dialogflow/V2/KnowledgeBase.php +++ /dev/null @@ -1,66 +0,0 @@ -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"žÚAparent‚Óä“Ž&/v2/{parent=projects/*}/knowledgeBasesZ42/v2/{parent=projects/*/locations/*}/knowledgeBasesZ.,/v2/{parent=projects/*/agent}/knowledgeBases‘ -GetKnowledgeBase3.google.cloud.dialogflow.v2.GetKnowledgeBaseRequest).google.cloud.dialogflow.v2.KnowledgeBase"œÚAname‚Óä“Ž&/v2/{name=projects/*/knowledgeBases/*}Z42/v2/{name=projects/*/locations/*/knowledgeBases/*}Z.,/v2/{name=projects/*/agent/knowledgeBases/*}Ø -CreateKnowledgeBase6.google.cloud.dialogflow.v2.CreateKnowledgeBaseRequest).google.cloud.dialogflow.v2.KnowledgeBase"ÝÚAparent,knowledge_base‚Ó䓾"&/v2/{parent=projects/*}/knowledgeBases:knowledge_baseZD"2/v2/{parent=projects/*/locations/*}/knowledgeBases:knowledge_baseZ>",/v2/{parent=projects/*/agent}/knowledgeBases:knowledge_base„ -DeleteKnowledgeBase6.google.cloud.dialogflow.v2.DeleteKnowledgeBaseRequest.google.protobuf.Empty"œÚAname‚Óä“Ž*&/v2/{name=projects/*/knowledgeBases/*}Z4*2/v2/{name=projects/*/locations/*/knowledgeBases/*}Z.*,/v2/{name=projects/*/agent/knowledgeBases/*}Š -UpdateKnowledgeBase6.google.cloud.dialogflow.v2.UpdateKnowledgeBaseRequest).google.cloud.dialogflow.v2.KnowledgeBase"ÚAknowledge_base,update_mask‚Óä“ë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_basexÊ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 7e7cb3ba934f786165f8d6715b73f7fcc83a0a22..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 14108 zcmd^GO>7&-70yzYB|XZLJdR|Vi4$h+*s>#&DU<%uagx=K6(zQ%NU~EqO4$`Tk~gMy zncbxv#n7cd5CjQO6zQP_dMZ#9D0=9nw;qBvJv42Aw#lJL(ZWE2qUfoIq6l*8o1a}S zm&=hTJ3xW@B$G35X5RbW_kL#h#8dU_bvTxrr8adG^&NFW!9YawVHFY zuvskBP1m<7R^7DyJQoaLn;X=tn-!XyU6{N`eY0x%=E^LWu`LTC*xS&o^@cid;!LAmVN>CjubGA=i+pMijQ?KG$b>DFpaA>KtPW@1k?33|R za#<$MTFZ@#J(fysn>?5E-3E=Wp3Aw^Z@BhZzHcUAJN#=UL1#wYS}|RPSWeMVEx!#86@Kdn)|3MRb-49Pfzd_76JO}x?S*uN{K!Gr$4E4z<+SmE$)4MWMxKIw zu2Z9#6n->RoXCrvBxyY#k(6J=IZQw=IRQsJt6p|##c`{ay{t{Dvb>^tB2AA&zIM%8cy*t{kfj;ba7_4 z8=Vd$1px!W$>hw~zPrU$kbMe{Do2qt^xU9ZLTlsz^lqB9hS1nRDfKl?Ux0l~ALL#b zS)9KxQ@(s@X<=q+?)==$^vFGA7}C#NzGz%38?!T)mPa&l2!@Tz%kvkF<(X;uVTuew z|IDT7^5vzO#gU%UpS6D)A8GJ#1opx(h)qUiF{M$IPb-;_ki;r@;Ia`E=BN` znfq~Mr;FJDhJkP9L#Ace>LEoK@TgrCa|Uqj9p`A|5)fo-rl7JJMrZCI>EfAS!30{& zOSLvby4b@q5ZnXXwe6!sv$o|~%#YY+9#hF%3T7E{5(eQ$&F4}}?;%9r)!?Dd5Dlz6 znEG5;<*EV?}K}LYZ-NUk7u>M00GE>~H5szA=uQV`Tl5?;h0mQH< z81u|+BlWqla+2)QF^yJeGLB6bS5B&Q9@z!cb4p)^(OK$8J`Of_wuQ`tt?iOC^fxs) ze8KXfg1tcUogRA(2I>sG9%j?ri+kBoG;$b#f9^Xss2y=(-Gxm1Uc5Ro4n-Rbq78yt zz(Y$g{@=9{anWHLqfI%oGPA>g{tjCHavf_3nxNd6<(T=qSd?3iF-C*SFSAh36_Moq zVL~YE{kwfI%Khy%IwgoOFw0~snpz>bOS==SE_|jA%dR(k$zl(y0J)5#=h)z9?m=6m z=_X?lFxC|A5Rjg0*C>F=VJ6}?r z%;3}F^73$?@~YSmUm!!cq{D%vFxH52fDiyz5Ee_M(l~fvvJZN>jr0i^n)Wx=BHPUZ zF)I~X$Kw&R2_@p25RhZ5hd}J>41f(N&kO)`1X2b%hxKXp=I~zPB zM8ZH|adDg)(#1k>;G|e*1QQK5Z;_z^9j;F@yu`vWm4u5j30Z~*t~WMJyDWAPK`0go z816ju5=J@7+_;HR5hKa-a372NJiSd2*|!IgQ!va8#*r$JA<%kSb<9@l>!0<)1Be@H zZeXq+H#OoHquyQNnQ0hoaZVBYlse?z9q~;h9NY?LE6fkDWS6*5Iwu#xI19-Wr=W~v zvS4Xq*JLpYY3@~mcR0ufpV2Vy2k|j?4PNu$r!&E)%xIEVl#pJgHCn&!*jvnGoH#uc z6DKHED5Z-^9mENx13?M;z8eH}fbXdzL1BqVZF99odD&-IvHrsXS3r>SRlmp&Cg8Xn zhY)AoIMj0zJ+PS3PmaQ<99^ZW7$OkQ$YpCz<`DaOvLE&f)HJ#9JH7B=N9;?QTV$c7 z;;gfFAOY1Gqj9pQuz_k)*J5VRXZ@PGw zsB^EXl3W9kcM=W_kt;)iAPRS`q|Bj=afJn2LXH9NSIhb_52|hd2ZCT%Ms+=JFjl zMZm9nPSM}OdZbMe(kCZjm{$NuAg1lzWL+Rp1)Nf8Uh31}Gssx7Hjuj$j;Ozpf{fhF zdGi$^;{VhzuWN85K^4+8B}lKCuf)uvtS3T!c4?A-Ymk-uSlU21u$0fbo8Cey4VTsW zJi(P&v4FGkJS^AXNe6i{8Df(scIj=&Q2ez9_a&ZNS^yo>KX zaL*TXiWear4PV${5W!hSR%Kf&G7*UslRDOe<;f+lI0p59q~K6eP+NepD(1-*R_N_aj)Zyy05hFau-+`aRpK*C`fJ zJy`J!uv(QHzDn^(yjPpT1ie4#@?%QPO0BOdRVd=5z%2GW#r?nx>*teEIAC(VM^m%= z2yp?CEx>`+aXWSNZ)-5nB&s3UFQm#dwjP2-)f77_ub!BRcypTIEOBKiTGCh##E+?L zzJ|+xK}Xzzk&s6v0WiN31-P(f(m5yN8Wx@SM?N>k;Y8jTxrDV53Nw)FxqNp~oiu?=@B6g>L*n>6-R}otv z$Do(GuH#A$BY~^ng+jOg-h5u_zYigF`1lB~ff%c`bbB_r{-Sa8#bZ%@0H?uG3A-|3(e?Fl6d3 z#kV{SuPl*{K*OE8Tg_`&P5+68El1%9ZO4>()eCUAjZGpUH(gX#lrgD->qR!(UD@}q zUKmXjMy|qe{Dcgc>EhEWR3*yFOI^?^k1WK5v6yI?#B(P}7me;$Xs#=Y-?m7@gLd{f z48`_>5uckc(&W$nr3Z%N0+DW{mqs|q1Yk@plODk|&)xCn^GM%I{JkJX9|sO%yPrKf zv^Md6k$=pgmM$*d`AYHu6N(NN%pT==p!jb~j>j1``wI<5;L)$kJI<FsNi zM5rM?Poadk4Dx0QM&kGNL|M$lM+c`@!m53eh!*&E;bTKS%xKX?m-q;E(LPV1jaH12 zU!l9Sy&_P%OWW{38@qRx4^RV#BYrXwd1$~@@-wX%!aZ=NeB9=km4$6-uW&kU=T`rD zv3McypN;|*YEud)w^K0GdKszqrPi^5{)#G+icgVP`a5cJEUHP~?dI2cF%?H%K1dbo z&&D;8p45F^ok|za9KdVxDhXsQ& zPrqkedsHL8O@(!UA*)rQw57~ig2BO7loZr9M*`sYF*5n3rY{CoP)D0Mqzf{Q!&=5G z$-jdwGV@mSZ*~yeg=KeGgnWp6B#+vxd)0i@HayVh-imAe4>66ttLe)f4!#2eB^|bT zDyCDaf2)J&JJe~*GUTt=VU}u&7W+hfBP?p3=!8JCd+jRdAH{V0p4Q}yJ4b7Dt4zD= z`sx>>-Pl6pljb#Ov((^~KKZ(mUpkbPyn4>6X|2OlNeh3}ILW`S=~p|bU=P@hosFsZ zWu11Ae}@2WUn~3S`^J%uE!saBSFihi-76IeH*emQN)Ml#bghGwoksKbu<6u01JQHNkHZ@Y(yi6a8fdZV&5%<~sG&v(f*2 zrfEM)rKZpSG?ks@zY@#y+xYx+*c{GZDX#A4O|ZvKhCf)D5I?Mn{0@u#sKTlw{057U M6u*_)hHZfV0`14o9smFU 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 a6bd1d5295af542a893637e00e93b2b369c096dc..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 7761 zcmds6&2!t<5jQEz7FV<^Kgltz$PP?9wfseTn8ZzJJ253vvQmGjlIqwQPB0MoNTP-S z1P_oRYjo*<(DvNvOmFR>(_?4y7oOMS3NVt3zu z{&x4_!6#nVgR9yCb*OIyw56?WX+f82p6>>(>Dt;_*ltr_Gu?I1vZ-IvwEA=H+4EJc zQD0oWf~?F9eUnzTj_Y=8S~hJrY?WJv+LF_>O%ghaREEi|BwHc{nwYpEqhg#r=wEuKX^Jx(J&V8Xb7qAn5 zY9{!r=2^{}GVt5wf9xo*caZ~T~J!tcK(brVLD1wW9 z1iq>Y_2`azBo5pIqy|rY-4wa6$kQxALZ0A?vUxp4GWT7q{`)C}3d?n*#$?q4jE$0i zS#b%JN4zYzR7$GnQHO}1OV6xh;wg&hy%LznF7-6>w(pr`4yYkh4+@Hn>r%Ewp2#P~ ze`R5!P6KKNvP_rhmmy^VslsVxM^aWT-#n`eEcE7SJQc{CF z3h}pe&+v_PR>-1&(aNooBu~nd(hoWP5+_Gpd`2F@s1#v2UKkXHgoN)MC}ELP&kmug zriF%4aj$> ztJ|(AU|ShI5veTd3Ni1A(;*+gh^l0UmJMOHU5&_+T%+0=c?-tSp)}xl!C`<2V@Jpj zU^1bI8HSFFPE8(F1HDE?X5h4EY}u~SDoAf#h*XPnMYae+;R@rRv5x=g298l%3`aI! zR;0qT0tk;+BN<8Ntwcga? zA-}7LIU$&xWRWr%rQD48R-00j05Fjbg0Fzv3w+lFn6JhOb-QmCzayfn~kj#ndO z8YWEx544%iY&X!`mTg;3r*K|8Ex>p?wE1r$cZFR%*>mJEO!hy)wT7XI3}KU((#^CW z$c9vUDp`23MrkW&Z4*!{I@r0;l9CP#6`*6c4t6 zpo=As-V(ibPZ0AcC`-@~?5!QgWw@>3rq*_`E>jJ80T&YiL-dGqg7>{N?Gk{3vlhP| zf@#DgYOG_3cXugF-2aE^U>e35+GbNd3~=D!nJuw@He1LHYIeL54uJpv@$A5BDo-xK zdFmKzsCBGZKz#7OaXr{VG(pT!aHHxS)L_pC>hi;cT=z(u_IuvnNboLQW zpp@O`5{@?`I15g-g7r3s>0J)tp<;#nLC&}j1;M`C6_WYPLCicHd&(vbL}aJLtQ23q z59b_LS4Q%K5sXEZn81YeT*OhH?-Abw`XrSP8>_hY;+ufzOXI?ekKmHrNA<2@ zw{;w&7~Pfa57?cM{?V4NFuCGO7*(U4 zux%O&Pa7*MwS|Vh`f916|LEDuQe$p$ez8#>KY;@-tS;A{t;{ViF0GDd$lGwC@vN>t zpVwCwpDjE=^3~M_63jKmv&Aap;sKtVQ&YdZ#Sm8mQ+sD^enF8F*9OHdKyQfW%={`| zE-La~VfSb)uQmown)^=T#iUM}hsz1`mzb~AqIM0Y#TNL6>b-qIk0(B%)kyIRxR4-+ zH%T%FlLHw?E2$e$EV6h9a`6{}yBafHUwR~q{>iQ5#A*d0ZYG_ z_1IG8^N(dGj;=xR#hYVv z(u>NswLfJKb4PnCPW)~4X=iVaMK!WRRt6I9%A@VRZ#ydaw|Nch^eUhy^ihJ)UdC@n zA5+xo9!)}@cC36PUDr?3Ev1*Spw*XKy8DrrA!z?Y#q_ zf?y%ivGiL`+%`bhe^=vVE@!H>oUR*o77QI{v%Nj_Ai@k6HI-H>n$41mv}PV{%G;`8 zMKfJRZVMebNKRkWdW~>&?|uzw28(Tz?2cjTY`i4nExxVOHuJYtw@Gr%rr#4wluxsM z744c{17E%gZjM7Fm}FL>LqD-cKXE&goOTgqQ>FB@Ys=V|yxjMoWf!pCa4YC8IN!Ix za?9jCnsXoV_)a|>=6UjhyV_wrWsQXFbh}WVbodWhENz-pwj%Y-DR4GGcz70^u;t@i zOo+`+S(e&F^|sMO=i+q9YneMD3xk&>F@P_!mMXhIC5pqG6u_&F z6BXfe2_Z3iIx{~En8DZ*Pn$lFO})PhxZ>; zii;~tE5*W@SKt+Jk-N&XITM3d!Da4}2M;Tid&Lrcb|#+vJ@G8}YXZF0*Dx$av{$f5 zMPCY}1r}+YK12$^(w_USE6E!)Bc9IF2bigIS8@`yYj2)@%RV^z--Yc^7^H8jmZ7)l za>vO3)Rj6IS@b*mr5nv%mE%q`6sC{Tp7(aFt?b95fxnCmroM=Qi}zGa0tLgX=%Wt8 z1TKP8rfkuyx{SF&8S`Im9!9GE6qqn+wdJ(*QW%6JrbMlol=}W2sMK z;8Ivz*rbOOf_K5B+c5nj0;XY(Bv)X!G?3SI^n}#=qOsXOk@^5!SVqD0c-hGvQWG~f zk(iPCg>H4xLUfJ_gyng8AvGw2H#qrnsxd-~0&y`d`kn^<(4?bRc;F#EZS5V)C%g$x zcN~{>Tj<^3lb(=LLOJ7==%24no23+Rsem*zB+%p6G4pH^z(A%j{4D{d_?-;j@#5y3 zzarnp?TBP{98*S|)X(vQoXhF`zyJL_{#_j2vmk7c%w;q8U&7(Pva>5!Ract?g9c^x_B9ajFV|erkYPPffsjHuxypZu9SANnKsuiW}3AtugB($3C~n|A*f zvfLq??AmkQ)MU~!toGcf|ta_U*_pUYQ@AVC% z|MHavNyovSH?wi8|HJcG>}fn+So$HJTz0Np#YOwdRV?^duHvIiv6t;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 3ac2a0b00de5ff9bc546227023da5affd2751375..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 3769 zcmbtX&u<$=6lU!V#w$Oc1I=3Y++cETyq!Cqa!Yto3^AELra^ zyR%74WC;+W7fv9!apB0nfy4oc3*2(bffFZ=2ytL`W_G>)5!VU1c(e1~oAZVTB=Vf#LI zbxhY*VOnUJW=n^Xs+(>@YG{gXwwk(mBps%tLufmiX^12!0EW_rj-{wj$d}fiK%_Jj zq*U|7zq;Z1S2KZsbvLyNfT}BwBka;R;1~$_&vNU!rV0*H5dL|fIW^7D5O&l)!8q20 zrlLC#`wrSRT|-4UA;EJf8Y)aK2sEZ=`@k|W?lr;BsN|Ibm!VoP5VQ?NuV$d5+M0z- zyM#^C=@vvm0lhcL1-7jhPHPHDnqxXWkmQiPr@NTCAqQ|=&E`9#V+BMsZ?B~Sm@3eix?0|y>ei})1>RfCa}Zx z)SJG;kZOx8Y5%uE97&wS2Vk15(zpCQ5Z}#~D}~}#t+Fj|?^J3#Ta{9FqmV0PGc&L7 zH^5Y3t5zx(^W|)%GQ;tc;Bq-DXP(YPcmO7Ha$ytOMbqDLf68BT;C_gA3JFv0h2R$HZ=#a?VU3G z*u@gzAAt!=vGKNy(}hzx@{c^vkAYwgOjP zv%M)e79M?&e;Zt7NFAI-6gR^B7`)H~eJr*#?3F^Ech z#evxk(yFX>e#HM#x<}v&Lre-c9$>F^BZ(I{ogE8*df`AiK}=7c=ZMK;F}fsV%^M6X zr9m+U6PadG1hW~a!+}IDTItlkli(@?9-s}6ZYc&;=pu|QuvV+^q8It)eG)KzD`+LVmcxK zt;CpwrG2UFttBqNT;R@s83EHhY8(x@$Mjr~zsHboF|11=u@c;$aw(DYA2Sg9dF%VI zEOr6}d)ZWar0Yn^gE0KhnERe-FuD*urhXyjd;wskk)yjv&W?Reyhu5IDa5^%MM`bI zbaZsY(hWZCii`H?MQYj771T8C_R`DDyIZY)%Yl3N zgy0up$dP9K8XJ!#uRtYk?=dxErzY=s(K5rAIGh?DOWi%J`fB)}zd7!QNFinternalAddGeneratedFile( - ' -Ó -(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 7009219c3e5b..000000000000 --- a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/AgentAssistantFeedback.php +++ /dev/null @@ -1,331 +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; - /** - * Optional. Feedback for knowledge search. - * - * Generated from protobuf field .google.cloud.dialogflow.v2.AgentAssistantFeedback.KnowledgeSearchFeedback knowledge_search_feedback = 5 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $knowledge_search_feedback = null; - /** - * Optional. Feedback for knowledge assist. - * - * Generated from protobuf field .google.cloud.dialogflow.v2.AgentAssistantFeedback.KnowledgeAssistFeedback knowledge_assist_feedback = 6 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $knowledge_assist_feedback = null; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type int $answer_relevance - * Optional. Whether or not the suggested answer is relevant. - * For example: - * * Query: "Can I change my mailing address?" - * * Suggested document says: "Items must be returned/exchanged within 60 - * days of the purchase date." - * * [answer_relevance][google.cloud.dialogflow.v2.AgentAssistantFeedback.answer_relevance]: [AnswerRelevance.IRRELEVANT][google.cloud.dialogflow.v2.AgentAssistantFeedback.AnswerRelevance.IRRELEVANT] - * @type int $document_correctness - * Optional. Whether or not the information in the document is correct. - * For example: - * * Query: "Can I return the package in 2 days once received?" - * * Suggested document says: "Items must be returned/exchanged within 60 - * days of the purchase date." - * * Ground truth: "No return or exchange is allowed." - * * [document_correctness]: INCORRECT - * @type int $document_efficiency - * Optional. Whether or not the suggested document is efficient. For example, - * if the document is poorly written, hard to understand, hard to use or - * too long to find useful information, - * [document_efficiency][google.cloud.dialogflow.v2.AgentAssistantFeedback.document_efficiency] - * is - * [DocumentEfficiency.INEFFICIENT][google.cloud.dialogflow.v2.AgentAssistantFeedback.DocumentEfficiency.INEFFICIENT]. - * @type \Google\Cloud\Dialogflow\V2\AgentAssistantFeedback\SummarizationFeedback $summarization_feedback - * Optional. Feedback for conversation summarization. - * @type \Google\Cloud\Dialogflow\V2\AgentAssistantFeedback\KnowledgeSearchFeedback $knowledge_search_feedback - * Optional. Feedback for knowledge search. - * @type \Google\Cloud\Dialogflow\V2\AgentAssistantFeedback\KnowledgeAssistFeedback $knowledge_assist_feedback - * Optional. Feedback for knowledge assist. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Dialogflow\V2\AnswerRecord::initOnce(); - parent::__construct($data); - } - - /** - * Optional. Whether or not the suggested answer is relevant. - * For example: - * * Query: "Can I change my mailing address?" - * * Suggested document says: "Items must be returned/exchanged within 60 - * days of the purchase date." - * * [answer_relevance][google.cloud.dialogflow.v2.AgentAssistantFeedback.answer_relevance]: [AnswerRelevance.IRRELEVANT][google.cloud.dialogflow.v2.AgentAssistantFeedback.AnswerRelevance.IRRELEVANT] - * - * Generated from protobuf field .google.cloud.dialogflow.v2.AgentAssistantFeedback.AnswerRelevance answer_relevance = 1 [(.google.api.field_behavior) = OPTIONAL]; - * @return int - */ - public function getAnswerRelevance() - { - return $this->answer_relevance; - } - - /** - * Optional. Whether or not the suggested answer is relevant. - * For example: - * * Query: "Can I change my mailing address?" - * * Suggested document says: "Items must be returned/exchanged within 60 - * days of the purchase date." - * * [answer_relevance][google.cloud.dialogflow.v2.AgentAssistantFeedback.answer_relevance]: [AnswerRelevance.IRRELEVANT][google.cloud.dialogflow.v2.AgentAssistantFeedback.AnswerRelevance.IRRELEVANT] - * - * Generated from protobuf field .google.cloud.dialogflow.v2.AgentAssistantFeedback.AnswerRelevance answer_relevance = 1 [(.google.api.field_behavior) = OPTIONAL]; - * @param int $var - * @return $this - */ - public function setAnswerRelevance($var) - { - GPBUtil::checkEnum($var, \Google\Cloud\Dialogflow\V2\AgentAssistantFeedback\AnswerRelevance::class); - $this->answer_relevance = $var; - - return $this; - } - - /** - * Optional. Whether or not the information in the document is correct. - * For example: - * * Query: "Can I return the package in 2 days once received?" - * * Suggested document says: "Items must be returned/exchanged within 60 - * days of the purchase date." - * * Ground truth: "No return or exchange is allowed." - * * [document_correctness]: 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; - } - - /** - * Optional. Feedback for knowledge search. - * - * Generated from protobuf field .google.cloud.dialogflow.v2.AgentAssistantFeedback.KnowledgeSearchFeedback knowledge_search_feedback = 5 [(.google.api.field_behavior) = OPTIONAL]; - * @return \Google\Cloud\Dialogflow\V2\AgentAssistantFeedback\KnowledgeSearchFeedback|null - */ - public function getKnowledgeSearchFeedback() - { - return $this->knowledge_search_feedback; - } - - public function hasKnowledgeSearchFeedback() - { - return isset($this->knowledge_search_feedback); - } - - public function clearKnowledgeSearchFeedback() - { - unset($this->knowledge_search_feedback); - } - - /** - * Optional. Feedback for knowledge search. - * - * Generated from protobuf field .google.cloud.dialogflow.v2.AgentAssistantFeedback.KnowledgeSearchFeedback knowledge_search_feedback = 5 [(.google.api.field_behavior) = OPTIONAL]; - * @param \Google\Cloud\Dialogflow\V2\AgentAssistantFeedback\KnowledgeSearchFeedback $var - * @return $this - */ - public function setKnowledgeSearchFeedback($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Dialogflow\V2\AgentAssistantFeedback\KnowledgeSearchFeedback::class); - $this->knowledge_search_feedback = $var; - - return $this; - } - - /** - * Optional. Feedback for knowledge assist. - * - * Generated from protobuf field .google.cloud.dialogflow.v2.AgentAssistantFeedback.KnowledgeAssistFeedback knowledge_assist_feedback = 6 [(.google.api.field_behavior) = OPTIONAL]; - * @return \Google\Cloud\Dialogflow\V2\AgentAssistantFeedback\KnowledgeAssistFeedback|null - */ - public function getKnowledgeAssistFeedback() - { - return $this->knowledge_assist_feedback; - } - - public function hasKnowledgeAssistFeedback() - { - return isset($this->knowledge_assist_feedback); - } - - public function clearKnowledgeAssistFeedback() - { - unset($this->knowledge_assist_feedback); - } - - /** - * Optional. Feedback for knowledge assist. - * - * Generated from protobuf field .google.cloud.dialogflow.v2.AgentAssistantFeedback.KnowledgeAssistFeedback knowledge_assist_feedback = 6 [(.google.api.field_behavior) = OPTIONAL]; - * @param \Google\Cloud\Dialogflow\V2\AgentAssistantFeedback\KnowledgeAssistFeedback $var - * @return $this - */ - public function setKnowledgeAssistFeedback($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Dialogflow\V2\AgentAssistantFeedback\KnowledgeAssistFeedback::class); - $this->knowledge_assist_feedback = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/AgentAssistantFeedback/AnswerRelevance.php b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/AgentAssistantFeedback/AnswerRelevance.php 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/KnowledgeAssistFeedback.php b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/AgentAssistantFeedback/KnowledgeAssistFeedback.php deleted file mode 100644 index 8b97472caaac..000000000000 --- a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/AgentAssistantFeedback/KnowledgeAssistFeedback.php +++ /dev/null @@ -1,132 +0,0 @@ -google.cloud.dialogflow.v2.AgentAssistantFeedback.KnowledgeAssistFeedback - */ -class KnowledgeAssistFeedback extends \Google\Protobuf\Internal\Message -{ - /** - * Whether the suggested answer was copied by the human agent. - * If the value is set to be true, - * [AnswerFeedback.clicked][google.cloud.dialogflow.v2.AnswerFeedback.clicked] - * will be updated to be true. - * - * Generated from protobuf field bool answer_copied = 1; - */ - protected $answer_copied = false; - /** - * The URIs clicked by the human agent. The value is appended for each - * UpdateAnswerRecordRequest. - * If the value is not empty, - * [AnswerFeedback.clicked][google.cloud.dialogflow.v2.AnswerFeedback.clicked] - * will be updated to be true. - * - * Generated from protobuf field repeated string clicked_uris = 2; - */ - private $clicked_uris; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type bool $answer_copied - * Whether the suggested answer was copied by the human agent. - * If the value is set to be true, - * [AnswerFeedback.clicked][google.cloud.dialogflow.v2.AnswerFeedback.clicked] - * will be updated to be true. - * @type array|\Google\Protobuf\Internal\RepeatedField $clicked_uris - * The URIs clicked by the human agent. The value is appended for each - * UpdateAnswerRecordRequest. - * If the value is not empty, - * [AnswerFeedback.clicked][google.cloud.dialogflow.v2.AnswerFeedback.clicked] - * will be updated to be true. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Dialogflow\V2\AnswerRecord::initOnce(); - parent::__construct($data); - } - - /** - * Whether the suggested answer was copied by the human agent. - * If the value is set to be true, - * [AnswerFeedback.clicked][google.cloud.dialogflow.v2.AnswerFeedback.clicked] - * will be updated to be true. - * - * Generated from protobuf field bool answer_copied = 1; - * @return bool - */ - public function getAnswerCopied() - { - return $this->answer_copied; - } - - /** - * Whether the suggested answer was copied by the human agent. - * If the value is set to be true, - * [AnswerFeedback.clicked][google.cloud.dialogflow.v2.AnswerFeedback.clicked] - * will be updated to be true. - * - * Generated from protobuf field bool answer_copied = 1; - * @param bool $var - * @return $this - */ - public function setAnswerCopied($var) - { - GPBUtil::checkBool($var); - $this->answer_copied = $var; - - return $this; - } - - /** - * The URIs clicked by the human agent. The value is appended for each - * UpdateAnswerRecordRequest. - * If the value is not empty, - * [AnswerFeedback.clicked][google.cloud.dialogflow.v2.AnswerFeedback.clicked] - * will be updated to be true. - * - * Generated from protobuf field repeated string clicked_uris = 2; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getClickedUris() - { - return $this->clicked_uris; - } - - /** - * The URIs clicked by the human agent. The value is appended for each - * UpdateAnswerRecordRequest. - * If the value is not empty, - * [AnswerFeedback.clicked][google.cloud.dialogflow.v2.AnswerFeedback.clicked] - * will be updated to be true. - * - * Generated from protobuf field repeated string clicked_uris = 2; - * @param array|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setClickedUris($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); - $this->clicked_uris = $arr; - - return $this; - } - -} - -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(KnowledgeAssistFeedback::class, \Google\Cloud\Dialogflow\V2\AgentAssistantFeedback_KnowledgeAssistFeedback::class); - diff --git a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/AgentAssistantFeedback/KnowledgeSearchFeedback.php b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/AgentAssistantFeedback/KnowledgeSearchFeedback.php deleted file mode 100644 index 4cf5a6398861..000000000000 --- a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/AgentAssistantFeedback/KnowledgeSearchFeedback.php +++ /dev/null @@ -1,132 +0,0 @@ -google.cloud.dialogflow.v2.AgentAssistantFeedback.KnowledgeSearchFeedback - */ -class KnowledgeSearchFeedback extends \Google\Protobuf\Internal\Message -{ - /** - * Whether the answer was copied by the human agent or not. - * If the value is set to be true, - * [AnswerFeedback.clicked][google.cloud.dialogflow.v2.AnswerFeedback.clicked] - * will be updated to be true. - * - * Generated from protobuf field bool answer_copied = 1; - */ - protected $answer_copied = false; - /** - * The URIs clicked by the human agent. The value is appended for each - * [UpdateAnswerRecordRequest][google.cloud.dialogflow.v2.UpdateAnswerRecordRequest]. - * If the value is not empty, - * [AnswerFeedback.clicked][google.cloud.dialogflow.v2.AnswerFeedback.clicked] - * will be updated to be true. - * - * Generated from protobuf field repeated string clicked_uris = 2; - */ - private $clicked_uris; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type bool $answer_copied - * Whether the answer was copied by the human agent or not. - * If the value is set to be true, - * [AnswerFeedback.clicked][google.cloud.dialogflow.v2.AnswerFeedback.clicked] - * will be updated to be true. - * @type array|\Google\Protobuf\Internal\RepeatedField $clicked_uris - * The URIs clicked by the human agent. The value is appended for each - * [UpdateAnswerRecordRequest][google.cloud.dialogflow.v2.UpdateAnswerRecordRequest]. - * If the value is not empty, - * [AnswerFeedback.clicked][google.cloud.dialogflow.v2.AnswerFeedback.clicked] - * will be updated to be true. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Dialogflow\V2\AnswerRecord::initOnce(); - parent::__construct($data); - } - - /** - * Whether the answer was copied by the human agent or not. - * If the value is set to be true, - * [AnswerFeedback.clicked][google.cloud.dialogflow.v2.AnswerFeedback.clicked] - * will be updated to be true. - * - * Generated from protobuf field bool answer_copied = 1; - * @return bool - */ - public function getAnswerCopied() - { - return $this->answer_copied; - } - - /** - * Whether the answer was copied by the human agent or not. - * If the value is set to be true, - * [AnswerFeedback.clicked][google.cloud.dialogflow.v2.AnswerFeedback.clicked] - * will be updated to be true. - * - * Generated from protobuf field bool answer_copied = 1; - * @param bool $var - * @return $this - */ - public function setAnswerCopied($var) - { - GPBUtil::checkBool($var); - $this->answer_copied = $var; - - return $this; - } - - /** - * The URIs clicked by the human agent. The value is appended for each - * [UpdateAnswerRecordRequest][google.cloud.dialogflow.v2.UpdateAnswerRecordRequest]. - * If the value is not empty, - * [AnswerFeedback.clicked][google.cloud.dialogflow.v2.AnswerFeedback.clicked] - * will be updated to be true. - * - * Generated from protobuf field repeated string clicked_uris = 2; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getClickedUris() - { - return $this->clicked_uris; - } - - /** - * The URIs clicked by the human agent. The value is appended for each - * [UpdateAnswerRecordRequest][google.cloud.dialogflow.v2.UpdateAnswerRecordRequest]. - * If the value is not empty, - * [AnswerFeedback.clicked][google.cloud.dialogflow.v2.AnswerFeedback.clicked] - * will be updated to be true. - * - * Generated from protobuf field repeated string clicked_uris = 2; - * @param array|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setClickedUris($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); - $this->clicked_uris = $arr; - - return $this; - } - -} - -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(KnowledgeSearchFeedback::class, \Google\Cloud\Dialogflow\V2\AgentAssistantFeedback_KnowledgeSearchFeedback::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 0b3045f5bb34..000000000000 --- a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/AgentAssistantFeedback/SummarizationFeedback.php +++ /dev/null @@ -1,192 +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 = ''; - /** - * Optional. Actual text sections of submitted summary. - * - * Generated from protobuf field map text_sections = 4 [(.google.api.field_behavior) = OPTIONAL]; - */ - private $text_sections; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type \Google\Protobuf\Timestamp $start_time - * Timestamp when composing of the summary starts. - * @type \Google\Protobuf\Timestamp $submit_time - * Timestamp when the summary was submitted. - * @type string $summary_text - * Text of actual submitted summary. - * @type array|\Google\Protobuf\Internal\MapField $text_sections - * Optional. Actual text sections of submitted summary. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Dialogflow\V2\AnswerRecord::initOnce(); - parent::__construct($data); - } - - /** - * Timestamp when composing of the summary starts. - * - * Generated from protobuf field .google.protobuf.Timestamp start_time = 1; - * @return \Google\Protobuf\Timestamp|null - */ - public function getStartTime() - { - return $this->start_time; - } - - public function hasStartTime() - { - return isset($this->start_time); - } - - public function clearStartTime() - { - unset($this->start_time); - } - - /** - * Timestamp when composing of the summary starts. - * - * Generated from protobuf field .google.protobuf.Timestamp start_time = 1; - * @param \Google\Protobuf\Timestamp $var - * @return $this - */ - public function setStartTime($var) - { - GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); - $this->start_time = $var; - - return $this; - } - - /** - * Timestamp when the summary was submitted. - * - * Generated from protobuf field .google.protobuf.Timestamp submit_time = 2; - * @return \Google\Protobuf\Timestamp|null - */ - public function getSubmitTime() - { - return $this->submit_time; - } - - public function hasSubmitTime() - { - return isset($this->submit_time); - } - - public function clearSubmitTime() - { - unset($this->submit_time); - } - - /** - * Timestamp when the summary was submitted. - * - * Generated from protobuf field .google.protobuf.Timestamp submit_time = 2; - * @param \Google\Protobuf\Timestamp $var - * @return $this - */ - public function setSubmitTime($var) - { - GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); - $this->submit_time = $var; - - return $this; - } - - /** - * Text of actual submitted summary. - * - * Generated from protobuf field string summary_text = 3; - * @return string - */ - public function getSummaryText() - { - return $this->summary_text; - } - - /** - * Text of actual submitted summary. - * - * Generated from protobuf field string summary_text = 3; - * @param string $var - * @return $this - */ - public function setSummaryText($var) - { - GPBUtil::checkString($var, True); - $this->summary_text = $var; - - return $this; - } - - /** - * Optional. Actual text sections of submitted summary. - * - * Generated from protobuf field map text_sections = 4 [(.google.api.field_behavior) = OPTIONAL]; - * @return \Google\Protobuf\Internal\MapField - */ - public function getTextSections() - { - return $this->text_sections; - } - - /** - * Optional. Actual text sections of submitted summary. - * - * Generated from protobuf field map text_sections = 4 [(.google.api.field_behavior) = OPTIONAL]; - * @param array|\Google\Protobuf\Internal\MapField $var - * @return $this - */ - public function setTextSections($var) - { - $arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::STRING, \Google\Protobuf\Internal\GPBType::STRING); - $this->text_sections = $arr; - - return $this; - } - -} - -// 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 d36c7985c540..000000000000 --- a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/AgentAssistantRecord.php +++ /dev/null @@ -1,141 +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. - * @type \Google\Cloud\Dialogflow\V2\DialogflowAssistAnswer $dialogflow_assist_answer - * Output only. Dialogflow assist 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; - } - - /** - * Output only. Dialogflow assist answer. - * - * Generated from protobuf field .google.cloud.dialogflow.v2.DialogflowAssistAnswer dialogflow_assist_answer = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return \Google\Cloud\Dialogflow\V2\DialogflowAssistAnswer|null - */ - public function getDialogflowAssistAnswer() - { - return $this->readOneof(7); - } - - public function hasDialogflowAssistAnswer() - { - return $this->hasOneof(7); - } - - /** - * Output only. Dialogflow assist answer. - * - * Generated from protobuf field .google.cloud.dialogflow.v2.DialogflowAssistAnswer dialogflow_assist_answer = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param \Google\Cloud\Dialogflow\V2\DialogflowAssistAnswer $var - * @return $this - */ - public function setDialogflowAssistAnswer($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Dialogflow\V2\DialogflowAssistAnswer::class); - $this->writeOneof(7, $var); - - return $this; - } - - /** - * @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 3e131721f33d..000000000000 --- a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/AnalyzeContentRequest.php +++ /dev/null @@ -1,470 +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\SuggestionInput $suggestion_input - * An input representing the selection of a suggestion. - * @type \Google\Cloud\Dialogflow\V2\OutputAudioConfig $reply_audio_config - * Speech synthesis configuration. - * The speech synthesis settings for a virtual agent that may be configured - * for the associated conversation profile are not used when calling - * AnalyzeContent. If this configuration is not supplied, speech synthesis - * is disabled. - * @type \Google\Cloud\Dialogflow\V2\QueryParameters $query_params - * Parameters for a Dialogflow virtual-agent query. - * @type \Google\Cloud\Dialogflow\V2\AssistQueryParameters $assist_query_params - * Parameters for a human assist query. - * @type \Google\Protobuf\Struct $cx_parameters - * Additional parameters to be put into Dialogflow CX session parameters. To - * remove a parameter from the session, clients should explicitly set the - * parameter value to null. - * Note: this field should only be used if you are connecting to a Dialogflow - * CX agent. - * @type string $request_id - * A unique identifier for this request. Restricted to 36 ASCII characters. - * A random UUID is recommended. - * This request is only idempotent if a `request_id` is provided. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Dialogflow\V2\Participant::initOnce(); - parent::__construct($data); - } - - /** - * Required. The name of the participant this text comes from. - * Format: `projects//locations//conversations//participants/`. - * - * Generated from protobuf field string participant = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @return string - */ - public function getParticipant() - { - return $this->participant; - } - - /** - * Required. The name of the participant this text comes from. - * Format: `projects//locations//conversations//participants/`. - * - * Generated from protobuf field string participant = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @param string $var - * @return $this - */ - public function setParticipant($var) - { - GPBUtil::checkString($var, True); - $this->participant = $var; - - return $this; - } - - /** - * The natural language text to be processed. - * - * Generated from protobuf field .google.cloud.dialogflow.v2.TextInput text_input = 6; - * @return \Google\Cloud\Dialogflow\V2\TextInput|null - */ - public function getTextInput() - { - return $this->readOneof(6); - } - - public function hasTextInput() - { - return $this->hasOneof(6); - } - - /** - * The natural language text to be processed. - * - * Generated from protobuf field .google.cloud.dialogflow.v2.TextInput text_input = 6; - * @param \Google\Cloud\Dialogflow\V2\TextInput $var - * @return $this - */ - public function setTextInput($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Dialogflow\V2\TextInput::class); - $this->writeOneof(6, $var); - - return $this; - } - - /** - * An input event to send to Dialogflow. - * - * Generated from protobuf field .google.cloud.dialogflow.v2.EventInput event_input = 8; - * @return \Google\Cloud\Dialogflow\V2\EventInput|null - */ - public function getEventInput() - { - return $this->readOneof(8); - } - - public function hasEventInput() - { - return $this->hasOneof(8); - } - - /** - * An input event to send to Dialogflow. - * - * Generated from protobuf field .google.cloud.dialogflow.v2.EventInput event_input = 8; - * @param \Google\Cloud\Dialogflow\V2\EventInput $var - * @return $this - */ - public function setEventInput($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Dialogflow\V2\EventInput::class); - $this->writeOneof(8, $var); - - return $this; - } - - /** - * An input representing the selection of a suggestion. - * - * Generated from protobuf field .google.cloud.dialogflow.v2.SuggestionInput suggestion_input = 12; - * @return \Google\Cloud\Dialogflow\V2\SuggestionInput|null - */ - public function getSuggestionInput() - { - return $this->readOneof(12); - } - - public function hasSuggestionInput() - { - return $this->hasOneof(12); - } - - /** - * An input representing the selection of a suggestion. - * - * Generated from protobuf field .google.cloud.dialogflow.v2.SuggestionInput suggestion_input = 12; - * @param \Google\Cloud\Dialogflow\V2\SuggestionInput $var - * @return $this - */ - public function setSuggestionInput($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Dialogflow\V2\SuggestionInput::class); - $this->writeOneof(12, $var); - - return $this; - } - - /** - * Speech synthesis configuration. - * The speech synthesis settings for a virtual agent that may be configured - * for the associated conversation profile are not used when calling - * AnalyzeContent. If this configuration is not supplied, speech synthesis - * is disabled. - * - * Generated from protobuf field .google.cloud.dialogflow.v2.OutputAudioConfig reply_audio_config = 5; - * @return \Google\Cloud\Dialogflow\V2\OutputAudioConfig|null - */ - public function getReplyAudioConfig() - { - return $this->reply_audio_config; - } - - public function hasReplyAudioConfig() - { - return isset($this->reply_audio_config); - } - - public function clearReplyAudioConfig() - { - unset($this->reply_audio_config); - } - - /** - * Speech synthesis configuration. - * The speech synthesis settings for a virtual agent that may be configured - * for the associated conversation profile are not used when calling - * AnalyzeContent. If this configuration is not supplied, speech synthesis - * is disabled. - * - * Generated from protobuf field .google.cloud.dialogflow.v2.OutputAudioConfig reply_audio_config = 5; - * @param \Google\Cloud\Dialogflow\V2\OutputAudioConfig $var - * @return $this - */ - public function setReplyAudioConfig($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Dialogflow\V2\OutputAudioConfig::class); - $this->reply_audio_config = $var; - - return $this; - } - - /** - * Parameters for a Dialogflow virtual-agent query. - * - * Generated from protobuf field .google.cloud.dialogflow.v2.QueryParameters query_params = 9; - * @return \Google\Cloud\Dialogflow\V2\QueryParameters|null - */ - public function getQueryParams() - { - return $this->query_params; - } - - public function hasQueryParams() - { - return isset($this->query_params); - } - - public function clearQueryParams() - { - unset($this->query_params); - } - - /** - * Parameters for a Dialogflow virtual-agent query. - * - * Generated from protobuf field .google.cloud.dialogflow.v2.QueryParameters query_params = 9; - * @param \Google\Cloud\Dialogflow\V2\QueryParameters $var - * @return $this - */ - public function setQueryParams($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Dialogflow\V2\QueryParameters::class); - $this->query_params = $var; - - return $this; - } - - /** - * Parameters for a human assist query. - * - * Generated from protobuf field .google.cloud.dialogflow.v2.AssistQueryParameters assist_query_params = 14; - * @return \Google\Cloud\Dialogflow\V2\AssistQueryParameters|null - */ - public function getAssistQueryParams() - { - return $this->assist_query_params; - } - - public function hasAssistQueryParams() - { - return isset($this->assist_query_params); - } - - public function clearAssistQueryParams() - { - unset($this->assist_query_params); - } - - /** - * Parameters for a human assist query. - * - * Generated from protobuf field .google.cloud.dialogflow.v2.AssistQueryParameters assist_query_params = 14; - * @param \Google\Cloud\Dialogflow\V2\AssistQueryParameters $var - * @return $this - */ - public function setAssistQueryParams($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Dialogflow\V2\AssistQueryParameters::class); - $this->assist_query_params = $var; - - return $this; - } - - /** - * Additional parameters to be put into Dialogflow CX session parameters. To - * remove a parameter from the session, clients should explicitly set the - * parameter value to null. - * Note: this field should only be used if you are connecting to a Dialogflow - * CX agent. - * - * Generated from protobuf field .google.protobuf.Struct cx_parameters = 18; - * @return \Google\Protobuf\Struct|null - */ - public function getCxParameters() - { - return $this->cx_parameters; - } - - public function hasCxParameters() - { - return isset($this->cx_parameters); - } - - public function clearCxParameters() - { - unset($this->cx_parameters); - } - - /** - * Additional parameters to be put into Dialogflow CX session parameters. To - * remove a parameter from the session, clients should explicitly set the - * parameter value to null. - * Note: this field should only be used if you are connecting to a Dialogflow - * CX agent. - * - * Generated from protobuf field .google.protobuf.Struct cx_parameters = 18; - * @param \Google\Protobuf\Struct $var - * @return $this - */ - public function setCxParameters($var) - { - GPBUtil::checkMessage($var, \Google\Protobuf\Struct::class); - $this->cx_parameters = $var; - - return $this; - } - - /** - * A unique identifier for this request. Restricted to 36 ASCII characters. - * A random UUID is recommended. - * This request is only idempotent if a `request_id` is provided. - * - * Generated from protobuf field string request_id = 11; - * @return string - */ - public function getRequestId() - { - return $this->request_id; - } - - /** - * A unique identifier for this request. Restricted to 36 ASCII characters. - * A random UUID is recommended. - * This request is only idempotent if a `request_id` is provided. - * - * Generated from protobuf field string request_id = 11; - * @param string $var - * @return $this - */ - public function setRequestId($var) - { - GPBUtil::checkString($var, True); - $this->request_id = $var; - - return $this; - } - - /** - * @return string - */ - public function getInput() - { - return $this->whichOneof("input"); - } - -} - diff --git a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/AnalyzeContentResponse.php b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/AnalyzeContentResponse.php 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 e630d149e731..000000000000 --- a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/AudioEncoding.php +++ /dev/null @@ -1,125 +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; - /** - * 8-bit samples that compand 13-bit audio samples using G.711 PCMU/a-law. - * - * Generated from protobuf enum AUDIO_ENCODING_ALAW = 8; - */ - const AUDIO_ENCODING_ALAW = 8; - - private static $valueToName = [ - self::AUDIO_ENCODING_UNSPECIFIED => 'AUDIO_ENCODING_UNSPECIFIED', - self::AUDIO_ENCODING_LINEAR_16 => 'AUDIO_ENCODING_LINEAR_16', - self::AUDIO_ENCODING_FLAC => 'AUDIO_ENCODING_FLAC', - self::AUDIO_ENCODING_MULAW => 'AUDIO_ENCODING_MULAW', - self::AUDIO_ENCODING_AMR => 'AUDIO_ENCODING_AMR', - self::AUDIO_ENCODING_AMR_WB => 'AUDIO_ENCODING_AMR_WB', - self::AUDIO_ENCODING_OGG_OPUS => 'AUDIO_ENCODING_OGG_OPUS', - self::AUDIO_ENCODING_SPEEX_WITH_HEADER_BYTE => 'AUDIO_ENCODING_SPEEX_WITH_HEADER_BYTE', - self::AUDIO_ENCODING_ALAW => 'AUDIO_ENCODING_ALAW', - ]; - - public static function name($value) - { - if (!isset(self::$valueToName[$value])) { - throw new UnexpectedValueException(sprintf( - 'Enum %s has no name defined for value %s', __CLASS__, $value)); - } - return self::$valueToName[$value]; - } - - - public static function value($name) - { - $const = __CLASS__ . '::' . strtoupper($name); - if (!defined($const)) { - throw new UnexpectedValueException(sprintf( - 'Enum %s has no value defined for name %s', __CLASS__, $name)); - } - return constant($const); - } -} - diff --git a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/AutomatedAgentConfig.php b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/AutomatedAgentConfig.php deleted file mode 100644 index 9c86f69649d9..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. Configure lifetime of the Dialogflow session. - * By default, a Dialogflow CX session remains active and its data is stored - * for 30 minutes after the last request is sent for the session. - * This value should be no longer than 1 day. - * - * Generated from protobuf field .google.protobuf.Duration session_ttl = 3 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $session_ttl = null; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $agent - * Required. ID of the Dialogflow agent environment to use. - * This project needs to either be the same project as the conversation or you - * need to grant `service-@gcp-sa-dialogflow.iam.gserviceaccount.com` the `Dialogflow API - * Service Agent` role in this project. - * - For ES agents, use format: `projects//locations//agent/environments/`. If environment is not - * specified, the default `draft` environment is used. Refer to - * [DetectIntentRequest](/dialogflow/docs/reference/rpc/google.cloud.dialogflow.v2#google.cloud.dialogflow.v2.DetectIntentRequest) - * for more details. - * - For CX agents, use format `projects//locations//agents//environments/`. If environment is not specified, the default `draft` environment - * is used. - * @type \Google\Protobuf\Duration $session_ttl - * Optional. Configure lifetime of the Dialogflow session. - * By default, a Dialogflow CX session remains active and its data is stored - * for 30 minutes after the last request is sent for the session. - * This value should be no longer than 1 day. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Dialogflow\V2\ConversationProfile::initOnce(); - parent::__construct($data); - } - - /** - * Required. ID of the Dialogflow agent environment to use. - * This project needs to either be the same project as the conversation or you - * need to grant `service-@gcp-sa-dialogflow.iam.gserviceaccount.com` the `Dialogflow API - * Service Agent` role in this project. - * - For ES agents, use format: `projects//locations//agent/environments/`. If environment is not - * specified, the default `draft` environment is used. Refer to - * [DetectIntentRequest](/dialogflow/docs/reference/rpc/google.cloud.dialogflow.v2#google.cloud.dialogflow.v2.DetectIntentRequest) - * for more details. - * - For CX agents, use format `projects//locations//agents//environments/`. If environment is not specified, the default `draft` environment - * is used. - * - * Generated from protobuf field string agent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @return string - */ - public function getAgent() - { - return $this->agent; - } - - /** - * Required. ID of the Dialogflow agent environment to use. - * This project needs to either be the same project as the conversation or you - * need to grant `service-@gcp-sa-dialogflow.iam.gserviceaccount.com` the `Dialogflow API - * Service Agent` role in this project. - * - For ES agents, use format: `projects//locations//agent/environments/`. If environment is not - * specified, the default `draft` environment is used. Refer to - * [DetectIntentRequest](/dialogflow/docs/reference/rpc/google.cloud.dialogflow.v2#google.cloud.dialogflow.v2.DetectIntentRequest) - * for more details. - * - For CX agents, use format `projects//locations//agents//environments/`. If environment is not specified, the default `draft` environment - * is used. - * - * Generated from protobuf field string agent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @param string $var - * @return $this - */ - public function setAgent($var) - { - GPBUtil::checkString($var, True); - $this->agent = $var; - - return $this; - } - - /** - * Optional. Configure lifetime of the Dialogflow session. - * By default, a Dialogflow CX session remains active and its data is stored - * for 30 minutes after the last request is sent for the session. - * This value should be no longer than 1 day. - * - * Generated from protobuf field .google.protobuf.Duration session_ttl = 3 [(.google.api.field_behavior) = OPTIONAL]; - * @return \Google\Protobuf\Duration|null - */ - public function getSessionTtl() - { - return $this->session_ttl; - } - - public function hasSessionTtl() - { - return isset($this->session_ttl); - } - - public function clearSessionTtl() - { - unset($this->session_ttl); - } - - /** - * Optional. Configure lifetime of the Dialogflow session. - * By default, a Dialogflow CX session remains active and its data is stored - * for 30 minutes after the last request is sent for the session. - * This value should be no longer than 1 day. - * - * Generated from protobuf field .google.protobuf.Duration session_ttl = 3 [(.google.api.field_behavior) = OPTIONAL]; - * @param \Google\Protobuf\Duration $var - * @return $this - */ - public function setSessionTtl($var) - { - GPBUtil::checkMessage($var, \Google\Protobuf\Duration::class); - $this->session_ttl = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/AutomatedAgentReply.php b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/AutomatedAgentReply.php 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 739ec5a13846..000000000000 --- a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/CloudConversationDebuggingInfo.php +++ /dev/null @@ -1,750 +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 for the stream. - * - * Generated from protobuf field .google.protobuf.Duration no_speech_timeout = 15; - */ - protected $no_speech_timeout = null; - /** - * Speech endpointing timeout settings for the stream. - * - * Generated from protobuf field .google.protobuf.Duration endpointing_timeout = 19; - */ - protected $endpointing_timeout = null; - /** - * Whether the streaming terminates with an injected text query. - * - * Generated from protobuf field bool is_input_text = 16; - */ - protected $is_input_text = false; - /** - * Client half close time in terms of input audio duration. - * - * Generated from protobuf field .google.protobuf.Duration client_half_close_time_offset = 17; - */ - protected $client_half_close_time_offset = null; - /** - * Client half close time in terms of API streaming duration. - * - * Generated from protobuf field .google.protobuf.Duration client_half_close_streaming_time_offset = 18; - */ - protected $client_half_close_streaming_time_offset = null; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type int $audio_data_chunks - * Number of input audio data chunks in streaming requests. - * @type \Google\Protobuf\Duration $result_end_time_offset - * Time offset of the end of speech utterance relative to the - * beginning of the first audio chunk. - * @type \Google\Protobuf\Duration $first_audio_duration - * Duration of first audio chunk. - * @type bool $single_utterance - * Whether client used single utterance mode. - * @type 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 for the stream. - * @type \Google\Protobuf\Duration $endpointing_timeout - * Speech endpointing timeout settings for the stream. - * @type bool $is_input_text - * Whether the streaming terminates with an injected text query. - * @type \Google\Protobuf\Duration $client_half_close_time_offset - * Client half close time in terms of input audio duration. - * @type \Google\Protobuf\Duration $client_half_close_streaming_time_offset - * Client half close time in terms of API streaming duration. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Dialogflow\V2\Session::initOnce(); - parent::__construct($data); - } - - /** - * Number of input audio data chunks in streaming requests. - * - * Generated from protobuf field int32 audio_data_chunks = 1; - * @return int - */ - public function getAudioDataChunks() - { - return $this->audio_data_chunks; - } - - /** - * Number of input audio data chunks in streaming requests. - * - * Generated from protobuf field int32 audio_data_chunks = 1; - * @param int $var - * @return $this - */ - public function setAudioDataChunks($var) - { - GPBUtil::checkInt32($var); - $this->audio_data_chunks = $var; - - return $this; - } - - /** - * Time offset of the end of speech utterance relative to the - * beginning of the first audio chunk. - * - * Generated from protobuf field .google.protobuf.Duration result_end_time_offset = 2; - * @return \Google\Protobuf\Duration|null - */ - public function getResultEndTimeOffset() - { - return $this->result_end_time_offset; - } - - public function hasResultEndTimeOffset() - { - return isset($this->result_end_time_offset); - } - - public function clearResultEndTimeOffset() - { - unset($this->result_end_time_offset); - } - - /** - * Time offset of the end of speech utterance relative to the - * beginning of the first audio chunk. - * - * Generated from protobuf field .google.protobuf.Duration result_end_time_offset = 2; - * @param \Google\Protobuf\Duration $var - * @return $this - */ - public function setResultEndTimeOffset($var) - { - GPBUtil::checkMessage($var, \Google\Protobuf\Duration::class); - $this->result_end_time_offset = $var; - - return $this; - } - - /** - * Duration of first audio chunk. - * - * Generated from protobuf field .google.protobuf.Duration first_audio_duration = 3; - * @return \Google\Protobuf\Duration|null - */ - public function getFirstAudioDuration() - { - return $this->first_audio_duration; - } - - public function hasFirstAudioDuration() - { - return isset($this->first_audio_duration); - } - - public function clearFirstAudioDuration() - { - unset($this->first_audio_duration); - } - - /** - * Duration of first audio chunk. - * - * Generated from protobuf field .google.protobuf.Duration first_audio_duration = 3; - * @param \Google\Protobuf\Duration $var - * @return $this - */ - public function setFirstAudioDuration($var) - { - GPBUtil::checkMessage($var, \Google\Protobuf\Duration::class); - $this->first_audio_duration = $var; - - return $this; - } - - /** - * Whether client used single utterance mode. - * - * Generated from protobuf field bool single_utterance = 5; - * @return bool - */ - public function getSingleUtterance() - { - return $this->single_utterance; - } - - /** - * Whether client used single utterance mode. - * - * Generated from protobuf field bool single_utterance = 5; - * @param bool $var - * @return $this - */ - public function setSingleUtterance($var) - { - GPBUtil::checkBool($var); - $this->single_utterance = $var; - - return $this; - } - - /** - * Time offsets of the speech partial results relative to the beginning of - * the stream. - * - * Generated from protobuf field repeated .google.protobuf.Duration speech_partial_results_end_times = 6; - * @return \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 for the stream. - * - * Generated from protobuf field .google.protobuf.Duration no_speech_timeout = 15; - * @return \Google\Protobuf\Duration|null - */ - public function getNoSpeechTimeout() - { - return $this->no_speech_timeout; - } - - public function hasNoSpeechTimeout() - { - return isset($this->no_speech_timeout); - } - - public function clearNoSpeechTimeout() - { - unset($this->no_speech_timeout); - } - - /** - * No speech timeout settings for the stream. - * - * Generated from protobuf field .google.protobuf.Duration no_speech_timeout = 15; - * @param \Google\Protobuf\Duration $var - * @return $this - */ - public function setNoSpeechTimeout($var) - { - GPBUtil::checkMessage($var, \Google\Protobuf\Duration::class); - $this->no_speech_timeout = $var; - - return $this; - } - - /** - * Speech endpointing timeout settings for the stream. - * - * Generated from protobuf field .google.protobuf.Duration endpointing_timeout = 19; - * @return \Google\Protobuf\Duration|null - */ - public function getEndpointingTimeout() - { - return $this->endpointing_timeout; - } - - public function hasEndpointingTimeout() - { - return isset($this->endpointing_timeout); - } - - public function clearEndpointingTimeout() - { - unset($this->endpointing_timeout); - } - - /** - * Speech endpointing timeout settings for the stream. - * - * Generated from protobuf field .google.protobuf.Duration endpointing_timeout = 19; - * @param \Google\Protobuf\Duration $var - * @return $this - */ - public function setEndpointingTimeout($var) - { - GPBUtil::checkMessage($var, \Google\Protobuf\Duration::class); - $this->endpointing_timeout = $var; - - return $this; - } - - /** - * Whether the streaming terminates with an injected text query. - * - * Generated from protobuf field bool is_input_text = 16; - * @return bool - */ - public function getIsInputText() - { - return $this->is_input_text; - } - - /** - * Whether the streaming terminates with an injected text query. - * - * Generated from protobuf field bool is_input_text = 16; - * @param bool $var - * @return $this - */ - public function setIsInputText($var) - { - GPBUtil::checkBool($var); - $this->is_input_text = $var; - - return $this; - } - - /** - * Client half close time in terms of input audio duration. - * - * Generated from protobuf field .google.protobuf.Duration client_half_close_time_offset = 17; - * @return \Google\Protobuf\Duration|null - */ - public function getClientHalfCloseTimeOffset() - { - return $this->client_half_close_time_offset; - } - - public function hasClientHalfCloseTimeOffset() - { - return isset($this->client_half_close_time_offset); - } - - public function clearClientHalfCloseTimeOffset() - { - unset($this->client_half_close_time_offset); - } - - /** - * Client half close time in terms of input audio duration. - * - * Generated from protobuf field .google.protobuf.Duration client_half_close_time_offset = 17; - * @param \Google\Protobuf\Duration $var - * @return $this - */ - public function setClientHalfCloseTimeOffset($var) - { - GPBUtil::checkMessage($var, \Google\Protobuf\Duration::class); - $this->client_half_close_time_offset = $var; - - return $this; - } - - /** - * Client half close time in terms of API streaming duration. - * - * Generated from protobuf field .google.protobuf.Duration client_half_close_streaming_time_offset = 18; - * @return \Google\Protobuf\Duration|null - */ - public function getClientHalfCloseStreamingTimeOffset() - { - return $this->client_half_close_streaming_time_offset; - } - - public function hasClientHalfCloseStreamingTimeOffset() - { - return isset($this->client_half_close_streaming_time_offset); - } - - public function clearClientHalfCloseStreamingTimeOffset() - { - unset($this->client_half_close_streaming_time_offset); - } - - /** - * Client half close time in terms of API streaming duration. - * - * Generated from protobuf field .google.protobuf.Duration client_half_close_streaming_time_offset = 18; - * @param \Google\Protobuf\Duration $var - * @return $this - */ - public function setClientHalfCloseStreamingTimeOffset($var) - { - GPBUtil::checkMessage($var, \Google\Protobuf\Duration::class); - $this->client_half_close_streaming_time_offset = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/CompleteConversationRequest.php b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/CompleteConversationRequest.php 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 917ef8d54609..000000000000 --- a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/Context.php +++ /dev/null @@ -1,261 +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 then use - * map, otherwise, depending on the parameter value type, it could be one of - * string, number, boolean, null, list or map. - * * MapValue value: If parameter's entity type is a composite entity then use - * map from composite entity property names to property values, otherwise, - * use parameter value. - * - * Generated from protobuf field .google.protobuf.Struct parameters = 3 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $parameters = null; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $name - * Required. The unique identifier of the context. Format: - * `projects//agent/sessions//contexts/`, - * or `projects//agent/environments//users//sessions//contexts/`. - * The `Context ID` is always converted to lowercase, may only contain - * characters in `a-zA-Z0-9_-%` and may be at most 250 bytes long. - * If `Environment ID` is not specified, we assume default 'draft' - * environment. If `User ID` is not specified, we assume default '-' user. - * The following context names are reserved for internal use by Dialogflow. - * You should not use these contexts or create contexts with these names: - * * `__system_counters__` - * * `*_id_dialog_context` - * * `*_dialog_params_size` - * @type int $lifespan_count - * Optional. The number of conversational query requests after which the - * context expires. The default is `0`. If set to `0`, the context expires - * immediately. Contexts expire automatically after 20 minutes if there - * are no matching queries. - * @type \Google\Protobuf\Struct $parameters - * Optional. The collection of parameters associated with this context. - * Depending on your protocol or client library language, this is a - * map, associative array, symbol table, dictionary, or JSON object - * composed of a collection of (MapKey, MapValue) pairs: - * * MapKey type: string - * * MapKey value: parameter name - * * MapValue type: If parameter's entity type is a composite entity then use - * map, otherwise, depending on the parameter value type, it could be one of - * string, number, boolean, null, list or map. - * * MapValue value: If parameter's entity type is a composite entity then use - * map from composite entity property names to property values, otherwise, - * use parameter value. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Dialogflow\V2\Context::initOnce(); - parent::__construct($data); - } - - /** - * Required. The unique identifier of the context. Format: - * `projects//agent/sessions//contexts/`, - * or `projects//agent/environments//users//sessions//contexts/`. - * The `Context ID` is always converted to lowercase, may only contain - * characters in `a-zA-Z0-9_-%` and may be at most 250 bytes long. - * If `Environment ID` is not specified, we assume default 'draft' - * environment. If `User ID` is not specified, we assume default '-' user. - * The following context names are reserved for internal use by Dialogflow. - * You should not use these contexts or create contexts with these names: - * * `__system_counters__` - * * `*_id_dialog_context` - * * `*_dialog_params_size` - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED]; - * @return string - */ - public function getName() - { - return $this->name; - } - - /** - * Required. The unique identifier of the context. Format: - * `projects//agent/sessions//contexts/`, - * or `projects//agent/environments//users//sessions//contexts/`. - * The `Context ID` is always converted to lowercase, may only contain - * characters in `a-zA-Z0-9_-%` and may be at most 250 bytes long. - * If `Environment ID` is not specified, we assume default 'draft' - * environment. If `User ID` is not specified, we assume default '-' user. - * The following context names are reserved for internal use by Dialogflow. - * You should not use these contexts or create contexts with these names: - * * `__system_counters__` - * * `*_id_dialog_context` - * * `*_dialog_params_size` - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED]; - * @param string $var - * @return $this - */ - public function setName($var) - { - GPBUtil::checkString($var, True); - $this->name = $var; - - return $this; - } - - /** - * Optional. The number of conversational query requests after which the - * context expires. The default is `0`. If set to `0`, the context expires - * immediately. Contexts expire automatically after 20 minutes if there - * are no matching queries. - * - * Generated from protobuf field int32 lifespan_count = 2 [(.google.api.field_behavior) = OPTIONAL]; - * @return int - */ - public function getLifespanCount() - { - return $this->lifespan_count; - } - - /** - * Optional. The number of conversational query requests after which the - * context expires. The default is `0`. If set to `0`, the context expires - * immediately. Contexts expire automatically after 20 minutes if there - * are no matching queries. - * - * Generated from protobuf field int32 lifespan_count = 2 [(.google.api.field_behavior) = OPTIONAL]; - * @param int $var - * @return $this - */ - public function setLifespanCount($var) - { - GPBUtil::checkInt32($var); - $this->lifespan_count = $var; - - return $this; - } - - /** - * Optional. The collection of parameters associated with this context. - * Depending on your protocol or client library language, this is a - * map, associative array, symbol table, dictionary, or JSON object - * composed of a collection of (MapKey, MapValue) pairs: - * * MapKey type: string - * * MapKey value: parameter name - * * MapValue type: If parameter's entity type is a composite entity then use - * map, otherwise, depending on the parameter value type, it could be one of - * string, number, boolean, null, list or map. - * * MapValue value: If parameter's entity type is a composite entity then use - * map from composite entity property names to property values, otherwise, - * use parameter value. - * - * Generated from protobuf field .google.protobuf.Struct parameters = 3 [(.google.api.field_behavior) = OPTIONAL]; - * @return \Google\Protobuf\Struct|null - */ - public function getParameters() - { - return $this->parameters; - } - - public function hasParameters() - { - return isset($this->parameters); - } - - public function clearParameters() - { - unset($this->parameters); - } - - /** - * Optional. The collection of parameters associated with this context. - * Depending on your protocol or client library language, this is a - * map, associative array, symbol table, dictionary, or JSON object - * composed of a collection of (MapKey, MapValue) pairs: - * * MapKey type: string - * * MapKey value: parameter name - * * MapValue type: If parameter's entity type is a composite entity then use - * map, otherwise, depending on the parameter value type, it could be one of - * string, number, boolean, null, list or map. - * * MapValue value: If parameter's entity type is a composite entity then use - * map from composite entity property names to property values, otherwise, - * use parameter value. - * - * Generated from protobuf field .google.protobuf.Struct parameters = 3 [(.google.api.field_behavior) = OPTIONAL]; - * @param \Google\Protobuf\Struct $var - * @return $this - */ - public function setParameters($var) - { - GPBUtil::checkMessage($var, \Google\Protobuf\Struct::class); - $this->parameters = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/Conversation.php b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/Conversation.php deleted file mode 100644 index 25fc57fa85e9..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. Identifier. The unique identifier of this conversation. - * Format: `projects//locations//conversations/`. - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.field_behavior) = IDENTIFIER]; - */ - protected $name = ''; - /** - * Output only. The current state of the Conversation. - * - * Generated from protobuf field .google.cloud.dialogflow.v2.Conversation.LifecycleState lifecycle_state = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $lifecycle_state = 0; - /** - * Required. The Conversation Profile to be used to configure this - * Conversation. This field cannot be updated. - * Format: `projects//locations//conversationProfiles/`. - * - * Generated from protobuf field string conversation_profile = 3 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - */ - protected $conversation_profile = ''; - /** - * Output only. It will not be empty if the conversation is to be connected - * over telephony. - * - * Generated from protobuf field .google.cloud.dialogflow.v2.ConversationPhoneNumber phone_number = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $phone_number = null; - /** - * Output only. The time the conversation was started. - * - * Generated from protobuf field .google.protobuf.Timestamp start_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $start_time = null; - /** - * Output only. The time the conversation was finished. - * - * Generated from protobuf field .google.protobuf.Timestamp end_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $end_time = null; - /** - * Optional. The stage of a conversation. It indicates whether the virtual - * agent or a human agent is handling the conversation. - * If the conversation is created with the conversation profile that has - * Dialogflow config set, defaults to - * [ConversationStage.VIRTUAL_AGENT_STAGE][google.cloud.dialogflow.v2.Conversation.ConversationStage.VIRTUAL_AGENT_STAGE]; - * Otherwise, defaults to - * [ConversationStage.HUMAN_ASSIST_STAGE][google.cloud.dialogflow.v2.Conversation.ConversationStage.HUMAN_ASSIST_STAGE]. - * If the conversation is created with the conversation profile that has - * Dialogflow config set but explicitly sets conversation_stage to - * [ConversationStage.HUMAN_ASSIST_STAGE][google.cloud.dialogflow.v2.Conversation.ConversationStage.HUMAN_ASSIST_STAGE], - * it skips - * [ConversationStage.VIRTUAL_AGENT_STAGE][google.cloud.dialogflow.v2.Conversation.ConversationStage.VIRTUAL_AGENT_STAGE] - * stage and directly goes to - * [ConversationStage.HUMAN_ASSIST_STAGE][google.cloud.dialogflow.v2.Conversation.ConversationStage.HUMAN_ASSIST_STAGE]. - * - * Generated from protobuf field .google.cloud.dialogflow.v2.Conversation.ConversationStage conversation_stage = 7 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $conversation_stage = 0; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $name - * Output only. Identifier. The unique identifier of this conversation. - * Format: `projects//locations//conversations/`. - * @type int $lifecycle_state - * Output only. The current state of the Conversation. - * @type string $conversation_profile - * Required. The Conversation Profile to be used to configure this - * Conversation. This field cannot be updated. - * Format: `projects//locations//conversationProfiles/`. - * @type \Google\Cloud\Dialogflow\V2\ConversationPhoneNumber $phone_number - * Output only. It will not be empty if the conversation is to be connected - * over telephony. - * @type \Google\Protobuf\Timestamp $start_time - * Output only. The time the conversation was started. - * @type \Google\Protobuf\Timestamp $end_time - * Output only. The time the conversation was finished. - * @type int $conversation_stage - * Optional. The stage of a conversation. It indicates whether the virtual - * agent or a human agent is handling the conversation. - * If the conversation is created with the conversation profile that has - * Dialogflow config set, defaults to - * [ConversationStage.VIRTUAL_AGENT_STAGE][google.cloud.dialogflow.v2.Conversation.ConversationStage.VIRTUAL_AGENT_STAGE]; - * Otherwise, defaults to - * [ConversationStage.HUMAN_ASSIST_STAGE][google.cloud.dialogflow.v2.Conversation.ConversationStage.HUMAN_ASSIST_STAGE]. - * If the conversation is created with the conversation profile that has - * Dialogflow config set but explicitly sets conversation_stage to - * [ConversationStage.HUMAN_ASSIST_STAGE][google.cloud.dialogflow.v2.Conversation.ConversationStage.HUMAN_ASSIST_STAGE], - * it skips - * [ConversationStage.VIRTUAL_AGENT_STAGE][google.cloud.dialogflow.v2.Conversation.ConversationStage.VIRTUAL_AGENT_STAGE] - * stage and directly goes to - * [ConversationStage.HUMAN_ASSIST_STAGE][google.cloud.dialogflow.v2.Conversation.ConversationStage.HUMAN_ASSIST_STAGE]. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Dialogflow\V2\Conversation::initOnce(); - parent::__construct($data); - } - - /** - * Output only. Identifier. The unique identifier of this conversation. - * Format: `projects//locations//conversations/`. - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.field_behavior) = IDENTIFIER]; - * @return string - */ - public function getName() - { - return $this->name; - } - - /** - * Output only. Identifier. The unique identifier of this conversation. - * Format: `projects//locations//conversations/`. - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.field_behavior) = IDENTIFIER]; - * @param string $var - * @return $this - */ - public function setName($var) - { - GPBUtil::checkString($var, True); - $this->name = $var; - - return $this; - } - - /** - * Output only. The current state of the Conversation. - * - * Generated from protobuf field .google.cloud.dialogflow.v2.Conversation.LifecycleState lifecycle_state = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return int - */ - public function getLifecycleState() - { - return $this->lifecycle_state; - } - - /** - * Output only. The current state of the Conversation. - * - * Generated from protobuf field .google.cloud.dialogflow.v2.Conversation.LifecycleState lifecycle_state = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param int $var - * @return $this - */ - public function setLifecycleState($var) - { - GPBUtil::checkEnum($var, \Google\Cloud\Dialogflow\V2\Conversation\LifecycleState::class); - $this->lifecycle_state = $var; - - return $this; - } - - /** - * Required. The Conversation Profile to be used to configure this - * Conversation. This field cannot be updated. - * Format: `projects//locations//conversationProfiles/`. - * - * Generated from protobuf field string conversation_profile = 3 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @return string - */ - public function getConversationProfile() - { - return $this->conversation_profile; - } - - /** - * Required. The Conversation Profile to be used to configure this - * Conversation. This field cannot be updated. - * Format: `projects//locations//conversationProfiles/`. - * - * Generated from protobuf field string conversation_profile = 3 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @param string $var - * @return $this - */ - public function setConversationProfile($var) - { - GPBUtil::checkString($var, True); - $this->conversation_profile = $var; - - return $this; - } - - /** - * Output only. It will not be empty if the conversation is to be connected - * over telephony. - * - * Generated from protobuf field .google.cloud.dialogflow.v2.ConversationPhoneNumber phone_number = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return \Google\Cloud\Dialogflow\V2\ConversationPhoneNumber|null - */ - public function getPhoneNumber() - { - return $this->phone_number; - } - - public function hasPhoneNumber() - { - return isset($this->phone_number); - } - - public function clearPhoneNumber() - { - unset($this->phone_number); - } - - /** - * Output only. It will not be empty if the conversation is to be connected - * over telephony. - * - * Generated from protobuf field .google.cloud.dialogflow.v2.ConversationPhoneNumber phone_number = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param \Google\Cloud\Dialogflow\V2\ConversationPhoneNumber $var - * @return $this - */ - public function setPhoneNumber($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Dialogflow\V2\ConversationPhoneNumber::class); - $this->phone_number = $var; - - return $this; - } - - /** - * Output only. The time the conversation was started. - * - * Generated from protobuf field .google.protobuf.Timestamp start_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return \Google\Protobuf\Timestamp|null - */ - public function getStartTime() - { - return $this->start_time; - } - - public function hasStartTime() - { - return isset($this->start_time); - } - - public function clearStartTime() - { - unset($this->start_time); - } - - /** - * Output only. The time the conversation was started. - * - * Generated from protobuf field .google.protobuf.Timestamp start_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param \Google\Protobuf\Timestamp $var - * @return $this - */ - public function setStartTime($var) - { - GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); - $this->start_time = $var; - - return $this; - } - - /** - * Output only. The time the conversation was finished. - * - * Generated from protobuf field .google.protobuf.Timestamp end_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return \Google\Protobuf\Timestamp|null - */ - public function getEndTime() - { - return $this->end_time; - } - - public function hasEndTime() - { - return isset($this->end_time); - } - - public function clearEndTime() - { - unset($this->end_time); - } - - /** - * Output only. The time the conversation was finished. - * - * Generated from protobuf field .google.protobuf.Timestamp end_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param \Google\Protobuf\Timestamp $var - * @return $this - */ - public function setEndTime($var) - { - GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); - $this->end_time = $var; - - return $this; - } - - /** - * Optional. The stage of a conversation. It indicates whether the virtual - * agent or a human agent is handling the conversation. - * If the conversation is created with the conversation profile that has - * Dialogflow config set, defaults to - * [ConversationStage.VIRTUAL_AGENT_STAGE][google.cloud.dialogflow.v2.Conversation.ConversationStage.VIRTUAL_AGENT_STAGE]; - * Otherwise, defaults to - * [ConversationStage.HUMAN_ASSIST_STAGE][google.cloud.dialogflow.v2.Conversation.ConversationStage.HUMAN_ASSIST_STAGE]. - * If the conversation is created with the conversation profile that has - * Dialogflow config set but explicitly sets conversation_stage to - * [ConversationStage.HUMAN_ASSIST_STAGE][google.cloud.dialogflow.v2.Conversation.ConversationStage.HUMAN_ASSIST_STAGE], - * it skips - * [ConversationStage.VIRTUAL_AGENT_STAGE][google.cloud.dialogflow.v2.Conversation.ConversationStage.VIRTUAL_AGENT_STAGE] - * stage and directly goes to - * [ConversationStage.HUMAN_ASSIST_STAGE][google.cloud.dialogflow.v2.Conversation.ConversationStage.HUMAN_ASSIST_STAGE]. - * - * Generated from protobuf field .google.cloud.dialogflow.v2.Conversation.ConversationStage conversation_stage = 7 [(.google.api.field_behavior) = OPTIONAL]; - * @return int - */ - public function getConversationStage() - { - return $this->conversation_stage; - } - - /** - * Optional. The stage of a conversation. It indicates whether the virtual - * agent or a human agent is handling the conversation. - * If the conversation is created with the conversation profile that has - * Dialogflow config set, defaults to - * [ConversationStage.VIRTUAL_AGENT_STAGE][google.cloud.dialogflow.v2.Conversation.ConversationStage.VIRTUAL_AGENT_STAGE]; - * Otherwise, defaults to - * [ConversationStage.HUMAN_ASSIST_STAGE][google.cloud.dialogflow.v2.Conversation.ConversationStage.HUMAN_ASSIST_STAGE]. - * If the conversation is created with the conversation profile that has - * Dialogflow config set but explicitly sets conversation_stage to - * [ConversationStage.HUMAN_ASSIST_STAGE][google.cloud.dialogflow.v2.Conversation.ConversationStage.HUMAN_ASSIST_STAGE], - * it skips - * [ConversationStage.VIRTUAL_AGENT_STAGE][google.cloud.dialogflow.v2.Conversation.ConversationStage.VIRTUAL_AGENT_STAGE] - * stage and directly goes to - * [ConversationStage.HUMAN_ASSIST_STAGE][google.cloud.dialogflow.v2.Conversation.ConversationStage.HUMAN_ASSIST_STAGE]. - * - * Generated from protobuf field .google.cloud.dialogflow.v2.Conversation.ConversationStage conversation_stage = 7 [(.google.api.field_behavior) = OPTIONAL]; - * @param int $var - * @return $this - */ - public function setConversationStage($var) - { - GPBUtil::checkEnum($var, \Google\Cloud\Dialogflow\V2\Conversation\ConversationStage::class); - $this->conversation_stage = $var; - - return $this; - } - -} - 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/ConversationContext.php b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/ConversationContext.php deleted file mode 100644 index 30ebd3778f77..000000000000 --- a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/ConversationContext.php +++ /dev/null @@ -1,67 +0,0 @@ -google.cloud.dialogflow.v2.ConversationContext - */ -class ConversationContext extends \Google\Protobuf\Internal\Message -{ - /** - * Optional. List of message transcripts in the conversation. - * - * Generated from protobuf field repeated .google.cloud.dialogflow.v2.MessageEntry message_entries = 1 [(.google.api.field_behavior) = OPTIONAL]; - */ - private $message_entries; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type array<\Google\Cloud\Dialogflow\V2\MessageEntry>|\Google\Protobuf\Internal\RepeatedField $message_entries - * Optional. List of message transcripts in the conversation. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Dialogflow\V2\Generator::initOnce(); - parent::__construct($data); - } - - /** - * Optional. List of message transcripts in the conversation. - * - * Generated from protobuf field repeated .google.cloud.dialogflow.v2.MessageEntry message_entries = 1 [(.google.api.field_behavior) = OPTIONAL]; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getMessageEntries() - { - return $this->message_entries; - } - - /** - * Optional. List of message transcripts in the conversation. - * - * Generated from protobuf field repeated .google.cloud.dialogflow.v2.MessageEntry message_entries = 1 [(.google.api.field_behavior) = OPTIONAL]; - * @param array<\Google\Cloud\Dialogflow\V2\MessageEntry>|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setMessageEntries($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Dialogflow\V2\MessageEntry::class); - $this->message_entries = $arr; - - return $this; - } - -} - diff --git a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/ConversationDataset.php b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/ConversationDataset.php deleted file mode 100644 index f0bcdc331c95..000000000000 --- a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/ConversationDataset.php +++ /dev/null @@ -1,412 +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; - /** - * Output only. A read only boolean field reflecting Zone Isolation status of - * the dataset. - * - * Generated from protobuf field optional bool satisfies_pzi = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $satisfies_pzi = null; - /** - * Output only. A read only boolean field reflecting Zone Separation status of - * the dataset. - * - * Generated from protobuf field optional bool satisfies_pzs = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $satisfies_pzs = null; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $name - * Output only. ConversationDataset resource name. Format: - * `projects//locations//conversationDatasets/` - * @type string $display_name - * Required. The display name of the dataset. Maximum of 64 bytes. - * @type string $description - * Optional. The description of the dataset. Maximum of 10000 bytes. - * @type \Google\Protobuf\Timestamp $create_time - * Output only. Creation time of this dataset. - * @type \Google\Cloud\Dialogflow\V2\InputConfig $input_config - * Output only. Input configurations set during conversation data import. - * @type \Google\Cloud\Dialogflow\V2\ConversationInfo $conversation_info - * Output only. Metadata set during conversation data import. - * @type int|string $conversation_count - * Output only. The number of conversations this conversation dataset - * contains. - * @type bool $satisfies_pzi - * Output only. A read only boolean field reflecting Zone Isolation status of - * the dataset. - * @type bool $satisfies_pzs - * Output only. A read only boolean field reflecting Zone Separation status of - * the dataset. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Dialogflow\V2\ConversationDataset::initOnce(); - parent::__construct($data); - } - - /** - * Output only. ConversationDataset resource name. Format: - * `projects//locations//conversationDatasets/` - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return string - */ - public function getName() - { - return $this->name; - } - - /** - * Output only. ConversationDataset resource name. Format: - * `projects//locations//conversationDatasets/` - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param string $var - * @return $this - */ - public function setName($var) - { - GPBUtil::checkString($var, True); - $this->name = $var; - - return $this; - } - - /** - * Required. The display name of the dataset. Maximum of 64 bytes. - * - * Generated from protobuf field string display_name = 2 [(.google.api.field_behavior) = REQUIRED]; - * @return string - */ - public function getDisplayName() - { - return $this->display_name; - } - - /** - * Required. The display name of the dataset. Maximum of 64 bytes. - * - * Generated from protobuf field string display_name = 2 [(.google.api.field_behavior) = REQUIRED]; - * @param string $var - * @return $this - */ - public function setDisplayName($var) - { - GPBUtil::checkString($var, True); - $this->display_name = $var; - - return $this; - } - - /** - * Optional. The description of the dataset. Maximum of 10000 bytes. - * - * Generated from protobuf field string description = 3 [(.google.api.field_behavior) = OPTIONAL]; - * @return string - */ - public function getDescription() - { - return $this->description; - } - - /** - * Optional. The description of the dataset. Maximum of 10000 bytes. - * - * Generated from protobuf field string description = 3 [(.google.api.field_behavior) = OPTIONAL]; - * @param string $var - * @return $this - */ - public function setDescription($var) - { - GPBUtil::checkString($var, True); - $this->description = $var; - - return $this; - } - - /** - * Output only. Creation time of this dataset. - * - * Generated from protobuf field .google.protobuf.Timestamp create_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return \Google\Protobuf\Timestamp|null - */ - public function getCreateTime() - { - return $this->create_time; - } - - public function hasCreateTime() - { - return isset($this->create_time); - } - - public function clearCreateTime() - { - unset($this->create_time); - } - - /** - * Output only. Creation time of this dataset. - * - * Generated from protobuf field .google.protobuf.Timestamp create_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param \Google\Protobuf\Timestamp $var - * @return $this - */ - public function setCreateTime($var) - { - GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); - $this->create_time = $var; - - return $this; - } - - /** - * Output only. Input configurations set during conversation data import. - * - * Generated from protobuf field .google.cloud.dialogflow.v2.InputConfig input_config = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return \Google\Cloud\Dialogflow\V2\InputConfig|null - */ - public function getInputConfig() - { - return $this->input_config; - } - - public function hasInputConfig() - { - return isset($this->input_config); - } - - public function clearInputConfig() - { - unset($this->input_config); - } - - /** - * Output only. Input configurations set during conversation data import. - * - * Generated from protobuf field .google.cloud.dialogflow.v2.InputConfig input_config = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param \Google\Cloud\Dialogflow\V2\InputConfig $var - * @return $this - */ - public function setInputConfig($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Dialogflow\V2\InputConfig::class); - $this->input_config = $var; - - return $this; - } - - /** - * Output only. Metadata set during conversation data import. - * - * Generated from protobuf field .google.cloud.dialogflow.v2.ConversationInfo conversation_info = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return \Google\Cloud\Dialogflow\V2\ConversationInfo|null - */ - public function getConversationInfo() - { - return $this->conversation_info; - } - - public function hasConversationInfo() - { - return isset($this->conversation_info); - } - - public function clearConversationInfo() - { - unset($this->conversation_info); - } - - /** - * Output only. Metadata set during conversation data import. - * - * Generated from protobuf field .google.cloud.dialogflow.v2.ConversationInfo conversation_info = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param \Google\Cloud\Dialogflow\V2\ConversationInfo $var - * @return $this - */ - public function setConversationInfo($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Dialogflow\V2\ConversationInfo::class); - $this->conversation_info = $var; - - return $this; - } - - /** - * Output only. The number of conversations this conversation dataset - * contains. - * - * Generated from protobuf field int64 conversation_count = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return int|string - */ - public function getConversationCount() - { - return $this->conversation_count; - } - - /** - * Output only. The number of conversations this conversation dataset - * contains. - * - * Generated from protobuf field int64 conversation_count = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param int|string $var - * @return $this - */ - public function setConversationCount($var) - { - GPBUtil::checkInt64($var); - $this->conversation_count = $var; - - return $this; - } - - /** - * Output only. A read only boolean field reflecting Zone Isolation status of - * the dataset. - * - * Generated from protobuf field optional bool satisfies_pzi = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return bool - */ - public function getSatisfiesPzi() - { - return isset($this->satisfies_pzi) ? $this->satisfies_pzi : false; - } - - public function hasSatisfiesPzi() - { - return isset($this->satisfies_pzi); - } - - public function clearSatisfiesPzi() - { - unset($this->satisfies_pzi); - } - - /** - * Output only. A read only boolean field reflecting Zone Isolation status of - * the dataset. - * - * Generated from protobuf field optional bool satisfies_pzi = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param bool $var - * @return $this - */ - public function setSatisfiesPzi($var) - { - GPBUtil::checkBool($var); - $this->satisfies_pzi = $var; - - return $this; - } - - /** - * Output only. A read only boolean field reflecting Zone Separation status of - * the dataset. - * - * Generated from protobuf field optional bool satisfies_pzs = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return bool - */ - public function getSatisfiesPzs() - { - return isset($this->satisfies_pzs) ? $this->satisfies_pzs : false; - } - - public function hasSatisfiesPzs() - { - return isset($this->satisfies_pzs); - } - - public function clearSatisfiesPzs() - { - unset($this->satisfies_pzs); - } - - /** - * Output only. A read only boolean field reflecting Zone Separation status of - * the dataset. - * - * Generated from protobuf field optional bool satisfies_pzs = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param bool $var - * @return $this - */ - public function setSatisfiesPzs($var) - { - GPBUtil::checkBool($var); - $this->satisfies_pzs = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/ConversationEvent.php b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/ConversationEvent.php 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 fa2896f524ae..000000000000 --- a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/ConversationModel.php +++ /dev/null @@ -1,442 +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 = ''; - /** - * Output only. A read only boolean field reflecting Zone Separation - * status of the model. - * - * Generated from protobuf field optional bool satisfies_pzs = 25 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $satisfies_pzs = null; - /** - * Output only. A read only boolean field reflecting Zone Isolation status - * of the model. - * - * Generated from protobuf field optional bool satisfies_pzi = 26 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $satisfies_pzi = null; - protected $model_metadata; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $name - * ConversationModel resource name. Format: - * `projects//conversationModels/` - * @type string $display_name - * Required. The display name of the model. At most 64 bytes long. - * @type \Google\Protobuf\Timestamp $create_time - * Output only. Creation time of this model. - * @type 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. - * @type bool $satisfies_pzs - * Output only. A read only boolean field reflecting Zone Separation - * status of the model. - * @type bool $satisfies_pzi - * Output only. A read only boolean field reflecting Zone Isolation status - * of the model. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Dialogflow\V2\ConversationModel::initOnce(); - parent::__construct($data); - } - - /** - * ConversationModel resource name. Format: - * `projects//conversationModels/` - * - * Generated from protobuf field string name = 1; - * @return string - */ - public function getName() - { - return $this->name; - } - - /** - * ConversationModel resource name. Format: - * `projects//conversationModels/` - * - * Generated from protobuf field string name = 1; - * @param string $var - * @return $this - */ - public function setName($var) - { - GPBUtil::checkString($var, True); - $this->name = $var; - - return $this; - } - - /** - * Required. The display name of the model. At most 64 bytes long. - * - * Generated from protobuf field string display_name = 2 [(.google.api.field_behavior) = REQUIRED]; - * @return string - */ - public function getDisplayName() - { - return $this->display_name; - } - - /** - * Required. The display name of the model. At most 64 bytes long. - * - * Generated from protobuf field string display_name = 2 [(.google.api.field_behavior) = REQUIRED]; - * @param string $var - * @return $this - */ - public function setDisplayName($var) - { - GPBUtil::checkString($var, True); - $this->display_name = $var; - - return $this; - } - - /** - * Output only. Creation time of this model. - * - * Generated from protobuf field .google.protobuf.Timestamp create_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return \Google\Protobuf\Timestamp|null - */ - public function getCreateTime() - { - return $this->create_time; - } - - public function hasCreateTime() - { - return isset($this->create_time); - } - - public function clearCreateTime() - { - unset($this->create_time); - } - - /** - * Output only. Creation time of this model. - * - * Generated from protobuf field .google.protobuf.Timestamp create_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param \Google\Protobuf\Timestamp $var - * @return $this - */ - public function setCreateTime($var) - { - GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); - $this->create_time = $var; - - return $this; - } - - /** - * Required. Datasets used to create model. - * - * Generated from protobuf field repeated .google.cloud.dialogflow.v2.InputDataset datasets = 4 [(.google.api.field_behavior) = REQUIRED]; - * @return \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; - } - - /** - * Output only. A read only boolean field reflecting Zone Separation - * status of the model. - * - * Generated from protobuf field optional bool satisfies_pzs = 25 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return bool - */ - public function getSatisfiesPzs() - { - return isset($this->satisfies_pzs) ? $this->satisfies_pzs : false; - } - - public function hasSatisfiesPzs() - { - return isset($this->satisfies_pzs); - } - - public function clearSatisfiesPzs() - { - unset($this->satisfies_pzs); - } - - /** - * Output only. A read only boolean field reflecting Zone Separation - * status of the model. - * - * Generated from protobuf field optional bool satisfies_pzs = 25 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param bool $var - * @return $this - */ - public function setSatisfiesPzs($var) - { - GPBUtil::checkBool($var); - $this->satisfies_pzs = $var; - - return $this; - } - - /** - * Output only. A read only boolean field reflecting Zone Isolation status - * of the model. - * - * Generated from protobuf field optional bool satisfies_pzi = 26 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return bool - */ - public function getSatisfiesPzi() - { - return isset($this->satisfies_pzi) ? $this->satisfies_pzi : false; - } - - public function hasSatisfiesPzi() - { - return isset($this->satisfies_pzi); - } - - public function clearSatisfiesPzi() - { - unset($this->satisfies_pzi); - } - - /** - * Output only. A read only boolean field reflecting Zone Isolation status - * of the model. - * - * Generated from protobuf field optional bool satisfies_pzi = 26 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param bool $var - * @return $this - */ - public function setSatisfiesPzi($var) - { - GPBUtil::checkBool($var); - $this->satisfies_pzi = $var; - - return $this; - } - - /** - * @return string - */ - public function getModelMetadata() - { - return $this->whichOneof("model_metadata"); - } - -} - diff --git a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/ConversationModel/ModelType.php b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/ConversationModel/ModelType.php 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 1a4146837421..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/CreateGeneratorRequest.php b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/CreateGeneratorRequest.php deleted file mode 100644 index 8e51638cc57d..000000000000 --- a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/CreateGeneratorRequest.php +++ /dev/null @@ -1,209 +0,0 @@ -google.cloud.dialogflow.v2.CreateGeneratorRequest - */ -class CreateGeneratorRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The project/location to create generator for. Format: - * `projects//locations/` - * - * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - */ - protected $parent = ''; - /** - * Required. The generator to create. - * - * Generated from protobuf field .google.cloud.dialogflow.v2.Generator generator = 2 [(.google.api.field_behavior) = REQUIRED]; - */ - protected $generator = null; - /** - * Optional. The ID to use for the generator, which will become the final - * component of the generator's resource name. - * The generator ID must be compliant with the regression fomula - * `[a-zA-Z][a-zA-Z0-9_-]*` with the characters length in range of [3,64]. - * If the field is not provided, an Id will be auto-generated. - * If the field is provided, the caller is 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 generator_id = 3 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $generator_id = ''; - - /** - * @param string $parent Required. The project/location to create generator for. Format: - * `projects//locations/` - * Please see {@see GeneratorsClient::projectName()} for help formatting this field. - * @param \Google\Cloud\Dialogflow\V2\Generator $generator Required. The generator to create. - * @param string $generatorId Optional. The ID to use for the generator, which will become the final - * component of the generator's resource name. - * - * The generator ID must be compliant with the regression fomula - * `[a-zA-Z][a-zA-Z0-9_-]*` with the characters length in range of [3,64]. - * If the field is not provided, an Id will be auto-generated. - * If the field is provided, the caller is 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. - * - * @return \Google\Cloud\Dialogflow\V2\CreateGeneratorRequest - * - * @experimental - */ - public static function build(string $parent, \Google\Cloud\Dialogflow\V2\Generator $generator, string $generatorId): self - { - return (new self()) - ->setParent($parent) - ->setGenerator($generator) - ->setGeneratorId($generatorId); - } - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $parent - * Required. The project/location to create generator for. Format: - * `projects//locations/` - * @type \Google\Cloud\Dialogflow\V2\Generator $generator - * Required. The generator to create. - * @type string $generator_id - * Optional. The ID to use for the generator, which will become the final - * component of the generator's resource name. - * The generator ID must be compliant with the regression fomula - * `[a-zA-Z][a-zA-Z0-9_-]*` with the characters length in range of [3,64]. - * If the field is not provided, an Id will be auto-generated. - * If the field is provided, the caller is 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\Generator::initOnce(); - parent::__construct($data); - } - - /** - * Required. The project/location to create generator for. Format: - * `projects//locations/` - * - * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @return string - */ - public function getParent() - { - return $this->parent; - } - - /** - * Required. The project/location to create generator for. Format: - * `projects//locations/` - * - * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @param string $var - * @return $this - */ - public function setParent($var) - { - GPBUtil::checkString($var, True); - $this->parent = $var; - - return $this; - } - - /** - * Required. The generator to create. - * - * Generated from protobuf field .google.cloud.dialogflow.v2.Generator generator = 2 [(.google.api.field_behavior) = REQUIRED]; - * @return \Google\Cloud\Dialogflow\V2\Generator|null - */ - public function getGenerator() - { - return $this->generator; - } - - public function hasGenerator() - { - return isset($this->generator); - } - - public function clearGenerator() - { - unset($this->generator); - } - - /** - * Required. The generator to create. - * - * Generated from protobuf field .google.cloud.dialogflow.v2.Generator generator = 2 [(.google.api.field_behavior) = REQUIRED]; - * @param \Google\Cloud\Dialogflow\V2\Generator $var - * @return $this - */ - public function setGenerator($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Dialogflow\V2\Generator::class); - $this->generator = $var; - - return $this; - } - - /** - * Optional. The ID to use for the generator, which will become the final - * component of the generator's resource name. - * The generator ID must be compliant with the regression fomula - * `[a-zA-Z][a-zA-Z0-9_-]*` with the characters length in range of [3,64]. - * If the field is not provided, an Id will be auto-generated. - * If the field is provided, the caller is 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 generator_id = 3 [(.google.api.field_behavior) = OPTIONAL]; - * @return string - */ - public function getGeneratorId() - { - return $this->generator_id; - } - - /** - * Optional. The ID to use for the generator, which will become the final - * component of the generator's resource name. - * The generator ID must be compliant with the regression fomula - * `[a-zA-Z][a-zA-Z0-9_-]*` with the characters length in range of [3,64]. - * If the field is not provided, an Id will be auto-generated. - * If the field is provided, the caller is 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 generator_id = 3 [(.google.api.field_behavior) = OPTIONAL]; - * @param string $var - * @return $this - */ - public function setGeneratorId($var) - { - GPBUtil::checkString($var, True); - $this->generator_id = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/CreateIntentRequest.php b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/CreateIntentRequest.php 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/DeleteGeneratorRequest.php b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/DeleteGeneratorRequest.php deleted file mode 100644 index 8cd00db55700..000000000000 --- a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/DeleteGeneratorRequest.php +++ /dev/null @@ -1,86 +0,0 @@ -google.cloud.dialogflow.v2.DeleteGeneratorRequest - */ -class DeleteGeneratorRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The generator resource name to delete. Format: - * `projects//locations//generators/` - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - */ - protected $name = ''; - - /** - * @param string $name Required. The generator resource name to delete. Format: - * `projects//locations//generators/` - * Please see {@see GeneratorsClient::generatorName()} for help formatting this field. - * - * @return \Google\Cloud\Dialogflow\V2\DeleteGeneratorRequest - * - * @experimental - */ - public static function build(string $name): self - { - return (new self()) - ->setName($name); - } - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $name - * Required. The generator resource name to delete. Format: - * `projects//locations//generators/` - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Dialogflow\V2\Generator::initOnce(); - parent::__construct($data); - } - - /** - * Required. The generator resource name to delete. Format: - * `projects//locations//generators/` - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @return string - */ - public function getName() - { - return $this->name; - } - - /** - * Required. The generator resource name to delete. Format: - * `projects//locations//generators/` - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @param string $var - * @return $this - */ - public function setName($var) - { - GPBUtil::checkString($var, True); - $this->name = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/DeleteIntentRequest.php b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/DeleteIntentRequest.php 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 8461a6598877..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/DialogflowAssistAnswer.php b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/DialogflowAssistAnswer.php deleted file mode 100644 index 65b84a8bf228..000000000000 --- a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/DialogflowAssistAnswer.php +++ /dev/null @@ -1,150 +0,0 @@ -google.cloud.dialogflow.v2.DialogflowAssistAnswer - */ -class DialogflowAssistAnswer extends \Google\Protobuf\Internal\Message -{ - /** - * The name of answer record, in the format of - * "projects//locations//answerRecords/" - * - * Generated from protobuf field string answer_record = 2; - */ - protected $answer_record = ''; - protected $result; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type \Google\Cloud\Dialogflow\V2\QueryResult $query_result - * Result from v2 agent. - * @type \Google\Cloud\Dialogflow\V2\IntentSuggestion $intent_suggestion - * An intent suggestion generated from conversation. - * @type string $answer_record - * The name of answer record, in the format of - * "projects//locations//answerRecords/" - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Dialogflow\V2\Participant::initOnce(); - parent::__construct($data); - } - - /** - * Result from v2 agent. - * - * Generated from protobuf field .google.cloud.dialogflow.v2.QueryResult query_result = 1; - * @return \Google\Cloud\Dialogflow\V2\QueryResult|null - */ - public function getQueryResult() - { - return $this->readOneof(1); - } - - public function hasQueryResult() - { - return $this->hasOneof(1); - } - - /** - * Result from v2 agent. - * - * Generated from protobuf field .google.cloud.dialogflow.v2.QueryResult query_result = 1; - * @param \Google\Cloud\Dialogflow\V2\QueryResult $var - * @return $this - */ - public function setQueryResult($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Dialogflow\V2\QueryResult::class); - $this->writeOneof(1, $var); - - return $this; - } - - /** - * An intent suggestion generated from conversation. - * - * Generated from protobuf field .google.cloud.dialogflow.v2.IntentSuggestion intent_suggestion = 5; - * @return \Google\Cloud\Dialogflow\V2\IntentSuggestion|null - */ - public function getIntentSuggestion() - { - return $this->readOneof(5); - } - - public function hasIntentSuggestion() - { - return $this->hasOneof(5); - } - - /** - * An intent suggestion generated from conversation. - * - * Generated from protobuf field .google.cloud.dialogflow.v2.IntentSuggestion intent_suggestion = 5; - * @param \Google\Cloud\Dialogflow\V2\IntentSuggestion $var - * @return $this - */ - public function setIntentSuggestion($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Dialogflow\V2\IntentSuggestion::class); - $this->writeOneof(5, $var); - - return $this; - } - - /** - * The name of answer record, in the format of - * "projects//locations//answerRecords/" - * - * Generated from protobuf field string answer_record = 2; - * @return string - */ - public function getAnswerRecord() - { - return $this->answer_record; - } - - /** - * The name of answer record, in the format of - * "projects//locations//answerRecords/" - * - * Generated from protobuf field string answer_record = 2; - * @param string $var - * @return $this - */ - public function setAnswerRecord($var) - { - GPBUtil::checkString($var, True); - $this->answer_record = $var; - - return $this; - } - - /** - * @return string - */ - public function getResult() - { - return $this->whichOneof("result"); - } - -} - diff --git a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/Document.php b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/Document.php 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/EncryptionSpec.php b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/EncryptionSpec.php deleted file mode 100644 index cf409b8ff23a..000000000000 --- a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/EncryptionSpec.php +++ /dev/null @@ -1,126 +0,0 @@ -google.cloud.dialogflow.v2.EncryptionSpec - */ -class EncryptionSpec extends \Google\Protobuf\Internal\Message -{ - /** - * Immutable. The resource name of the encryption key specification resource. - * Format: - * projects/{project}/locations/{location}/encryptionSpec - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = IMMUTABLE]; - */ - protected $name = ''; - /** - * Required. The name of customer-managed encryption key that is used to - * secure a resource and its sub-resources. If empty, the resource is secured - * by the default Google encryption key. Only the key in the same location as - * this resource is allowed to be used for encryption. Format: - * `projects/{project}/locations/{location}/keyRings/{keyRing}/cryptoKeys/{key}` - * - * Generated from protobuf field string kms_key = 2 [(.google.api.field_behavior) = REQUIRED]; - */ - protected $kms_key = ''; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $name - * Immutable. The resource name of the encryption key specification resource. - * Format: - * projects/{project}/locations/{location}/encryptionSpec - * @type string $kms_key - * Required. The name of customer-managed encryption key that is used to - * secure a resource and its sub-resources. If empty, the resource is secured - * by the default Google encryption key. Only the key in the same location as - * this resource is allowed to be used for encryption. Format: - * `projects/{project}/locations/{location}/keyRings/{keyRing}/cryptoKeys/{key}` - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Dialogflow\V2\EncryptionSpec::initOnce(); - parent::__construct($data); - } - - /** - * Immutable. The resource name of the encryption key specification resource. - * Format: - * projects/{project}/locations/{location}/encryptionSpec - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = IMMUTABLE]; - * @return string - */ - public function getName() - { - return $this->name; - } - - /** - * Immutable. The resource name of the encryption key specification resource. - * Format: - * projects/{project}/locations/{location}/encryptionSpec - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = IMMUTABLE]; - * @param string $var - * @return $this - */ - public function setName($var) - { - GPBUtil::checkString($var, True); - $this->name = $var; - - return $this; - } - - /** - * Required. The name of customer-managed encryption key that is used to - * secure a resource and its sub-resources. If empty, the resource is secured - * by the default Google encryption key. Only the key in the same location as - * this resource is allowed to be used for encryption. Format: - * `projects/{project}/locations/{location}/keyRings/{keyRing}/cryptoKeys/{key}` - * - * Generated from protobuf field string kms_key = 2 [(.google.api.field_behavior) = REQUIRED]; - * @return string - */ - public function getKmsKey() - { - return $this->kms_key; - } - - /** - * Required. The name of customer-managed encryption key that is used to - * secure a resource and its sub-resources. If empty, the resource is secured - * by the default Google encryption key. Only the key in the same location as - * this resource is allowed to be used for encryption. Format: - * `projects/{project}/locations/{location}/keyRings/{keyRing}/cryptoKeys/{key}` - * - * Generated from protobuf field string kms_key = 2 [(.google.api.field_behavior) = REQUIRED]; - * @param string $var - * @return $this - */ - public function setKmsKey($var) - { - GPBUtil::checkString($var, True); - $this->kms_key = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/EntityType.php b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/EntityType.php 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 015785c67f65..000000000000 --- a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/EventInput.php +++ /dev/null @@ -1,221 +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 then use - * map, otherwise, depending on the parameter value type, it could be one of - * string, number, boolean, null, list or map. - * * MapValue value: If parameter's entity type is a composite entity then use - * map from composite entity property names to property values, otherwise, - * use parameter value. - * - * Generated from protobuf field .google.protobuf.Struct parameters = 2; - */ - protected $parameters = null; - /** - * Required. The language of this query. See [Language - * Support](https://cloud.google.com/dialogflow/docs/reference/language) - * for a list of the currently supported language codes. Note that queries in - * the same session do not necessarily need to specify the same language. - * This field is ignored when used in the context of a - * [WebhookResponse.followup_event_input][google.cloud.dialogflow.v2.WebhookResponse.followup_event_input] - * field, because the language was already defined in the originating detect - * intent request. - * - * Generated from protobuf field string language_code = 3 [(.google.api.field_behavior) = REQUIRED]; - */ - protected $language_code = ''; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $name - * Required. The unique identifier of the event. - * @type \Google\Protobuf\Struct $parameters - * The collection of parameters associated with the event. - * Depending on your protocol or client library language, this is a - * map, associative array, symbol table, dictionary, or JSON object - * composed of a collection of (MapKey, MapValue) pairs: - * * MapKey type: string - * * MapKey value: parameter name - * * MapValue type: If parameter's entity type is a composite entity then use - * map, otherwise, depending on the parameter value type, it could be one of - * string, number, boolean, null, list or map. - * * MapValue value: If parameter's entity type is a composite entity then use - * map from composite entity property names to property values, otherwise, - * use parameter value. - * @type string $language_code - * Required. The language of this query. See [Language - * Support](https://cloud.google.com/dialogflow/docs/reference/language) - * for a list of the currently supported language codes. Note that queries in - * the same session do not necessarily need to specify the same language. - * This field is ignored when used in the context of a - * [WebhookResponse.followup_event_input][google.cloud.dialogflow.v2.WebhookResponse.followup_event_input] - * field, because the language was already defined in the originating detect - * intent request. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Dialogflow\V2\Session::initOnce(); - parent::__construct($data); - } - - /** - * Required. The unique identifier of the event. - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED]; - * @return string - */ - public function getName() - { - return $this->name; - } - - /** - * Required. The unique identifier of the event. - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED]; - * @param string $var - * @return $this - */ - public function setName($var) - { - GPBUtil::checkString($var, True); - $this->name = $var; - - return $this; - } - - /** - * The collection of parameters associated with the event. - * Depending on your protocol or client library language, this is a - * map, associative array, symbol table, dictionary, or JSON object - * composed of a collection of (MapKey, MapValue) pairs: - * * MapKey type: string - * * MapKey value: parameter name - * * MapValue type: If parameter's entity type is a composite entity then use - * map, otherwise, depending on the parameter value type, it could be one of - * string, number, boolean, null, list or map. - * * MapValue value: If parameter's entity type is a composite entity then use - * map from composite entity property names to property values, otherwise, - * use parameter value. - * - * Generated from protobuf field .google.protobuf.Struct parameters = 2; - * @return \Google\Protobuf\Struct|null - */ - public function getParameters() - { - return $this->parameters; - } - - public function hasParameters() - { - return isset($this->parameters); - } - - public function clearParameters() - { - unset($this->parameters); - } - - /** - * The collection of parameters associated with the event. - * Depending on your protocol or client library language, this is a - * map, associative array, symbol table, dictionary, or JSON object - * composed of a collection of (MapKey, MapValue) pairs: - * * MapKey type: string - * * MapKey value: parameter name - * * MapValue type: If parameter's entity type is a composite entity then use - * map, otherwise, depending on the parameter value type, it could be one of - * string, number, boolean, null, list or map. - * * MapValue value: If parameter's entity type is a composite entity then use - * map from composite entity property names to property values, otherwise, - * use parameter value. - * - * Generated from protobuf field .google.protobuf.Struct parameters = 2; - * @param \Google\Protobuf\Struct $var - * @return $this - */ - public function setParameters($var) - { - GPBUtil::checkMessage($var, \Google\Protobuf\Struct::class); - $this->parameters = $var; - - return $this; - } - - /** - * Required. The language of this query. See [Language - * Support](https://cloud.google.com/dialogflow/docs/reference/language) - * for a list of the currently supported language codes. Note that queries in - * the same session do not necessarily need to specify the same language. - * This field is ignored when used in the context of a - * [WebhookResponse.followup_event_input][google.cloud.dialogflow.v2.WebhookResponse.followup_event_input] - * field, because the language was already defined in the originating detect - * intent request. - * - * Generated from protobuf field string language_code = 3 [(.google.api.field_behavior) = REQUIRED]; - * @return string - */ - public function getLanguageCode() - { - return $this->language_code; - } - - /** - * Required. The language of this query. See [Language - * Support](https://cloud.google.com/dialogflow/docs/reference/language) - * for a list of the currently supported language codes. Note that queries in - * the same session do not necessarily need to specify the same language. - * This field is ignored when used in the context of a - * [WebhookResponse.followup_event_input][google.cloud.dialogflow.v2.WebhookResponse.followup_event_input] - * field, because the language was already defined in the originating detect - * intent request. - * - * Generated from protobuf field string language_code = 3 [(.google.api.field_behavior) = REQUIRED]; - * @param string $var - * @return $this - */ - public function setLanguageCode($var) - { - GPBUtil::checkString($var, True); - $this->language_code = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/ExportAgentRequest.php b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/ExportAgentRequest.php 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/FewShotExample.php b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/FewShotExample.php deleted file mode 100644 index 52ef044b9d7b..000000000000 --- a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/FewShotExample.php +++ /dev/null @@ -1,207 +0,0 @@ -google.cloud.dialogflow.v2.FewShotExample - */ -class FewShotExample extends \Google\Protobuf\Internal\Message -{ - /** - * Optional. Conversation transcripts. - * - * Generated from protobuf field .google.cloud.dialogflow.v2.ConversationContext conversation_context = 3 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $conversation_context = null; - /** - * Optional. Key is the placeholder field name in input, value is the value of - * the placeholder. E.g. instruction contains "@price", and ingested data has - * <"price", "10"> - * - * Generated from protobuf field map extra_info = 4 [(.google.api.field_behavior) = OPTIONAL]; - */ - private $extra_info; - /** - * Required. Example output of the model. - * - * Generated from protobuf field .google.cloud.dialogflow.v2.GeneratorSuggestion output = 7 [(.google.api.field_behavior) = REQUIRED]; - */ - protected $output = null; - protected $instruction_list; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type \Google\Cloud\Dialogflow\V2\ConversationContext $conversation_context - * Optional. Conversation transcripts. - * @type array|\Google\Protobuf\Internal\MapField $extra_info - * Optional. Key is the placeholder field name in input, value is the value of - * the placeholder. E.g. instruction contains "@price", and ingested data has - * <"price", "10"> - * @type \Google\Cloud\Dialogflow\V2\SummarizationSectionList $summarization_section_list - * Summarization sections. - * @type \Google\Cloud\Dialogflow\V2\GeneratorSuggestion $output - * Required. Example output of the model. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Dialogflow\V2\Generator::initOnce(); - parent::__construct($data); - } - - /** - * Optional. Conversation transcripts. - * - * Generated from protobuf field .google.cloud.dialogflow.v2.ConversationContext conversation_context = 3 [(.google.api.field_behavior) = OPTIONAL]; - * @return \Google\Cloud\Dialogflow\V2\ConversationContext|null - */ - public function getConversationContext() - { - return $this->conversation_context; - } - - public function hasConversationContext() - { - return isset($this->conversation_context); - } - - public function clearConversationContext() - { - unset($this->conversation_context); - } - - /** - * Optional. Conversation transcripts. - * - * Generated from protobuf field .google.cloud.dialogflow.v2.ConversationContext conversation_context = 3 [(.google.api.field_behavior) = OPTIONAL]; - * @param \Google\Cloud\Dialogflow\V2\ConversationContext $var - * @return $this - */ - public function setConversationContext($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Dialogflow\V2\ConversationContext::class); - $this->conversation_context = $var; - - return $this; - } - - /** - * Optional. Key is the placeholder field name in input, value is the value of - * the placeholder. E.g. instruction contains "@price", and ingested data has - * <"price", "10"> - * - * Generated from protobuf field map extra_info = 4 [(.google.api.field_behavior) = OPTIONAL]; - * @return \Google\Protobuf\Internal\MapField - */ - public function getExtraInfo() - { - return $this->extra_info; - } - - /** - * Optional. Key is the placeholder field name in input, value is the value of - * the placeholder. E.g. instruction contains "@price", and ingested data has - * <"price", "10"> - * - * Generated from protobuf field map extra_info = 4 [(.google.api.field_behavior) = OPTIONAL]; - * @param array|\Google\Protobuf\Internal\MapField $var - * @return $this - */ - public function setExtraInfo($var) - { - $arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::STRING, \Google\Protobuf\Internal\GPBType::STRING); - $this->extra_info = $arr; - - return $this; - } - - /** - * Summarization sections. - * - * Generated from protobuf field .google.cloud.dialogflow.v2.SummarizationSectionList summarization_section_list = 6; - * @return \Google\Cloud\Dialogflow\V2\SummarizationSectionList|null - */ - public function getSummarizationSectionList() - { - return $this->readOneof(6); - } - - public function hasSummarizationSectionList() - { - return $this->hasOneof(6); - } - - /** - * Summarization sections. - * - * Generated from protobuf field .google.cloud.dialogflow.v2.SummarizationSectionList summarization_section_list = 6; - * @param \Google\Cloud\Dialogflow\V2\SummarizationSectionList $var - * @return $this - */ - public function setSummarizationSectionList($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Dialogflow\V2\SummarizationSectionList::class); - $this->writeOneof(6, $var); - - return $this; - } - - /** - * Required. Example output of the model. - * - * Generated from protobuf field .google.cloud.dialogflow.v2.GeneratorSuggestion output = 7 [(.google.api.field_behavior) = REQUIRED]; - * @return \Google\Cloud\Dialogflow\V2\GeneratorSuggestion|null - */ - public function getOutput() - { - return $this->output; - } - - public function hasOutput() - { - return isset($this->output); - } - - public function clearOutput() - { - unset($this->output); - } - - /** - * Required. Example output of the model. - * - * Generated from protobuf field .google.cloud.dialogflow.v2.GeneratorSuggestion output = 7 [(.google.api.field_behavior) = REQUIRED]; - * @param \Google\Cloud\Dialogflow\V2\GeneratorSuggestion $var - * @return $this - */ - public function setOutput($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Dialogflow\V2\GeneratorSuggestion::class); - $this->output = $var; - - return $this; - } - - /** - * @return string - */ - public function getInstructionList() - { - return $this->whichOneof("instruction_list"); - } - -} - diff --git a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/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 db741ca11ad4..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 f4a6871fa81f..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/GenerateStatelessSuggestionRequest.php b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/GenerateStatelessSuggestionRequest.php deleted file mode 100644 index 03058fb6bbf4..000000000000 --- a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/GenerateStatelessSuggestionRequest.php +++ /dev/null @@ -1,235 +0,0 @@ -google.cloud.dialogflow.v2.GenerateStatelessSuggestionRequest - */ -class GenerateStatelessSuggestionRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The parent resource to charge for the Suggestion's generation. - * Format: `projects//locations/`. - * - * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - */ - protected $parent = ''; - /** - * Optional. Context of the conversation, including transcripts. - * - * Generated from protobuf field .google.cloud.dialogflow.v2.ConversationContext conversation_context = 5 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $conversation_context = null; - /** - * Optional. A list of trigger events. Generator will be triggered only if - * it's trigger event is included here. - * - * Generated from protobuf field repeated .google.cloud.dialogflow.v2.TriggerEvent trigger_events = 6 [(.google.api.field_behavior) = OPTIONAL]; - */ - private $trigger_events; - protected $generator_resource; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $parent - * Required. The parent resource to charge for the Suggestion's generation. - * Format: `projects//locations/`. - * @type \Google\Cloud\Dialogflow\V2\Generator $generator - * Uncreated generator. It should be a complete generator that includes all - * information about the generator. - * @type string $generator_name - * The resource name of the existing created generator. Format: - * `projects//locations//generators/` - * @type \Google\Cloud\Dialogflow\V2\ConversationContext $conversation_context - * Optional. Context of the conversation, including transcripts. - * @type array|\Google\Protobuf\Internal\RepeatedField $trigger_events - * Optional. A list of trigger events. Generator will be triggered only if - * it's trigger event is included here. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Dialogflow\V2\Conversation::initOnce(); - parent::__construct($data); - } - - /** - * Required. The parent resource to charge for the Suggestion's generation. - * Format: `projects//locations/`. - * - * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @return string - */ - public function getParent() - { - return $this->parent; - } - - /** - * Required. The parent resource to charge for the Suggestion's generation. - * Format: `projects//locations/`. - * - * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @param string $var - * @return $this - */ - public function setParent($var) - { - GPBUtil::checkString($var, True); - $this->parent = $var; - - return $this; - } - - /** - * Uncreated generator. It should be a complete generator that includes all - * information about the generator. - * - * Generated from protobuf field .google.cloud.dialogflow.v2.Generator generator = 2; - * @return \Google\Cloud\Dialogflow\V2\Generator|null - */ - public function getGenerator() - { - return $this->readOneof(2); - } - - public function hasGenerator() - { - return $this->hasOneof(2); - } - - /** - * Uncreated generator. It should be a complete generator that includes all - * information about the generator. - * - * Generated from protobuf field .google.cloud.dialogflow.v2.Generator generator = 2; - * @param \Google\Cloud\Dialogflow\V2\Generator $var - * @return $this - */ - public function setGenerator($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Dialogflow\V2\Generator::class); - $this->writeOneof(2, $var); - - return $this; - } - - /** - * The resource name of the existing created generator. Format: - * `projects//locations//generators/` - * - * Generated from protobuf field string generator_name = 3; - * @return string - */ - public function getGeneratorName() - { - return $this->readOneof(3); - } - - public function hasGeneratorName() - { - return $this->hasOneof(3); - } - - /** - * The resource name of the existing created generator. Format: - * `projects//locations//generators/` - * - * Generated from protobuf field string generator_name = 3; - * @param string $var - * @return $this - */ - public function setGeneratorName($var) - { - GPBUtil::checkString($var, True); - $this->writeOneof(3, $var); - - return $this; - } - - /** - * Optional. Context of the conversation, including transcripts. - * - * Generated from protobuf field .google.cloud.dialogflow.v2.ConversationContext conversation_context = 5 [(.google.api.field_behavior) = OPTIONAL]; - * @return \Google\Cloud\Dialogflow\V2\ConversationContext|null - */ - public function getConversationContext() - { - return $this->conversation_context; - } - - public function hasConversationContext() - { - return isset($this->conversation_context); - } - - public function clearConversationContext() - { - unset($this->conversation_context); - } - - /** - * Optional. Context of the conversation, including transcripts. - * - * Generated from protobuf field .google.cloud.dialogflow.v2.ConversationContext conversation_context = 5 [(.google.api.field_behavior) = OPTIONAL]; - * @param \Google\Cloud\Dialogflow\V2\ConversationContext $var - * @return $this - */ - public function setConversationContext($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Dialogflow\V2\ConversationContext::class); - $this->conversation_context = $var; - - return $this; - } - - /** - * Optional. A list of trigger events. Generator will be triggered only if - * it's trigger event is included here. - * - * Generated from protobuf field repeated .google.cloud.dialogflow.v2.TriggerEvent trigger_events = 6 [(.google.api.field_behavior) = OPTIONAL]; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getTriggerEvents() - { - return $this->trigger_events; - } - - /** - * Optional. A list of trigger events. Generator will be triggered only if - * it's trigger event is included here. - * - * Generated from protobuf field repeated .google.cloud.dialogflow.v2.TriggerEvent trigger_events = 6 [(.google.api.field_behavior) = OPTIONAL]; - * @param array|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setTriggerEvents($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::ENUM, \Google\Cloud\Dialogflow\V2\TriggerEvent::class); - $this->trigger_events = $arr; - - return $this; - } - - /** - * @return string - */ - public function getGeneratorResource() - { - return $this->whichOneof("generator_resource"); - } - -} - diff --git a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/GenerateStatelessSuggestionResponse.php b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/GenerateStatelessSuggestionResponse.php deleted file mode 100644 index 304f86b0165d..000000000000 --- a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/GenerateStatelessSuggestionResponse.php +++ /dev/null @@ -1,78 +0,0 @@ -google.cloud.dialogflow.v2.GenerateStatelessSuggestionResponse - */ -class GenerateStatelessSuggestionResponse extends \Google\Protobuf\Internal\Message -{ - /** - * Required. Generated suggestion for a conversation. - * - * Generated from protobuf field .google.cloud.dialogflow.v2.GeneratorSuggestion generator_suggestion = 1 [(.google.api.field_behavior) = REQUIRED]; - */ - protected $generator_suggestion = null; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type \Google\Cloud\Dialogflow\V2\GeneratorSuggestion $generator_suggestion - * Required. Generated suggestion for a conversation. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Dialogflow\V2\Conversation::initOnce(); - parent::__construct($data); - } - - /** - * Required. Generated suggestion for a conversation. - * - * Generated from protobuf field .google.cloud.dialogflow.v2.GeneratorSuggestion generator_suggestion = 1 [(.google.api.field_behavior) = REQUIRED]; - * @return \Google\Cloud\Dialogflow\V2\GeneratorSuggestion|null - */ - public function getGeneratorSuggestion() - { - return $this->generator_suggestion; - } - - public function hasGeneratorSuggestion() - { - return isset($this->generator_suggestion); - } - - public function clearGeneratorSuggestion() - { - unset($this->generator_suggestion); - } - - /** - * Required. Generated suggestion for a conversation. - * - * Generated from protobuf field .google.cloud.dialogflow.v2.GeneratorSuggestion generator_suggestion = 1 [(.google.api.field_behavior) = REQUIRED]; - * @param \Google\Cloud\Dialogflow\V2\GeneratorSuggestion $var - * @return $this - */ - public function setGeneratorSuggestion($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Dialogflow\V2\GeneratorSuggestion::class); - $this->generator_suggestion = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/GenerateStatelessSummaryRequest.php b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/GenerateStatelessSummaryRequest.php deleted file mode 100644 index 444878d8939e..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; - /** - * Optional. The name of the latest conversation message used as context for - * generating a Summary. If empty, the latest message of the conversation will - * be used. The format is specific to the user and the names of the messages - * provided. - * - * Generated from protobuf field string latest_message = 3 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { - */ - protected $latest_message = ''; - /** - * Optional. Max number of messages prior to and including - * [latest_message] to use as context when compiling the - * suggestion. By default 500 and at most 1000. - * - * Generated from protobuf field int32 max_context_size = 4 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $max_context_size = 0; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type \Google\Cloud\Dialogflow\V2\GenerateStatelessSummaryRequest\MinimalConversation $stateless_conversation - * Required. The conversation to suggest a summary for. - * @type \Google\Cloud\Dialogflow\V2\ConversationProfile $conversation_profile - * Required. A ConversationProfile containing information required for Summary - * generation. - * Required fields: {language_code, security_settings} - * Optional fields: {agent_assistant_config} - * @type string $latest_message - * Optional. The name of the latest conversation message used as context for - * generating a Summary. If empty, the latest message of the conversation will - * be used. The format is specific to the user and the names of the messages - * provided. - * @type int $max_context_size - * Optional. Max number of messages prior to and including - * [latest_message] to use as context when compiling the - * suggestion. By default 500 and at most 1000. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Dialogflow\V2\Conversation::initOnce(); - parent::__construct($data); - } - - /** - * Required. The conversation to suggest a summary for. - * - * Generated from protobuf field .google.cloud.dialogflow.v2.GenerateStatelessSummaryRequest.MinimalConversation stateless_conversation = 1 [(.google.api.field_behavior) = REQUIRED]; - * @return \Google\Cloud\Dialogflow\V2\GenerateStatelessSummaryRequest\MinimalConversation|null - */ - public function getStatelessConversation() - { - return $this->stateless_conversation; - } - - public function hasStatelessConversation() - { - return isset($this->stateless_conversation); - } - - public function clearStatelessConversation() - { - unset($this->stateless_conversation); - } - - /** - * Required. The conversation to suggest a summary for. - * - * Generated from protobuf field .google.cloud.dialogflow.v2.GenerateStatelessSummaryRequest.MinimalConversation stateless_conversation = 1 [(.google.api.field_behavior) = REQUIRED]; - * @param \Google\Cloud\Dialogflow\V2\GenerateStatelessSummaryRequest\MinimalConversation $var - * @return $this - */ - public function setStatelessConversation($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Dialogflow\V2\GenerateStatelessSummaryRequest\MinimalConversation::class); - $this->stateless_conversation = $var; - - return $this; - } - - /** - * Required. A ConversationProfile containing information required for Summary - * generation. - * Required fields: {language_code, security_settings} - * Optional fields: {agent_assistant_config} - * - * Generated from protobuf field .google.cloud.dialogflow.v2.ConversationProfile conversation_profile = 2 [(.google.api.field_behavior) = REQUIRED]; - * @return \Google\Cloud\Dialogflow\V2\ConversationProfile|null - */ - public function getConversationProfile() - { - return $this->conversation_profile; - } - - public function hasConversationProfile() - { - return isset($this->conversation_profile); - } - - public function clearConversationProfile() - { - unset($this->conversation_profile); - } - - /** - * Required. A ConversationProfile containing information required for Summary - * generation. - * Required fields: {language_code, security_settings} - * Optional fields: {agent_assistant_config} - * - * Generated from protobuf field .google.cloud.dialogflow.v2.ConversationProfile conversation_profile = 2 [(.google.api.field_behavior) = REQUIRED]; - * @param \Google\Cloud\Dialogflow\V2\ConversationProfile $var - * @return $this - */ - public function setConversationProfile($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Dialogflow\V2\ConversationProfile::class); - $this->conversation_profile = $var; - - return $this; - } - - /** - * Optional. The name of the latest conversation message used as context for - * generating a Summary. If empty, the latest message of the conversation will - * be used. The format is specific to the user and the names of the messages - * provided. - * - * Generated from protobuf field string latest_message = 3 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { - * @return string - */ - public function getLatestMessage() - { - return $this->latest_message; - } - - /** - * Optional. The name of the latest conversation message used as context for - * generating a Summary. If empty, the latest message of the conversation will - * be used. The format is specific to the user and the names of the messages - * provided. - * - * Generated from protobuf field string latest_message = 3 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { - * @param string $var - * @return $this - */ - public function setLatestMessage($var) - { - GPBUtil::checkString($var, True); - $this->latest_message = $var; - - return $this; - } - - /** - * Optional. Max number of messages prior to and including - * [latest_message] to use as context when compiling the - * suggestion. By default 500 and at most 1000. - * - * Generated from protobuf field int32 max_context_size = 4 [(.google.api.field_behavior) = OPTIONAL]; - * @return int - */ - public function getMaxContextSize() - { - return $this->max_context_size; - } - - /** - * Optional. Max number of messages prior to and including - * [latest_message] to use as context when compiling the - * suggestion. By default 500 and at most 1000. - * - * Generated from protobuf field int32 max_context_size = 4 [(.google.api.field_behavior) = OPTIONAL]; - * @param int $var - * @return $this - */ - public function setMaxContextSize($var) - { - GPBUtil::checkInt32($var); - $this->max_context_size = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/GenerateStatelessSummaryRequest/MinimalConversation.php b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/GenerateStatelessSummaryRequest/MinimalConversation.php 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 17d7ddc9e7ef..000000000000 --- a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/GenerateStatelessSummaryResponse/Summary.php +++ /dev/null @@ -1,150 +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; - /** - * The baseline model version used to generate this summary. It is empty if - * a baseline model was not used to generate this summary. - * - * Generated from protobuf field string baseline_model_version = 4; - */ - protected $baseline_model_version = ''; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $text - * The summary content that is concatenated into one string. - * @type array|\Google\Protobuf\Internal\MapField $text_sections - * The summary content that is divided into sections. The key is the - * section's name and the value is the section's content. There is no - * specific format for the key or value. - * @type string $baseline_model_version - * The baseline model version used to generate this summary. It is empty if - * a baseline model was not used to generate this summary. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Dialogflow\V2\Conversation::initOnce(); - parent::__construct($data); - } - - /** - * The summary content that is concatenated into one string. - * - * Generated from protobuf field string text = 1; - * @return string - */ - public function getText() - { - return $this->text; - } - - /** - * The summary content that is concatenated into one string. - * - * Generated from protobuf field string text = 1; - * @param string $var - * @return $this - */ - public function setText($var) - { - GPBUtil::checkString($var, True); - $this->text = $var; - - return $this; - } - - /** - * The summary content that is divided into sections. The key is the - * section's name and the value is the section's content. There is no - * specific format for the key or value. - * - * Generated from protobuf field map text_sections = 2; - * @return \Google\Protobuf\Internal\MapField - */ - public function getTextSections() - { - return $this->text_sections; - } - - /** - * The summary content that is divided into sections. The key is the - * section's name and the value is the section's content. There is no - * specific format for the key or value. - * - * Generated from protobuf field map text_sections = 2; - * @param array|\Google\Protobuf\Internal\MapField $var - * @return $this - */ - public function setTextSections($var) - { - $arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::STRING, \Google\Protobuf\Internal\GPBType::STRING); - $this->text_sections = $arr; - - return $this; - } - - /** - * The baseline model version used to generate this summary. It is empty if - * a baseline model was not used to generate this summary. - * - * Generated from protobuf field string baseline_model_version = 4; - * @return string - */ - public function getBaselineModelVersion() - { - return $this->baseline_model_version; - } - - /** - * The baseline model version used to generate this summary. It is empty if - * a baseline model was not used to generate this summary. - * - * Generated from protobuf field string baseline_model_version = 4; - * @param string $var - * @return $this - */ - public function setBaselineModelVersion($var) - { - GPBUtil::checkString($var, True); - $this->baseline_model_version = $var; - - return $this; - } - -} - -// 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/Generator.php b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/Generator.php deleted file mode 100644 index ccfa4554f07a..000000000000 --- a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/Generator.php +++ /dev/null @@ -1,317 +0,0 @@ -google.cloud.dialogflow.v2.Generator - */ -class Generator extends \Google\Protobuf\Internal\Message -{ - /** - * Output only. Identifier. The resource name of the generator. Format: - * `projects//locations//generators/` - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = IDENTIFIER, (.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $name = ''; - /** - * Optional. Human readable description of the generator. - * - * Generated from protobuf field string description = 2 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $description = ''; - /** - * Optional. Inference parameters for this generator. - * - * Generated from protobuf field .google.cloud.dialogflow.v2.InferenceParameter inference_parameter = 4 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $inference_parameter = null; - /** - * Optional. The trigger event of the generator. It defines when the generator - * is triggered in a conversation. - * - * Generated from protobuf field .google.cloud.dialogflow.v2.TriggerEvent trigger_event = 5 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $trigger_event = 0; - /** - * Output only. Creation time of this generator. - * - * Generated from protobuf field .google.protobuf.Timestamp create_time = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $create_time = null; - /** - * Output only. Update time of this generator. - * - * Generated from protobuf field .google.protobuf.Timestamp update_time = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $update_time = null; - protected $context; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $name - * Output only. Identifier. The resource name of the generator. Format: - * `projects//locations//generators/` - * @type string $description - * Optional. Human readable description of the generator. - * @type \Google\Cloud\Dialogflow\V2\SummarizationContext $summarization_context - * Input of prebuilt Summarization feature. - * @type \Google\Cloud\Dialogflow\V2\InferenceParameter $inference_parameter - * Optional. Inference parameters for this generator. - * @type int $trigger_event - * Optional. The trigger event of the generator. It defines when the generator - * is triggered in a conversation. - * @type \Google\Protobuf\Timestamp $create_time - * Output only. Creation time of this generator. - * @type \Google\Protobuf\Timestamp $update_time - * Output only. Update time of this generator. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Dialogflow\V2\Generator::initOnce(); - parent::__construct($data); - } - - /** - * Output only. Identifier. The resource name of the generator. Format: - * `projects//locations//generators/` - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = IDENTIFIER, (.google.api.field_behavior) = OUTPUT_ONLY]; - * @return string - */ - public function getName() - { - return $this->name; - } - - /** - * Output only. Identifier. The resource name of the generator. Format: - * `projects//locations//generators/` - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = IDENTIFIER, (.google.api.field_behavior) = OUTPUT_ONLY]; - * @param string $var - * @return $this - */ - public function setName($var) - { - GPBUtil::checkString($var, True); - $this->name = $var; - - return $this; - } - - /** - * Optional. Human readable description of the generator. - * - * Generated from protobuf field string description = 2 [(.google.api.field_behavior) = OPTIONAL]; - * @return string - */ - public function getDescription() - { - return $this->description; - } - - /** - * Optional. Human readable description of the generator. - * - * Generated from protobuf field string description = 2 [(.google.api.field_behavior) = OPTIONAL]; - * @param string $var - * @return $this - */ - public function setDescription($var) - { - GPBUtil::checkString($var, True); - $this->description = $var; - - return $this; - } - - /** - * Input of prebuilt Summarization feature. - * - * Generated from protobuf field .google.cloud.dialogflow.v2.SummarizationContext summarization_context = 13; - * @return \Google\Cloud\Dialogflow\V2\SummarizationContext|null - */ - public function getSummarizationContext() - { - return $this->readOneof(13); - } - - public function hasSummarizationContext() - { - return $this->hasOneof(13); - } - - /** - * Input of prebuilt Summarization feature. - * - * Generated from protobuf field .google.cloud.dialogflow.v2.SummarizationContext summarization_context = 13; - * @param \Google\Cloud\Dialogflow\V2\SummarizationContext $var - * @return $this - */ - public function setSummarizationContext($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Dialogflow\V2\SummarizationContext::class); - $this->writeOneof(13, $var); - - return $this; - } - - /** - * Optional. Inference parameters for this generator. - * - * Generated from protobuf field .google.cloud.dialogflow.v2.InferenceParameter inference_parameter = 4 [(.google.api.field_behavior) = OPTIONAL]; - * @return \Google\Cloud\Dialogflow\V2\InferenceParameter|null - */ - public function getInferenceParameter() - { - return $this->inference_parameter; - } - - public function hasInferenceParameter() - { - return isset($this->inference_parameter); - } - - public function clearInferenceParameter() - { - unset($this->inference_parameter); - } - - /** - * Optional. Inference parameters for this generator. - * - * Generated from protobuf field .google.cloud.dialogflow.v2.InferenceParameter inference_parameter = 4 [(.google.api.field_behavior) = OPTIONAL]; - * @param \Google\Cloud\Dialogflow\V2\InferenceParameter $var - * @return $this - */ - public function setInferenceParameter($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Dialogflow\V2\InferenceParameter::class); - $this->inference_parameter = $var; - - return $this; - } - - /** - * Optional. The trigger event of the generator. It defines when the generator - * is triggered in a conversation. - * - * Generated from protobuf field .google.cloud.dialogflow.v2.TriggerEvent trigger_event = 5 [(.google.api.field_behavior) = OPTIONAL]; - * @return int - */ - public function getTriggerEvent() - { - return $this->trigger_event; - } - - /** - * Optional. The trigger event of the generator. It defines when the generator - * is triggered in a conversation. - * - * Generated from protobuf field .google.cloud.dialogflow.v2.TriggerEvent trigger_event = 5 [(.google.api.field_behavior) = OPTIONAL]; - * @param int $var - * @return $this - */ - public function setTriggerEvent($var) - { - GPBUtil::checkEnum($var, \Google\Cloud\Dialogflow\V2\TriggerEvent::class); - $this->trigger_event = $var; - - return $this; - } - - /** - * Output only. Creation time of this generator. - * - * Generated from protobuf field .google.protobuf.Timestamp create_time = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return \Google\Protobuf\Timestamp|null - */ - public function getCreateTime() - { - return $this->create_time; - } - - public function hasCreateTime() - { - return isset($this->create_time); - } - - public function clearCreateTime() - { - unset($this->create_time); - } - - /** - * Output only. Creation time of this generator. - * - * Generated from protobuf field .google.protobuf.Timestamp create_time = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param \Google\Protobuf\Timestamp $var - * @return $this - */ - public function setCreateTime($var) - { - GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); - $this->create_time = $var; - - return $this; - } - - /** - * Output only. Update time of this generator. - * - * Generated from protobuf field .google.protobuf.Timestamp update_time = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return \Google\Protobuf\Timestamp|null - */ - public function getUpdateTime() - { - return $this->update_time; - } - - public function hasUpdateTime() - { - return isset($this->update_time); - } - - public function clearUpdateTime() - { - unset($this->update_time); - } - - /** - * Output only. Update time of this generator. - * - * Generated from protobuf field .google.protobuf.Timestamp update_time = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param \Google\Protobuf\Timestamp $var - * @return $this - */ - public function setUpdateTime($var) - { - GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); - $this->update_time = $var; - - return $this; - } - - /** - * @return string - */ - public function getContext() - { - return $this->whichOneof("context"); - } - -} - diff --git a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/GeneratorSuggestion.php b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/GeneratorSuggestion.php deleted file mode 100644 index 87774c2b0e4c..000000000000 --- a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/GeneratorSuggestion.php +++ /dev/null @@ -1,75 +0,0 @@ -google.cloud.dialogflow.v2.GeneratorSuggestion - */ -class GeneratorSuggestion extends \Google\Protobuf\Internal\Message -{ - protected $suggestion; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type \Google\Cloud\Dialogflow\V2\SummarySuggestion $summary_suggestion - * Optional. Suggested summary. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Dialogflow\V2\Generator::initOnce(); - parent::__construct($data); - } - - /** - * Optional. Suggested summary. - * - * Generated from protobuf field .google.cloud.dialogflow.v2.SummarySuggestion summary_suggestion = 2 [(.google.api.field_behavior) = OPTIONAL]; - * @return \Google\Cloud\Dialogflow\V2\SummarySuggestion|null - */ - public function getSummarySuggestion() - { - return $this->readOneof(2); - } - - public function hasSummarySuggestion() - { - return $this->hasOneof(2); - } - - /** - * Optional. Suggested summary. - * - * Generated from protobuf field .google.cloud.dialogflow.v2.SummarySuggestion summary_suggestion = 2 [(.google.api.field_behavior) = OPTIONAL]; - * @param \Google\Cloud\Dialogflow\V2\SummarySuggestion $var - * @return $this - */ - public function setSummarySuggestion($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Dialogflow\V2\SummarySuggestion::class); - $this->writeOneof(2, $var); - - return $this; - } - - /** - * @return string - */ - public function getSuggestion() - { - return $this->whichOneof("suggestion"); - } - -} - 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/GetEncryptionSpecRequest.php b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/GetEncryptionSpecRequest.php deleted file mode 100644 index df230e6800c5..000000000000 --- a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/GetEncryptionSpecRequest.php +++ /dev/null @@ -1,81 +0,0 @@ -google.cloud.dialogflow.v2.GetEncryptionSpecRequest - */ -class GetEncryptionSpecRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The name of the encryption spec resource to get. - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - */ - protected $name = ''; - - /** - * @param string $name Required. The name of the encryption spec resource to get. Please see - * {@see EncryptionSpecServiceClient::encryptionSpecName()} for help formatting this field. - * - * @return \Google\Cloud\Dialogflow\V2\GetEncryptionSpecRequest - * - * @experimental - */ - public static function build(string $name): self - { - return (new self()) - ->setName($name); - } - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $name - * Required. The name of the encryption spec resource to get. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Dialogflow\V2\EncryptionSpec::initOnce(); - parent::__construct($data); - } - - /** - * Required. The name of the encryption spec resource to get. - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @return string - */ - public function getName() - { - return $this->name; - } - - /** - * Required. The name of the encryption spec resource to get. - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @param string $var - * @return $this - */ - public function setName($var) - { - GPBUtil::checkString($var, True); - $this->name = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/GetEntityTypeRequest.php b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/GetEntityTypeRequest.php 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/GetGeneratorRequest.php b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/GetGeneratorRequest.php deleted file mode 100644 index 4afab4140d9b..000000000000 --- a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/GetGeneratorRequest.php +++ /dev/null @@ -1,86 +0,0 @@ -google.cloud.dialogflow.v2.GetGeneratorRequest - */ -class GetGeneratorRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The generator resource name to retrieve. Format: - * `projects//locations/`/generators/` - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - */ - protected $name = ''; - - /** - * @param string $name Required. The generator resource name to retrieve. Format: - * `projects//locations/`/generators/` - * Please see {@see GeneratorsClient::generatorName()} for help formatting this field. - * - * @return \Google\Cloud\Dialogflow\V2\GetGeneratorRequest - * - * @experimental - */ - public static function build(string $name): self - { - return (new self()) - ->setName($name); - } - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $name - * Required. The generator resource name to retrieve. Format: - * `projects//locations/`/generators/` - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Dialogflow\V2\Generator::initOnce(); - parent::__construct($data); - } - - /** - * Required. The generator resource name to retrieve. Format: - * `projects//locations/`/generators/` - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @return string - */ - public function getName() - { - return $this->name; - } - - /** - * Required. The generator resource name to retrieve. Format: - * `projects//locations/`/generators/` - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @param string $var - * @return $this - */ - public function setName($var) - { - GPBUtil::checkString($var, True); - $this->name = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/GetIntentRequest.php b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/GetIntentRequest.php 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 09dd830b6145..000000000000 --- a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/HumanAgentAssistantConfig/SuggestionConfig.php +++ /dev/null @@ -1,236 +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; - /** - * Optional. List of various generator resource names used in the - * conversation profile. - * - * Generated from protobuf field repeated string generators = 4 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { - */ - private $generators; - /** - * Optional. When disable_high_latency_features_sync_delivery is true and - * using the AnalyzeContent API, we will not deliver the responses from high - * latency features in the API response. The - * human_agent_assistant_config.notification_config must be configured and - * enable_event_based_suggestion must be set to true to receive the - * responses from high latency features in Pub/Sub. High latency feature(s): - * KNOWLEDGE_ASSIST - * - * Generated from protobuf field bool disable_high_latency_features_sync_delivery = 5 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $disable_high_latency_features_sync_delivery = false; - - /** - * 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. - * @type array|\Google\Protobuf\Internal\RepeatedField $generators - * Optional. List of various generator resource names used in the - * conversation profile. - * @type bool $disable_high_latency_features_sync_delivery - * Optional. When disable_high_latency_features_sync_delivery is true and - * using the AnalyzeContent API, we will not deliver the responses from high - * latency features in the API response. The - * human_agent_assistant_config.notification_config must be configured and - * enable_event_based_suggestion must be set to true to receive the - * responses from high latency features in Pub/Sub. High latency feature(s): - * KNOWLEDGE_ASSIST - * } - */ - 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; - } - - /** - * Optional. List of various generator resource names used in the - * conversation profile. - * - * Generated from protobuf field repeated string generators = 4 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getGenerators() - { - return $this->generators; - } - - /** - * Optional. List of various generator resource names used in the - * conversation profile. - * - * Generated from protobuf field repeated string generators = 4 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { - * @param array|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setGenerators($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); - $this->generators = $arr; - - return $this; - } - - /** - * Optional. When disable_high_latency_features_sync_delivery is true and - * using the AnalyzeContent API, we will not deliver the responses from high - * latency features in the API response. The - * human_agent_assistant_config.notification_config must be configured and - * enable_event_based_suggestion must be set to true to receive the - * responses from high latency features in Pub/Sub. High latency feature(s): - * KNOWLEDGE_ASSIST - * - * Generated from protobuf field bool disable_high_latency_features_sync_delivery = 5 [(.google.api.field_behavior) = OPTIONAL]; - * @return bool - */ - public function getDisableHighLatencyFeaturesSyncDelivery() - { - return $this->disable_high_latency_features_sync_delivery; - } - - /** - * Optional. When disable_high_latency_features_sync_delivery is true and - * using the AnalyzeContent API, we will not deliver the responses from high - * latency features in the API response. The - * human_agent_assistant_config.notification_config must be configured and - * enable_event_based_suggestion must be set to true to receive the - * responses from high latency features in Pub/Sub. High latency feature(s): - * KNOWLEDGE_ASSIST - * - * Generated from protobuf field bool disable_high_latency_features_sync_delivery = 5 [(.google.api.field_behavior) = OPTIONAL]; - * @param bool $var - * @return $this - */ - public function setDisableHighLatencyFeaturesSyncDelivery($var) - { - GPBUtil::checkBool($var); - $this->disable_high_latency_features_sync_delivery = $var; - - return $this; - } - -} - -// 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 166f22dd13f6..000000000000 --- a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/HumanAgentAssistantConfig/SuggestionFeatureConfig.php +++ /dev/null @@ -1,466 +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, - * KNOWLEDGE_ASSIST. - * - * Generated from protobuf field bool enable_event_based_suggestion = 3; - */ - protected $enable_event_based_suggestion = false; - /** - * Optional. Disable the logging of search queries sent by human agents. It - * can prevent those queries from being stored at answer records. - * Supported features: KNOWLEDGE_SEARCH. - * - * Generated from protobuf field bool disable_agent_query_logging = 14 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $disable_agent_query_logging = false; - /** - * Optional. Enable query suggestion even if we can't find its answer. - * By default, queries are suggested only if we find its answer. - * Supported features: KNOWLEDGE_ASSIST - * - * Generated from protobuf field bool enable_query_suggestion_when_no_answer = 15 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $enable_query_suggestion_when_no_answer = false; - /** - * Optional. Enable including conversation context during query answer - * generation. Supported features: KNOWLEDGE_SEARCH. - * - * Generated from protobuf field bool enable_conversation_augmented_query = 16 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $enable_conversation_augmented_query = false; - /** - * Optional. Enable query suggestion only. - * Supported features: KNOWLEDGE_ASSIST - * - * Generated from protobuf field bool enable_query_suggestion_only = 17 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $enable_query_suggestion_only = false; - /** - * Settings of suggestion trigger. - * Currently, only ARTICLE_SUGGESTION and FAQ will use this field. - * - * Generated from protobuf field .google.cloud.dialogflow.v2.HumanAgentAssistantConfig.SuggestionTriggerSettings suggestion_trigger_settings = 10; - */ - protected $suggestion_trigger_settings = null; - /** - * Configs of query. - * - * Generated from protobuf field .google.cloud.dialogflow.v2.HumanAgentAssistantConfig.SuggestionQueryConfig query_config = 6; - */ - protected $query_config = null; - /** - * Configs of custom conversation model. - * - * Generated from protobuf field .google.cloud.dialogflow.v2.HumanAgentAssistantConfig.ConversationModelConfig conversation_model_config = 7; - */ - protected $conversation_model_config = null; - /** - * Configs for processing conversation. - * - * Generated from protobuf field .google.cloud.dialogflow.v2.HumanAgentAssistantConfig.ConversationProcessConfig conversation_process_config = 8; - */ - protected $conversation_process_config = null; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type \Google\Cloud\Dialogflow\V2\SuggestionFeature $suggestion_feature - * The suggestion feature. - * @type bool $enable_event_based_suggestion - * Automatically iterates all participants and tries to compile - * suggestions. - * Supported features: ARTICLE_SUGGESTION, FAQ, DIALOGFLOW_ASSIST, - * KNOWLEDGE_ASSIST. - * @type bool $disable_agent_query_logging - * Optional. Disable the logging of search queries sent by human agents. It - * can prevent those queries from being stored at answer records. - * Supported features: KNOWLEDGE_SEARCH. - * @type bool $enable_query_suggestion_when_no_answer - * Optional. Enable query suggestion even if we can't find its answer. - * By default, queries are suggested only if we find its answer. - * Supported features: KNOWLEDGE_ASSIST - * @type bool $enable_conversation_augmented_query - * Optional. Enable including conversation context during query answer - * generation. Supported features: KNOWLEDGE_SEARCH. - * @type bool $enable_query_suggestion_only - * Optional. Enable query suggestion only. - * Supported features: KNOWLEDGE_ASSIST - * @type \Google\Cloud\Dialogflow\V2\HumanAgentAssistantConfig\SuggestionTriggerSettings $suggestion_trigger_settings - * Settings of suggestion trigger. - * Currently, only ARTICLE_SUGGESTION and FAQ will use this field. - * @type \Google\Cloud\Dialogflow\V2\HumanAgentAssistantConfig\SuggestionQueryConfig $query_config - * Configs of query. - * @type \Google\Cloud\Dialogflow\V2\HumanAgentAssistantConfig\ConversationModelConfig $conversation_model_config - * Configs of custom conversation model. - * @type \Google\Cloud\Dialogflow\V2\HumanAgentAssistantConfig\ConversationProcessConfig $conversation_process_config - * Configs for processing conversation. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Dialogflow\V2\ConversationProfile::initOnce(); - parent::__construct($data); - } - - /** - * The suggestion feature. - * - * Generated from protobuf field .google.cloud.dialogflow.v2.SuggestionFeature suggestion_feature = 5; - * @return \Google\Cloud\Dialogflow\V2\SuggestionFeature|null - */ - public function getSuggestionFeature() - { - return $this->suggestion_feature; - } - - public function hasSuggestionFeature() - { - return isset($this->suggestion_feature); - } - - public function clearSuggestionFeature() - { - unset($this->suggestion_feature); - } - - /** - * The suggestion feature. - * - * Generated from protobuf field .google.cloud.dialogflow.v2.SuggestionFeature suggestion_feature = 5; - * @param \Google\Cloud\Dialogflow\V2\SuggestionFeature $var - * @return $this - */ - public function setSuggestionFeature($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Dialogflow\V2\SuggestionFeature::class); - $this->suggestion_feature = $var; - - return $this; - } - - /** - * Automatically iterates all participants and tries to compile - * suggestions. - * Supported features: ARTICLE_SUGGESTION, FAQ, DIALOGFLOW_ASSIST, - * KNOWLEDGE_ASSIST. - * - * Generated from protobuf field bool enable_event_based_suggestion = 3; - * @return bool - */ - public function getEnableEventBasedSuggestion() - { - return $this->enable_event_based_suggestion; - } - - /** - * Automatically iterates all participants and tries to compile - * suggestions. - * Supported features: ARTICLE_SUGGESTION, FAQ, DIALOGFLOW_ASSIST, - * KNOWLEDGE_ASSIST. - * - * Generated from protobuf field bool enable_event_based_suggestion = 3; - * @param bool $var - * @return $this - */ - public function setEnableEventBasedSuggestion($var) - { - GPBUtil::checkBool($var); - $this->enable_event_based_suggestion = $var; - - return $this; - } - - /** - * Optional. Disable the logging of search queries sent by human agents. It - * can prevent those queries from being stored at answer records. - * Supported features: KNOWLEDGE_SEARCH. - * - * Generated from protobuf field bool disable_agent_query_logging = 14 [(.google.api.field_behavior) = OPTIONAL]; - * @return bool - */ - public function getDisableAgentQueryLogging() - { - return $this->disable_agent_query_logging; - } - - /** - * Optional. Disable the logging of search queries sent by human agents. It - * can prevent those queries from being stored at answer records. - * Supported features: KNOWLEDGE_SEARCH. - * - * Generated from protobuf field bool disable_agent_query_logging = 14 [(.google.api.field_behavior) = OPTIONAL]; - * @param bool $var - * @return $this - */ - public function setDisableAgentQueryLogging($var) - { - GPBUtil::checkBool($var); - $this->disable_agent_query_logging = $var; - - return $this; - } - - /** - * Optional. Enable query suggestion even if we can't find its answer. - * By default, queries are suggested only if we find its answer. - * Supported features: KNOWLEDGE_ASSIST - * - * Generated from protobuf field bool enable_query_suggestion_when_no_answer = 15 [(.google.api.field_behavior) = OPTIONAL]; - * @return bool - */ - public function getEnableQuerySuggestionWhenNoAnswer() - { - return $this->enable_query_suggestion_when_no_answer; - } - - /** - * Optional. Enable query suggestion even if we can't find its answer. - * By default, queries are suggested only if we find its answer. - * Supported features: KNOWLEDGE_ASSIST - * - * Generated from protobuf field bool enable_query_suggestion_when_no_answer = 15 [(.google.api.field_behavior) = OPTIONAL]; - * @param bool $var - * @return $this - */ - public function setEnableQuerySuggestionWhenNoAnswer($var) - { - GPBUtil::checkBool($var); - $this->enable_query_suggestion_when_no_answer = $var; - - return $this; - } - - /** - * Optional. Enable including conversation context during query answer - * generation. Supported features: KNOWLEDGE_SEARCH. - * - * Generated from protobuf field bool enable_conversation_augmented_query = 16 [(.google.api.field_behavior) = OPTIONAL]; - * @return bool - */ - public function getEnableConversationAugmentedQuery() - { - return $this->enable_conversation_augmented_query; - } - - /** - * Optional. Enable including conversation context during query answer - * generation. Supported features: KNOWLEDGE_SEARCH. - * - * Generated from protobuf field bool enable_conversation_augmented_query = 16 [(.google.api.field_behavior) = OPTIONAL]; - * @param bool $var - * @return $this - */ - public function setEnableConversationAugmentedQuery($var) - { - GPBUtil::checkBool($var); - $this->enable_conversation_augmented_query = $var; - - return $this; - } - - /** - * Optional. Enable query suggestion only. - * Supported features: KNOWLEDGE_ASSIST - * - * Generated from protobuf field bool enable_query_suggestion_only = 17 [(.google.api.field_behavior) = OPTIONAL]; - * @return bool - */ - public function getEnableQuerySuggestionOnly() - { - return $this->enable_query_suggestion_only; - } - - /** - * Optional. Enable query suggestion only. - * Supported features: KNOWLEDGE_ASSIST - * - * Generated from protobuf field bool enable_query_suggestion_only = 17 [(.google.api.field_behavior) = OPTIONAL]; - * @param bool $var - * @return $this - */ - public function setEnableQuerySuggestionOnly($var) - { - GPBUtil::checkBool($var); - $this->enable_query_suggestion_only = $var; - - return $this; - } - - /** - * 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 c17f9878b001..000000000000 --- a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/HumanAgentAssistantConfig/SuggestionQueryConfig.php +++ /dev/null @@ -1,374 +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; - /** - * Optional. The customized sections chosen to return when requesting a - * summary of a conversation. - * - * Generated from protobuf field .google.cloud.dialogflow.v2.HumanAgentAssistantConfig.SuggestionQueryConfig.Sections sections = 8 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $sections = null; - protected $query_source; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type \Google\Cloud\Dialogflow\V2\HumanAgentAssistantConfig\SuggestionQueryConfig\KnowledgeBaseQuerySource $knowledge_base_query_source - * Query from knowledgebase. It is used by: - * ARTICLE_SUGGESTION, FAQ. - * @type \Google\Cloud\Dialogflow\V2\HumanAgentAssistantConfig\SuggestionQueryConfig\DocumentQuerySource $document_query_source - * Query from knowledge base document. It is used by: - * SMART_REPLY, SMART_COMPOSE. - * @type \Google\Cloud\Dialogflow\V2\HumanAgentAssistantConfig\SuggestionQueryConfig\DialogflowQuerySource $dialogflow_query_source - * Query from Dialogflow agent. It is used by DIALOGFLOW_ASSIST. - * @type int $max_results - * Maximum number of results to return. Currently, if unset, defaults to 10. - * And the max number is 20. - * @type float $confidence_threshold - * Confidence threshold of query result. - * Agent Assist gives each suggestion a score in the range [0.0, 1.0], based - * on the relevance between the suggestion and the current conversation - * context. A score of 0.0 has no relevance, while a score of 1.0 has high - * relevance. Only suggestions with a score greater than or equal to the - * value of this field are included in the results. - * For a baseline model (the default), the recommended value is in the range - * [0.05, 0.1]. - * For a custom model, there is no recommended value. Tune this value by - * starting from a very low value and slowly increasing until you have - * desired results. - * If this field is not set, it defaults to 0.0, which means that all - * suggestions are returned. - * Supported features: ARTICLE_SUGGESTION, FAQ, SMART_REPLY, SMART_COMPOSE, - * KNOWLEDGE_SEARCH, KNOWLEDGE_ASSIST, ENTITY_EXTRACTION. - * @type \Google\Cloud\Dialogflow\V2\HumanAgentAssistantConfig\SuggestionQueryConfig\ContextFilterSettings $context_filter_settings - * Determines how recent conversation context is filtered when generating - * suggestions. If unspecified, no messages will be dropped. - * @type \Google\Cloud\Dialogflow\V2\HumanAgentAssistantConfig\SuggestionQueryConfig\Sections $sections - * Optional. The customized sections chosen to return when requesting a - * summary of a conversation. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Dialogflow\V2\ConversationProfile::initOnce(); - parent::__construct($data); - } - - /** - * Query from knowledgebase. It is used by: - * ARTICLE_SUGGESTION, FAQ. - * - * Generated from protobuf field .google.cloud.dialogflow.v2.HumanAgentAssistantConfig.SuggestionQueryConfig.KnowledgeBaseQuerySource knowledge_base_query_source = 1; - * @return \Google\Cloud\Dialogflow\V2\HumanAgentAssistantConfig\SuggestionQueryConfig\KnowledgeBaseQuerySource|null - */ - public function getKnowledgeBaseQuerySource() - { - return $this->readOneof(1); - } - - public function hasKnowledgeBaseQuerySource() - { - return $this->hasOneof(1); - } - - /** - * Query from knowledgebase. It is used by: - * ARTICLE_SUGGESTION, FAQ. - * - * Generated from protobuf field .google.cloud.dialogflow.v2.HumanAgentAssistantConfig.SuggestionQueryConfig.KnowledgeBaseQuerySource knowledge_base_query_source = 1; - * @param \Google\Cloud\Dialogflow\V2\HumanAgentAssistantConfig\SuggestionQueryConfig\KnowledgeBaseQuerySource $var - * @return $this - */ - public function setKnowledgeBaseQuerySource($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Dialogflow\V2\HumanAgentAssistantConfig\SuggestionQueryConfig\KnowledgeBaseQuerySource::class); - $this->writeOneof(1, $var); - - return $this; - } - - /** - * Query from knowledge base document. It is used by: - * SMART_REPLY, SMART_COMPOSE. - * - * Generated from protobuf field .google.cloud.dialogflow.v2.HumanAgentAssistantConfig.SuggestionQueryConfig.DocumentQuerySource document_query_source = 2; - * @return \Google\Cloud\Dialogflow\V2\HumanAgentAssistantConfig\SuggestionQueryConfig\DocumentQuerySource|null - */ - public function getDocumentQuerySource() - { - return $this->readOneof(2); - } - - public function hasDocumentQuerySource() - { - return $this->hasOneof(2); - } - - /** - * Query from knowledge base document. It is used by: - * SMART_REPLY, SMART_COMPOSE. - * - * Generated from protobuf field .google.cloud.dialogflow.v2.HumanAgentAssistantConfig.SuggestionQueryConfig.DocumentQuerySource document_query_source = 2; - * @param \Google\Cloud\Dialogflow\V2\HumanAgentAssistantConfig\SuggestionQueryConfig\DocumentQuerySource $var - * @return $this - */ - public function setDocumentQuerySource($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Dialogflow\V2\HumanAgentAssistantConfig\SuggestionQueryConfig\DocumentQuerySource::class); - $this->writeOneof(2, $var); - - return $this; - } - - /** - * Query from Dialogflow agent. It is used by DIALOGFLOW_ASSIST. - * - * Generated from protobuf field .google.cloud.dialogflow.v2.HumanAgentAssistantConfig.SuggestionQueryConfig.DialogflowQuerySource dialogflow_query_source = 3; - * @return \Google\Cloud\Dialogflow\V2\HumanAgentAssistantConfig\SuggestionQueryConfig\DialogflowQuerySource|null - */ - public function getDialogflowQuerySource() - { - return $this->readOneof(3); - } - - public function hasDialogflowQuerySource() - { - return $this->hasOneof(3); - } - - /** - * Query from Dialogflow agent. It is used by DIALOGFLOW_ASSIST. - * - * Generated from protobuf field .google.cloud.dialogflow.v2.HumanAgentAssistantConfig.SuggestionQueryConfig.DialogflowQuerySource dialogflow_query_source = 3; - * @param \Google\Cloud\Dialogflow\V2\HumanAgentAssistantConfig\SuggestionQueryConfig\DialogflowQuerySource $var - * @return $this - */ - public function setDialogflowQuerySource($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Dialogflow\V2\HumanAgentAssistantConfig\SuggestionQueryConfig\DialogflowQuerySource::class); - $this->writeOneof(3, $var); - - return $this; - } - - /** - * Maximum number of results to return. Currently, if unset, defaults to 10. - * And the max number is 20. - * - * Generated from protobuf field int32 max_results = 4; - * @return int - */ - public function getMaxResults() - { - return $this->max_results; - } - - /** - * Maximum number of results to return. Currently, if unset, defaults to 10. - * And the max number is 20. - * - * Generated from protobuf field int32 max_results = 4; - * @param int $var - * @return $this - */ - public function setMaxResults($var) - { - GPBUtil::checkInt32($var); - $this->max_results = $var; - - return $this; - } - - /** - * Confidence threshold of query result. - * Agent Assist gives each suggestion a score in the range [0.0, 1.0], based - * on the relevance between the suggestion and the current conversation - * context. A score of 0.0 has no relevance, while a score of 1.0 has high - * relevance. Only suggestions with a score greater than or equal to the - * value of this field are included in the results. - * For a baseline model (the default), the recommended value is in the range - * [0.05, 0.1]. - * For a custom model, there is no recommended value. Tune this value by - * starting from a very low value and slowly increasing until you have - * desired results. - * If this field is not set, it defaults to 0.0, which means that all - * suggestions are returned. - * Supported features: ARTICLE_SUGGESTION, FAQ, SMART_REPLY, SMART_COMPOSE, - * KNOWLEDGE_SEARCH, KNOWLEDGE_ASSIST, ENTITY_EXTRACTION. - * - * Generated from protobuf field float confidence_threshold = 5; - * @return float - */ - public function getConfidenceThreshold() - { - return $this->confidence_threshold; - } - - /** - * Confidence threshold of query result. - * Agent Assist gives each suggestion a score in the range [0.0, 1.0], based - * on the relevance between the suggestion and the current conversation - * context. A score of 0.0 has no relevance, while a score of 1.0 has high - * relevance. Only suggestions with a score greater than or equal to the - * value of this field are included in the results. - * For a baseline model (the default), the recommended value is in the range - * [0.05, 0.1]. - * For a custom model, there is no recommended value. Tune this value by - * starting from a very low value and slowly increasing until you have - * desired results. - * If this field is not set, it defaults to 0.0, which means that all - * suggestions are returned. - * Supported features: ARTICLE_SUGGESTION, FAQ, SMART_REPLY, SMART_COMPOSE, - * KNOWLEDGE_SEARCH, KNOWLEDGE_ASSIST, ENTITY_EXTRACTION. - * - * Generated from protobuf field float confidence_threshold = 5; - * @param float $var - * @return $this - */ - public function setConfidenceThreshold($var) - { - GPBUtil::checkFloat($var); - $this->confidence_threshold = $var; - - return $this; - } - - /** - * Determines how recent conversation context is filtered when generating - * suggestions. If unspecified, no messages will be dropped. - * - * Generated from protobuf field .google.cloud.dialogflow.v2.HumanAgentAssistantConfig.SuggestionQueryConfig.ContextFilterSettings context_filter_settings = 7; - * @return \Google\Cloud\Dialogflow\V2\HumanAgentAssistantConfig\SuggestionQueryConfig\ContextFilterSettings|null - */ - public function getContextFilterSettings() - { - return $this->context_filter_settings; - } - - public function hasContextFilterSettings() - { - return isset($this->context_filter_settings); - } - - public function clearContextFilterSettings() - { - unset($this->context_filter_settings); - } - - /** - * Determines how recent conversation context is filtered when generating - * suggestions. If unspecified, no messages will be dropped. - * - * Generated from protobuf field .google.cloud.dialogflow.v2.HumanAgentAssistantConfig.SuggestionQueryConfig.ContextFilterSettings context_filter_settings = 7; - * @param \Google\Cloud\Dialogflow\V2\HumanAgentAssistantConfig\SuggestionQueryConfig\ContextFilterSettings $var - * @return $this - */ - public function setContextFilterSettings($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Dialogflow\V2\HumanAgentAssistantConfig\SuggestionQueryConfig\ContextFilterSettings::class); - $this->context_filter_settings = $var; - - return $this; - } - - /** - * Optional. The customized sections chosen to return when requesting a - * summary of a conversation. - * - * Generated from protobuf field .google.cloud.dialogflow.v2.HumanAgentAssistantConfig.SuggestionQueryConfig.Sections sections = 8 [(.google.api.field_behavior) = OPTIONAL]; - * @return \Google\Cloud\Dialogflow\V2\HumanAgentAssistantConfig\SuggestionQueryConfig\Sections|null - */ - public function getSections() - { - return $this->sections; - } - - public function hasSections() - { - return isset($this->sections); - } - - public function clearSections() - { - unset($this->sections); - } - - /** - * Optional. The customized sections chosen to return when requesting a - * summary of a conversation. - * - * Generated from protobuf field .google.cloud.dialogflow.v2.HumanAgentAssistantConfig.SuggestionQueryConfig.Sections sections = 8 [(.google.api.field_behavior) = OPTIONAL]; - * @param \Google\Cloud\Dialogflow\V2\HumanAgentAssistantConfig\SuggestionQueryConfig\Sections $var - * @return $this - */ - public function setSections($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Dialogflow\V2\HumanAgentAssistantConfig\SuggestionQueryConfig\Sections::class); - $this->sections = $var; - - return $this; - } - - /** - * @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 e97e539e31db..000000000000 --- a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/HumanAgentAssistantConfig/SuggestionQueryConfig/DialogflowQuerySource.php +++ /dev/null @@ -1,127 +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 = ''; - /** - * Optional. The Dialogflow assist configuration for human agent. - * - * Generated from protobuf field .google.cloud.dialogflow.v2.HumanAgentAssistantConfig.SuggestionQueryConfig.DialogflowQuerySource.HumanAgentSideConfig human_agent_side_config = 3 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $human_agent_side_config = null; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $agent - * Required. The name of a Dialogflow virtual agent used for end user side - * intent detection and suggestion. Format: `projects//locations//agent`. When multiple agents are allowed in - * the same Dialogflow project. - * @type \Google\Cloud\Dialogflow\V2\HumanAgentAssistantConfig\SuggestionQueryConfig\DialogflowQuerySource\HumanAgentSideConfig $human_agent_side_config - * Optional. The Dialogflow assist configuration for human agent. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Dialogflow\V2\ConversationProfile::initOnce(); - parent::__construct($data); - } - - /** - * Required. The name of a Dialogflow virtual agent used for end user side - * intent detection and suggestion. Format: `projects//locations//agent`. When multiple agents are allowed in - * the same Dialogflow project. - * - * Generated from protobuf field string agent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @return string - */ - public function getAgent() - { - return $this->agent; - } - - /** - * Required. The name of a Dialogflow virtual agent used for end user side - * intent detection and suggestion. Format: `projects//locations//agent`. When multiple agents are allowed in - * the same Dialogflow project. - * - * Generated from protobuf field string agent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @param string $var - * @return $this - */ - public function setAgent($var) - { - GPBUtil::checkString($var, True); - $this->agent = $var; - - return $this; - } - - /** - * Optional. The Dialogflow assist configuration for human agent. - * - * Generated from protobuf field .google.cloud.dialogflow.v2.HumanAgentAssistantConfig.SuggestionQueryConfig.DialogflowQuerySource.HumanAgentSideConfig human_agent_side_config = 3 [(.google.api.field_behavior) = OPTIONAL]; - * @return \Google\Cloud\Dialogflow\V2\HumanAgentAssistantConfig\SuggestionQueryConfig\DialogflowQuerySource\HumanAgentSideConfig|null - */ - public function getHumanAgentSideConfig() - { - return $this->human_agent_side_config; - } - - public function hasHumanAgentSideConfig() - { - return isset($this->human_agent_side_config); - } - - public function clearHumanAgentSideConfig() - { - unset($this->human_agent_side_config); - } - - /** - * Optional. The Dialogflow assist configuration for human agent. - * - * Generated from protobuf field .google.cloud.dialogflow.v2.HumanAgentAssistantConfig.SuggestionQueryConfig.DialogflowQuerySource.HumanAgentSideConfig human_agent_side_config = 3 [(.google.api.field_behavior) = OPTIONAL]; - * @param \Google\Cloud\Dialogflow\V2\HumanAgentAssistantConfig\SuggestionQueryConfig\DialogflowQuerySource\HumanAgentSideConfig $var - * @return $this - */ - public function setHumanAgentSideConfig($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Dialogflow\V2\HumanAgentAssistantConfig\SuggestionQueryConfig\DialogflowQuerySource\HumanAgentSideConfig::class); - $this->human_agent_side_config = $var; - - return $this; - } - -} - -// 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/DialogflowQuerySource/HumanAgentSideConfig.php b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/HumanAgentAssistantConfig/SuggestionQueryConfig/DialogflowQuerySource/HumanAgentSideConfig.php deleted file mode 100644 index 2d8b90e6a804..000000000000 --- a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/HumanAgentAssistantConfig/SuggestionQueryConfig/DialogflowQuerySource/HumanAgentSideConfig.php +++ /dev/null @@ -1,79 +0,0 @@ -google.cloud.dialogflow.v2.HumanAgentAssistantConfig.SuggestionQueryConfig.DialogflowQuerySource.HumanAgentSideConfig - */ -class HumanAgentSideConfig extends \Google\Protobuf\Internal\Message -{ - /** - * Optional. The name of a dialogflow virtual agent used for intent - * detection and suggestion triggered by human agent. - * Format: `projects//locations//agent`. - * - * Generated from protobuf field string agent = 1 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { - */ - protected $agent = ''; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $agent - * Optional. The name of a dialogflow virtual agent used for intent - * detection and suggestion triggered by human agent. - * Format: `projects//locations//agent`. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Dialogflow\V2\ConversationProfile::initOnce(); - parent::__construct($data); - } - - /** - * Optional. The name of a dialogflow virtual agent used for intent - * detection and suggestion triggered by human agent. - * Format: `projects//locations//agent`. - * - * Generated from protobuf field string agent = 1 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { - * @return string - */ - public function getAgent() - { - return $this->agent; - } - - /** - * Optional. The name of a dialogflow virtual agent used for intent - * detection and suggestion triggered by human agent. - * Format: `projects//locations//agent`. - * - * Generated from protobuf field string agent = 1 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { - * @param string $var - * @return $this - */ - public function setAgent($var) - { - GPBUtil::checkString($var, True); - $this->agent = $var; - - return $this; - } - -} - -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(HumanAgentSideConfig::class, \Google\Cloud\Dialogflow\V2\HumanAgentAssistantConfig_SuggestionQueryConfig_DialogflowQuerySource_HumanAgentSideConfig::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/SuggestionQueryConfig/Sections.php b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/HumanAgentAssistantConfig/SuggestionQueryConfig/Sections.php deleted file mode 100644 index f118378813fe..000000000000 --- a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/HumanAgentAssistantConfig/SuggestionQueryConfig/Sections.php +++ /dev/null @@ -1,85 +0,0 @@ -google.cloud.dialogflow.v2.HumanAgentAssistantConfig.SuggestionQueryConfig.Sections - */ -class Sections extends \Google\Protobuf\Internal\Message -{ - /** - * The selected sections chosen to return when requesting a summary of a - * conversation. A duplicate selected section will be treated as a single - * selected section. If section types are not provided, the default will - * be {SITUATION, ACTION, RESULT}. - * - * Generated from protobuf field repeated .google.cloud.dialogflow.v2.HumanAgentAssistantConfig.SuggestionQueryConfig.Sections.SectionType section_types = 1; - */ - private $section_types; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type array|\Google\Protobuf\Internal\RepeatedField $section_types - * The selected sections chosen to return when requesting a summary of a - * conversation. A duplicate selected section will be treated as a single - * selected section. If section types are not provided, the default will - * be {SITUATION, ACTION, RESULT}. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Dialogflow\V2\ConversationProfile::initOnce(); - parent::__construct($data); - } - - /** - * The selected sections chosen to return when requesting a summary of a - * conversation. A duplicate selected section will be treated as a single - * selected section. If section types are not provided, the default will - * be {SITUATION, ACTION, RESULT}. - * - * Generated from protobuf field repeated .google.cloud.dialogflow.v2.HumanAgentAssistantConfig.SuggestionQueryConfig.Sections.SectionType section_types = 1; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getSectionTypes() - { - return $this->section_types; - } - - /** - * The selected sections chosen to return when requesting a summary of a - * conversation. A duplicate selected section will be treated as a single - * selected section. If section types are not provided, the default will - * be {SITUATION, ACTION, RESULT}. - * - * Generated from protobuf field repeated .google.cloud.dialogflow.v2.HumanAgentAssistantConfig.SuggestionQueryConfig.Sections.SectionType section_types = 1; - * @param array|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setSectionTypes($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::ENUM, \Google\Cloud\Dialogflow\V2\HumanAgentAssistantConfig\SuggestionQueryConfig\Sections\SectionType::class); - $this->section_types = $arr; - - return $this; - } - -} - -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(Sections::class, \Google\Cloud\Dialogflow\V2\HumanAgentAssistantConfig_SuggestionQueryConfig_Sections::class); - diff --git a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/HumanAgentAssistantConfig/SuggestionQueryConfig/Sections/SectionType.php b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/HumanAgentAssistantConfig/SuggestionQueryConfig/Sections/SectionType.php deleted file mode 100644 index c6bfcdda0aa4..000000000000 --- a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/HumanAgentAssistantConfig/SuggestionQueryConfig/Sections/SectionType.php +++ /dev/null @@ -1,103 +0,0 @@ -google.cloud.dialogflow.v2.HumanAgentAssistantConfig.SuggestionQueryConfig.Sections.SectionType - */ -class SectionType -{ - /** - * Undefined section type, does not return anything. - * - * Generated from protobuf enum SECTION_TYPE_UNSPECIFIED = 0; - */ - const SECTION_TYPE_UNSPECIFIED = 0; - /** - * What the customer needs help with or has question about. - * Section name: "situation". - * - * Generated from protobuf enum SITUATION = 1; - */ - const SITUATION = 1; - /** - * What the agent does to help the customer. - * Section name: "action". - * - * Generated from protobuf enum ACTION = 2; - */ - const ACTION = 2; - /** - * Result of the customer service. A single word describing the result - * of the conversation. - * Section name: "resolution". - * - * Generated from protobuf enum RESOLUTION = 3; - */ - const RESOLUTION = 3; - /** - * Reason for cancellation if the customer requests for a cancellation. - * "N/A" otherwise. - * Section name: "reason_for_cancellation". - * - * Generated from protobuf enum REASON_FOR_CANCELLATION = 4; - */ - const REASON_FOR_CANCELLATION = 4; - /** - * "Unsatisfied" or "Satisfied" depending on the customer's feelings at - * the end of the conversation. - * Section name: "customer_satisfaction". - * - * Generated from protobuf enum CUSTOMER_SATISFACTION = 5; - */ - const CUSTOMER_SATISFACTION = 5; - /** - * Key entities extracted from the conversation, such as ticket number, - * order number, dollar amount, etc. - * Section names are prefixed by "entities/". - * - * Generated from protobuf enum ENTITIES = 6; - */ - const ENTITIES = 6; - - private static $valueToName = [ - self::SECTION_TYPE_UNSPECIFIED => 'SECTION_TYPE_UNSPECIFIED', - self::SITUATION => 'SITUATION', - self::ACTION => 'ACTION', - self::RESOLUTION => 'RESOLUTION', - self::REASON_FOR_CANCELLATION => 'REASON_FOR_CANCELLATION', - self::CUSTOMER_SATISFACTION => 'CUSTOMER_SATISFACTION', - self::ENTITIES => 'ENTITIES', - ]; - - public static function name($value) - { - if (!isset(self::$valueToName[$value])) { - throw new UnexpectedValueException(sprintf( - 'Enum %s has no name defined for value %s', __CLASS__, $value)); - } - return self::$valueToName[$value]; - } - - - public static function value($name) - { - $const = __CLASS__ . '::' . strtoupper($name); - if (!defined($const)) { - throw new UnexpectedValueException(sprintf( - 'Enum %s has no value defined for name %s', __CLASS__, $name)); - } - return constant($const); - } -} - -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(SectionType::class, \Google\Cloud\Dialogflow\V2\HumanAgentAssistantConfig_SuggestionQueryConfig_Sections_SectionType::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 643f3580afc3..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 b10024ebc165..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/InferenceParameter.php b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/InferenceParameter.php deleted file mode 100644 index 20c1554587ba..000000000000 --- a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/InferenceParameter.php +++ /dev/null @@ -1,277 +0,0 @@ -google.cloud.dialogflow.v2.InferenceParameter - */ -class InferenceParameter extends \Google\Protobuf\Internal\Message -{ - /** - * Optional. Maximum number of the output tokens for the generator. - * - * Generated from protobuf field optional int32 max_output_tokens = 1 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $max_output_tokens = null; - /** - * Optional. Controls the randomness of LLM predictions. - * Low temperature = less random. High temperature = more random. - * If unset (or 0), uses a default value of 0. - * - * Generated from protobuf field optional double temperature = 2 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $temperature = null; - /** - * Optional. Top-k changes how the model selects tokens for output. A top-k of - * 1 means the selected token is the most probable among all tokens in the - * model's vocabulary (also called greedy decoding), while a top-k of 3 means - * that the next token is selected from among the 3 most probable tokens - * (using temperature). For each token selection step, the top K tokens with - * the highest probabilities are sampled. Then tokens are further filtered - * based on topP with the final token selected using temperature sampling. - * Specify a lower value for less random responses and a higher value for more - * random responses. Acceptable value is [1, 40], default to 40. - * - * Generated from protobuf field optional int32 top_k = 3 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $top_k = null; - /** - * Optional. Top-p changes how the model selects tokens for output. Tokens are - * selected from most K (see topK parameter) probable to least until the sum - * of their probabilities equals the top-p value. For example, if tokens A, B, - * and C have a probability of 0.3, 0.2, and 0.1 and the top-p value is 0.5, - * then the model will select either A or B as the next token (using - * temperature) and doesn't consider C. The default top-p value is 0.95. - * Specify a lower value for less random responses and a higher value for more - * random responses. Acceptable value is [0.0, 1.0], default to 0.95. - * - * Generated from protobuf field optional double top_p = 4 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $top_p = null; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type int $max_output_tokens - * Optional. Maximum number of the output tokens for the generator. - * @type float $temperature - * Optional. Controls the randomness of LLM predictions. - * Low temperature = less random. High temperature = more random. - * If unset (or 0), uses a default value of 0. - * @type int $top_k - * Optional. Top-k changes how the model selects tokens for output. A top-k of - * 1 means the selected token is the most probable among all tokens in the - * model's vocabulary (also called greedy decoding), while a top-k of 3 means - * that the next token is selected from among the 3 most probable tokens - * (using temperature). For each token selection step, the top K tokens with - * the highest probabilities are sampled. Then tokens are further filtered - * based on topP with the final token selected using temperature sampling. - * Specify a lower value for less random responses and a higher value for more - * random responses. Acceptable value is [1, 40], default to 40. - * @type float $top_p - * Optional. Top-p changes how the model selects tokens for output. Tokens are - * selected from most K (see topK parameter) probable to least until the sum - * of their probabilities equals the top-p value. For example, if tokens A, B, - * and C have a probability of 0.3, 0.2, and 0.1 and the top-p value is 0.5, - * then the model will select either A or B as the next token (using - * temperature) and doesn't consider C. The default top-p value is 0.95. - * Specify a lower value for less random responses and a higher value for more - * random responses. Acceptable value is [0.0, 1.0], default to 0.95. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Dialogflow\V2\Generator::initOnce(); - parent::__construct($data); - } - - /** - * Optional. Maximum number of the output tokens for the generator. - * - * Generated from protobuf field optional int32 max_output_tokens = 1 [(.google.api.field_behavior) = OPTIONAL]; - * @return int - */ - public function getMaxOutputTokens() - { - return isset($this->max_output_tokens) ? $this->max_output_tokens : 0; - } - - public function hasMaxOutputTokens() - { - return isset($this->max_output_tokens); - } - - public function clearMaxOutputTokens() - { - unset($this->max_output_tokens); - } - - /** - * Optional. Maximum number of the output tokens for the generator. - * - * Generated from protobuf field optional int32 max_output_tokens = 1 [(.google.api.field_behavior) = OPTIONAL]; - * @param int $var - * @return $this - */ - public function setMaxOutputTokens($var) - { - GPBUtil::checkInt32($var); - $this->max_output_tokens = $var; - - return $this; - } - - /** - * Optional. Controls the randomness of LLM predictions. - * Low temperature = less random. High temperature = more random. - * If unset (or 0), uses a default value of 0. - * - * Generated from protobuf field optional double temperature = 2 [(.google.api.field_behavior) = OPTIONAL]; - * @return float - */ - public function getTemperature() - { - return isset($this->temperature) ? $this->temperature : 0.0; - } - - public function hasTemperature() - { - return isset($this->temperature); - } - - public function clearTemperature() - { - unset($this->temperature); - } - - /** - * Optional. Controls the randomness of LLM predictions. - * Low temperature = less random. High temperature = more random. - * If unset (or 0), uses a default value of 0. - * - * Generated from protobuf field optional double temperature = 2 [(.google.api.field_behavior) = OPTIONAL]; - * @param float $var - * @return $this - */ - public function setTemperature($var) - { - GPBUtil::checkDouble($var); - $this->temperature = $var; - - return $this; - } - - /** - * Optional. Top-k changes how the model selects tokens for output. A top-k of - * 1 means the selected token is the most probable among all tokens in the - * model's vocabulary (also called greedy decoding), while a top-k of 3 means - * that the next token is selected from among the 3 most probable tokens - * (using temperature). For each token selection step, the top K tokens with - * the highest probabilities are sampled. Then tokens are further filtered - * based on topP with the final token selected using temperature sampling. - * Specify a lower value for less random responses and a higher value for more - * random responses. Acceptable value is [1, 40], default to 40. - * - * Generated from protobuf field optional int32 top_k = 3 [(.google.api.field_behavior) = OPTIONAL]; - * @return int - */ - public function getTopK() - { - return isset($this->top_k) ? $this->top_k : 0; - } - - public function hasTopK() - { - return isset($this->top_k); - } - - public function clearTopK() - { - unset($this->top_k); - } - - /** - * Optional. Top-k changes how the model selects tokens for output. A top-k of - * 1 means the selected token is the most probable among all tokens in the - * model's vocabulary (also called greedy decoding), while a top-k of 3 means - * that the next token is selected from among the 3 most probable tokens - * (using temperature). For each token selection step, the top K tokens with - * the highest probabilities are sampled. Then tokens are further filtered - * based on topP with the final token selected using temperature sampling. - * Specify a lower value for less random responses and a higher value for more - * random responses. Acceptable value is [1, 40], default to 40. - * - * Generated from protobuf field optional int32 top_k = 3 [(.google.api.field_behavior) = OPTIONAL]; - * @param int $var - * @return $this - */ - public function setTopK($var) - { - GPBUtil::checkInt32($var); - $this->top_k = $var; - - return $this; - } - - /** - * Optional. Top-p changes how the model selects tokens for output. Tokens are - * selected from most K (see topK parameter) probable to least until the sum - * of their probabilities equals the top-p value. For example, if tokens A, B, - * and C have a probability of 0.3, 0.2, and 0.1 and the top-p value is 0.5, - * then the model will select either A or B as the next token (using - * temperature) and doesn't consider C. The default top-p value is 0.95. - * Specify a lower value for less random responses and a higher value for more - * random responses. Acceptable value is [0.0, 1.0], default to 0.95. - * - * Generated from protobuf field optional double top_p = 4 [(.google.api.field_behavior) = OPTIONAL]; - * @return float - */ - public function getTopP() - { - return isset($this->top_p) ? $this->top_p : 0.0; - } - - public function hasTopP() - { - return isset($this->top_p); - } - - public function clearTopP() - { - unset($this->top_p); - } - - /** - * Optional. Top-p changes how the model selects tokens for output. Tokens are - * selected from most K (see topK parameter) probable to least until the sum - * of their probabilities equals the top-p value. For example, if tokens A, B, - * and C have a probability of 0.3, 0.2, and 0.1 and the top-p value is 0.5, - * then the model will select either A or B as the next token (using - * temperature) and doesn't consider C. The default top-p value is 0.95. - * Specify a lower value for less random responses and a higher value for more - * random responses. Acceptable value is [0.0, 1.0], default to 0.95. - * - * Generated from protobuf field optional double top_p = 4 [(.google.api.field_behavior) = OPTIONAL]; - * @param float $var - * @return $this - */ - public function setTopP($var) - { - GPBUtil::checkDouble($var); - $this->top_p = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/InitializeEncryptionSpecMetadata.php b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/InitializeEncryptionSpecMetadata.php deleted file mode 100644 index 388d113825e2..000000000000 --- a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/InitializeEncryptionSpecMetadata.php +++ /dev/null @@ -1,77 +0,0 @@ -google.cloud.dialogflow.v2.InitializeEncryptionSpecMetadata - */ -class InitializeEncryptionSpecMetadata extends \Google\Protobuf\Internal\Message -{ - /** - * Output only. The original request for initialization. - * - * Generated from protobuf field .google.cloud.dialogflow.v2.InitializeEncryptionSpecRequest request = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $request = null; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type \Google\Cloud\Dialogflow\V2\InitializeEncryptionSpecRequest $request - * Output only. The original request for initialization. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Dialogflow\V2\EncryptionSpec::initOnce(); - parent::__construct($data); - } - - /** - * Output only. The original request for initialization. - * - * Generated from protobuf field .google.cloud.dialogflow.v2.InitializeEncryptionSpecRequest request = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return \Google\Cloud\Dialogflow\V2\InitializeEncryptionSpecRequest|null - */ - public function getRequest() - { - return $this->request; - } - - public function hasRequest() - { - return isset($this->request); - } - - public function clearRequest() - { - unset($this->request); - } - - /** - * Output only. The original request for initialization. - * - * Generated from protobuf field .google.cloud.dialogflow.v2.InitializeEncryptionSpecRequest request = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param \Google\Cloud\Dialogflow\V2\InitializeEncryptionSpecRequest $var - * @return $this - */ - public function setRequest($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Dialogflow\V2\InitializeEncryptionSpecRequest::class); - $this->request = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/InitializeEncryptionSpecRequest.php b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/InitializeEncryptionSpecRequest.php deleted file mode 100644 index f639eeac970e..000000000000 --- a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/InitializeEncryptionSpecRequest.php +++ /dev/null @@ -1,105 +0,0 @@ -google.cloud.dialogflow.v2.InitializeEncryptionSpecRequest - */ -class InitializeEncryptionSpecRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The encryption spec used for CMEK encryption. It is required that - * the kms key is in the same region as the endpoint. The same key will be - * used for all provisioned resources, if encryption is available. If the - * kms_key_name is left empty, no encryption will be enforced. - * - * Generated from protobuf field .google.cloud.dialogflow.v2.EncryptionSpec encryption_spec = 1 [(.google.api.field_behavior) = REQUIRED]; - */ - protected $encryption_spec = null; - - /** - * @param \Google\Cloud\Dialogflow\V2\EncryptionSpec $encryptionSpec Required. The encryption spec used for CMEK encryption. It is required that - * the kms key is in the same region as the endpoint. The same key will be - * used for all provisioned resources, if encryption is available. If the - * kms_key_name is left empty, no encryption will be enforced. - * - * @return \Google\Cloud\Dialogflow\V2\InitializeEncryptionSpecRequest - * - * @experimental - */ - public static function build(\Google\Cloud\Dialogflow\V2\EncryptionSpec $encryptionSpec): self - { - return (new self()) - ->setEncryptionSpec($encryptionSpec); - } - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type \Google\Cloud\Dialogflow\V2\EncryptionSpec $encryption_spec - * Required. The encryption spec used for CMEK encryption. It is required that - * the kms key is in the same region as the endpoint. The same key will be - * used for all provisioned resources, if encryption is available. If the - * kms_key_name is left empty, no encryption will be enforced. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Dialogflow\V2\EncryptionSpec::initOnce(); - parent::__construct($data); - } - - /** - * Required. The encryption spec used for CMEK encryption. It is required that - * the kms key is in the same region as the endpoint. The same key will be - * used for all provisioned resources, if encryption is available. If the - * kms_key_name is left empty, no encryption will be enforced. - * - * Generated from protobuf field .google.cloud.dialogflow.v2.EncryptionSpec encryption_spec = 1 [(.google.api.field_behavior) = REQUIRED]; - * @return \Google\Cloud\Dialogflow\V2\EncryptionSpec|null - */ - public function getEncryptionSpec() - { - return $this->encryption_spec; - } - - public function hasEncryptionSpec() - { - return isset($this->encryption_spec); - } - - public function clearEncryptionSpec() - { - unset($this->encryption_spec); - } - - /** - * Required. The encryption spec used for CMEK encryption. It is required that - * the kms key is in the same region as the endpoint. The same key will be - * used for all provisioned resources, if encryption is available. If the - * kms_key_name is left empty, no encryption will be enforced. - * - * Generated from protobuf field .google.cloud.dialogflow.v2.EncryptionSpec encryption_spec = 1 [(.google.api.field_behavior) = REQUIRED]; - * @param \Google\Cloud\Dialogflow\V2\EncryptionSpec $var - * @return $this - */ - public function setEncryptionSpec($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Dialogflow\V2\EncryptionSpec::class); - $this->encryption_spec = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/InitializeEncryptionSpecResponse.php b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/InitializeEncryptionSpecResponse.php deleted file mode 100644 index c4ba7c5c5a32..000000000000 --- a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/InitializeEncryptionSpecResponse.php +++ /dev/null @@ -1,33 +0,0 @@ -google.cloud.dialogflow.v2.InitializeEncryptionSpecResponse - */ -class InitializeEncryptionSpecResponse extends \Google\Protobuf\Internal\Message -{ - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Dialogflow\V2\EncryptionSpec::initOnce(); - parent::__construct($data); - } - -} - diff --git a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/InputAudioConfig.php b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/InputAudioConfig.php deleted file mode 100644 index 809550788b8f..000000000000 --- a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/InputAudioConfig.php +++ /dev/null @@ -1,614 +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 [(.google.api.field_behavior) = REQUIRED]; - */ - protected $audio_encoding = 0; - /** - * Required. Sample rate (in Hertz) of the audio content sent in the query. - * Refer to [Cloud Speech API - * documentation](https://cloud.google.com/speech-to-text/docs/basics) for - * more details. - * - * Generated from protobuf field int32 sample_rate_hertz = 2 [(.google.api.field_behavior) = REQUIRED]; - */ - protected $sample_rate_hertz = 0; - /** - * Required. The language of the supplied audio. Dialogflow does not do - * translations. See [Language - * Support](https://cloud.google.com/dialogflow/docs/reference/language) - * for a list of the currently supported language codes. Note that queries in - * the same session do not necessarily need to specify the same language. - * - * Generated from protobuf field string language_code = 3 [(.google.api.field_behavior) = REQUIRED]; - */ - protected $language_code = ''; - /** - * If `true`, Dialogflow returns - * [SpeechWordInfo][google.cloud.dialogflow.v2.SpeechWordInfo] in - * [StreamingRecognitionResult][google.cloud.dialogflow.v2.StreamingRecognitionResult] - * with information about the recognized speech words, e.g. start and end time - * offsets. If false or unspecified, Speech doesn't return any word-level - * information. - * - * Generated from protobuf field bool enable_word_info = 13; - */ - protected $enable_word_info = false; - /** - * A list of strings containing words and phrases that the speech - * recognizer should recognize with higher likelihood. - * See [the Cloud Speech - * documentation](https://cloud.google.com/speech-to-text/docs/basics#phrase-hints) - * for more details. - * This field is deprecated. Please use [`speech_contexts`]() instead. If you - * specify both [`phrase_hints`]() and [`speech_contexts`](), Dialogflow will - * treat the [`phrase_hints`]() as a single additional [`SpeechContext`](). - * - * Generated from protobuf field repeated string phrase_hints = 4 [deprecated = true]; - * @deprecated - */ - private $phrase_hints; - /** - * Context information to assist speech recognition. - * See [the Cloud Speech - * documentation](https://cloud.google.com/speech-to-text/docs/basics#phrase-hints) - * for more details. - * - * Generated from protobuf field repeated .google.cloud.dialogflow.v2.SpeechContext speech_contexts = 11; - */ - private $speech_contexts; - /** - * Optional. Which Speech model to select for the given request. - * For more information, see - * [Speech models](https://cloud.google.com/dialogflow/es/docs/speech-models). - * - * Generated from protobuf field string model = 7; - */ - protected $model = ''; - /** - * Which variant of the [Speech - * model][google.cloud.dialogflow.v2.InputAudioConfig.model] to use. - * - * Generated from protobuf field .google.cloud.dialogflow.v2.SpeechModelVariant model_variant = 10; - */ - protected $model_variant = 0; - /** - * If `false` (default), recognition does not cease until the - * client closes the stream. - * If `true`, the recognizer will detect a single spoken utterance in input - * audio. Recognition ceases when it detects the audio's voice has - * stopped or paused. In this case, once a detected intent is received, the - * client should close the stream and start a new request with a new stream as - * needed. - * Note: This setting is relevant only for streaming methods. - * Note: When specified, InputAudioConfig.single_utterance takes precedence - * over StreamingDetectIntentRequest.single_utterance. - * - * Generated from protobuf field bool single_utterance = 8; - */ - protected $single_utterance = false; - /** - * Only used in - * [Participants.AnalyzeContent][google.cloud.dialogflow.v2.Participants.AnalyzeContent] - * and - * [Participants.StreamingAnalyzeContent][google.cloud.dialogflow.v2.Participants.StreamingAnalyzeContent]. - * If `false` and recognition doesn't return any result, trigger - * `NO_SPEECH_RECOGNIZED` event to Dialogflow agent. - * - * Generated from protobuf field bool disable_no_speech_recognized_event = 14; - */ - protected $disable_no_speech_recognized_event = false; - /** - * Enable automatic punctuation option at the speech backend. - * - * Generated from protobuf field bool enable_automatic_punctuation = 17; - */ - protected $enable_automatic_punctuation = false; - /** - * If `true`, the request will opt out for STT conformer model migration. - * This field will be deprecated once force migration takes place in June - * 2024. Please refer to [Dialogflow ES Speech model - * migration](https://cloud.google.com/dialogflow/es/docs/speech-model-migration). - * - * Generated from protobuf field bool opt_out_conformer_model_migration = 26; - */ - protected $opt_out_conformer_model_migration = false; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type int $audio_encoding - * Required. Audio encoding of the audio content to process. - * @type int $sample_rate_hertz - * Required. Sample rate (in Hertz) of the audio content sent in the query. - * Refer to [Cloud Speech API - * documentation](https://cloud.google.com/speech-to-text/docs/basics) for - * more details. - * @type string $language_code - * Required. The language of the supplied audio. Dialogflow does not do - * translations. See [Language - * Support](https://cloud.google.com/dialogflow/docs/reference/language) - * for a list of the currently supported language codes. Note that queries in - * the same session do not necessarily need to specify the same language. - * @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 - * Optional. Which Speech model to select for the given request. - * For more information, see - * [Speech models](https://cloud.google.com/dialogflow/es/docs/speech-models). - * @type int $model_variant - * Which variant of the [Speech - * model][google.cloud.dialogflow.v2.InputAudioConfig.model] to use. - * @type bool $single_utterance - * If `false` (default), recognition does not cease until the - * client closes the stream. - * If `true`, the recognizer will detect a single spoken utterance in input - * audio. Recognition ceases when it detects the audio's voice has - * stopped or paused. In this case, once a detected intent is received, the - * client should close the stream and start a new request with a new stream as - * needed. - * Note: This setting is relevant only for streaming methods. - * Note: When specified, InputAudioConfig.single_utterance takes precedence - * over StreamingDetectIntentRequest.single_utterance. - * @type bool $disable_no_speech_recognized_event - * Only used in - * [Participants.AnalyzeContent][google.cloud.dialogflow.v2.Participants.AnalyzeContent] - * and - * [Participants.StreamingAnalyzeContent][google.cloud.dialogflow.v2.Participants.StreamingAnalyzeContent]. - * If `false` and recognition doesn't return any result, trigger - * `NO_SPEECH_RECOGNIZED` event to Dialogflow agent. - * @type bool $enable_automatic_punctuation - * Enable automatic punctuation option at the speech backend. - * @type bool $opt_out_conformer_model_migration - * If `true`, the request will opt out for STT conformer model migration. - * This field will be deprecated once force migration takes place in June - * 2024. Please refer to [Dialogflow ES Speech model - * migration](https://cloud.google.com/dialogflow/es/docs/speech-model-migration). - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Dialogflow\V2\AudioConfig::initOnce(); - parent::__construct($data); - } - - /** - * Required. Audio encoding of the audio content to process. - * - * Generated from protobuf field .google.cloud.dialogflow.v2.AudioEncoding audio_encoding = 1 [(.google.api.field_behavior) = REQUIRED]; - * @return int - */ - public function getAudioEncoding() - { - return $this->audio_encoding; - } - - /** - * Required. Audio encoding of the audio content to process. - * - * Generated from protobuf field .google.cloud.dialogflow.v2.AudioEncoding audio_encoding = 1 [(.google.api.field_behavior) = REQUIRED]; - * @param int $var - * @return $this - */ - public function setAudioEncoding($var) - { - GPBUtil::checkEnum($var, \Google\Cloud\Dialogflow\V2\AudioEncoding::class); - $this->audio_encoding = $var; - - return $this; - } - - /** - * Required. Sample rate (in Hertz) of the audio content sent in the query. - * Refer to [Cloud Speech API - * documentation](https://cloud.google.com/speech-to-text/docs/basics) for - * more details. - * - * Generated from protobuf field int32 sample_rate_hertz = 2 [(.google.api.field_behavior) = REQUIRED]; - * @return int - */ - public function getSampleRateHertz() - { - return $this->sample_rate_hertz; - } - - /** - * Required. Sample rate (in Hertz) of the audio content sent in the query. - * Refer to [Cloud Speech API - * documentation](https://cloud.google.com/speech-to-text/docs/basics) for - * more details. - * - * Generated from protobuf field int32 sample_rate_hertz = 2 [(.google.api.field_behavior) = REQUIRED]; - * @param int $var - * @return $this - */ - public function setSampleRateHertz($var) - { - GPBUtil::checkInt32($var); - $this->sample_rate_hertz = $var; - - return $this; - } - - /** - * Required. The language of the supplied audio. Dialogflow does not do - * translations. See [Language - * Support](https://cloud.google.com/dialogflow/docs/reference/language) - * for a list of the currently supported language codes. Note that queries in - * the same session do not necessarily need to specify the same language. - * - * Generated from protobuf field string language_code = 3 [(.google.api.field_behavior) = REQUIRED]; - * @return string - */ - public function getLanguageCode() - { - return $this->language_code; - } - - /** - * Required. The language of the supplied audio. Dialogflow does not do - * translations. See [Language - * Support](https://cloud.google.com/dialogflow/docs/reference/language) - * for a list of the currently supported language codes. Note that queries in - * the same session do not necessarily need to specify the same language. - * - * Generated from protobuf field string language_code = 3 [(.google.api.field_behavior) = REQUIRED]; - * @param string $var - * @return $this - */ - public function setLanguageCode($var) - { - GPBUtil::checkString($var, True); - $this->language_code = $var; - - return $this; - } - - /** - * If `true`, Dialogflow returns - * [SpeechWordInfo][google.cloud.dialogflow.v2.SpeechWordInfo] in - * [StreamingRecognitionResult][google.cloud.dialogflow.v2.StreamingRecognitionResult] - * with information about the recognized speech words, e.g. start and end time - * offsets. If false or unspecified, Speech doesn't return any word-level - * information. - * - * Generated from protobuf field bool enable_word_info = 13; - * @return bool - */ - public function getEnableWordInfo() - { - return $this->enable_word_info; - } - - /** - * If `true`, Dialogflow returns - * [SpeechWordInfo][google.cloud.dialogflow.v2.SpeechWordInfo] in - * [StreamingRecognitionResult][google.cloud.dialogflow.v2.StreamingRecognitionResult] - * with information about the recognized speech words, e.g. start and end time - * offsets. If false or unspecified, Speech doesn't return any word-level - * information. - * - * Generated from protobuf field bool enable_word_info = 13; - * @param bool $var - * @return $this - */ - public function setEnableWordInfo($var) - { - GPBUtil::checkBool($var); - $this->enable_word_info = $var; - - return $this; - } - - /** - * A list of strings containing words and phrases that the speech - * recognizer should recognize with higher likelihood. - * See [the Cloud Speech - * documentation](https://cloud.google.com/speech-to-text/docs/basics#phrase-hints) - * for more details. - * This field is deprecated. Please use [`speech_contexts`]() instead. If you - * specify both [`phrase_hints`]() and [`speech_contexts`](), Dialogflow will - * treat the [`phrase_hints`]() as a single additional [`SpeechContext`](). - * - * Generated from protobuf field repeated string phrase_hints = 4 [deprecated = true]; - * @return \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; - } - - /** - * Optional. Which Speech model to select for the given request. - * For more information, see - * [Speech models](https://cloud.google.com/dialogflow/es/docs/speech-models). - * - * Generated from protobuf field string model = 7; - * @return string - */ - public function getModel() - { - return $this->model; - } - - /** - * Optional. Which Speech model to select for the given request. - * For more information, see - * [Speech models](https://cloud.google.com/dialogflow/es/docs/speech-models). - * - * Generated from protobuf field string model = 7; - * @param string $var - * @return $this - */ - public function setModel($var) - { - GPBUtil::checkString($var, True); - $this->model = $var; - - return $this; - } - - /** - * Which variant of the [Speech - * model][google.cloud.dialogflow.v2.InputAudioConfig.model] to use. - * - * Generated from protobuf field .google.cloud.dialogflow.v2.SpeechModelVariant model_variant = 10; - * @return int - */ - public function getModelVariant() - { - return $this->model_variant; - } - - /** - * Which variant of the [Speech - * model][google.cloud.dialogflow.v2.InputAudioConfig.model] to use. - * - * Generated from protobuf field .google.cloud.dialogflow.v2.SpeechModelVariant model_variant = 10; - * @param int $var - * @return $this - */ - public function setModelVariant($var) - { - GPBUtil::checkEnum($var, \Google\Cloud\Dialogflow\V2\SpeechModelVariant::class); - $this->model_variant = $var; - - return $this; - } - - /** - * If `false` (default), recognition does not cease until the - * client closes the stream. - * If `true`, the recognizer will detect a single spoken utterance in input - * audio. Recognition ceases when it detects the audio's voice has - * stopped or paused. In this case, once a detected intent is received, the - * client should close the stream and start a new request with a new stream as - * needed. - * Note: This setting is relevant only for streaming methods. - * Note: When specified, InputAudioConfig.single_utterance takes precedence - * over StreamingDetectIntentRequest.single_utterance. - * - * Generated from protobuf field bool single_utterance = 8; - * @return bool - */ - public function getSingleUtterance() - { - return $this->single_utterance; - } - - /** - * If `false` (default), recognition does not cease until the - * client closes the stream. - * If `true`, the recognizer will detect a single spoken utterance in input - * audio. Recognition ceases when it detects the audio's voice has - * stopped or paused. In this case, once a detected intent is received, the - * client should close the stream and start a new request with a new stream as - * needed. - * Note: This setting is relevant only for streaming methods. - * Note: When specified, InputAudioConfig.single_utterance takes precedence - * over StreamingDetectIntentRequest.single_utterance. - * - * Generated from protobuf field bool single_utterance = 8; - * @param bool $var - * @return $this - */ - public function setSingleUtterance($var) - { - GPBUtil::checkBool($var); - $this->single_utterance = $var; - - return $this; - } - - /** - * Only used in - * [Participants.AnalyzeContent][google.cloud.dialogflow.v2.Participants.AnalyzeContent] - * and - * [Participants.StreamingAnalyzeContent][google.cloud.dialogflow.v2.Participants.StreamingAnalyzeContent]. - * If `false` and recognition doesn't return any result, trigger - * `NO_SPEECH_RECOGNIZED` event to Dialogflow agent. - * - * Generated from protobuf field bool disable_no_speech_recognized_event = 14; - * @return bool - */ - public function getDisableNoSpeechRecognizedEvent() - { - return $this->disable_no_speech_recognized_event; - } - - /** - * Only used in - * [Participants.AnalyzeContent][google.cloud.dialogflow.v2.Participants.AnalyzeContent] - * and - * [Participants.StreamingAnalyzeContent][google.cloud.dialogflow.v2.Participants.StreamingAnalyzeContent]. - * If `false` and recognition doesn't return any result, trigger - * `NO_SPEECH_RECOGNIZED` event to Dialogflow agent. - * - * Generated from protobuf field bool disable_no_speech_recognized_event = 14; - * @param bool $var - * @return $this - */ - public function setDisableNoSpeechRecognizedEvent($var) - { - GPBUtil::checkBool($var); - $this->disable_no_speech_recognized_event = $var; - - return $this; - } - - /** - * Enable automatic punctuation option at the speech backend. - * - * Generated from protobuf field bool enable_automatic_punctuation = 17; - * @return bool - */ - public function getEnableAutomaticPunctuation() - { - return $this->enable_automatic_punctuation; - } - - /** - * Enable automatic punctuation option at the speech backend. - * - * Generated from protobuf field bool enable_automatic_punctuation = 17; - * @param bool $var - * @return $this - */ - public function setEnableAutomaticPunctuation($var) - { - GPBUtil::checkBool($var); - $this->enable_automatic_punctuation = $var; - - return $this; - } - - /** - * If `true`, the request will opt out for STT conformer model migration. - * This field will be deprecated once force migration takes place in June - * 2024. Please refer to [Dialogflow ES Speech model - * migration](https://cloud.google.com/dialogflow/es/docs/speech-model-migration). - * - * Generated from protobuf field bool opt_out_conformer_model_migration = 26; - * @return bool - */ - public function getOptOutConformerModelMigration() - { - return $this->opt_out_conformer_model_migration; - } - - /** - * If `true`, the request will opt out for STT conformer model migration. - * This field will be deprecated once force migration takes place in June - * 2024. Please refer to [Dialogflow ES Speech model - * migration](https://cloud.google.com/dialogflow/es/docs/speech-model-migration). - * - * Generated from protobuf field bool opt_out_conformer_model_migration = 26; - * @param bool $var - * @return $this - */ - public function setOptOutConformerModelMigration($var) - { - GPBUtil::checkBool($var); - $this->opt_out_conformer_model_migration = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/InputConfig.php b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/InputConfig.php 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/IntentSuggestion.php b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/IntentSuggestion.php deleted file mode 100644 index 87f1941fe131..000000000000 --- a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/IntentSuggestion.php +++ /dev/null @@ -1,153 +0,0 @@ -google.cloud.dialogflow.v2.IntentSuggestion - */ -class IntentSuggestion extends \Google\Protobuf\Internal\Message -{ - /** - * The display name of the intent. - * - * Generated from protobuf field string display_name = 1; - */ - protected $display_name = ''; - /** - * Human readable description for better understanding an intent like its - * scope, content, result etc. Maximum character limit: 140 characters. - * - * Generated from protobuf field string description = 5; - */ - protected $description = ''; - protected $intent; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $display_name - * The display name of the intent. - * @type string $intent_v2 - * The unique identifier of this - * [intent][google.cloud.dialogflow.v2.Intent]. Format: `projects//locations//agent/intents/`. - * @type string $description - * Human readable description for better understanding an intent like its - * scope, content, result etc. Maximum character limit: 140 characters. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Dialogflow\V2\Participant::initOnce(); - parent::__construct($data); - } - - /** - * The display name of the intent. - * - * Generated from protobuf field string display_name = 1; - * @return string - */ - public function getDisplayName() - { - return $this->display_name; - } - - /** - * The display name of the intent. - * - * Generated from protobuf field string display_name = 1; - * @param string $var - * @return $this - */ - public function setDisplayName($var) - { - GPBUtil::checkString($var, True); - $this->display_name = $var; - - return $this; - } - - /** - * The unique identifier of this - * [intent][google.cloud.dialogflow.v2.Intent]. Format: `projects//locations//agent/intents/`. - * - * Generated from protobuf field string intent_v2 = 2; - * @return string - */ - public function getIntentV2() - { - return $this->readOneof(2); - } - - public function hasIntentV2() - { - return $this->hasOneof(2); - } - - /** - * The unique identifier of this - * [intent][google.cloud.dialogflow.v2.Intent]. Format: `projects//locations//agent/intents/`. - * - * Generated from protobuf field string intent_v2 = 2; - * @param string $var - * @return $this - */ - public function setIntentV2($var) - { - GPBUtil::checkString($var, True); - $this->writeOneof(2, $var); - - return $this; - } - - /** - * Human readable description for better understanding an intent like its - * scope, content, result etc. Maximum character limit: 140 characters. - * - * Generated from protobuf field string description = 5; - * @return string - */ - public function getDescription() - { - return $this->description; - } - - /** - * Human readable description for better understanding an intent like its - * scope, content, result etc. Maximum character limit: 140 characters. - * - * Generated from protobuf field string description = 5; - * @param string $var - * @return $this - */ - public function setDescription($var) - { - GPBUtil::checkString($var, True); - $this->description = $var; - - return $this; - } - - /** - * @return string - */ - public function getIntent() - { - return $this->whichOneof("intent"); - } - -} - diff --git a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/IntentView.php b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/IntentView.php 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/KnowledgeAssistAnswer.php b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/KnowledgeAssistAnswer.php deleted file mode 100644 index 4b76d0287474..000000000000 --- a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/KnowledgeAssistAnswer.php +++ /dev/null @@ -1,171 +0,0 @@ -google.cloud.dialogflow.v2.KnowledgeAssistAnswer - */ -class KnowledgeAssistAnswer extends \Google\Protobuf\Internal\Message -{ - /** - * The query suggested based on the context. Suggestion is made only if it - * is different from the previous suggestion. - * - * Generated from protobuf field .google.cloud.dialogflow.v2.KnowledgeAssistAnswer.SuggestedQuery suggested_query = 1; - */ - protected $suggested_query = null; - /** - * The answer generated for the suggested query. Whether or not an answer is - * generated depends on how confident we are about the generated query. - * - * Generated from protobuf field .google.cloud.dialogflow.v2.KnowledgeAssistAnswer.KnowledgeAnswer suggested_query_answer = 2; - */ - protected $suggested_query_answer = null; - /** - * The name of the answer record. - * Format: `projects//locations//answer - * Records/`. - * - * Generated from protobuf field string answer_record = 3; - */ - protected $answer_record = ''; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type \Google\Cloud\Dialogflow\V2\KnowledgeAssistAnswer\SuggestedQuery $suggested_query - * The query suggested based on the context. Suggestion is made only if it - * is different from the previous suggestion. - * @type \Google\Cloud\Dialogflow\V2\KnowledgeAssistAnswer\KnowledgeAnswer $suggested_query_answer - * The answer generated for the suggested query. Whether or not an answer is - * generated depends on how confident we are about the generated query. - * @type string $answer_record - * The name of the answer record. - * Format: `projects//locations//answer - * Records/`. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Dialogflow\V2\Participant::initOnce(); - parent::__construct($data); - } - - /** - * The query suggested based on the context. Suggestion is made only if it - * is different from the previous suggestion. - * - * Generated from protobuf field .google.cloud.dialogflow.v2.KnowledgeAssistAnswer.SuggestedQuery suggested_query = 1; - * @return \Google\Cloud\Dialogflow\V2\KnowledgeAssistAnswer\SuggestedQuery|null - */ - public function getSuggestedQuery() - { - return $this->suggested_query; - } - - public function hasSuggestedQuery() - { - return isset($this->suggested_query); - } - - public function clearSuggestedQuery() - { - unset($this->suggested_query); - } - - /** - * The query suggested based on the context. Suggestion is made only if it - * is different from the previous suggestion. - * - * Generated from protobuf field .google.cloud.dialogflow.v2.KnowledgeAssistAnswer.SuggestedQuery suggested_query = 1; - * @param \Google\Cloud\Dialogflow\V2\KnowledgeAssistAnswer\SuggestedQuery $var - * @return $this - */ - public function setSuggestedQuery($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Dialogflow\V2\KnowledgeAssistAnswer\SuggestedQuery::class); - $this->suggested_query = $var; - - return $this; - } - - /** - * The answer generated for the suggested query. Whether or not an answer is - * generated depends on how confident we are about the generated query. - * - * Generated from protobuf field .google.cloud.dialogflow.v2.KnowledgeAssistAnswer.KnowledgeAnswer suggested_query_answer = 2; - * @return \Google\Cloud\Dialogflow\V2\KnowledgeAssistAnswer\KnowledgeAnswer|null - */ - public function getSuggestedQueryAnswer() - { - return $this->suggested_query_answer; - } - - public function hasSuggestedQueryAnswer() - { - return isset($this->suggested_query_answer); - } - - public function clearSuggestedQueryAnswer() - { - unset($this->suggested_query_answer); - } - - /** - * The answer generated for the suggested query. Whether or not an answer is - * generated depends on how confident we are about the generated query. - * - * Generated from protobuf field .google.cloud.dialogflow.v2.KnowledgeAssistAnswer.KnowledgeAnswer suggested_query_answer = 2; - * @param \Google\Cloud\Dialogflow\V2\KnowledgeAssistAnswer\KnowledgeAnswer $var - * @return $this - */ - public function setSuggestedQueryAnswer($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Dialogflow\V2\KnowledgeAssistAnswer\KnowledgeAnswer::class); - $this->suggested_query_answer = $var; - - return $this; - } - - /** - * The name of the answer record. - * Format: `projects//locations//answer - * Records/`. - * - * Generated from protobuf field string answer_record = 3; - * @return string - */ - public function getAnswerRecord() - { - return $this->answer_record; - } - - /** - * The name of the answer record. - * Format: `projects//locations//answer - * Records/`. - * - * Generated from protobuf field string answer_record = 3; - * @param string $var - * @return $this - */ - public function setAnswerRecord($var) - { - GPBUtil::checkString($var, True); - $this->answer_record = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/KnowledgeAssistAnswer/KnowledgeAnswer.php b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/KnowledgeAssistAnswer/KnowledgeAnswer.php deleted file mode 100644 index eb9f85a5aaf8..000000000000 --- a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/KnowledgeAssistAnswer/KnowledgeAnswer.php +++ /dev/null @@ -1,146 +0,0 @@ -google.cloud.dialogflow.v2.KnowledgeAssistAnswer.KnowledgeAnswer - */ -class KnowledgeAnswer extends \Google\Protobuf\Internal\Message -{ - /** - * The piece of text from the `source` that answers this suggested query. - * - * Generated from protobuf field string answer_text = 1; - */ - protected $answer_text = ''; - protected $source; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $answer_text - * The piece of text from the `source` that answers this suggested query. - * @type \Google\Cloud\Dialogflow\V2\KnowledgeAssistAnswer\KnowledgeAnswer\FaqSource $faq_source - * Populated if the prediction came from FAQ. - * @type \Google\Cloud\Dialogflow\V2\KnowledgeAssistAnswer\KnowledgeAnswer\GenerativeSource $generative_source - * Populated if the prediction was Generative. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Dialogflow\V2\Participant::initOnce(); - parent::__construct($data); - } - - /** - * The piece of text from the `source` that answers this suggested query. - * - * Generated from protobuf field string answer_text = 1; - * @return string - */ - public function getAnswerText() - { - return $this->answer_text; - } - - /** - * The piece of text from the `source` that answers this suggested query. - * - * Generated from protobuf field string answer_text = 1; - * @param string $var - * @return $this - */ - public function setAnswerText($var) - { - GPBUtil::checkString($var, True); - $this->answer_text = $var; - - return $this; - } - - /** - * Populated if the prediction came from FAQ. - * - * Generated from protobuf field .google.cloud.dialogflow.v2.KnowledgeAssistAnswer.KnowledgeAnswer.FaqSource faq_source = 3; - * @return \Google\Cloud\Dialogflow\V2\KnowledgeAssistAnswer\KnowledgeAnswer\FaqSource|null - */ - public function getFaqSource() - { - return $this->readOneof(3); - } - - public function hasFaqSource() - { - return $this->hasOneof(3); - } - - /** - * Populated if the prediction came from FAQ. - * - * Generated from protobuf field .google.cloud.dialogflow.v2.KnowledgeAssistAnswer.KnowledgeAnswer.FaqSource faq_source = 3; - * @param \Google\Cloud\Dialogflow\V2\KnowledgeAssistAnswer\KnowledgeAnswer\FaqSource $var - * @return $this - */ - public function setFaqSource($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Dialogflow\V2\KnowledgeAssistAnswer\KnowledgeAnswer\FaqSource::class); - $this->writeOneof(3, $var); - - return $this; - } - - /** - * Populated if the prediction was Generative. - * - * Generated from protobuf field .google.cloud.dialogflow.v2.KnowledgeAssistAnswer.KnowledgeAnswer.GenerativeSource generative_source = 4; - * @return \Google\Cloud\Dialogflow\V2\KnowledgeAssistAnswer\KnowledgeAnswer\GenerativeSource|null - */ - public function getGenerativeSource() - { - return $this->readOneof(4); - } - - public function hasGenerativeSource() - { - return $this->hasOneof(4); - } - - /** - * Populated if the prediction was Generative. - * - * Generated from protobuf field .google.cloud.dialogflow.v2.KnowledgeAssistAnswer.KnowledgeAnswer.GenerativeSource generative_source = 4; - * @param \Google\Cloud\Dialogflow\V2\KnowledgeAssistAnswer\KnowledgeAnswer\GenerativeSource $var - * @return $this - */ - public function setGenerativeSource($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Dialogflow\V2\KnowledgeAssistAnswer\KnowledgeAnswer\GenerativeSource::class); - $this->writeOneof(4, $var); - - return $this; - } - - /** - * @return string - */ - public function getSource() - { - return $this->whichOneof("source"); - } - -} - -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(KnowledgeAnswer::class, \Google\Cloud\Dialogflow\V2\KnowledgeAssistAnswer_KnowledgeAnswer::class); - diff --git a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/KnowledgeAssistAnswer/KnowledgeAnswer/FaqSource.php b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/KnowledgeAssistAnswer/KnowledgeAnswer/FaqSource.php deleted file mode 100644 index 474ed7380b54..000000000000 --- a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/KnowledgeAssistAnswer/KnowledgeAnswer/FaqSource.php +++ /dev/null @@ -1,70 +0,0 @@ -google.cloud.dialogflow.v2.KnowledgeAssistAnswer.KnowledgeAnswer.FaqSource - */ -class FaqSource extends \Google\Protobuf\Internal\Message -{ - /** - * The corresponding FAQ question. - * - * Generated from protobuf field string question = 2; - */ - protected $question = ''; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $question - * The corresponding FAQ question. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Dialogflow\V2\Participant::initOnce(); - parent::__construct($data); - } - - /** - * The corresponding FAQ question. - * - * Generated from protobuf field string question = 2; - * @return string - */ - public function getQuestion() - { - return $this->question; - } - - /** - * The corresponding FAQ question. - * - * Generated from protobuf field string question = 2; - * @param string $var - * @return $this - */ - public function setQuestion($var) - { - GPBUtil::checkString($var, True); - $this->question = $var; - - return $this; - } - -} - -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(FaqSource::class, \Google\Cloud\Dialogflow\V2\KnowledgeAssistAnswer_KnowledgeAnswer_FaqSource::class); - diff --git a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/KnowledgeAssistAnswer/KnowledgeAnswer/GenerativeSource.php b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/KnowledgeAssistAnswer/KnowledgeAnswer/GenerativeSource.php deleted file mode 100644 index 5a3095710f66..000000000000 --- a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/KnowledgeAssistAnswer/KnowledgeAnswer/GenerativeSource.php +++ /dev/null @@ -1,74 +0,0 @@ -google.cloud.dialogflow.v2.KnowledgeAssistAnswer.KnowledgeAnswer.GenerativeSource - */ -class GenerativeSource extends \Google\Protobuf\Internal\Message -{ - /** - * All snippets used for this Generative Prediction, with their source URI - * and data. - * - * Generated from protobuf field repeated .google.cloud.dialogflow.v2.KnowledgeAssistAnswer.KnowledgeAnswer.GenerativeSource.Snippet snippets = 1; - */ - private $snippets; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type array<\Google\Cloud\Dialogflow\V2\KnowledgeAssistAnswer\KnowledgeAnswer\GenerativeSource\Snippet>|\Google\Protobuf\Internal\RepeatedField $snippets - * All snippets used for this Generative Prediction, with their source URI - * and data. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Dialogflow\V2\Participant::initOnce(); - parent::__construct($data); - } - - /** - * All snippets used for this Generative Prediction, with their source URI - * and data. - * - * Generated from protobuf field repeated .google.cloud.dialogflow.v2.KnowledgeAssistAnswer.KnowledgeAnswer.GenerativeSource.Snippet snippets = 1; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getSnippets() - { - return $this->snippets; - } - - /** - * All snippets used for this Generative Prediction, with their source URI - * and data. - * - * Generated from protobuf field repeated .google.cloud.dialogflow.v2.KnowledgeAssistAnswer.KnowledgeAnswer.GenerativeSource.Snippet snippets = 1; - * @param array<\Google\Cloud\Dialogflow\V2\KnowledgeAssistAnswer\KnowledgeAnswer\GenerativeSource\Snippet>|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setSnippets($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Dialogflow\V2\KnowledgeAssistAnswer\KnowledgeAnswer\GenerativeSource\Snippet::class); - $this->snippets = $arr; - - return $this; - } - -} - -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(GenerativeSource::class, \Google\Cloud\Dialogflow\V2\KnowledgeAssistAnswer_KnowledgeAnswer_GenerativeSource::class); - diff --git a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/KnowledgeAssistAnswer/KnowledgeAnswer/GenerativeSource/Snippet.php b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/KnowledgeAssistAnswer/KnowledgeAnswer/GenerativeSource/Snippet.php deleted file mode 100644 index 81f818028d5d..000000000000 --- a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/KnowledgeAssistAnswer/KnowledgeAnswer/GenerativeSource/Snippet.php +++ /dev/null @@ -1,138 +0,0 @@ -google.cloud.dialogflow.v2.KnowledgeAssistAnswer.KnowledgeAnswer.GenerativeSource.Snippet - */ -class Snippet extends \Google\Protobuf\Internal\Message -{ - /** - * URI the data is sourced from. - * - * Generated from protobuf field string uri = 2; - */ - protected $uri = ''; - /** - * Text taken from that URI. - * - * Generated from protobuf field string text = 3; - */ - protected $text = ''; - /** - * Title of the document. - * - * Generated from protobuf field string title = 4; - */ - protected $title = ''; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $uri - * URI the data is sourced from. - * @type string $text - * Text taken from that URI. - * @type string $title - * Title of the document. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Dialogflow\V2\Participant::initOnce(); - parent::__construct($data); - } - - /** - * URI the data is sourced from. - * - * Generated from protobuf field string uri = 2; - * @return string - */ - public function getUri() - { - return $this->uri; - } - - /** - * URI the data is sourced from. - * - * Generated from protobuf field string uri = 2; - * @param string $var - * @return $this - */ - public function setUri($var) - { - GPBUtil::checkString($var, True); - $this->uri = $var; - - return $this; - } - - /** - * Text taken from that URI. - * - * Generated from protobuf field string text = 3; - * @return string - */ - public function getText() - { - return $this->text; - } - - /** - * Text taken from that URI. - * - * Generated from protobuf field string text = 3; - * @param string $var - * @return $this - */ - public function setText($var) - { - GPBUtil::checkString($var, True); - $this->text = $var; - - return $this; - } - - /** - * Title of the document. - * - * Generated from protobuf field string title = 4; - * @return string - */ - public function getTitle() - { - return $this->title; - } - - /** - * Title of the document. - * - * Generated from protobuf field string title = 4; - * @param string $var - * @return $this - */ - public function setTitle($var) - { - GPBUtil::checkString($var, True); - $this->title = $var; - - return $this; - } - -} - -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(Snippet::class, \Google\Cloud\Dialogflow\V2\KnowledgeAssistAnswer_KnowledgeAnswer_GenerativeSource_Snippet::class); - diff --git a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/KnowledgeAssistAnswer/SuggestedQuery.php b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/KnowledgeAssistAnswer/SuggestedQuery.php deleted file mode 100644 index 07a0c9e373c2..000000000000 --- a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/KnowledgeAssistAnswer/SuggestedQuery.php +++ /dev/null @@ -1,70 +0,0 @@ -google.cloud.dialogflow.v2.KnowledgeAssistAnswer.SuggestedQuery - */ -class SuggestedQuery extends \Google\Protobuf\Internal\Message -{ - /** - * Suggested query text. - * - * Generated from protobuf field string query_text = 1; - */ - protected $query_text = ''; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $query_text - * Suggested query text. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Dialogflow\V2\Participant::initOnce(); - parent::__construct($data); - } - - /** - * Suggested query text. - * - * Generated from protobuf field string query_text = 1; - * @return string - */ - public function getQueryText() - { - return $this->query_text; - } - - /** - * Suggested query text. - * - * Generated from protobuf field string query_text = 1; - * @param string $var - * @return $this - */ - public function setQueryText($var) - { - GPBUtil::checkString($var, True); - $this->query_text = $var; - - return $this; - } - -} - -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(SuggestedQuery::class, \Google\Cloud\Dialogflow\V2\KnowledgeAssistAnswer_SuggestedQuery::class); - 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 0c1077812614..000000000000 --- a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/ListConversationsRequest.php +++ /dev/null @@ -1,213 +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 = ''; - /** - * Optional. A filter expression that filters conversations listed in the - * response. Only `lifecycle_state` can be filtered on in this way. For - * example, the following expression only returns `COMPLETED` conversations: - * `lifecycle_state = "COMPLETED"` - * For more information about filtering, see - * [API Filtering](https://aip.dev/160). - * - * Generated from protobuf field string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $filter = ''; - - /** - * @param string $parent Required. The project from which to list all conversation. - * Format: `projects//locations/`. Please see - * {@see ConversationsClient::projectName()} for help formatting this field. - * - * @return \Google\Cloud\Dialogflow\V2\ListConversationsRequest - * - * @experimental - */ - public static function build(string $parent): self - { - return (new self()) - ->setParent($parent); - } - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $parent - * Required. The project from which to list all conversation. - * Format: `projects//locations/`. - * @type int $page_size - * Optional. The maximum number of items to return in a single page. By - * default 100 and at most 1000. - * @type string $page_token - * Optional. The next_page_token value returned from a previous list request. - * @type string $filter - * Optional. A filter expression that filters conversations listed in the - * response. Only `lifecycle_state` can be filtered on in this way. For - * example, the following expression only returns `COMPLETED` conversations: - * `lifecycle_state = "COMPLETED"` - * For more information about filtering, see - * [API Filtering](https://aip.dev/160). - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Dialogflow\V2\Conversation::initOnce(); - parent::__construct($data); - } - - /** - * Required. The project from which to list all conversation. - * Format: `projects//locations/`. - * - * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @return string - */ - public function getParent() - { - return $this->parent; - } - - /** - * Required. The project from which to list all conversation. - * Format: `projects//locations/`. - * - * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @param string $var - * @return $this - */ - public function setParent($var) - { - GPBUtil::checkString($var, True); - $this->parent = $var; - - return $this; - } - - /** - * Optional. The maximum number of items to return in a single page. By - * default 100 and at most 1000. - * - * Generated from protobuf field int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; - * @return int - */ - public function getPageSize() - { - return $this->page_size; - } - - /** - * Optional. The maximum number of items to return in a single page. By - * default 100 and at most 1000. - * - * Generated from protobuf field int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; - * @param int $var - * @return $this - */ - public function setPageSize($var) - { - GPBUtil::checkInt32($var); - $this->page_size = $var; - - return $this; - } - - /** - * Optional. The next_page_token value returned from a previous list request. - * - * Generated from protobuf field string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; - * @return string - */ - public function getPageToken() - { - return $this->page_token; - } - - /** - * Optional. The next_page_token value returned from a previous list request. - * - * Generated from protobuf field string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; - * @param string $var - * @return $this - */ - public function setPageToken($var) - { - GPBUtil::checkString($var, True); - $this->page_token = $var; - - return $this; - } - - /** - * Optional. A filter expression that filters conversations listed in the - * response. Only `lifecycle_state` can be filtered on in this way. For - * example, the following expression only returns `COMPLETED` conversations: - * `lifecycle_state = "COMPLETED"` - * For more information about filtering, see - * [API Filtering](https://aip.dev/160). - * - * Generated from protobuf field string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; - * @return string - */ - public function getFilter() - { - return $this->filter; - } - - /** - * Optional. A filter expression that filters conversations listed in the - * response. Only `lifecycle_state` can be filtered on in this way. For - * example, the following expression only returns `COMPLETED` conversations: - * `lifecycle_state = "COMPLETED"` - * For more information about filtering, see - * [API Filtering](https://aip.dev/160). - * - * Generated from protobuf field string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; - * @param string $var - * @return $this - */ - public function setFilter($var) - { - GPBUtil::checkString($var, True); - $this->filter = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/ListConversationsResponse.php b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/ListConversationsResponse.php 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/ListGeneratorsRequest.php b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/ListGeneratorsRequest.php deleted file mode 100644 index 84a69731d916..000000000000 --- a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/ListGeneratorsRequest.php +++ /dev/null @@ -1,158 +0,0 @@ -google.cloud.dialogflow.v2.ListGeneratorsRequest - */ -class ListGeneratorsRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The project/location to list generators for. Format: - * `projects//locations/` - * - * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - */ - protected $parent = ''; - /** - * Optional. Maximum number of conversation models to return in a single page. - * Default to 10. - * - * Generated from protobuf field int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $page_size = 0; - /** - * Optional. The next_page_token value returned from a previous list request. - * - * Generated from protobuf field string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $page_token = ''; - - /** - * @param string $parent Required. The project/location to list generators for. Format: - * `projects//locations/` - * Please see {@see GeneratorsClient::projectName()} for help formatting this field. - * - * @return \Google\Cloud\Dialogflow\V2\ListGeneratorsRequest - * - * @experimental - */ - public static function build(string $parent): self - { - return (new self()) - ->setParent($parent); - } - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $parent - * Required. The project/location to list generators for. Format: - * `projects//locations/` - * @type int $page_size - * Optional. Maximum number of conversation models to return in a single page. - * Default to 10. - * @type string $page_token - * Optional. The next_page_token value returned from a previous list request. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Dialogflow\V2\Generator::initOnce(); - parent::__construct($data); - } - - /** - * Required. The project/location to list generators for. Format: - * `projects//locations/` - * - * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @return string - */ - public function getParent() - { - return $this->parent; - } - - /** - * Required. The project/location to list generators for. Format: - * `projects//locations/` - * - * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @param string $var - * @return $this - */ - public function setParent($var) - { - GPBUtil::checkString($var, True); - $this->parent = $var; - - return $this; - } - - /** - * Optional. Maximum number of conversation models to return in a single page. - * Default to 10. - * - * Generated from protobuf field int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; - * @return int - */ - public function getPageSize() - { - return $this->page_size; - } - - /** - * Optional. Maximum number of conversation models to return in a single page. - * Default to 10. - * - * Generated from protobuf field int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; - * @param int $var - * @return $this - */ - public function setPageSize($var) - { - GPBUtil::checkInt32($var); - $this->page_size = $var; - - return $this; - } - - /** - * Optional. The next_page_token value returned from a previous list request. - * - * Generated from protobuf field string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; - * @return string - */ - public function getPageToken() - { - return $this->page_token; - } - - /** - * Optional. The next_page_token value returned from a previous list request. - * - * Generated from protobuf field string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; - * @param string $var - * @return $this - */ - public function setPageToken($var) - { - GPBUtil::checkString($var, True); - $this->page_token = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/ListGeneratorsResponse.php b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/ListGeneratorsResponse.php deleted file mode 100644 index e4988973a0e5..000000000000 --- a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/ListGeneratorsResponse.php +++ /dev/null @@ -1,105 +0,0 @@ -google.cloud.dialogflow.v2.ListGeneratorsResponse - */ -class ListGeneratorsResponse extends \Google\Protobuf\Internal\Message -{ - /** - * List of generators retrieved. - * - * Generated from protobuf field repeated .google.cloud.dialogflow.v2.Generator generators = 1; - */ - private $generators; - /** - * Token to retrieve the next page of results, or empty if there are no more - * results in the list. - * - * Generated from protobuf field string next_page_token = 2; - */ - protected $next_page_token = ''; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type array<\Google\Cloud\Dialogflow\V2\Generator>|\Google\Protobuf\Internal\RepeatedField $generators - * List of generators retrieved. - * @type string $next_page_token - * Token to retrieve the next page of results, or empty if there are no more - * results in the list. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Dialogflow\V2\Generator::initOnce(); - parent::__construct($data); - } - - /** - * List of generators retrieved. - * - * Generated from protobuf field repeated .google.cloud.dialogflow.v2.Generator generators = 1; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getGenerators() - { - return $this->generators; - } - - /** - * List of generators retrieved. - * - * Generated from protobuf field repeated .google.cloud.dialogflow.v2.Generator generators = 1; - * @param array<\Google\Cloud\Dialogflow\V2\Generator>|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setGenerators($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Dialogflow\V2\Generator::class); - $this->generators = $arr; - - return $this; - } - - /** - * Token to retrieve the next page of results, or empty if there are no more - * results in the list. - * - * Generated from protobuf field string next_page_token = 2; - * @return string - */ - public function getNextPageToken() - { - return $this->next_page_token; - } - - /** - * Token to retrieve the next page of results, or empty if there are no more - * results in the list. - * - * Generated from protobuf field string next_page_token = 2; - * @param string $var - * @return $this - */ - public function setNextPageToken($var) - { - GPBUtil::checkString($var, True); - $this->next_page_token = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/ListIntentsRequest.php b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/ListIntentsRequest.php 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/MessageEntry.php b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/MessageEntry.php deleted file mode 100644 index 53c6cdd6fbae..000000000000 --- a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/MessageEntry.php +++ /dev/null @@ -1,187 +0,0 @@ -google.cloud.dialogflow.v2.MessageEntry - */ -class MessageEntry extends \Google\Protobuf\Internal\Message -{ - /** - * Optional. Participant role of the message. - * - * Generated from protobuf field .google.cloud.dialogflow.v2.MessageEntry.Role role = 1 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $role = 0; - /** - * Optional. Transcript content of the message. - * - * Generated from protobuf field string text = 2 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $text = ''; - /** - * Optional. The language of the text. See [Language - * Support](https://cloud.google.com/dialogflow/docs/reference/language) for a - * list of the currently supported language codes. - * - * Generated from protobuf field string language_code = 3 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $language_code = ''; - /** - * Optional. Create time of the message entry. - * - * Generated from protobuf field .google.protobuf.Timestamp create_time = 4 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $create_time = null; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type int $role - * Optional. Participant role of the message. - * @type string $text - * Optional. Transcript content of the message. - * @type string $language_code - * Optional. The language of the text. See [Language - * Support](https://cloud.google.com/dialogflow/docs/reference/language) for a - * list of the currently supported language codes. - * @type \Google\Protobuf\Timestamp $create_time - * Optional. Create time of the message entry. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Dialogflow\V2\Generator::initOnce(); - parent::__construct($data); - } - - /** - * Optional. Participant role of the message. - * - * Generated from protobuf field .google.cloud.dialogflow.v2.MessageEntry.Role role = 1 [(.google.api.field_behavior) = OPTIONAL]; - * @return int - */ - public function getRole() - { - return $this->role; - } - - /** - * Optional. Participant role of the message. - * - * Generated from protobuf field .google.cloud.dialogflow.v2.MessageEntry.Role role = 1 [(.google.api.field_behavior) = OPTIONAL]; - * @param int $var - * @return $this - */ - public function setRole($var) - { - GPBUtil::checkEnum($var, \Google\Cloud\Dialogflow\V2\MessageEntry\Role::class); - $this->role = $var; - - return $this; - } - - /** - * Optional. Transcript content of the message. - * - * Generated from protobuf field string text = 2 [(.google.api.field_behavior) = OPTIONAL]; - * @return string - */ - public function getText() - { - return $this->text; - } - - /** - * Optional. Transcript content of the message. - * - * Generated from protobuf field string text = 2 [(.google.api.field_behavior) = OPTIONAL]; - * @param string $var - * @return $this - */ - public function setText($var) - { - GPBUtil::checkString($var, True); - $this->text = $var; - - return $this; - } - - /** - * Optional. The language of the text. See [Language - * Support](https://cloud.google.com/dialogflow/docs/reference/language) for a - * list of the currently supported language codes. - * - * Generated from protobuf field string language_code = 3 [(.google.api.field_behavior) = OPTIONAL]; - * @return string - */ - public function getLanguageCode() - { - return $this->language_code; - } - - /** - * Optional. The language of the text. See [Language - * Support](https://cloud.google.com/dialogflow/docs/reference/language) for a - * list of the currently supported language codes. - * - * Generated from protobuf field string language_code = 3 [(.google.api.field_behavior) = OPTIONAL]; - * @param string $var - * @return $this - */ - public function setLanguageCode($var) - { - GPBUtil::checkString($var, True); - $this->language_code = $var; - - return $this; - } - - /** - * Optional. Create time of the message entry. - * - * Generated from protobuf field .google.protobuf.Timestamp create_time = 4 [(.google.api.field_behavior) = OPTIONAL]; - * @return \Google\Protobuf\Timestamp|null - */ - public function getCreateTime() - { - return $this->create_time; - } - - public function hasCreateTime() - { - return isset($this->create_time); - } - - public function clearCreateTime() - { - unset($this->create_time); - } - - /** - * Optional. Create time of the message entry. - * - * Generated from protobuf field .google.protobuf.Timestamp create_time = 4 [(.google.api.field_behavior) = OPTIONAL]; - * @param \Google\Protobuf\Timestamp $var - * @return $this - */ - public function setCreateTime($var) - { - GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); - $this->create_time = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/MessageEntry/Role.php b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/MessageEntry/Role.php deleted file mode 100644 index 4a2b311504ab..000000000000 --- a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/MessageEntry/Role.php +++ /dev/null @@ -1,72 +0,0 @@ -google.cloud.dialogflow.v2.MessageEntry.Role - */ -class Role -{ - /** - * Participant role not set. - * - * Generated from protobuf enum ROLE_UNSPECIFIED = 0; - */ - const ROLE_UNSPECIFIED = 0; - /** - * Participant is a human agent. - * - * Generated from protobuf enum HUMAN_AGENT = 1; - */ - const HUMAN_AGENT = 1; - /** - * Participant is an automated agent, such as a Dialogflow agent. - * - * Generated from protobuf enum AUTOMATED_AGENT = 2; - */ - const AUTOMATED_AGENT = 2; - /** - * Participant is an end user that has called or chatted with - * Dialogflow services. - * - * Generated from protobuf enum END_USER = 3; - */ - const END_USER = 3; - - private static $valueToName = [ - self::ROLE_UNSPECIFIED => 'ROLE_UNSPECIFIED', - self::HUMAN_AGENT => 'HUMAN_AGENT', - self::AUTOMATED_AGENT => 'AUTOMATED_AGENT', - self::END_USER => 'END_USER', - ]; - - public static function name($value) - { - if (!isset(self::$valueToName[$value])) { - throw new UnexpectedValueException(sprintf( - 'Enum %s has no name defined for value %s', __CLASS__, $value)); - } - return self::$valueToName[$value]; - } - - - public static function value($name) - { - $const = __CLASS__ . '::' . strtoupper($name); - if (!defined($const)) { - throw new UnexpectedValueException(sprintf( - 'Enum %s has no value defined for name %s', __CLASS__, $name)); - } - return constant($const); - } -} - -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(Role::class, \Google\Cloud\Dialogflow\V2\MessageEntry_Role::class); - 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 5ddca3f8b2c8..000000000000 --- a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/OutputAudioEncoding.php +++ /dev/null @@ -1,93 +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; - /** - * 8-bit samples that compand 13-bit audio samples using G.711 PCMU/a-law. - * - * Generated from protobuf enum OUTPUT_AUDIO_ENCODING_ALAW = 6; - */ - const OUTPUT_AUDIO_ENCODING_ALAW = 6; - - private static $valueToName = [ - self::OUTPUT_AUDIO_ENCODING_UNSPECIFIED => 'OUTPUT_AUDIO_ENCODING_UNSPECIFIED', - self::OUTPUT_AUDIO_ENCODING_LINEAR_16 => 'OUTPUT_AUDIO_ENCODING_LINEAR_16', - self::OUTPUT_AUDIO_ENCODING_MP3 => 'OUTPUT_AUDIO_ENCODING_MP3', - self::OUTPUT_AUDIO_ENCODING_MP3_64_KBPS => 'OUTPUT_AUDIO_ENCODING_MP3_64_KBPS', - self::OUTPUT_AUDIO_ENCODING_OGG_OPUS => 'OUTPUT_AUDIO_ENCODING_OGG_OPUS', - self::OUTPUT_AUDIO_ENCODING_MULAW => 'OUTPUT_AUDIO_ENCODING_MULAW', - self::OUTPUT_AUDIO_ENCODING_ALAW => 'OUTPUT_AUDIO_ENCODING_ALAW', - ]; - - public static function name($value) - { - if (!isset(self::$valueToName[$value])) { - throw new UnexpectedValueException(sprintf( - 'Enum %s has no name defined for value %s', __CLASS__, $value)); - } - return self::$valueToName[$value]; - } - - - public static function value($name) - { - $const = __CLASS__ . '::' . strtoupper($name); - if (!defined($const)) { - throw new UnexpectedValueException(sprintf( - 'Enum %s has no value defined for name %s', __CLASS__, $name)); - } - return constant($const); - } -} - diff --git a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/Participant.php b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/Participant.php 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 d3a9a29c1990..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 bed9ba9259cd..000000000000 --- a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/QueryParameters.php +++ /dev/null @@ -1,461 +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; - /** - * The platform of the virtual agent response messages. - * If not empty, only emits messages from this platform in the response. - * Valid values are the enum names of - * [platform][google.cloud.dialogflow.v2.Intent.Message.platform]. - * - * Generated from protobuf field string platform = 18; - */ - protected $platform = ''; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $time_zone - * The time zone of this conversational query from the - * [time zone database](https://www.iana.org/time-zones), e.g., - * America/New_York, Europe/Paris. If not provided, the time zone specified in - * agent settings is used. - * @type \Google\Type\LatLng $geo_location - * The geo location of this conversational query. - * @type 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. - * @type string $platform - * The platform of the virtual agent response messages. - * If not empty, only emits messages from this platform in the response. - * Valid values are the enum names of - * [platform][google.cloud.dialogflow.v2.Intent.Message.platform]. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Dialogflow\V2\Session::initOnce(); - parent::__construct($data); - } - - /** - * The time zone of this conversational query from the - * [time zone database](https://www.iana.org/time-zones), e.g., - * America/New_York, Europe/Paris. If not provided, the time zone specified in - * agent settings is used. - * - * Generated from protobuf field string time_zone = 1; - * @return string - */ - public function getTimeZone() - { - return $this->time_zone; - } - - /** - * The time zone of this conversational query from the - * [time zone database](https://www.iana.org/time-zones), e.g., - * America/New_York, Europe/Paris. If not provided, the time zone specified in - * agent settings is used. - * - * Generated from protobuf field string time_zone = 1; - * @param string $var - * @return $this - */ - public function setTimeZone($var) - { - GPBUtil::checkString($var, True); - $this->time_zone = $var; - - return $this; - } - - /** - * The geo location of this conversational query. - * - * Generated from protobuf field .google.type.LatLng geo_location = 2; - * @return \Google\Type\LatLng|null - */ - public function getGeoLocation() - { - return $this->geo_location; - } - - public function hasGeoLocation() - { - return isset($this->geo_location); - } - - public function clearGeoLocation() - { - unset($this->geo_location); - } - - /** - * The geo location of this conversational query. - * - * Generated from protobuf field .google.type.LatLng geo_location = 2; - * @param \Google\Type\LatLng $var - * @return $this - */ - public function setGeoLocation($var) - { - GPBUtil::checkMessage($var, \Google\Type\LatLng::class); - $this->geo_location = $var; - - return $this; - } - - /** - * The collection of contexts to be activated before this query is - * executed. - * - * Generated from protobuf field repeated .google.cloud.dialogflow.v2.Context contexts = 3; - * @return \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; - } - - /** - * The platform of the virtual agent response messages. - * If not empty, only emits messages from this platform in the response. - * Valid values are the enum names of - * [platform][google.cloud.dialogflow.v2.Intent.Message.platform]. - * - * Generated from protobuf field string platform = 18; - * @return string - */ - public function getPlatform() - { - return $this->platform; - } - - /** - * The platform of the virtual agent response messages. - * If not empty, only emits messages from this platform in the response. - * Valid values are the enum names of - * [platform][google.cloud.dialogflow.v2.Intent.Message.platform]. - * - * Generated from protobuf field string platform = 18; - * @param string $var - * @return $this - */ - public function setPlatform($var) - { - GPBUtil::checkString($var, True); - $this->platform = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/QueryResult.php b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/QueryResult.php deleted file mode 100644 index d7ec0fedbd64..000000000000 --- a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/QueryResult.php +++ /dev/null @@ -1,847 +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 then use - * map, otherwise, depending on the parameter value type, it could be one of - * string, number, boolean, null, list or map. - * * MapValue value: If parameter's entity type is a composite entity then use - * map from composite entity property names to property values, otherwise, - * use parameter value. - * - * Generated from protobuf field .google.protobuf.Struct parameters = 4; - */ - protected $parameters = null; - /** - * This field is set to: - * - `false` if the matched intent has required parameters and not all of - * the required parameter values have been collected. - * - `true` if all required parameter values have been collected, or if the - * matched intent doesn't contain any required parameters. - * - * Generated from protobuf field bool all_required_params_present = 5; - */ - protected $all_required_params_present = false; - /** - * Indicates whether the conversational query triggers a cancellation for slot - * filling. For more information, see the [cancel slot filling - * documentation](https://cloud.google.com/dialogflow/es/docs/intents-actions-parameters#cancel). - * - * Generated from protobuf field bool cancels_slot_filling = 21; - */ - protected $cancels_slot_filling = false; - /** - * The text to be pronounced to the user or shown on the screen. - * Note: This is a legacy field, `fulfillment_messages` should be preferred. - * - * Generated from protobuf field string fulfillment_text = 6; - */ - protected $fulfillment_text = ''; - /** - * The collection of rich messages to present to the user. - * - * Generated from protobuf field repeated .google.cloud.dialogflow.v2.Intent.Message fulfillment_messages = 7; - */ - private $fulfillment_messages; - /** - * If the query was fulfilled by a webhook call, this field is set to the - * value of the `source` field returned in the webhook response. - * - * Generated from protobuf field string webhook_source = 8; - */ - protected $webhook_source = ''; - /** - * If the query was fulfilled by a webhook call, this field is set to the - * value of the `payload` field returned in the webhook response. - * - * Generated from protobuf field .google.protobuf.Struct webhook_payload = 9; - */ - protected $webhook_payload = null; - /** - * The collection of output contexts. If applicable, - * `output_contexts.parameters` contains entries with name - * `.original` containing the original parameter values - * before the query. - * - * Generated from protobuf field repeated .google.cloud.dialogflow.v2.Context output_contexts = 10; - */ - private $output_contexts; - /** - * The intent that matched the conversational query. Some, not - * all fields are filled in this message, including but not limited to: - * `name`, `display_name`, `end_interaction` and `is_fallback`. - * - * Generated from protobuf field .google.cloud.dialogflow.v2.Intent intent = 11; - */ - protected $intent = null; - /** - * The intent detection confidence. Values range from 0.0 - * (completely uncertain) to 1.0 (completely certain). - * This value is for informational purpose only and is only used to - * help match the best intent within the classification threshold. - * This value may change for the same end-user expression at any time due to a - * model retraining or change in implementation. - * If there are `multiple knowledge_answers` messages, this value is set to - * the greatest `knowledgeAnswers.match_confidence` value in the list. - * - * Generated from protobuf field float intent_detection_confidence = 12; - */ - protected $intent_detection_confidence = 0.0; - /** - * Free-form diagnostic information for the associated detect intent request. - * The fields of this data can change without notice, so you should not write - * code that depends on its structure. - * The data may contain: - * - webhook call latency - * - webhook errors - * - * Generated from protobuf field .google.protobuf.Struct diagnostic_info = 14; - */ - protected $diagnostic_info = null; - /** - * The sentiment analysis result, which depends on the - * `sentiment_analysis_request_config` specified in the request. - * - * Generated from protobuf field .google.cloud.dialogflow.v2.SentimentAnalysisResult sentiment_analysis_result = 17; - */ - protected $sentiment_analysis_result = null; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $query_text - * The original conversational query text: - * - If natural language text was provided as input, `query_text` contains - * a copy of the input. - * - If natural language speech audio was provided as input, `query_text` - * contains the speech recognition result. If speech recognizer produced - * multiple alternatives, a particular one is picked. - * - If automatic spell correction is enabled, `query_text` will contain the - * corrected user input. - * @type string $language_code - * The language that was triggered during intent detection. - * See [Language - * Support](https://cloud.google.com/dialogflow/docs/reference/language) - * for a list of the currently supported language codes. - * @type float $speech_recognition_confidence - * The Speech recognition confidence between 0.0 and 1.0. A higher number - * indicates an estimated greater likelihood that the recognized words are - * correct. The default of 0.0 is a sentinel value indicating that confidence - * was not set. - * This field is not guaranteed to be accurate or set. In particular this - * field isn't set for StreamingDetectIntent since the streaming endpoint has - * separate confidence estimates per portion of the audio in - * StreamingRecognitionResult. - * @type string $action - * The action name from the matched intent. - * @type \Google\Protobuf\Struct $parameters - * The collection of extracted parameters. - * Depending on your protocol or client library language, this is a - * map, associative array, symbol table, dictionary, or JSON object - * composed of a collection of (MapKey, MapValue) pairs: - * * MapKey type: string - * * MapKey value: parameter name - * * MapValue type: If parameter's entity type is a composite entity then use - * map, otherwise, depending on the parameter value type, it could be one of - * string, number, boolean, null, list or map. - * * MapValue value: If parameter's entity type is a composite entity then use - * map from composite entity property names to property values, otherwise, - * use parameter value. - * @type bool $all_required_params_present - * This field is set to: - * - `false` if the matched intent has required parameters and not all of - * the required parameter values have been collected. - * - `true` if all required parameter values have been collected, or if the - * matched intent doesn't contain any required parameters. - * @type bool $cancels_slot_filling - * Indicates whether the conversational query triggers a cancellation for slot - * filling. For more information, see the [cancel slot filling - * documentation](https://cloud.google.com/dialogflow/es/docs/intents-actions-parameters#cancel). - * @type string $fulfillment_text - * The text to be pronounced to the user or shown on the screen. - * Note: This is a legacy field, `fulfillment_messages` should be preferred. - * @type 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 then use - * map, otherwise, depending on the parameter value type, it could be one of - * string, number, boolean, null, list or map. - * * MapValue value: If parameter's entity type is a composite entity then use - * map from composite entity property names to property values, otherwise, - * use parameter value. - * - * Generated from protobuf field .google.protobuf.Struct parameters = 4; - * @return \Google\Protobuf\Struct|null - */ - public function getParameters() - { - return $this->parameters; - } - - public function hasParameters() - { - return isset($this->parameters); - } - - public function clearParameters() - { - unset($this->parameters); - } - - /** - * The collection of extracted parameters. - * Depending on your protocol or client library language, this is a - * map, associative array, symbol table, dictionary, or JSON object - * composed of a collection of (MapKey, MapValue) pairs: - * * MapKey type: string - * * MapKey value: parameter name - * * MapValue type: If parameter's entity type is a composite entity then use - * map, otherwise, depending on the parameter value type, it could be one of - * string, number, boolean, null, list or map. - * * MapValue value: If parameter's entity type is a composite entity then use - * map from composite entity property names to property values, otherwise, - * use parameter value. - * - * Generated from protobuf field .google.protobuf.Struct parameters = 4; - * @param \Google\Protobuf\Struct $var - * @return $this - */ - public function setParameters($var) - { - GPBUtil::checkMessage($var, \Google\Protobuf\Struct::class); - $this->parameters = $var; - - return $this; - } - - /** - * This field is set to: - * - `false` if the matched intent has required parameters and not all of - * the required parameter values have been collected. - * - `true` if all required parameter values have been collected, or if the - * matched intent doesn't contain any required parameters. - * - * Generated from protobuf field bool all_required_params_present = 5; - * @return bool - */ - public function getAllRequiredParamsPresent() - { - return $this->all_required_params_present; - } - - /** - * This field is set to: - * - `false` if the matched intent has required parameters and not all of - * the required parameter values have been collected. - * - `true` if all required parameter values have been collected, or if the - * matched intent doesn't contain any required parameters. - * - * Generated from protobuf field bool all_required_params_present = 5; - * @param bool $var - * @return $this - */ - public function setAllRequiredParamsPresent($var) - { - GPBUtil::checkBool($var); - $this->all_required_params_present = $var; - - return $this; - } - - /** - * Indicates whether the conversational query triggers a cancellation for slot - * filling. For more information, see the [cancel slot filling - * documentation](https://cloud.google.com/dialogflow/es/docs/intents-actions-parameters#cancel). - * - * Generated from protobuf field bool cancels_slot_filling = 21; - * @return bool - */ - public function getCancelsSlotFilling() - { - return $this->cancels_slot_filling; - } - - /** - * Indicates whether the conversational query triggers a cancellation for slot - * filling. For more information, see the [cancel slot filling - * documentation](https://cloud.google.com/dialogflow/es/docs/intents-actions-parameters#cancel). - * - * Generated from protobuf field bool cancels_slot_filling = 21; - * @param bool $var - * @return $this - */ - public function setCancelsSlotFilling($var) - { - GPBUtil::checkBool($var); - $this->cancels_slot_filling = $var; - - return $this; - } - - /** - * The text to be pronounced to the user or shown on the screen. - * Note: This is a legacy field, `fulfillment_messages` should be preferred. - * - * Generated from protobuf field string fulfillment_text = 6; - * @return string - */ - public function getFulfillmentText() - { - return $this->fulfillment_text; - } - - /** - * The text to be pronounced to the user or shown on the screen. - * Note: This is a legacy field, `fulfillment_messages` should be preferred. - * - * Generated from protobuf field string fulfillment_text = 6; - * @param string $var - * @return $this - */ - public function setFulfillmentText($var) - { - GPBUtil::checkString($var, True); - $this->fulfillment_text = $var; - - return $this; - } - - /** - * The collection of rich messages to present to the user. - * - * Generated from protobuf field repeated .google.cloud.dialogflow.v2.Intent.Message fulfillment_messages = 7; - * @return \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/SearchKnowledgeAnswer.php b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/SearchKnowledgeAnswer.php deleted file mode 100644 index 9e7e6214b069..000000000000 --- a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/SearchKnowledgeAnswer.php +++ /dev/null @@ -1,181 +0,0 @@ -google.cloud.dialogflow.v2.SearchKnowledgeAnswer - */ -class SearchKnowledgeAnswer extends \Google\Protobuf\Internal\Message -{ - /** - * The piece of text from the knowledge base documents that answers - * the search query - * - * Generated from protobuf field string answer = 1; - */ - protected $answer = ''; - /** - * The type of the answer. - * - * Generated from protobuf field .google.cloud.dialogflow.v2.SearchKnowledgeAnswer.AnswerType answer_type = 2; - */ - protected $answer_type = 0; - /** - * All sources used to generate the answer. - * - * Generated from protobuf field repeated .google.cloud.dialogflow.v2.SearchKnowledgeAnswer.AnswerSource answer_sources = 3; - */ - private $answer_sources; - /** - * The name of the answer record. - * Format: `projects//locations//answer - * Records/` - * - * Generated from protobuf field string answer_record = 5; - */ - protected $answer_record = ''; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $answer - * The piece of text from the knowledge base documents that answers - * the search query - * @type int $answer_type - * The type of the answer. - * @type array<\Google\Cloud\Dialogflow\V2\SearchKnowledgeAnswer\AnswerSource>|\Google\Protobuf\Internal\RepeatedField $answer_sources - * All sources used to generate the answer. - * @type string $answer_record - * The name of the answer record. - * Format: `projects//locations//answer - * Records/` - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Dialogflow\V2\Conversation::initOnce(); - parent::__construct($data); - } - - /** - * The piece of text from the knowledge base documents that answers - * the search query - * - * Generated from protobuf field string answer = 1; - * @return string - */ - public function getAnswer() - { - return $this->answer; - } - - /** - * The piece of text from the knowledge base documents that answers - * the search query - * - * Generated from protobuf field string answer = 1; - * @param string $var - * @return $this - */ - public function setAnswer($var) - { - GPBUtil::checkString($var, True); - $this->answer = $var; - - return $this; - } - - /** - * The type of the answer. - * - * Generated from protobuf field .google.cloud.dialogflow.v2.SearchKnowledgeAnswer.AnswerType answer_type = 2; - * @return int - */ - public function getAnswerType() - { - return $this->answer_type; - } - - /** - * The type of the answer. - * - * Generated from protobuf field .google.cloud.dialogflow.v2.SearchKnowledgeAnswer.AnswerType answer_type = 2; - * @param int $var - * @return $this - */ - public function setAnswerType($var) - { - GPBUtil::checkEnum($var, \Google\Cloud\Dialogflow\V2\SearchKnowledgeAnswer\AnswerType::class); - $this->answer_type = $var; - - return $this; - } - - /** - * All sources used to generate the answer. - * - * Generated from protobuf field repeated .google.cloud.dialogflow.v2.SearchKnowledgeAnswer.AnswerSource answer_sources = 3; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getAnswerSources() - { - return $this->answer_sources; - } - - /** - * All sources used to generate the answer. - * - * Generated from protobuf field repeated .google.cloud.dialogflow.v2.SearchKnowledgeAnswer.AnswerSource answer_sources = 3; - * @param array<\Google\Cloud\Dialogflow\V2\SearchKnowledgeAnswer\AnswerSource>|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setAnswerSources($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Dialogflow\V2\SearchKnowledgeAnswer\AnswerSource::class); - $this->answer_sources = $arr; - - return $this; - } - - /** - * The name of the answer record. - * Format: `projects//locations//answer - * Records/` - * - * Generated from protobuf field string answer_record = 5; - * @return string - */ - public function getAnswerRecord() - { - return $this->answer_record; - } - - /** - * The name of the answer record. - * Format: `projects//locations//answer - * Records/` - * - * Generated from protobuf field string answer_record = 5; - * @param string $var - * @return $this - */ - public function setAnswerRecord($var) - { - GPBUtil::checkString($var, True); - $this->answer_record = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/SearchKnowledgeAnswer/AnswerSource.php b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/SearchKnowledgeAnswer/AnswerSource.php deleted file mode 100644 index dd6e5bf95ab9..000000000000 --- a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/SearchKnowledgeAnswer/AnswerSource.php +++ /dev/null @@ -1,138 +0,0 @@ -google.cloud.dialogflow.v2.SearchKnowledgeAnswer.AnswerSource - */ -class AnswerSource extends \Google\Protobuf\Internal\Message -{ - /** - * The title of the article. - * - * Generated from protobuf field string title = 1; - */ - protected $title = ''; - /** - * The URI of the article. - * - * Generated from protobuf field string uri = 2; - */ - protected $uri = ''; - /** - * The relevant snippet of the article. - * - * Generated from protobuf field string snippet = 3; - */ - protected $snippet = ''; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $title - * The title of the article. - * @type string $uri - * The URI of the article. - * @type string $snippet - * The relevant snippet of the article. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Dialogflow\V2\Conversation::initOnce(); - parent::__construct($data); - } - - /** - * The title of the article. - * - * Generated from protobuf field string title = 1; - * @return string - */ - public function getTitle() - { - return $this->title; - } - - /** - * The title of the article. - * - * Generated from protobuf field string title = 1; - * @param string $var - * @return $this - */ - public function setTitle($var) - { - GPBUtil::checkString($var, True); - $this->title = $var; - - return $this; - } - - /** - * The URI of the article. - * - * Generated from protobuf field string uri = 2; - * @return string - */ - public function getUri() - { - return $this->uri; - } - - /** - * The URI of the article. - * - * Generated from protobuf field string uri = 2; - * @param string $var - * @return $this - */ - public function setUri($var) - { - GPBUtil::checkString($var, True); - $this->uri = $var; - - return $this; - } - - /** - * The relevant snippet of the article. - * - * Generated from protobuf field string snippet = 3; - * @return string - */ - public function getSnippet() - { - return $this->snippet; - } - - /** - * The relevant snippet of the article. - * - * Generated from protobuf field string snippet = 3; - * @param string $var - * @return $this - */ - public function setSnippet($var) - { - GPBUtil::checkString($var, True); - $this->snippet = $var; - - return $this; - } - -} - -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(AnswerSource::class, \Google\Cloud\Dialogflow\V2\SearchKnowledgeAnswer_AnswerSource::class); - diff --git a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/SearchKnowledgeAnswer/AnswerType.php b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/SearchKnowledgeAnswer/AnswerType.php deleted file mode 100644 index dbbc1d41ebdf..000000000000 --- a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/SearchKnowledgeAnswer/AnswerType.php +++ /dev/null @@ -1,71 +0,0 @@ -google.cloud.dialogflow.v2.SearchKnowledgeAnswer.AnswerType - */ -class AnswerType -{ - /** - * The answer has a unspecified type. - * - * Generated from protobuf enum ANSWER_TYPE_UNSPECIFIED = 0; - */ - const ANSWER_TYPE_UNSPECIFIED = 0; - /** - * The answer is from FAQ documents. - * - * Generated from protobuf enum FAQ = 1; - */ - const FAQ = 1; - /** - * The answer is from generative model. - * - * Generated from protobuf enum GENERATIVE = 2; - */ - const GENERATIVE = 2; - /** - * The answer is from intent matching. - * - * Generated from protobuf enum INTENT = 3; - */ - const INTENT = 3; - - private static $valueToName = [ - self::ANSWER_TYPE_UNSPECIFIED => 'ANSWER_TYPE_UNSPECIFIED', - self::FAQ => 'FAQ', - self::GENERATIVE => 'GENERATIVE', - self::INTENT => 'INTENT', - ]; - - 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(AnswerType::class, \Google\Cloud\Dialogflow\V2\SearchKnowledgeAnswer_AnswerType::class); - diff --git a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/SearchKnowledgeRequest.php b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/SearchKnowledgeRequest.php deleted file mode 100644 index d16f90981a9f..000000000000 --- a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/SearchKnowledgeRequest.php +++ /dev/null @@ -1,308 +0,0 @@ -google.cloud.dialogflow.v2.SearchKnowledgeRequest - */ -class SearchKnowledgeRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The parent resource contains the conversation profile - * Format: 'projects/' or `projects//locations/`. - * - * Generated from protobuf field string parent = 6 [(.google.api.field_behavior) = REQUIRED]; - */ - protected $parent = ''; - /** - * Required. The natural language text query for knowledge search. - * - * Generated from protobuf field .google.cloud.dialogflow.v2.TextInput query = 1 [(.google.api.field_behavior) = REQUIRED]; - */ - protected $query = null; - /** - * Required. The conversation profile used to configure the search. - * Format: `projects//locations//conversationProfiles/`. - * - * Generated from protobuf field string conversation_profile = 2 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - */ - protected $conversation_profile = ''; - /** - * Required. The ID of the search session. - * The session_id can be combined with Dialogflow V3 Agent ID retrieved from - * conversation profile or on its own to identify a search session. The search - * history of the same session will impact the search result. It's up to the - * API caller to choose an appropriate `Session ID`. It can be a random number - * or some type of session identifiers (preferably hashed). The length must - * not exceed 36 characters. - * - * Generated from protobuf field string session_id = 3 [(.google.api.field_behavior) = REQUIRED]; - */ - protected $session_id = ''; - /** - * Optional. The conversation (between human agent and end user) where the - * search request is triggered. Format: `projects//locations//conversations/`. - * - * Generated from protobuf field string conversation = 4 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { - */ - protected $conversation = ''; - /** - * Optional. The name of the latest conversation message when the request is - * triggered. - * Format: `projects//locations//conversations//messages/`. - * - * Generated from protobuf field string latest_message = 5 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { - */ - protected $latest_message = ''; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $parent - * Required. The parent resource contains the conversation profile - * Format: 'projects/' or `projects//locations/`. - * @type \Google\Cloud\Dialogflow\V2\TextInput $query - * Required. The natural language text query for knowledge search. - * @type string $conversation_profile - * Required. The conversation profile used to configure the search. - * Format: `projects//locations//conversationProfiles/`. - * @type string $session_id - * Required. The ID of the search session. - * The session_id can be combined with Dialogflow V3 Agent ID retrieved from - * conversation profile or on its own to identify a search session. The search - * history of the same session will impact the search result. It's up to the - * API caller to choose an appropriate `Session ID`. It can be a random number - * or some type of session identifiers (preferably hashed). The length must - * not exceed 36 characters. - * @type string $conversation - * Optional. The conversation (between human agent and end user) where the - * search request is triggered. Format: `projects//locations//conversations/`. - * @type string $latest_message - * Optional. The name of the latest conversation message when the request is - * triggered. - * Format: `projects//locations//conversations//messages/`. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Dialogflow\V2\Conversation::initOnce(); - parent::__construct($data); - } - - /** - * Required. The parent resource contains the conversation profile - * Format: 'projects/' or `projects//locations/`. - * - * Generated from protobuf field string parent = 6 [(.google.api.field_behavior) = REQUIRED]; - * @return string - */ - public function getParent() - { - return $this->parent; - } - - /** - * Required. The parent resource contains the conversation profile - * Format: 'projects/' or `projects//locations/`. - * - * Generated from protobuf field string parent = 6 [(.google.api.field_behavior) = REQUIRED]; - * @param string $var - * @return $this - */ - public function setParent($var) - { - GPBUtil::checkString($var, True); - $this->parent = $var; - - return $this; - } - - /** - * Required. The natural language text query for knowledge search. - * - * Generated from protobuf field .google.cloud.dialogflow.v2.TextInput query = 1 [(.google.api.field_behavior) = REQUIRED]; - * @return \Google\Cloud\Dialogflow\V2\TextInput|null - */ - public function getQuery() - { - return $this->query; - } - - public function hasQuery() - { - return isset($this->query); - } - - public function clearQuery() - { - unset($this->query); - } - - /** - * Required. The natural language text query for knowledge search. - * - * Generated from protobuf field .google.cloud.dialogflow.v2.TextInput query = 1 [(.google.api.field_behavior) = REQUIRED]; - * @param \Google\Cloud\Dialogflow\V2\TextInput $var - * @return $this - */ - public function setQuery($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Dialogflow\V2\TextInput::class); - $this->query = $var; - - return $this; - } - - /** - * Required. The conversation profile used to configure the search. - * Format: `projects//locations//conversationProfiles/`. - * - * Generated from protobuf field string conversation_profile = 2 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @return string - */ - public function getConversationProfile() - { - return $this->conversation_profile; - } - - /** - * Required. The conversation profile used to configure the search. - * Format: `projects//locations//conversationProfiles/`. - * - * Generated from protobuf field string conversation_profile = 2 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @param string $var - * @return $this - */ - public function setConversationProfile($var) - { - GPBUtil::checkString($var, True); - $this->conversation_profile = $var; - - return $this; - } - - /** - * Required. The ID of the search session. - * The session_id can be combined with Dialogflow V3 Agent ID retrieved from - * conversation profile or on its own to identify a search session. The search - * history of the same session will impact the search result. It's up to the - * API caller to choose an appropriate `Session ID`. It can be a random number - * or some type of session identifiers (preferably hashed). The length must - * not exceed 36 characters. - * - * Generated from protobuf field string session_id = 3 [(.google.api.field_behavior) = REQUIRED]; - * @return string - */ - public function getSessionId() - { - return $this->session_id; - } - - /** - * Required. The ID of the search session. - * The session_id can be combined with Dialogflow V3 Agent ID retrieved from - * conversation profile or on its own to identify a search session. The search - * history of the same session will impact the search result. It's up to the - * API caller to choose an appropriate `Session ID`. It can be a random number - * or some type of session identifiers (preferably hashed). The length must - * not exceed 36 characters. - * - * Generated from protobuf field string session_id = 3 [(.google.api.field_behavior) = REQUIRED]; - * @param string $var - * @return $this - */ - public function setSessionId($var) - { - GPBUtil::checkString($var, True); - $this->session_id = $var; - - return $this; - } - - /** - * Optional. The conversation (between human agent and end user) where the - * search request is triggered. Format: `projects//locations//conversations/`. - * - * Generated from protobuf field string conversation = 4 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { - * @return string - */ - public function getConversation() - { - return $this->conversation; - } - - /** - * Optional. The conversation (between human agent and end user) where the - * search request is triggered. Format: `projects//locations//conversations/`. - * - * Generated from protobuf field string conversation = 4 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { - * @param string $var - * @return $this - */ - public function setConversation($var) - { - GPBUtil::checkString($var, True); - $this->conversation = $var; - - return $this; - } - - /** - * Optional. The name of the latest conversation message when the request is - * triggered. - * Format: `projects//locations//conversations//messages/`. - * - * Generated from protobuf field string latest_message = 5 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { - * @return string - */ - public function getLatestMessage() - { - return $this->latest_message; - } - - /** - * Optional. The name of the latest conversation message when the request is - * triggered. - * Format: `projects//locations//conversations//messages/`. - * - * Generated from protobuf field string latest_message = 5 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { - * @param string $var - * @return $this - */ - public function setLatestMessage($var) - { - GPBUtil::checkString($var, True); - $this->latest_message = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/SearchKnowledgeResponse.php b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/SearchKnowledgeResponse.php deleted file mode 100644 index 8e15b611b209..000000000000 --- a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/SearchKnowledgeResponse.php +++ /dev/null @@ -1,106 +0,0 @@ -google.cloud.dialogflow.v2.SearchKnowledgeResponse - */ -class SearchKnowledgeResponse extends \Google\Protobuf\Internal\Message -{ - /** - * Most relevant snippets extracted from articles in the given knowledge base, - * ordered by confidence. - * - * Generated from protobuf field repeated .google.cloud.dialogflow.v2.SearchKnowledgeAnswer answers = 2; - */ - private $answers; - /** - * The rewritten query used to search knowledge. - * - * Generated from protobuf field string rewritten_query = 3; - */ - protected $rewritten_query = ''; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type array<\Google\Cloud\Dialogflow\V2\SearchKnowledgeAnswer>|\Google\Protobuf\Internal\RepeatedField $answers - * Most relevant snippets extracted from articles in the given knowledge base, - * ordered by confidence. - * @type string $rewritten_query - * The rewritten query used to search knowledge. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Dialogflow\V2\Conversation::initOnce(); - parent::__construct($data); - } - - /** - * Most relevant snippets extracted from articles in the given knowledge base, - * ordered by confidence. - * - * Generated from protobuf field repeated .google.cloud.dialogflow.v2.SearchKnowledgeAnswer answers = 2; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getAnswers() - { - return $this->answers; - } - - /** - * Most relevant snippets extracted from articles in the given knowledge base, - * ordered by confidence. - * - * Generated from protobuf field repeated .google.cloud.dialogflow.v2.SearchKnowledgeAnswer answers = 2; - * @param array<\Google\Cloud\Dialogflow\V2\SearchKnowledgeAnswer>|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setAnswers($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Dialogflow\V2\SearchKnowledgeAnswer::class); - $this->answers = $arr; - - return $this; - } - - /** - * The rewritten query used to search knowledge. - * - * Generated from protobuf field string rewritten_query = 3; - * @return string - */ - public function getRewrittenQuery() - { - return $this->rewritten_query; - } - - /** - * The rewritten query used to search knowledge. - * - * Generated from protobuf field string rewritten_query = 3; - * @param string $var - * @return $this - */ - public function setRewrittenQuery($var) - { - GPBUtil::checkString($var, True); - $this->rewritten_query = $var; - - return $this; - } - -} - 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 2f9398ec632c..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 [(.google.api.field_behavior) = OPTIONAL]; - */ - private $phrases; - /** - * Optional. Boost for this context compared to other contexts: - * * If the boost is positive, Dialogflow will increase the probability that - * the phrases in this context are recognized over similar sounding phrases. - * * If the boost is unspecified or non-positive, Dialogflow will not apply - * any boost. - * Dialogflow recommends that you use boosts in the range (0, 20] and that you - * find a value that fits your use case with binary search. - * - * Generated from protobuf field float boost = 2 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $boost = 0.0; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type 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 [(.google.api.field_behavior) = OPTIONAL]; - * @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 [(.google.api.field_behavior) = OPTIONAL]; - * @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 [(.google.api.field_behavior) = OPTIONAL]; - * @return float - */ - public function getBoost() - { - return $this->boost; - } - - /** - * Optional. Boost for this context compared to other contexts: - * * If the boost is positive, Dialogflow will increase the probability that - * the phrases in this context are recognized over similar sounding phrases. - * * If the boost is unspecified or non-positive, Dialogflow will not apply - * any boost. - * Dialogflow recommends that you use boosts in the range (0, 20] and that you - * find a value that fits your use case with binary search. - * - * Generated from protobuf field float boost = 2 [(.google.api.field_behavior) = OPTIONAL]; - * @param float $var - * @return $this - */ - public function setBoost($var) - { - GPBUtil::checkFloat($var); - $this->boost = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/SpeechModelVariant.php b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/SpeechModelVariant.php 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 6d7ec2f3ac7d..000000000000 --- a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/SpeechToTextConfig.php +++ /dev/null @@ -1,432 +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 Dialogflow auto-selects a model based on other - * parameters in the SpeechToTextConfig and Agent settings. - * If enhanced speech model is enabled for the agent and an enhanced - * version of the specified model for the language does not exist, then the - * speech is recognized using the standard version of the specified model. - * Refer to - * [Cloud Speech API - * documentation](https://cloud.google.com/speech-to-text/docs/basics#select-model) - * for more details. - * If you specify a model, the following models typically have the best - * performance: - * - phone_call (best for Agent Assist and telephony) - * - latest_short (best for Dialogflow non-telephony) - * - command_and_search - * Leave this field unspecified to use - * [Agent Speech - * settings](https://cloud.google.com/dialogflow/cx/docs/concept/agent#settings-speech) - * for model selection. - * - * Generated from protobuf field string model = 2; - */ - protected $model = ''; - /** - * Audio encoding of the audio content to process. - * - * Generated from protobuf field .google.cloud.dialogflow.v2.AudioEncoding audio_encoding = 6; - */ - protected $audio_encoding = 0; - /** - * Sample rate (in Hertz) of the audio content sent in the query. - * Refer to [Cloud Speech API - * documentation](https://cloud.google.com/speech-to-text/docs/basics) for - * more details. - * - * Generated from protobuf field int32 sample_rate_hertz = 7; - */ - protected $sample_rate_hertz = 0; - /** - * The language of the supplied audio. Dialogflow does not do - * translations. See [Language - * Support](https://cloud.google.com/dialogflow/docs/reference/language) - * for a list of the currently supported language codes. Note that queries in - * the same session do not necessarily need to specify the same language. - * - * Generated from protobuf field string language_code = 8; - */ - protected $language_code = ''; - /** - * If `true`, Dialogflow returns - * [SpeechWordInfo][google.cloud.dialogflow.v2.SpeechWordInfo] in - * [StreamingRecognitionResult][google.cloud.dialogflow.v2.StreamingRecognitionResult] - * with information about the recognized speech words, e.g. start and end time - * offsets. If false or unspecified, Speech doesn't return any word-level - * information. - * - * Generated from protobuf field bool enable_word_info = 9; - */ - protected $enable_word_info = false; - /** - * Use timeout based endpointing, interpreting endpointer sensitivy as - * seconds of timeout value. - * - * Generated from protobuf field bool use_timeout_based_endpointing = 11; - */ - protected $use_timeout_based_endpointing = false; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type int $speech_model_variant - * The speech model used in speech to text. - * `SPEECH_MODEL_VARIANT_UNSPECIFIED`, `USE_BEST_AVAILABLE` will be treated as - * `USE_ENHANCED`. It can be overridden in - * [AnalyzeContentRequest][google.cloud.dialogflow.v2.AnalyzeContentRequest] - * and - * [StreamingAnalyzeContentRequest][google.cloud.dialogflow.v2.StreamingAnalyzeContentRequest] - * request. If enhanced model variant is specified and an enhanced version of - * the specified model for the language does not exist, then it would emit an - * error. - * @type string $model - * Which Speech model to select. Select the - * model best suited to your domain to get best results. If a model is not - * explicitly specified, then Dialogflow auto-selects a model based on other - * parameters in the SpeechToTextConfig and Agent settings. - * If enhanced speech model is enabled for the agent and an enhanced - * version of the specified model for the language does not exist, then the - * speech is recognized using the standard version of the specified model. - * Refer to - * [Cloud Speech API - * documentation](https://cloud.google.com/speech-to-text/docs/basics#select-model) - * for more details. - * If you specify a model, the following models typically have the best - * performance: - * - phone_call (best for Agent Assist and telephony) - * - latest_short (best for Dialogflow non-telephony) - * - command_and_search - * Leave this field unspecified to use - * [Agent Speech - * settings](https://cloud.google.com/dialogflow/cx/docs/concept/agent#settings-speech) - * for model selection. - * @type int $audio_encoding - * Audio encoding of the audio content to process. - * @type int $sample_rate_hertz - * Sample rate (in Hertz) of the audio content sent in the query. - * Refer to [Cloud Speech API - * documentation](https://cloud.google.com/speech-to-text/docs/basics) for - * more details. - * @type string $language_code - * The language of the supplied audio. Dialogflow does not do - * translations. See [Language - * Support](https://cloud.google.com/dialogflow/docs/reference/language) - * for a list of the currently supported language codes. Note that queries in - * the same session do not necessarily need to specify the same language. - * @type bool $enable_word_info - * If `true`, Dialogflow returns - * [SpeechWordInfo][google.cloud.dialogflow.v2.SpeechWordInfo] in - * [StreamingRecognitionResult][google.cloud.dialogflow.v2.StreamingRecognitionResult] - * with information about the recognized speech words, e.g. start and end time - * offsets. If false or unspecified, Speech doesn't return any word-level - * information. - * @type bool $use_timeout_based_endpointing - * Use timeout based endpointing, interpreting endpointer sensitivy as - * seconds of timeout value. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Dialogflow\V2\AudioConfig::initOnce(); - parent::__construct($data); - } - - /** - * The speech model used in speech to text. - * `SPEECH_MODEL_VARIANT_UNSPECIFIED`, `USE_BEST_AVAILABLE` will be treated as - * `USE_ENHANCED`. It can be overridden in - * [AnalyzeContentRequest][google.cloud.dialogflow.v2.AnalyzeContentRequest] - * and - * [StreamingAnalyzeContentRequest][google.cloud.dialogflow.v2.StreamingAnalyzeContentRequest] - * request. If enhanced model variant is specified and an enhanced version of - * the specified model for the language does not exist, then it would emit an - * error. - * - * Generated from protobuf field .google.cloud.dialogflow.v2.SpeechModelVariant speech_model_variant = 1; - * @return int - */ - public function getSpeechModelVariant() - { - return $this->speech_model_variant; - } - - /** - * The speech model used in speech to text. - * `SPEECH_MODEL_VARIANT_UNSPECIFIED`, `USE_BEST_AVAILABLE` will be treated as - * `USE_ENHANCED`. It can be overridden in - * [AnalyzeContentRequest][google.cloud.dialogflow.v2.AnalyzeContentRequest] - * and - * [StreamingAnalyzeContentRequest][google.cloud.dialogflow.v2.StreamingAnalyzeContentRequest] - * request. If enhanced model variant is specified and an enhanced version of - * the specified model for the language does not exist, then it would emit an - * error. - * - * Generated from protobuf field .google.cloud.dialogflow.v2.SpeechModelVariant speech_model_variant = 1; - * @param int $var - * @return $this - */ - public function setSpeechModelVariant($var) - { - GPBUtil::checkEnum($var, \Google\Cloud\Dialogflow\V2\SpeechModelVariant::class); - $this->speech_model_variant = $var; - - return $this; - } - - /** - * Which Speech model to select. Select the - * model best suited to your domain to get best results. If a model is not - * explicitly specified, then Dialogflow auto-selects a model based on other - * parameters in the SpeechToTextConfig and Agent settings. - * If enhanced speech model is enabled for the agent and an enhanced - * version of the specified model for the language does not exist, then the - * speech is recognized using the standard version of the specified model. - * Refer to - * [Cloud Speech API - * documentation](https://cloud.google.com/speech-to-text/docs/basics#select-model) - * for more details. - * If you specify a model, the following models typically have the best - * performance: - * - phone_call (best for Agent Assist and telephony) - * - latest_short (best for Dialogflow non-telephony) - * - command_and_search - * Leave this field unspecified to use - * [Agent Speech - * settings](https://cloud.google.com/dialogflow/cx/docs/concept/agent#settings-speech) - * for model selection. - * - * Generated from protobuf field string model = 2; - * @return string - */ - public function getModel() - { - return $this->model; - } - - /** - * Which Speech model to select. Select the - * model best suited to your domain to get best results. If a model is not - * explicitly specified, then Dialogflow auto-selects a model based on other - * parameters in the SpeechToTextConfig and Agent settings. - * If enhanced speech model is enabled for the agent and an enhanced - * version of the specified model for the language does not exist, then the - * speech is recognized using the standard version of the specified model. - * Refer to - * [Cloud Speech API - * documentation](https://cloud.google.com/speech-to-text/docs/basics#select-model) - * for more details. - * If you specify a model, the following models typically have the best - * performance: - * - phone_call (best for Agent Assist and telephony) - * - latest_short (best for Dialogflow non-telephony) - * - command_and_search - * Leave this field unspecified to use - * [Agent Speech - * settings](https://cloud.google.com/dialogflow/cx/docs/concept/agent#settings-speech) - * for model selection. - * - * Generated from protobuf field string model = 2; - * @param string $var - * @return $this - */ - public function setModel($var) - { - GPBUtil::checkString($var, True); - $this->model = $var; - - return $this; - } - - /** - * Audio encoding of the audio content to process. - * - * Generated from protobuf field .google.cloud.dialogflow.v2.AudioEncoding audio_encoding = 6; - * @return int - */ - public function getAudioEncoding() - { - return $this->audio_encoding; - } - - /** - * Audio encoding of the audio content to process. - * - * Generated from protobuf field .google.cloud.dialogflow.v2.AudioEncoding audio_encoding = 6; - * @param int $var - * @return $this - */ - public function setAudioEncoding($var) - { - GPBUtil::checkEnum($var, \Google\Cloud\Dialogflow\V2\AudioEncoding::class); - $this->audio_encoding = $var; - - return $this; - } - - /** - * Sample rate (in Hertz) of the audio content sent in the query. - * Refer to [Cloud Speech API - * documentation](https://cloud.google.com/speech-to-text/docs/basics) for - * more details. - * - * Generated from protobuf field int32 sample_rate_hertz = 7; - * @return int - */ - public function getSampleRateHertz() - { - return $this->sample_rate_hertz; - } - - /** - * Sample rate (in Hertz) of the audio content sent in the query. - * Refer to [Cloud Speech API - * documentation](https://cloud.google.com/speech-to-text/docs/basics) for - * more details. - * - * Generated from protobuf field int32 sample_rate_hertz = 7; - * @param int $var - * @return $this - */ - public function setSampleRateHertz($var) - { - GPBUtil::checkInt32($var); - $this->sample_rate_hertz = $var; - - return $this; - } - - /** - * The language of the supplied audio. Dialogflow does not do - * translations. See [Language - * Support](https://cloud.google.com/dialogflow/docs/reference/language) - * for a list of the currently supported language codes. Note that queries in - * the same session do not necessarily need to specify the same language. - * - * Generated from protobuf field string language_code = 8; - * @return string - */ - public function getLanguageCode() - { - return $this->language_code; - } - - /** - * The language of the supplied audio. Dialogflow does not do - * translations. See [Language - * Support](https://cloud.google.com/dialogflow/docs/reference/language) - * for a list of the currently supported language codes. Note that queries in - * the same session do not necessarily need to specify the same language. - * - * Generated from protobuf field string language_code = 8; - * @param string $var - * @return $this - */ - public function setLanguageCode($var) - { - GPBUtil::checkString($var, True); - $this->language_code = $var; - - return $this; - } - - /** - * If `true`, Dialogflow returns - * [SpeechWordInfo][google.cloud.dialogflow.v2.SpeechWordInfo] in - * [StreamingRecognitionResult][google.cloud.dialogflow.v2.StreamingRecognitionResult] - * with information about the recognized speech words, e.g. start and end time - * offsets. If false or unspecified, Speech doesn't return any word-level - * information. - * - * Generated from protobuf field bool enable_word_info = 9; - * @return bool - */ - public function getEnableWordInfo() - { - return $this->enable_word_info; - } - - /** - * If `true`, Dialogflow returns - * [SpeechWordInfo][google.cloud.dialogflow.v2.SpeechWordInfo] in - * [StreamingRecognitionResult][google.cloud.dialogflow.v2.StreamingRecognitionResult] - * with information about the recognized speech words, e.g. start and end time - * offsets. If false or unspecified, Speech doesn't return any word-level - * information. - * - * Generated from protobuf field bool enable_word_info = 9; - * @param bool $var - * @return $this - */ - public function setEnableWordInfo($var) - { - GPBUtil::checkBool($var); - $this->enable_word_info = $var; - - return $this; - } - - /** - * Use timeout based endpointing, interpreting endpointer sensitivy as - * seconds of timeout value. - * - * Generated from protobuf field bool use_timeout_based_endpointing = 11; - * @return bool - */ - public function getUseTimeoutBasedEndpointing() - { - return $this->use_timeout_based_endpointing; - } - - /** - * Use timeout based endpointing, interpreting endpointer sensitivy as - * seconds of timeout value. - * - * Generated from protobuf field bool use_timeout_based_endpointing = 11; - * @param bool $var - * @return $this - */ - public function setUseTimeoutBasedEndpointing($var) - { - GPBUtil::checkBool($var); - $this->use_timeout_based_endpointing = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/SpeechWordInfo.php b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/SpeechWordInfo.php 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 7861bbaeedd2..000000000000 --- a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/StreamingAnalyzeContentRequest.php +++ /dev/null @@ -1,693 +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; - /** - * Optional. Enable full bidirectional streaming. You can keep streaming the - * audio until timeout, and there's no need to half close the stream to get - * the response. - * Restrictions: - * - Timeout: 3 mins. - * - Audio Encoding: only supports - * [AudioEncoding.AUDIO_ENCODING_LINEAR_16][google.cloud.dialogflow.v2.AudioEncoding.AUDIO_ENCODING_LINEAR_16] - * and - * [AudioEncoding.AUDIO_ENCODING_MULAW][google.cloud.dialogflow.v2.AudioEncoding.AUDIO_ENCODING_MULAW] - * - Lifecycle: conversation should be in `Assist Stage`, go to - * [Conversation.CreateConversation][] for more information. - * InvalidArgument Error will be returned if the one of restriction checks - * failed. - * You can find more details in - * https://cloud.google.com/agent-assist/docs/extended-streaming - * - * Generated from protobuf field bool enable_extended_streaming = 11 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $enable_extended_streaming = false; - /** - * 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, and would cancel the speech recognition if any ongoing. - * @type \Google\Cloud\Dialogflow\V2\TelephonyDtmfEvents $input_dtmf - * The DTMF digits used to invoke intent and fill in parameter value. - * This input is ignored if the previous response indicated that DTMF input - * is not accepted. - * @type \Google\Cloud\Dialogflow\V2\QueryParameters $query_params - * Parameters for a Dialogflow virtual-agent query. - * @type \Google\Cloud\Dialogflow\V2\AssistQueryParameters $assist_query_params - * Parameters for a human assist query. - * @type \Google\Protobuf\Struct $cx_parameters - * Additional parameters to be put into Dialogflow CX session parameters. To - * remove a parameter from the session, clients should explicitly set the - * parameter value to null. - * Note: this field should only be used if you are connecting to a Dialogflow - * CX agent. - * @type bool $enable_extended_streaming - * Optional. Enable full bidirectional streaming. You can keep streaming the - * audio until timeout, and there's no need to half close the stream to get - * the response. - * Restrictions: - * - Timeout: 3 mins. - * - Audio Encoding: only supports - * [AudioEncoding.AUDIO_ENCODING_LINEAR_16][google.cloud.dialogflow.v2.AudioEncoding.AUDIO_ENCODING_LINEAR_16] - * and - * [AudioEncoding.AUDIO_ENCODING_MULAW][google.cloud.dialogflow.v2.AudioEncoding.AUDIO_ENCODING_MULAW] - * - Lifecycle: conversation should be in `Assist Stage`, go to - * [Conversation.CreateConversation][] for more information. - * InvalidArgument Error will be returned if the one of restriction checks - * failed. - * You can find more details in - * https://cloud.google.com/agent-assist/docs/extended-streaming - * @type bool $enable_partial_automated_agent_reply - * 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, and would cancel the speech recognition if any ongoing. - * - * Generated from protobuf field string input_text = 6; - * @return string - */ - public function getInputText() - { - return $this->readOneof(6); - } - - public function hasInputText() - { - return $this->hasOneof(6); - } - - /** - * The UTF-8 encoded natural language text to be processed. Must be sent if - * `text_config` is set in the first message. Text length must not exceed - * 256 bytes for virtual agent interactions. The `input_text` field can be - * only sent once, and would cancel the speech recognition if any ongoing. - * - * Generated from protobuf field string input_text = 6; - * @param string $var - * @return $this - */ - public function setInputText($var) - { - GPBUtil::checkString($var, True); - $this->writeOneof(6, $var); - - return $this; - } - - /** - * The DTMF digits used to invoke intent and fill in parameter value. - * This input is ignored if the previous response indicated that DTMF input - * is not accepted. - * - * Generated from protobuf field .google.cloud.dialogflow.v2.TelephonyDtmfEvents input_dtmf = 9; - * @return \Google\Cloud\Dialogflow\V2\TelephonyDtmfEvents|null - */ - public function getInputDtmf() - { - return $this->readOneof(9); - } - - public function hasInputDtmf() - { - return $this->hasOneof(9); - } - - /** - * The DTMF digits used to invoke intent and fill in parameter value. - * This input is ignored if the previous response indicated that DTMF input - * is not accepted. - * - * Generated from protobuf field .google.cloud.dialogflow.v2.TelephonyDtmfEvents input_dtmf = 9; - * @param \Google\Cloud\Dialogflow\V2\TelephonyDtmfEvents $var - * @return $this - */ - public function setInputDtmf($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Dialogflow\V2\TelephonyDtmfEvents::class); - $this->writeOneof(9, $var); - - return $this; - } - - /** - * Parameters for a Dialogflow virtual-agent query. - * - * Generated from protobuf field .google.cloud.dialogflow.v2.QueryParameters query_params = 7; - * @return \Google\Cloud\Dialogflow\V2\QueryParameters|null - */ - public function getQueryParams() - { - return $this->query_params; - } - - public function hasQueryParams() - { - return isset($this->query_params); - } - - public function clearQueryParams() - { - unset($this->query_params); - } - - /** - * Parameters for a Dialogflow virtual-agent query. - * - * Generated from protobuf field .google.cloud.dialogflow.v2.QueryParameters query_params = 7; - * @param \Google\Cloud\Dialogflow\V2\QueryParameters $var - * @return $this - */ - public function setQueryParams($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Dialogflow\V2\QueryParameters::class); - $this->query_params = $var; - - return $this; - } - - /** - * Parameters for a human assist query. - * - * Generated from protobuf field .google.cloud.dialogflow.v2.AssistQueryParameters assist_query_params = 8; - * @return \Google\Cloud\Dialogflow\V2\AssistQueryParameters|null - */ - public function getAssistQueryParams() - { - return $this->assist_query_params; - } - - public function hasAssistQueryParams() - { - return isset($this->assist_query_params); - } - - public function clearAssistQueryParams() - { - unset($this->assist_query_params); - } - - /** - * Parameters for a human assist query. - * - * Generated from protobuf field .google.cloud.dialogflow.v2.AssistQueryParameters assist_query_params = 8; - * @param \Google\Cloud\Dialogflow\V2\AssistQueryParameters $var - * @return $this - */ - public function setAssistQueryParams($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Dialogflow\V2\AssistQueryParameters::class); - $this->assist_query_params = $var; - - return $this; - } - - /** - * Additional parameters to be put into Dialogflow CX session parameters. To - * remove a parameter from the session, clients should explicitly set the - * parameter value to null. - * Note: this field should only be used if you are connecting to a Dialogflow - * CX agent. - * - * Generated from protobuf field .google.protobuf.Struct cx_parameters = 13; - * @return \Google\Protobuf\Struct|null - */ - public function getCxParameters() - { - return $this->cx_parameters; - } - - public function hasCxParameters() - { - return isset($this->cx_parameters); - } - - public function clearCxParameters() - { - unset($this->cx_parameters); - } - - /** - * Additional parameters to be put into Dialogflow CX session parameters. To - * remove a parameter from the session, clients should explicitly set the - * parameter value to null. - * Note: this field should only be used if you are connecting to a Dialogflow - * CX agent. - * - * Generated from protobuf field .google.protobuf.Struct cx_parameters = 13; - * @param \Google\Protobuf\Struct $var - * @return $this - */ - public function setCxParameters($var) - { - GPBUtil::checkMessage($var, \Google\Protobuf\Struct::class); - $this->cx_parameters = $var; - - return $this; - } - - /** - * Optional. Enable full bidirectional streaming. You can keep streaming the - * audio until timeout, and there's no need to half close the stream to get - * the response. - * Restrictions: - * - Timeout: 3 mins. - * - Audio Encoding: only supports - * [AudioEncoding.AUDIO_ENCODING_LINEAR_16][google.cloud.dialogflow.v2.AudioEncoding.AUDIO_ENCODING_LINEAR_16] - * and - * [AudioEncoding.AUDIO_ENCODING_MULAW][google.cloud.dialogflow.v2.AudioEncoding.AUDIO_ENCODING_MULAW] - * - Lifecycle: conversation should be in `Assist Stage`, go to - * [Conversation.CreateConversation][] for more information. - * InvalidArgument Error will be returned if the one of restriction checks - * failed. - * You can find more details in - * https://cloud.google.com/agent-assist/docs/extended-streaming - * - * Generated from protobuf field bool enable_extended_streaming = 11 [(.google.api.field_behavior) = OPTIONAL]; - * @return bool - */ - public function getEnableExtendedStreaming() - { - return $this->enable_extended_streaming; - } - - /** - * Optional. Enable full bidirectional streaming. You can keep streaming the - * audio until timeout, and there's no need to half close the stream to get - * the response. - * Restrictions: - * - Timeout: 3 mins. - * - Audio Encoding: only supports - * [AudioEncoding.AUDIO_ENCODING_LINEAR_16][google.cloud.dialogflow.v2.AudioEncoding.AUDIO_ENCODING_LINEAR_16] - * and - * [AudioEncoding.AUDIO_ENCODING_MULAW][google.cloud.dialogflow.v2.AudioEncoding.AUDIO_ENCODING_MULAW] - * - Lifecycle: conversation should be in `Assist Stage`, go to - * [Conversation.CreateConversation][] for more information. - * InvalidArgument Error will be returned if the one of restriction checks - * failed. - * You can find more details in - * https://cloud.google.com/agent-assist/docs/extended-streaming - * - * Generated from protobuf field bool enable_extended_streaming = 11 [(.google.api.field_behavior) = OPTIONAL]; - * @param bool $var - * @return $this - */ - public function setEnableExtendedStreaming($var) - { - GPBUtil::checkBool($var); - $this->enable_extended_streaming = $var; - - return $this; - } - - /** - * 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 344d25b5d757..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 44445567a3c9..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; - /** - * This event indicates that the server has detected the end of the user's - * speech utterance and expects no additional inputs. - * Therefore, the server will not process additional audio (although it may - * subsequently return additional results). The client should stop sending - * additional audio data, half-close the gRPC connection, and wait for any - * additional results until the server closes the gRPC connection. This - * message is only sent if `single_utterance` was set to `true`, and is not - * used otherwise. - * - * Generated from protobuf enum END_OF_SINGLE_UTTERANCE = 2; - */ - const END_OF_SINGLE_UTTERANCE = 2; - - private static $valueToName = [ - self::MESSAGE_TYPE_UNSPECIFIED => 'MESSAGE_TYPE_UNSPECIFIED', - self::TRANSCRIPT => 'TRANSCRIPT', - self::END_OF_SINGLE_UTTERANCE => 'END_OF_SINGLE_UTTERANCE', - ]; - - public static function name($value) - { - if (!isset(self::$valueToName[$value])) { - throw new UnexpectedValueException(sprintf( - 'Enum %s has no name defined for value %s', __CLASS__, $value)); - } - return self::$valueToName[$value]; - } - - - public static function value($name) - { - $const = __CLASS__ . '::' . strtoupper($name); - if (!defined($const)) { - throw new UnexpectedValueException(sprintf( - 'Enum %s has no value defined for name %s', __CLASS__, $name)); - } - return constant($const); - } -} - -// 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 e648058b21e6..000000000000 --- a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/SuggestConversationSummaryRequest.php +++ /dev/null @@ -1,232 +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 = ''; - /** - * Optional. The name of the latest conversation message used as context for - * compiling suggestion. If empty, the latest message of the conversation will - * be used. - * Format: `projects//locations//conversations//messages/`. - * - * Generated from protobuf field string latest_message = 3 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { - */ - protected $latest_message = ''; - /** - * Optional. Max number of messages prior to and including - * [latest_message] to use as context when compiling the - * suggestion. By default 500 and at most 1000. - * - * Generated from protobuf field int32 context_size = 4 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $context_size = 0; - /** - * Optional. Parameters for a human assist query. Only used for POC/demo - * purpose. - * - * Generated from protobuf field .google.cloud.dialogflow.v2.AssistQueryParameters assist_query_params = 5 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $assist_query_params = null; - - /** - * @param string $conversation Required. The conversation to fetch suggestion for. - * Format: `projects//locations//conversations/`. Please see - * {@see ConversationsClient::conversationName()} for help formatting this field. - * - * @return \Google\Cloud\Dialogflow\V2\SuggestConversationSummaryRequest - * - * @experimental - */ - public static function build(string $conversation): self - { - return (new self()) - ->setConversation($conversation); - } - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $conversation - * Required. The conversation to fetch suggestion for. - * Format: `projects//locations//conversations/`. - * @type string $latest_message - * Optional. The name of the latest conversation message used as context for - * compiling suggestion. If empty, the latest message of the conversation will - * be used. - * Format: `projects//locations//conversations//messages/`. - * @type int $context_size - * Optional. Max number of messages prior to and including - * [latest_message] to use as context when compiling the - * suggestion. By default 500 and at most 1000. - * @type \Google\Cloud\Dialogflow\V2\AssistQueryParameters $assist_query_params - * Optional. Parameters for a human assist query. Only used for POC/demo - * purpose. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Dialogflow\V2\Conversation::initOnce(); - parent::__construct($data); - } - - /** - * Required. The conversation to fetch suggestion for. - * Format: `projects//locations//conversations/`. - * - * Generated from protobuf field string conversation = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @return string - */ - public function getConversation() - { - return $this->conversation; - } - - /** - * Required. The conversation to fetch suggestion for. - * Format: `projects//locations//conversations/`. - * - * Generated from protobuf field string conversation = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @param string $var - * @return $this - */ - public function setConversation($var) - { - GPBUtil::checkString($var, True); - $this->conversation = $var; - - return $this; - } - - /** - * Optional. The name of the latest conversation message used as context for - * compiling suggestion. If empty, the latest message of the conversation will - * be used. - * Format: `projects//locations//conversations//messages/`. - * - * Generated from protobuf field string latest_message = 3 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { - * @return string - */ - public function getLatestMessage() - { - return $this->latest_message; - } - - /** - * Optional. The name of the latest conversation message used as context for - * compiling suggestion. If empty, the latest message of the conversation will - * be used. - * Format: `projects//locations//conversations//messages/`. - * - * Generated from protobuf field string latest_message = 3 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { - * @param string $var - * @return $this - */ - public function setLatestMessage($var) - { - GPBUtil::checkString($var, True); - $this->latest_message = $var; - - return $this; - } - - /** - * Optional. Max number of messages prior to and including - * [latest_message] to use as context when compiling the - * suggestion. By default 500 and at most 1000. - * - * Generated from protobuf field int32 context_size = 4 [(.google.api.field_behavior) = OPTIONAL]; - * @return int - */ - public function getContextSize() - { - return $this->context_size; - } - - /** - * Optional. Max number of messages prior to and including - * [latest_message] to use as context when compiling the - * suggestion. By default 500 and at most 1000. - * - * Generated from protobuf field int32 context_size = 4 [(.google.api.field_behavior) = OPTIONAL]; - * @param int $var - * @return $this - */ - public function setContextSize($var) - { - GPBUtil::checkInt32($var); - $this->context_size = $var; - - return $this; - } - - /** - * Optional. Parameters for a human assist query. Only used for POC/demo - * purpose. - * - * Generated from protobuf field .google.cloud.dialogflow.v2.AssistQueryParameters assist_query_params = 5 [(.google.api.field_behavior) = OPTIONAL]; - * @return \Google\Cloud\Dialogflow\V2\AssistQueryParameters|null - */ - public function getAssistQueryParams() - { - return $this->assist_query_params; - } - - public function hasAssistQueryParams() - { - return isset($this->assist_query_params); - } - - public function clearAssistQueryParams() - { - unset($this->assist_query_params); - } - - /** - * Optional. Parameters for a human assist query. Only used for POC/demo - * purpose. - * - * Generated from protobuf field .google.cloud.dialogflow.v2.AssistQueryParameters assist_query_params = 5 [(.google.api.field_behavior) = OPTIONAL]; - * @param \Google\Cloud\Dialogflow\V2\AssistQueryParameters $var - * @return $this - */ - public function setAssistQueryParams($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Dialogflow\V2\AssistQueryParameters::class); - $this->assist_query_params = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/SuggestConversationSummaryResponse.php b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/SuggestConversationSummaryResponse.php 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 eb2a074d400b..000000000000 --- a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/SuggestConversationSummaryResponse/Summary.php +++ /dev/null @@ -1,188 +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 = ''; - /** - * The baseline model version used to generate this summary. It is empty if - * a baseline model was not used to generate this summary. - * - * Generated from protobuf field string baseline_model_version = 5; - */ - protected $baseline_model_version = ''; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $text - * The summary content that is concatenated into one string. - * @type array|\Google\Protobuf\Internal\MapField $text_sections - * The summary content that is divided into sections. The key is the - * section's name and the value is the section's content. There is no - * specific format for the key or value. - * @type string $answer_record - * The name of the answer record. Format: - * "projects//answerRecords/" - * @type string $baseline_model_version - * The baseline model version used to generate this summary. It is empty if - * a baseline model was not used to generate this summary. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Dialogflow\V2\Conversation::initOnce(); - parent::__construct($data); - } - - /** - * The summary content that is concatenated into one string. - * - * Generated from protobuf field string text = 1; - * @return string - */ - public function getText() - { - return $this->text; - } - - /** - * The summary content that is concatenated into one string. - * - * Generated from protobuf field string text = 1; - * @param string $var - * @return $this - */ - public function setText($var) - { - GPBUtil::checkString($var, True); - $this->text = $var; - - return $this; - } - - /** - * The summary content that is divided into sections. The key is the - * section's name and the value is the section's content. There is no - * specific format for the key or value. - * - * Generated from protobuf field map text_sections = 4; - * @return \Google\Protobuf\Internal\MapField - */ - public function getTextSections() - { - return $this->text_sections; - } - - /** - * The summary content that is divided into sections. The key is the - * section's name and the value is the section's content. There is no - * specific format for the key or value. - * - * Generated from protobuf field map text_sections = 4; - * @param array|\Google\Protobuf\Internal\MapField $var - * @return $this - */ - public function setTextSections($var) - { - $arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::STRING, \Google\Protobuf\Internal\GPBType::STRING); - $this->text_sections = $arr; - - return $this; - } - - /** - * The name of the answer record. Format: - * "projects//answerRecords/" - * - * Generated from protobuf field string answer_record = 3 [(.google.api.resource_reference) = { - * @return string - */ - public function getAnswerRecord() - { - return $this->answer_record; - } - - /** - * The name of the answer record. Format: - * "projects//answerRecords/" - * - * Generated from protobuf field string answer_record = 3 [(.google.api.resource_reference) = { - * @param string $var - * @return $this - */ - public function setAnswerRecord($var) - { - GPBUtil::checkString($var, True); - $this->answer_record = $var; - - return $this; - } - - /** - * The baseline model version used to generate this summary. It is empty if - * a baseline model was not used to generate this summary. - * - * Generated from protobuf field string baseline_model_version = 5; - * @return string - */ - public function getBaselineModelVersion() - { - return $this->baseline_model_version; - } - - /** - * The baseline model version used to generate this summary. It is empty if - * a baseline model was not used to generate this summary. - * - * Generated from protobuf field string baseline_model_version = 5; - * @param string $var - * @return $this - */ - public function setBaselineModelVersion($var) - { - GPBUtil::checkString($var, True); - $this->baseline_model_version = $var; - - return $this; - } - -} - -// 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/SuggestKnowledgeAssistRequest.php b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/SuggestKnowledgeAssistRequest.php deleted file mode 100644 index 8cb2fed5f399..000000000000 --- a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/SuggestKnowledgeAssistRequest.php +++ /dev/null @@ -1,214 +0,0 @@ -google.cloud.dialogflow.v2.SuggestKnowledgeAssistRequest - */ -class SuggestKnowledgeAssistRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The name of the participant to fetch suggestions for. - * Format: `projects//locations//conversations//participants/`. - * - * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - */ - protected $parent = ''; - /** - * Optional. The name of the latest conversation message to compile - * suggestions for. If empty, it will be the latest message of the - * conversation. Format: `projects//locations//conversations//messages/`. - * - * Generated from protobuf field string latest_message = 2 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { - */ - protected $latest_message = ''; - /** - * Optional. Max number of messages prior to and including - * [latest_message][google.cloud.dialogflow.v2.SuggestKnowledgeAssistRequest.latest_message] - * to use as context when compiling the suggestion. The context size is by - * default 100 and at most 100. - * - * Generated from protobuf field int32 context_size = 3 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $context_size = 0; - /** - * Optional. The previously suggested query for the given conversation. This - * helps identify whether the next suggestion we generate is resonably - * different from the previous one. This is useful to avoid similar - * suggestions within the conversation. - * - * Generated from protobuf field string previous_suggested_query = 4 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $previous_suggested_query = ''; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $parent - * Required. The name of the participant to fetch suggestions for. - * Format: `projects//locations//conversations//participants/`. - * @type string $latest_message - * Optional. The name of the latest conversation message to compile - * suggestions for. If empty, it will be the latest message of the - * conversation. Format: `projects//locations//conversations//messages/`. - * @type int $context_size - * Optional. Max number of messages prior to and including - * [latest_message][google.cloud.dialogflow.v2.SuggestKnowledgeAssistRequest.latest_message] - * to use as context when compiling the suggestion. The context size is by - * default 100 and at most 100. - * @type string $previous_suggested_query - * Optional. The previously suggested query for the given conversation. This - * helps identify whether the next suggestion we generate is resonably - * different from the previous one. This is useful to avoid similar - * suggestions within the conversation. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Dialogflow\V2\Participant::initOnce(); - parent::__construct($data); - } - - /** - * Required. The name of the participant to fetch suggestions for. - * Format: `projects//locations//conversations//participants/`. - * - * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @return string - */ - public function getParent() - { - return $this->parent; - } - - /** - * Required. The name of the participant to fetch suggestions for. - * Format: `projects//locations//conversations//participants/`. - * - * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @param string $var - * @return $this - */ - public function setParent($var) - { - GPBUtil::checkString($var, True); - $this->parent = $var; - - return $this; - } - - /** - * Optional. The name of the latest conversation message to compile - * suggestions for. If empty, it will be the latest message of the - * conversation. Format: `projects//locations//conversations//messages/`. - * - * Generated from protobuf field string latest_message = 2 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { - * @return string - */ - public function getLatestMessage() - { - return $this->latest_message; - } - - /** - * Optional. The name of the latest conversation message to compile - * suggestions for. If empty, it will be the latest message of the - * conversation. Format: `projects//locations//conversations//messages/`. - * - * Generated from protobuf field string latest_message = 2 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { - * @param string $var - * @return $this - */ - public function setLatestMessage($var) - { - GPBUtil::checkString($var, True); - $this->latest_message = $var; - - return $this; - } - - /** - * Optional. Max number of messages prior to and including - * [latest_message][google.cloud.dialogflow.v2.SuggestKnowledgeAssistRequest.latest_message] - * to use as context when compiling the suggestion. The context size is by - * default 100 and at most 100. - * - * Generated from protobuf field int32 context_size = 3 [(.google.api.field_behavior) = OPTIONAL]; - * @return int - */ - public function getContextSize() - { - return $this->context_size; - } - - /** - * Optional. Max number of messages prior to and including - * [latest_message][google.cloud.dialogflow.v2.SuggestKnowledgeAssistRequest.latest_message] - * to use as context when compiling the suggestion. The context size is by - * default 100 and at most 100. - * - * Generated from protobuf field int32 context_size = 3 [(.google.api.field_behavior) = OPTIONAL]; - * @param int $var - * @return $this - */ - public function setContextSize($var) - { - GPBUtil::checkInt32($var); - $this->context_size = $var; - - return $this; - } - - /** - * Optional. The previously suggested query for the given conversation. This - * helps identify whether the next suggestion we generate is resonably - * different from the previous one. This is useful to avoid similar - * suggestions within the conversation. - * - * Generated from protobuf field string previous_suggested_query = 4 [(.google.api.field_behavior) = OPTIONAL]; - * @return string - */ - public function getPreviousSuggestedQuery() - { - return $this->previous_suggested_query; - } - - /** - * Optional. The previously suggested query for the given conversation. This - * helps identify whether the next suggestion we generate is resonably - * different from the previous one. This is useful to avoid similar - * suggestions within the conversation. - * - * Generated from protobuf field string previous_suggested_query = 4 [(.google.api.field_behavior) = OPTIONAL]; - * @param string $var - * @return $this - */ - public function setPreviousSuggestedQuery($var) - { - GPBUtil::checkString($var, True); - $this->previous_suggested_query = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/SuggestKnowledgeAssistResponse.php b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/SuggestKnowledgeAssistResponse.php deleted file mode 100644 index c153303cc3ef..000000000000 --- a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/SuggestKnowledgeAssistResponse.php +++ /dev/null @@ -1,170 +0,0 @@ -google.cloud.dialogflow.v2.SuggestKnowledgeAssistResponse - */ -class SuggestKnowledgeAssistResponse extends \Google\Protobuf\Internal\Message -{ - /** - * Output only. Knowledge Assist suggestion. - * - * Generated from protobuf field .google.cloud.dialogflow.v2.KnowledgeAssistAnswer knowledge_assist_answer = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $knowledge_assist_answer = null; - /** - * The name of the latest conversation message used to compile suggestion for. - * Format: `projects//locations//conversations//messages/`. - * - * Generated from protobuf field string latest_message = 2; - */ - protected $latest_message = ''; - /** - * Number of messages prior to and including - * [latest_message][google.cloud.dialogflow.v2.SuggestKnowledgeAssistResponse.latest_message] - * to compile the suggestion. It may be smaller than the - * [SuggestKnowledgeAssistRequest.context_size][google.cloud.dialogflow.v2.SuggestKnowledgeAssistRequest.context_size] - * field in the request if there are fewer messages in the conversation. - * - * Generated from protobuf field int32 context_size = 3; - */ - protected $context_size = 0; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type \Google\Cloud\Dialogflow\V2\KnowledgeAssistAnswer $knowledge_assist_answer - * Output only. Knowledge Assist suggestion. - * @type string $latest_message - * The name of the latest conversation message used to compile suggestion for. - * Format: `projects//locations//conversations//messages/`. - * @type int $context_size - * Number of messages prior to and including - * [latest_message][google.cloud.dialogflow.v2.SuggestKnowledgeAssistResponse.latest_message] - * to compile the suggestion. It may be smaller than the - * [SuggestKnowledgeAssistRequest.context_size][google.cloud.dialogflow.v2.SuggestKnowledgeAssistRequest.context_size] - * field in the request if there are fewer messages in the conversation. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Dialogflow\V2\Participant::initOnce(); - parent::__construct($data); - } - - /** - * Output only. Knowledge Assist suggestion. - * - * Generated from protobuf field .google.cloud.dialogflow.v2.KnowledgeAssistAnswer knowledge_assist_answer = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return \Google\Cloud\Dialogflow\V2\KnowledgeAssistAnswer|null - */ - public function getKnowledgeAssistAnswer() - { - return $this->knowledge_assist_answer; - } - - public function hasKnowledgeAssistAnswer() - { - return isset($this->knowledge_assist_answer); - } - - public function clearKnowledgeAssistAnswer() - { - unset($this->knowledge_assist_answer); - } - - /** - * Output only. Knowledge Assist suggestion. - * - * Generated from protobuf field .google.cloud.dialogflow.v2.KnowledgeAssistAnswer knowledge_assist_answer = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param \Google\Cloud\Dialogflow\V2\KnowledgeAssistAnswer $var - * @return $this - */ - public function setKnowledgeAssistAnswer($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Dialogflow\V2\KnowledgeAssistAnswer::class); - $this->knowledge_assist_answer = $var; - - return $this; - } - - /** - * The name of the latest conversation message used to compile suggestion for. - * Format: `projects//locations//conversations//messages/`. - * - * Generated from protobuf field string latest_message = 2; - * @return string - */ - public function getLatestMessage() - { - return $this->latest_message; - } - - /** - * The name of the latest conversation message used to compile suggestion for. - * Format: `projects//locations//conversations//messages/`. - * - * Generated from protobuf field string latest_message = 2; - * @param string $var - * @return $this - */ - public function setLatestMessage($var) - { - GPBUtil::checkString($var, True); - $this->latest_message = $var; - - return $this; - } - - /** - * Number of messages prior to and including - * [latest_message][google.cloud.dialogflow.v2.SuggestKnowledgeAssistResponse.latest_message] - * to compile the suggestion. It may be smaller than the - * [SuggestKnowledgeAssistRequest.context_size][google.cloud.dialogflow.v2.SuggestKnowledgeAssistRequest.context_size] - * field in the request if there are fewer messages in the conversation. - * - * Generated from protobuf field int32 context_size = 3; - * @return int - */ - public function getContextSize() - { - return $this->context_size; - } - - /** - * Number of messages prior to and including - * [latest_message][google.cloud.dialogflow.v2.SuggestKnowledgeAssistResponse.latest_message] - * to compile the suggestion. It may be smaller than the - * [SuggestKnowledgeAssistRequest.context_size][google.cloud.dialogflow.v2.SuggestKnowledgeAssistRequest.context_size] - * field in the request if there are fewer messages in the conversation. - * - * Generated from protobuf field int32 context_size = 3; - * @param int $var - * @return $this - */ - public function setContextSize($var) - { - GPBUtil::checkInt32($var); - $this->context_size = $var; - - return $this; - } - -} - 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 eb42871c36c0..000000000000 --- a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/SuggestionFeature/Type.php +++ /dev/null @@ -1,85 +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; - /** - * Run knowledge search with text input from agent or text generated query. - * - * Generated from protobuf enum KNOWLEDGE_SEARCH = 14; - */ - const KNOWLEDGE_SEARCH = 14; - /** - * Run knowledge assist with automatic query generation. - * - * Generated from protobuf enum KNOWLEDGE_ASSIST = 15; - */ - const KNOWLEDGE_ASSIST = 15; - - private static $valueToName = [ - self::TYPE_UNSPECIFIED => 'TYPE_UNSPECIFIED', - self::ARTICLE_SUGGESTION => 'ARTICLE_SUGGESTION', - self::FAQ => 'FAQ', - self::SMART_REPLY => 'SMART_REPLY', - self::KNOWLEDGE_SEARCH => 'KNOWLEDGE_SEARCH', - self::KNOWLEDGE_ASSIST => 'KNOWLEDGE_ASSIST', - ]; - - public static function name($value) - { - if (!isset(self::$valueToName[$value])) { - throw new UnexpectedValueException(sprintf( - 'Enum %s has no name defined for value %s', __CLASS__, $value)); - } - return self::$valueToName[$value]; - } - - - public static function value($name) - { - $const = __CLASS__ . '::' . strtoupper($name); - if (!defined($const)) { - throw new UnexpectedValueException(sprintf( - 'Enum %s has no value defined for name %s', __CLASS__, $name)); - } - return constant($const); - } -} - -// 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/SuggestionInput.php b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/SuggestionInput.php deleted file mode 100644 index bd6a71451c17..000000000000 --- a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/SuggestionInput.php +++ /dev/null @@ -1,87 +0,0 @@ -google.cloud.dialogflow.v2.SuggestionInput - */ -class SuggestionInput extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The ID of a suggestion selected by the human agent. - * The suggestion(s) were generated in a previous call to - * request Dialogflow assist. - * The format is: - * `projects//locations//answerRecords/` where is an alphanumeric string. - * - * Generated from protobuf field string answer_record = 1 [(.google.api.field_behavior) = REQUIRED]; - */ - protected $answer_record = ''; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $answer_record - * Required. The ID of a suggestion selected by the human agent. - * The suggestion(s) were generated in a previous call to - * request Dialogflow assist. - * The format is: - * `projects//locations//answerRecords/` where is an alphanumeric string. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Dialogflow\V2\Participant::initOnce(); - parent::__construct($data); - } - - /** - * Required. The ID of a suggestion selected by the human agent. - * The suggestion(s) were generated in a previous call to - * request Dialogflow assist. - * The format is: - * `projects//locations//answerRecords/` where is an alphanumeric string. - * - * Generated from protobuf field string answer_record = 1 [(.google.api.field_behavior) = REQUIRED]; - * @return string - */ - public function getAnswerRecord() - { - return $this->answer_record; - } - - /** - * Required. The ID of a suggestion selected by the human agent. - * The suggestion(s) were generated in a previous call to - * request Dialogflow assist. - * The format is: - * `projects//locations//answerRecords/` where is an alphanumeric string. - * - * Generated from protobuf field string answer_record = 1 [(.google.api.field_behavior) = REQUIRED]; - * @param string $var - * @return $this - */ - public function setAnswerRecord($var) - { - GPBUtil::checkString($var, True); - $this->answer_record = $var; - - return $this; - } - -} - 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 f93ae3753a44..000000000000 --- a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/SuggestionResult.php +++ /dev/null @@ -1,213 +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\SuggestKnowledgeAssistResponse $suggest_knowledge_assist_response - * SuggestKnowledgeAssistResponse if request is for KNOWLEDGE_ASSIST. - * @type \Google\Cloud\Dialogflow\V2\SuggestFaqAnswersResponse $suggest_faq_answers_response - * SuggestFaqAnswersResponse if request is for FAQ_ANSWER. - * @type \Google\Cloud\Dialogflow\V2\SuggestSmartRepliesResponse $suggest_smart_replies_response - * SuggestSmartRepliesResponse if request is for SMART_REPLY. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Dialogflow\V2\Participant::initOnce(); - parent::__construct($data); - } - - /** - * Error status if the request failed. - * - * Generated from protobuf field .google.rpc.Status error = 1; - * @return \Google\Rpc\Status|null - */ - public function getError() - { - return $this->readOneof(1); - } - - public function hasError() - { - return $this->hasOneof(1); - } - - /** - * Error status if the request failed. - * - * Generated from protobuf field .google.rpc.Status error = 1; - * @param \Google\Rpc\Status $var - * @return $this - */ - public function setError($var) - { - GPBUtil::checkMessage($var, \Google\Rpc\Status::class); - $this->writeOneof(1, $var); - - return $this; - } - - /** - * SuggestArticlesResponse if request is for ARTICLE_SUGGESTION. - * - * Generated from protobuf field .google.cloud.dialogflow.v2.SuggestArticlesResponse suggest_articles_response = 2; - * @return \Google\Cloud\Dialogflow\V2\SuggestArticlesResponse|null - */ - public function getSuggestArticlesResponse() - { - return $this->readOneof(2); - } - - public function hasSuggestArticlesResponse() - { - return $this->hasOneof(2); - } - - /** - * SuggestArticlesResponse if request is for ARTICLE_SUGGESTION. - * - * Generated from protobuf field .google.cloud.dialogflow.v2.SuggestArticlesResponse suggest_articles_response = 2; - * @param \Google\Cloud\Dialogflow\V2\SuggestArticlesResponse $var - * @return $this - */ - public function setSuggestArticlesResponse($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Dialogflow\V2\SuggestArticlesResponse::class); - $this->writeOneof(2, $var); - - return $this; - } - - /** - * SuggestKnowledgeAssistResponse if request is for KNOWLEDGE_ASSIST. - * - * Generated from protobuf field .google.cloud.dialogflow.v2.SuggestKnowledgeAssistResponse suggest_knowledge_assist_response = 8; - * @return \Google\Cloud\Dialogflow\V2\SuggestKnowledgeAssistResponse|null - */ - public function getSuggestKnowledgeAssistResponse() - { - return $this->readOneof(8); - } - - public function hasSuggestKnowledgeAssistResponse() - { - return $this->hasOneof(8); - } - - /** - * SuggestKnowledgeAssistResponse if request is for KNOWLEDGE_ASSIST. - * - * Generated from protobuf field .google.cloud.dialogflow.v2.SuggestKnowledgeAssistResponse suggest_knowledge_assist_response = 8; - * @param \Google\Cloud\Dialogflow\V2\SuggestKnowledgeAssistResponse $var - * @return $this - */ - public function setSuggestKnowledgeAssistResponse($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Dialogflow\V2\SuggestKnowledgeAssistResponse::class); - $this->writeOneof(8, $var); - - return $this; - } - - /** - * SuggestFaqAnswersResponse if request is for FAQ_ANSWER. - * - * Generated from protobuf field .google.cloud.dialogflow.v2.SuggestFaqAnswersResponse suggest_faq_answers_response = 3; - * @return \Google\Cloud\Dialogflow\V2\SuggestFaqAnswersResponse|null - */ - public function getSuggestFaqAnswersResponse() - { - return $this->readOneof(3); - } - - public function hasSuggestFaqAnswersResponse() - { - return $this->hasOneof(3); - } - - /** - * SuggestFaqAnswersResponse if request is for FAQ_ANSWER. - * - * Generated from protobuf field .google.cloud.dialogflow.v2.SuggestFaqAnswersResponse suggest_faq_answers_response = 3; - * @param \Google\Cloud\Dialogflow\V2\SuggestFaqAnswersResponse $var - * @return $this - */ - public function setSuggestFaqAnswersResponse($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Dialogflow\V2\SuggestFaqAnswersResponse::class); - $this->writeOneof(3, $var); - - return $this; - } - - /** - * SuggestSmartRepliesResponse if request is for SMART_REPLY. - * - * Generated from protobuf field .google.cloud.dialogflow.v2.SuggestSmartRepliesResponse suggest_smart_replies_response = 4; - * @return \Google\Cloud\Dialogflow\V2\SuggestSmartRepliesResponse|null - */ - public function getSuggestSmartRepliesResponse() - { - return $this->readOneof(4); - } - - public function hasSuggestSmartRepliesResponse() - { - return $this->hasOneof(4); - } - - /** - * SuggestSmartRepliesResponse if request is for SMART_REPLY. - * - * Generated from protobuf field .google.cloud.dialogflow.v2.SuggestSmartRepliesResponse suggest_smart_replies_response = 4; - * @param \Google\Cloud\Dialogflow\V2\SuggestSmartRepliesResponse $var - * @return $this - */ - public function setSuggestSmartRepliesResponse($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Dialogflow\V2\SuggestSmartRepliesResponse::class); - $this->writeOneof(4, $var); - - return $this; - } - - /** - * @return string - */ - public function getSuggestionResponse() - { - return $this->whichOneof("suggestion_response"); - } - -} - diff --git a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/SummarizationContext.php b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/SummarizationContext.php deleted file mode 100644 index 3b8dacc8925f..000000000000 --- a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/SummarizationContext.php +++ /dev/null @@ -1,185 +0,0 @@ -google.cloud.dialogflow.v2.SummarizationContext - */ -class SummarizationContext extends \Google\Protobuf\Internal\Message -{ - /** - * Optional. List of sections. Note it contains both predefined section sand - * customer defined sections. - * - * Generated from protobuf field repeated .google.cloud.dialogflow.v2.SummarizationSection summarization_sections = 1 [(.google.api.field_behavior) = OPTIONAL]; - */ - private $summarization_sections; - /** - * Optional. List of few shot examples. - * - * Generated from protobuf field repeated .google.cloud.dialogflow.v2.FewShotExample few_shot_examples = 2 [(.google.api.field_behavior) = OPTIONAL]; - */ - private $few_shot_examples; - /** - * Optional. Version of the feature. If not set, default to latest version. - * Current candidates are ["1.0"]. - * - * Generated from protobuf field string version = 3 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $version = ''; - /** - * Optional. The target language of the generated summary. The language code - * for conversation will be used if this field is empty. Supported 2.0 and - * later versions. - * - * Generated from protobuf field string output_language_code = 6 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $output_language_code = ''; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type array<\Google\Cloud\Dialogflow\V2\SummarizationSection>|\Google\Protobuf\Internal\RepeatedField $summarization_sections - * Optional. List of sections. Note it contains both predefined section sand - * customer defined sections. - * @type array<\Google\Cloud\Dialogflow\V2\FewShotExample>|\Google\Protobuf\Internal\RepeatedField $few_shot_examples - * Optional. List of few shot examples. - * @type string $version - * Optional. Version of the feature. If not set, default to latest version. - * Current candidates are ["1.0"]. - * @type string $output_language_code - * Optional. The target language of the generated summary. The language code - * for conversation will be used if this field is empty. Supported 2.0 and - * later versions. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Dialogflow\V2\Generator::initOnce(); - parent::__construct($data); - } - - /** - * Optional. List of sections. Note it contains both predefined section sand - * customer defined sections. - * - * Generated from protobuf field repeated .google.cloud.dialogflow.v2.SummarizationSection summarization_sections = 1 [(.google.api.field_behavior) = OPTIONAL]; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getSummarizationSections() - { - return $this->summarization_sections; - } - - /** - * Optional. List of sections. Note it contains both predefined section sand - * customer defined sections. - * - * Generated from protobuf field repeated .google.cloud.dialogflow.v2.SummarizationSection summarization_sections = 1 [(.google.api.field_behavior) = OPTIONAL]; - * @param array<\Google\Cloud\Dialogflow\V2\SummarizationSection>|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setSummarizationSections($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Dialogflow\V2\SummarizationSection::class); - $this->summarization_sections = $arr; - - return $this; - } - - /** - * Optional. List of few shot examples. - * - * Generated from protobuf field repeated .google.cloud.dialogflow.v2.FewShotExample few_shot_examples = 2 [(.google.api.field_behavior) = OPTIONAL]; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getFewShotExamples() - { - return $this->few_shot_examples; - } - - /** - * Optional. List of few shot examples. - * - * Generated from protobuf field repeated .google.cloud.dialogflow.v2.FewShotExample few_shot_examples = 2 [(.google.api.field_behavior) = OPTIONAL]; - * @param array<\Google\Cloud\Dialogflow\V2\FewShotExample>|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setFewShotExamples($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Dialogflow\V2\FewShotExample::class); - $this->few_shot_examples = $arr; - - return $this; - } - - /** - * Optional. Version of the feature. If not set, default to latest version. - * Current candidates are ["1.0"]. - * - * Generated from protobuf field string version = 3 [(.google.api.field_behavior) = OPTIONAL]; - * @return string - */ - public function getVersion() - { - return $this->version; - } - - /** - * Optional. Version of the feature. If not set, default to latest version. - * Current candidates are ["1.0"]. - * - * Generated from protobuf field string version = 3 [(.google.api.field_behavior) = OPTIONAL]; - * @param string $var - * @return $this - */ - public function setVersion($var) - { - GPBUtil::checkString($var, True); - $this->version = $var; - - return $this; - } - - /** - * Optional. The target language of the generated summary. The language code - * for conversation will be used if this field is empty. Supported 2.0 and - * later versions. - * - * Generated from protobuf field string output_language_code = 6 [(.google.api.field_behavior) = OPTIONAL]; - * @return string - */ - public function getOutputLanguageCode() - { - return $this->output_language_code; - } - - /** - * Optional. The target language of the generated summary. The language code - * for conversation will be used if this field is empty. Supported 2.0 and - * later versions. - * - * Generated from protobuf field string output_language_code = 6 [(.google.api.field_behavior) = OPTIONAL]; - * @param string $var - * @return $this - */ - public function setOutputLanguageCode($var) - { - GPBUtil::checkString($var, True); - $this->output_language_code = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/SummarizationSection.php b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/SummarizationSection.php deleted file mode 100644 index c1ffe61abc31..000000000000 --- a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/SummarizationSection.php +++ /dev/null @@ -1,139 +0,0 @@ -google.cloud.dialogflow.v2.SummarizationSection - */ -class SummarizationSection extends \Google\Protobuf\Internal\Message -{ - /** - * Optional. Name of the section, for example, "situation". - * - * Generated from protobuf field string key = 1 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $key = ''; - /** - * Optional. Definition of the section, for example, "what the customer needs - * help with or has question about." - * - * Generated from protobuf field string definition = 2 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $definition = ''; - /** - * Optional. Type of the summarization section. - * - * Generated from protobuf field .google.cloud.dialogflow.v2.SummarizationSection.Type type = 3 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $type = 0; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $key - * Optional. Name of the section, for example, "situation". - * @type string $definition - * Optional. Definition of the section, for example, "what the customer needs - * help with or has question about." - * @type int $type - * Optional. Type of the summarization section. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Dialogflow\V2\Generator::initOnce(); - parent::__construct($data); - } - - /** - * Optional. Name of the section, for example, "situation". - * - * Generated from protobuf field string key = 1 [(.google.api.field_behavior) = OPTIONAL]; - * @return string - */ - public function getKey() - { - return $this->key; - } - - /** - * Optional. Name of the section, for example, "situation". - * - * Generated from protobuf field string key = 1 [(.google.api.field_behavior) = OPTIONAL]; - * @param string $var - * @return $this - */ - public function setKey($var) - { - GPBUtil::checkString($var, True); - $this->key = $var; - - return $this; - } - - /** - * Optional. Definition of the section, for example, "what the customer needs - * help with or has question about." - * - * Generated from protobuf field string definition = 2 [(.google.api.field_behavior) = OPTIONAL]; - * @return string - */ - public function getDefinition() - { - return $this->definition; - } - - /** - * Optional. Definition of the section, for example, "what the customer needs - * help with or has question about." - * - * Generated from protobuf field string definition = 2 [(.google.api.field_behavior) = OPTIONAL]; - * @param string $var - * @return $this - */ - public function setDefinition($var) - { - GPBUtil::checkString($var, True); - $this->definition = $var; - - return $this; - } - - /** - * Optional. Type of the summarization section. - * - * Generated from protobuf field .google.cloud.dialogflow.v2.SummarizationSection.Type type = 3 [(.google.api.field_behavior) = OPTIONAL]; - * @return int - */ - public function getType() - { - return $this->type; - } - - /** - * Optional. Type of the summarization section. - * - * Generated from protobuf field .google.cloud.dialogflow.v2.SummarizationSection.Type type = 3 [(.google.api.field_behavior) = OPTIONAL]; - * @param int $var - * @return $this - */ - public function setType($var) - { - GPBUtil::checkEnum($var, \Google\Cloud\Dialogflow\V2\SummarizationSection\Type::class); - $this->type = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/SummarizationSection/Type.php b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/SummarizationSection/Type.php deleted file mode 100644 index ac4a0442e8f4..000000000000 --- a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/SummarizationSection/Type.php +++ /dev/null @@ -1,109 +0,0 @@ -google.cloud.dialogflow.v2.SummarizationSection.Type - */ -class Type -{ - /** - * Undefined section type, does not return anything. - * - * Generated from protobuf enum TYPE_UNSPECIFIED = 0; - */ - const TYPE_UNSPECIFIED = 0; - /** - * What the customer needs help with or has question about. - * Section name: "situation". - * - * Generated from protobuf enum SITUATION = 1; - */ - const SITUATION = 1; - /** - * What the agent does to help the customer. - * Section name: "action". - * - * Generated from protobuf enum ACTION = 2; - */ - const ACTION = 2; - /** - * Result of the customer service. A single word describing the result - * of the conversation. - * Section name: "resolution". - * - * Generated from protobuf enum RESOLUTION = 3; - */ - const RESOLUTION = 3; - /** - * Reason for cancellation if the customer requests for a cancellation. - * "N/A" otherwise. - * Section name: "reason_for_cancellation". - * - * Generated from protobuf enum REASON_FOR_CANCELLATION = 4; - */ - const REASON_FOR_CANCELLATION = 4; - /** - * "Unsatisfied" or "Satisfied" depending on the customer's feelings at - * the end of the conversation. - * Section name: "customer_satisfaction". - * - * Generated from protobuf enum CUSTOMER_SATISFACTION = 5; - */ - const CUSTOMER_SATISFACTION = 5; - /** - * Key entities extracted from the conversation, such as ticket number, - * order number, dollar amount, etc. - * Section names are prefixed by "entities/". - * - * Generated from protobuf enum ENTITIES = 6; - */ - const ENTITIES = 6; - /** - * Customer defined sections. - * - * Generated from protobuf enum CUSTOMER_DEFINED = 7; - */ - const CUSTOMER_DEFINED = 7; - - private static $valueToName = [ - self::TYPE_UNSPECIFIED => 'TYPE_UNSPECIFIED', - self::SITUATION => 'SITUATION', - self::ACTION => 'ACTION', - self::RESOLUTION => 'RESOLUTION', - self::REASON_FOR_CANCELLATION => 'REASON_FOR_CANCELLATION', - self::CUSTOMER_SATISFACTION => 'CUSTOMER_SATISFACTION', - self::ENTITIES => 'ENTITIES', - self::CUSTOMER_DEFINED => 'CUSTOMER_DEFINED', - ]; - - 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\SummarizationSection_Type::class); - diff --git a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/SummarizationSectionList.php b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/SummarizationSectionList.php deleted file mode 100644 index d565c6b7162c..000000000000 --- a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/SummarizationSectionList.php +++ /dev/null @@ -1,67 +0,0 @@ -google.cloud.dialogflow.v2.SummarizationSectionList - */ -class SummarizationSectionList extends \Google\Protobuf\Internal\Message -{ - /** - * Optional. Summarization sections. - * - * Generated from protobuf field repeated .google.cloud.dialogflow.v2.SummarizationSection summarization_sections = 1 [(.google.api.field_behavior) = OPTIONAL]; - */ - private $summarization_sections; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type array<\Google\Cloud\Dialogflow\V2\SummarizationSection>|\Google\Protobuf\Internal\RepeatedField $summarization_sections - * Optional. Summarization sections. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Dialogflow\V2\Generator::initOnce(); - parent::__construct($data); - } - - /** - * Optional. Summarization sections. - * - * Generated from protobuf field repeated .google.cloud.dialogflow.v2.SummarizationSection summarization_sections = 1 [(.google.api.field_behavior) = OPTIONAL]; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getSummarizationSections() - { - return $this->summarization_sections; - } - - /** - * Optional. Summarization sections. - * - * Generated from protobuf field repeated .google.cloud.dialogflow.v2.SummarizationSection summarization_sections = 1 [(.google.api.field_behavior) = OPTIONAL]; - * @param array<\Google\Cloud\Dialogflow\V2\SummarizationSection>|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setSummarizationSections($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Dialogflow\V2\SummarizationSection::class); - $this->summarization_sections = $arr; - - return $this; - } - -} - diff --git a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/SummarySuggestion.php b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/SummarySuggestion.php deleted file mode 100644 index 592840193943..000000000000 --- a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/SummarySuggestion.php +++ /dev/null @@ -1,67 +0,0 @@ -google.cloud.dialogflow.v2.SummarySuggestion - */ -class SummarySuggestion extends \Google\Protobuf\Internal\Message -{ - /** - * Required. All the parts of generated summary. - * - * Generated from protobuf field repeated .google.cloud.dialogflow.v2.SummarySuggestion.SummarySection summary_sections = 1 [(.google.api.field_behavior) = REQUIRED]; - */ - private $summary_sections; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type array<\Google\Cloud\Dialogflow\V2\SummarySuggestion\SummarySection>|\Google\Protobuf\Internal\RepeatedField $summary_sections - * Required. All the parts of generated summary. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Dialogflow\V2\Generator::initOnce(); - parent::__construct($data); - } - - /** - * Required. All the parts of generated summary. - * - * Generated from protobuf field repeated .google.cloud.dialogflow.v2.SummarySuggestion.SummarySection summary_sections = 1 [(.google.api.field_behavior) = REQUIRED]; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getSummarySections() - { - return $this->summary_sections; - } - - /** - * Required. All the parts of generated summary. - * - * Generated from protobuf field repeated .google.cloud.dialogflow.v2.SummarySuggestion.SummarySection summary_sections = 1 [(.google.api.field_behavior) = REQUIRED]; - * @param array<\Google\Cloud\Dialogflow\V2\SummarySuggestion\SummarySection>|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setSummarySections($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Dialogflow\V2\SummarySuggestion\SummarySection::class); - $this->summary_sections = $arr; - - return $this; - } - -} - diff --git a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/SummarySuggestion/SummarySection.php b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/SummarySuggestion/SummarySection.php deleted file mode 100644 index d6e160a2293c..000000000000 --- a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/SummarySuggestion/SummarySection.php +++ /dev/null @@ -1,104 +0,0 @@ -google.cloud.dialogflow.v2.SummarySuggestion.SummarySection - */ -class SummarySection extends \Google\Protobuf\Internal\Message -{ - /** - * Required. Name of the section. - * - * Generated from protobuf field string section = 1 [(.google.api.field_behavior) = REQUIRED]; - */ - protected $section = ''; - /** - * Required. Summary text for the section. - * - * Generated from protobuf field string summary = 2 [(.google.api.field_behavior) = REQUIRED]; - */ - protected $summary = ''; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $section - * Required. Name of the section. - * @type string $summary - * Required. Summary text for the section. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Dialogflow\V2\Generator::initOnce(); - parent::__construct($data); - } - - /** - * Required. Name of the section. - * - * Generated from protobuf field string section = 1 [(.google.api.field_behavior) = REQUIRED]; - * @return string - */ - public function getSection() - { - return $this->section; - } - - /** - * Required. Name of the section. - * - * Generated from protobuf field string section = 1 [(.google.api.field_behavior) = REQUIRED]; - * @param string $var - * @return $this - */ - public function setSection($var) - { - GPBUtil::checkString($var, True); - $this->section = $var; - - return $this; - } - - /** - * Required. Summary text for the section. - * - * Generated from protobuf field string summary = 2 [(.google.api.field_behavior) = REQUIRED]; - * @return string - */ - public function getSummary() - { - return $this->summary; - } - - /** - * Required. Summary text for the section. - * - * Generated from protobuf field string summary = 2 [(.google.api.field_behavior) = REQUIRED]; - * @param string $var - * @return $this - */ - public function setSummary($var) - { - GPBUtil::checkString($var, True); - $this->summary = $var; - - return $this; - } - -} - -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(SummarySection::class, \Google\Cloud\Dialogflow\V2\SummarySuggestion_SummarySection::class); - 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 d0507cc812f8..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 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $speaking_rate = 0.0; - /** - * Optional. Speaking pitch, in the range [-20.0, 20.0]. 20 means increase 20 - * semitones from the original pitch. -20 means decrease 20 semitones from the - * original pitch. - * - * Generated from protobuf field double pitch = 2 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $pitch = 0.0; - /** - * Optional. Volume gain (in dB) of the normal native volume supported by the - * specific voice, in the range [-96.0, 16.0]. If unset, or set to a value of - * 0.0 (dB), will play at normal native signal amplitude. A value of -6.0 (dB) - * will play at approximately half the amplitude of the normal native signal - * amplitude. A value of +6.0 (dB) will play at approximately twice the - * amplitude of the normal native signal amplitude. We strongly recommend not - * to exceed +10 (dB) as there's usually no effective increase in loudness for - * any value greater than that. - * - * Generated from protobuf field double volume_gain_db = 3 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $volume_gain_db = 0.0; - /** - * Optional. An identifier which selects 'audio effects' profiles that are - * applied on (post synthesized) text to speech. Effects are applied on top of - * each other in the order they are given. - * - * Generated from protobuf field repeated string effects_profile_id = 5 [(.google.api.field_behavior) = OPTIONAL]; - */ - private $effects_profile_id; - /** - * Optional. The desired voice of the synthesized audio. - * - * Generated from protobuf field .google.cloud.dialogflow.v2.VoiceSelectionParams voice = 4 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $voice = null; - - /** - * 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 [(.google.api.field_behavior) = OPTIONAL]; - * @return float - */ - public function getSpeakingRate() - { - return $this->speaking_rate; - } - - /** - * Optional. Speaking rate/speed, in the range [0.25, 4.0]. 1.0 is the normal - * native speed supported by the specific voice. 2.0 is twice as fast, and 0.5 - * is half as fast. If unset(0.0), defaults to the native 1.0 speed. Any other - * values < 0.25 or > 4.0 will return an error. - * - * Generated from protobuf field double speaking_rate = 1 [(.google.api.field_behavior) = OPTIONAL]; - * @param float $var - * @return $this - */ - public function setSpeakingRate($var) - { - GPBUtil::checkDouble($var); - $this->speaking_rate = $var; - - return $this; - } - - /** - * Optional. Speaking pitch, in the range [-20.0, 20.0]. 20 means increase 20 - * semitones from the original pitch. -20 means decrease 20 semitones from the - * original pitch. - * - * Generated from protobuf field double pitch = 2 [(.google.api.field_behavior) = OPTIONAL]; - * @return float - */ - public function getPitch() - { - return $this->pitch; - } - - /** - * Optional. Speaking pitch, in the range [-20.0, 20.0]. 20 means increase 20 - * semitones from the original pitch. -20 means decrease 20 semitones from the - * original pitch. - * - * Generated from protobuf field double pitch = 2 [(.google.api.field_behavior) = OPTIONAL]; - * @param float $var - * @return $this - */ - public function setPitch($var) - { - GPBUtil::checkDouble($var); - $this->pitch = $var; - - return $this; - } - - /** - * Optional. Volume gain (in dB) of the normal native volume supported by the - * specific voice, in the range [-96.0, 16.0]. If unset, or set to a value of - * 0.0 (dB), will play at normal native signal amplitude. A value of -6.0 (dB) - * will play at approximately half the amplitude of the normal native signal - * amplitude. A value of +6.0 (dB) will play at approximately twice the - * amplitude of the normal native signal amplitude. We strongly recommend not - * to exceed +10 (dB) as there's usually no effective increase in loudness for - * any value greater than that. - * - * Generated from protobuf field double volume_gain_db = 3 [(.google.api.field_behavior) = OPTIONAL]; - * @return float - */ - public function getVolumeGainDb() - { - return $this->volume_gain_db; - } - - /** - * Optional. Volume gain (in dB) of the normal native volume supported by the - * specific voice, in the range [-96.0, 16.0]. If unset, or set to a value of - * 0.0 (dB), will play at normal native signal amplitude. A value of -6.0 (dB) - * will play at approximately half the amplitude of the normal native signal - * amplitude. A value of +6.0 (dB) will play at approximately twice the - * amplitude of the normal native signal amplitude. We strongly recommend not - * to exceed +10 (dB) as there's usually no effective increase in loudness for - * any value greater than that. - * - * Generated from protobuf field double volume_gain_db = 3 [(.google.api.field_behavior) = OPTIONAL]; - * @param float $var - * @return $this - */ - public function setVolumeGainDb($var) - { - GPBUtil::checkDouble($var); - $this->volume_gain_db = $var; - - return $this; - } - - /** - * Optional. An identifier which selects 'audio effects' profiles that are - * applied on (post synthesized) text to speech. Effects are applied on top of - * each other in the order they are given. - * - * Generated from protobuf field repeated string effects_profile_id = 5 [(.google.api.field_behavior) = OPTIONAL]; - * @return \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 [(.google.api.field_behavior) = OPTIONAL]; - * @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 [(.google.api.field_behavior) = OPTIONAL]; - * @return \Google\Cloud\Dialogflow\V2\VoiceSelectionParams|null - */ - public function getVoice() - { - return $this->voice; - } - - public function hasVoice() - { - return isset($this->voice); - } - - public function clearVoice() - { - unset($this->voice); - } - - /** - * Optional. The desired voice of the synthesized audio. - * - * Generated from protobuf field .google.cloud.dialogflow.v2.VoiceSelectionParams voice = 4 [(.google.api.field_behavior) = OPTIONAL]; - * @param \Google\Cloud\Dialogflow\V2\VoiceSelectionParams $var - * @return $this - */ - public function setVoice($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Dialogflow\V2\VoiceSelectionParams::class); - $this->voice = $var; - - return $this; - } - -} - 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 601c8942c1d8..000000000000 --- a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/TextInput.php +++ /dev/null @@ -1,118 +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/TriggerEvent.php b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/TriggerEvent.php deleted file mode 100644 index a26516d38a48..000000000000 --- a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/TriggerEvent.php +++ /dev/null @@ -1,63 +0,0 @@ -google.cloud.dialogflow.v2.TriggerEvent - */ -class TriggerEvent -{ - /** - * Default value for TriggerEvent. - * - * Generated from protobuf enum TRIGGER_EVENT_UNSPECIFIED = 0; - */ - const TRIGGER_EVENT_UNSPECIFIED = 0; - /** - * Triggers when each chat message or voice utterance ends. - * - * Generated from protobuf enum END_OF_UTTERANCE = 1; - */ - const END_OF_UTTERANCE = 1; - /** - * Triggers on the conversation manually by API calls, such as - * Conversations.GenerateStatelessSuggestion and - * Conversations.GenerateSuggestions. - * - * Generated from protobuf enum MANUAL_CALL = 2; - */ - const MANUAL_CALL = 2; - - private static $valueToName = [ - self::TRIGGER_EVENT_UNSPECIFIED => 'TRIGGER_EVENT_UNSPECIFIED', - self::END_OF_UTTERANCE => 'END_OF_UTTERANCE', - self::MANUAL_CALL => 'MANUAL_CALL', - ]; - - public static function name($value) - { - if (!isset(self::$valueToName[$value])) { - throw new UnexpectedValueException(sprintf( - 'Enum %s has no name defined for value %s', __CLASS__, $value)); - } - return self::$valueToName[$value]; - } - - - public static function value($name) - { - $const = __CLASS__ . '::' . strtoupper($name); - if (!defined($const)) { - throw new UnexpectedValueException(sprintf( - 'Enum %s has no value defined for name %s', __CLASS__, $name)); - } - return constant($const); - } -} - diff --git a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/UndeployConversationModelOperationMetadata.php b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/UndeployConversationModelOperationMetadata.php 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/UpdateGeneratorRequest.php b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/UpdateGeneratorRequest.php deleted file mode 100644 index 583853e7d6e8..000000000000 --- a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/UpdateGeneratorRequest.php +++ /dev/null @@ -1,141 +0,0 @@ -google.cloud.dialogflow.v2.UpdateGeneratorRequest - */ -class UpdateGeneratorRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The generator to update. - * The name field of generator is to identify the generator to update. - * - * Generated from protobuf field .google.cloud.dialogflow.v2.Generator generator = 1 [(.google.api.field_behavior) = REQUIRED]; - */ - protected $generator = null; - /** - * Optional. The list of fields to update. - * - * Generated from protobuf field .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $update_mask = null; - - /** - * @param \Google\Cloud\Dialogflow\V2\Generator $generator Required. The generator to update. - * The name field of generator is to identify the generator to update. - * @param \Google\Protobuf\FieldMask $updateMask Optional. The list of fields to update. - * - * @return \Google\Cloud\Dialogflow\V2\UpdateGeneratorRequest - * - * @experimental - */ - public static function build(\Google\Cloud\Dialogflow\V2\Generator $generator, \Google\Protobuf\FieldMask $updateMask): self - { - return (new self()) - ->setGenerator($generator) - ->setUpdateMask($updateMask); - } - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type \Google\Cloud\Dialogflow\V2\Generator $generator - * Required. The generator to update. - * The name field of generator is to identify the generator to update. - * @type \Google\Protobuf\FieldMask $update_mask - * Optional. The list of fields to update. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Dialogflow\V2\Generator::initOnce(); - parent::__construct($data); - } - - /** - * Required. The generator to update. - * The name field of generator is to identify the generator to update. - * - * Generated from protobuf field .google.cloud.dialogflow.v2.Generator generator = 1 [(.google.api.field_behavior) = REQUIRED]; - * @return \Google\Cloud\Dialogflow\V2\Generator|null - */ - public function getGenerator() - { - return $this->generator; - } - - public function hasGenerator() - { - return isset($this->generator); - } - - public function clearGenerator() - { - unset($this->generator); - } - - /** - * Required. The generator to update. - * The name field of generator is to identify the generator to update. - * - * Generated from protobuf field .google.cloud.dialogflow.v2.Generator generator = 1 [(.google.api.field_behavior) = REQUIRED]; - * @param \Google\Cloud\Dialogflow\V2\Generator $var - * @return $this - */ - public function setGenerator($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Dialogflow\V2\Generator::class); - $this->generator = $var; - - return $this; - } - - /** - * Optional. The list of fields to update. - * - * Generated from protobuf field .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = OPTIONAL]; - * @return \Google\Protobuf\FieldMask|null - */ - public function getUpdateMask() - { - return $this->update_mask; - } - - public function hasUpdateMask() - { - return isset($this->update_mask); - } - - public function clearUpdateMask() - { - unset($this->update_mask); - } - - /** - * Optional. The list of fields to update. - * - * Generated from protobuf field .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = OPTIONAL]; - * @param \Google\Protobuf\FieldMask $var - * @return $this - */ - public function setUpdateMask($var) - { - GPBUtil::checkMessage($var, \Google\Protobuf\FieldMask::class); - $this->update_mask = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/UpdateIntentRequest.php b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/UpdateIntentRequest.php 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 77f102d74f74..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 cf034643bb4b..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 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $name = ''; - /** - * Optional. The preferred gender of the voice. If not set, the service will - * choose a voice based on the other parameters such as language_code and - * [name][google.cloud.dialogflow.v2.VoiceSelectionParams.name]. Note that - * this is only a preference, not requirement. If a voice of the appropriate - * gender is not available, the synthesizer should substitute a voice with a - * different gender rather than failing the request. - * - * Generated from protobuf field .google.cloud.dialogflow.v2.SsmlVoiceGender ssml_gender = 2 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $ssml_gender = 0; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $name - * Optional. The name of the voice. If not set, the service will choose a - * voice based on the other parameters such as language_code and - * [ssml_gender][google.cloud.dialogflow.v2.VoiceSelectionParams.ssml_gender]. - * @type int $ssml_gender - * Optional. The preferred gender of the voice. If not set, the service will - * choose a voice based on the other parameters such as language_code and - * [name][google.cloud.dialogflow.v2.VoiceSelectionParams.name]. Note that - * this is only a preference, not requirement. If a voice of the appropriate - * gender is not available, the synthesizer should substitute a voice with a - * different gender rather than failing the request. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Dialogflow\V2\AudioConfig::initOnce(); - parent::__construct($data); - } - - /** - * Optional. The name of the voice. If not set, the service will choose a - * voice based on the other parameters such as language_code and - * [ssml_gender][google.cloud.dialogflow.v2.VoiceSelectionParams.ssml_gender]. - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = OPTIONAL]; - * @return string - */ - public function getName() - { - return $this->name; - } - - /** - * Optional. The name of the voice. If not set, the service will choose a - * voice based on the other parameters such as language_code and - * [ssml_gender][google.cloud.dialogflow.v2.VoiceSelectionParams.ssml_gender]. - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = OPTIONAL]; - * @param string $var - * @return $this - */ - public function setName($var) - { - GPBUtil::checkString($var, True); - $this->name = $var; - - return $this; - } - - /** - * Optional. The preferred gender of the voice. If not set, the service will - * choose a voice based on the other parameters such as language_code and - * [name][google.cloud.dialogflow.v2.VoiceSelectionParams.name]. Note that - * this is only a preference, not requirement. If a voice of the appropriate - * gender is not available, the synthesizer should substitute a voice with a - * different gender rather than failing the request. - * - * Generated from protobuf field .google.cloud.dialogflow.v2.SsmlVoiceGender ssml_gender = 2 [(.google.api.field_behavior) = OPTIONAL]; - * @return int - */ - public function getSsmlGender() - { - return $this->ssml_gender; - } - - /** - * Optional. The preferred gender of the voice. If not set, the service will - * choose a voice based on the other parameters such as language_code and - * [name][google.cloud.dialogflow.v2.VoiceSelectionParams.name]. Note that - * this is only a preference, not requirement. If a voice of the appropriate - * gender is not available, the synthesizer should substitute a voice with a - * different gender rather than failing the request. - * - * Generated from protobuf field .google.cloud.dialogflow.v2.SsmlVoiceGender ssml_gender = 2 [(.google.api.field_behavior) = OPTIONAL]; - * @param int $var - * @return $this - */ - public function setSsmlGender($var) - { - GPBUtil::checkEnum($var, \Google\Cloud\Dialogflow\V2\SsmlVoiceGender::class); - $this->ssml_gender = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/WebhookRequest.php b/owl-bot-staging/Dialogflow/v2/proto/src/Google/Cloud/Dialogflow/V2/WebhookRequest.php 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 4866414090ce..000000000000 --- a/owl-bot-staging/Dialogflow/v2/samples/V2/AgentsClient/delete_agent.php +++ /dev/null @@ -1,70 +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(); - - // Prepare the request message. - $request = (new DeleteAgentRequest()) - ->setParent($formattedParent); - - // Call the API and handle any network failures. - try { - $agentsClient->deleteAgent($request); - printf('Call completed successfully.' . PHP_EOL); - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} - -/** - * Helper to execute the sample. - * - * This sample has been automatically generated and should be regarded as a code - * template only. It will require modifications to work: - * - It may require correct/in-range values for request initialization. - * - It may require specifying regional endpoints when creating the service client, - * please see the apiEndpoint client configuration option for more details. - */ -function callSample(): void -{ - $formattedParent = AgentsClient::projectName('[PROJECT]'); - - delete_agent_sample($formattedParent); -} -// [END dialogflow_v2_generated_Agents_DeleteAgent_sync] diff --git a/owl-bot-staging/Dialogflow/v2/samples/V2/AgentsClient/export_agent.php b/owl-bot-staging/Dialogflow/v2/samples/V2/AgentsClient/export_agent.php deleted file mode 100644 index 40dddde24421..000000000000 --- a/owl-bot-staging/Dialogflow/v2/samples/V2/AgentsClient/export_agent.php +++ /dev/null @@ -1,105 +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(); - - // Prepare the request message. - $request = (new ExportAgentRequest()) - ->setParent($formattedParent) - ->setAgentUri($agentUri); - - // Call the API and handle any network failures. - try { - /** @var OperationResponse $response */ - $response = $agentsClient->exportAgent($request); - $response->pollUntilComplete(); - - if ($response->operationSucceeded()) { - /** @var ExportAgentResponse $result */ - $result = $response->getResult(); - printf('Operation successful with response data: %s' . PHP_EOL, $result->serializeToJsonString()); - } else { - /** @var Status $error */ - $error = $response->getError(); - printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); - } - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} - -/** - * Helper to execute the sample. - * - * This sample has been automatically generated and should be regarded as a code - * template only. It will require modifications to work: - * - It may require correct/in-range values for request initialization. - * - It may require specifying regional endpoints when creating the service client, - * please see the apiEndpoint client configuration option for more details. - */ -function callSample(): void -{ - $formattedParent = AgentsClient::projectName('[PROJECT]'); - $agentUri = '[AGENT_URI]'; - - export_agent_sample($formattedParent, $agentUri); -} -// [END dialogflow_v2_generated_Agents_ExportAgent_sync] diff --git a/owl-bot-staging/Dialogflow/v2/samples/V2/AgentsClient/get_agent.php b/owl-bot-staging/Dialogflow/v2/samples/V2/AgentsClient/get_agent.php deleted file mode 100644 index d44d6025e757..000000000000 --- a/owl-bot-staging/Dialogflow/v2/samples/V2/AgentsClient/get_agent.php +++ /dev/null @@ -1,72 +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(); - - // Prepare the request message. - $request = (new GetAgentRequest()) - ->setParent($formattedParent); - - // Call the API and handle any network failures. - try { - /** @var Agent $response */ - $response = $agentsClient->getAgent($request); - printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} - -/** - * Helper to execute the sample. - * - * This sample has been automatically generated and should be regarded as a code - * template only. It will require modifications to work: - * - It may require correct/in-range values for request initialization. - * - It may require specifying regional endpoints when creating the service client, - * please see the apiEndpoint client configuration option for more details. - */ -function callSample(): void -{ - $formattedParent = AgentsClient::projectName('[PROJECT]'); - - get_agent_sample($formattedParent); -} -// [END dialogflow_v2_generated_Agents_GetAgent_sync] diff --git a/owl-bot-staging/Dialogflow/v2/samples/V2/AgentsClient/get_location.php b/owl-bot-staging/Dialogflow/v2/samples/V2/AgentsClient/get_location.php deleted file mode 100644 index e3b46d604a20..000000000000 --- a/owl-bot-staging/Dialogflow/v2/samples/V2/AgentsClient/get_location.php +++ /dev/null @@ -1,57 +0,0 @@ -getLocation($request); - printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} -// [END dialogflow_v2_generated_Agents_GetLocation_sync] diff --git a/owl-bot-staging/Dialogflow/v2/samples/V2/AgentsClient/get_validation_result.php b/owl-bot-staging/Dialogflow/v2/samples/V2/AgentsClient/get_validation_result.php deleted file mode 100644 index fcd46f1e12d5..000000000000 --- a/owl-bot-staging/Dialogflow/v2/samples/V2/AgentsClient/get_validation_result.php +++ /dev/null @@ -1,73 +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(); - - // Prepare the request message. - $request = (new GetValidationResultRequest()) - ->setParent($formattedParent); - - // Call the API and handle any network failures. - try { - /** @var ValidationResult $response */ - $response = $agentsClient->getValidationResult($request); - printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} - -/** - * Helper to execute the sample. - * - * This sample has been automatically generated and should be regarded as a code - * template only. It will require modifications to work: - * - It may require correct/in-range values for request initialization. - * - It may require specifying regional endpoints when creating the service client, - * please see the apiEndpoint client configuration option for more details. - */ -function callSample(): void -{ - $formattedParent = AgentsClient::projectName('[PROJECT]'); - - get_validation_result_sample($formattedParent); -} -// [END dialogflow_v2_generated_Agents_GetValidationResult_sync] diff --git a/owl-bot-staging/Dialogflow/v2/samples/V2/AgentsClient/import_agent.php b/owl-bot-staging/Dialogflow/v2/samples/V2/AgentsClient/import_agent.php deleted file mode 100644 index 85b9346604ea..000000000000 --- a/owl-bot-staging/Dialogflow/v2/samples/V2/AgentsClient/import_agent.php +++ /dev/null @@ -1,107 +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(); - - // Prepare the request message. - $request = (new ImportAgentRequest()) - ->setParent($formattedParent); - - // Call the API and handle any network failures. - try { - /** @var OperationResponse $response */ - $response = $agentsClient->importAgent($request); - $response->pollUntilComplete(); - - if ($response->operationSucceeded()) { - printf('Operation completed successfully.' . PHP_EOL); - } else { - /** @var Status $error */ - $error = $response->getError(); - printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); - } - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} - -/** - * Helper to execute the sample. - * - * This sample has been automatically generated and should be regarded as a code - * template only. It will require modifications to work: - * - It may require correct/in-range values for request initialization. - * - It may require specifying regional endpoints when creating the service client, - * please see the apiEndpoint client configuration option for more details. - */ -function callSample(): void -{ - $formattedParent = AgentsClient::projectName('[PROJECT]'); - - import_agent_sample($formattedParent); -} -// [END dialogflow_v2_generated_Agents_ImportAgent_sync] diff --git a/owl-bot-staging/Dialogflow/v2/samples/V2/AgentsClient/list_locations.php b/owl-bot-staging/Dialogflow/v2/samples/V2/AgentsClient/list_locations.php deleted file mode 100644 index a4a72b9b3fe8..000000000000 --- a/owl-bot-staging/Dialogflow/v2/samples/V2/AgentsClient/list_locations.php +++ /dev/null @@ -1,62 +0,0 @@ -listLocations($request); - - /** @var Location $element */ - foreach ($response as $element) { - printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString()); - } - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} -// [END dialogflow_v2_generated_Agents_ListLocations_sync] diff --git a/owl-bot-staging/Dialogflow/v2/samples/V2/AgentsClient/restore_agent.php b/owl-bot-staging/Dialogflow/v2/samples/V2/AgentsClient/restore_agent.php deleted file mode 100644 index ec05d8131768..000000000000 --- a/owl-bot-staging/Dialogflow/v2/samples/V2/AgentsClient/restore_agent.php +++ /dev/null @@ -1,105 +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(); - - // Prepare the request message. - $request = (new RestoreAgentRequest()) - ->setParent($formattedParent); - - // Call the API and handle any network failures. - try { - /** @var OperationResponse $response */ - $response = $agentsClient->restoreAgent($request); - $response->pollUntilComplete(); - - if ($response->operationSucceeded()) { - printf('Operation completed successfully.' . PHP_EOL); - } else { - /** @var Status $error */ - $error = $response->getError(); - printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); - } - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} - -/** - * Helper to execute the sample. - * - * This sample has been automatically generated and should be regarded as a code - * template only. It will require modifications to work: - * - It may require correct/in-range values for request initialization. - * - It may require specifying regional endpoints when creating the service client, - * please see the apiEndpoint client configuration option for more details. - */ -function callSample(): void -{ - $formattedParent = AgentsClient::projectName('[PROJECT]'); - - restore_agent_sample($formattedParent); -} -// [END dialogflow_v2_generated_Agents_RestoreAgent_sync] diff --git a/owl-bot-staging/Dialogflow/v2/samples/V2/AgentsClient/search_agents.php b/owl-bot-staging/Dialogflow/v2/samples/V2/AgentsClient/search_agents.php deleted file mode 100644 index f8566a1332b9..000000000000 --- a/owl-bot-staging/Dialogflow/v2/samples/V2/AgentsClient/search_agents.php +++ /dev/null @@ -1,83 +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(); - - // Prepare the request message. - $request = (new SearchAgentsRequest()) - ->setParent($formattedParent); - - // Call the API and handle any network failures. - try { - /** @var PagedListResponse $response */ - $response = $agentsClient->searchAgents($request); - - /** @var Agent $element */ - foreach ($response as $element) { - printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString()); - } - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} - -/** - * Helper to execute the sample. - * - * This sample has been automatically generated and should be regarded as a code - * template only. It will require modifications to work: - * - It may require correct/in-range values for request initialization. - * - It may require specifying regional endpoints when creating the service client, - * please see the apiEndpoint client configuration option for more details. - */ -function callSample(): void -{ - $formattedParent = AgentsClient::projectName('[PROJECT]'); - - search_agents_sample($formattedParent); -} -// [END dialogflow_v2_generated_Agents_SearchAgents_sync] diff --git a/owl-bot-staging/Dialogflow/v2/samples/V2/AgentsClient/set_agent.php b/owl-bot-staging/Dialogflow/v2/samples/V2/AgentsClient/set_agent.php deleted file mode 100644 index bf1518ebc7d9..000000000000 --- a/owl-bot-staging/Dialogflow/v2/samples/V2/AgentsClient/set_agent.php +++ /dev/null @@ -1,102 +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 the request message. - $agent = (new Agent()) - ->setParent($formattedAgentParent) - ->setDisplayName($agentDisplayName) - ->setDefaultLanguageCode($agentDefaultLanguageCode) - ->setTimeZone($agentTimeZone); - $request = (new SetAgentRequest()) - ->setAgent($agent); - - // Call the API and handle any network failures. - try { - /** @var Agent $response */ - $response = $agentsClient->setAgent($request); - printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} - -/** - * Helper to execute the sample. - * - * This sample has been automatically generated and should be regarded as a code - * template only. It will require modifications to work: - * - It may require correct/in-range values for request initialization. - * - It may require specifying regional endpoints when creating the service client, - * please see the apiEndpoint client configuration option for more details. - */ -function callSample(): void -{ - $formattedAgentParent = AgentsClient::projectName('[PROJECT]'); - $agentDisplayName = '[DISPLAY_NAME]'; - $agentDefaultLanguageCode = '[DEFAULT_LANGUAGE_CODE]'; - $agentTimeZone = '[TIME_ZONE]'; - - set_agent_sample( - $formattedAgentParent, - $agentDisplayName, - $agentDefaultLanguageCode, - $agentTimeZone - ); -} -// [END dialogflow_v2_generated_Agents_SetAgent_sync] diff --git a/owl-bot-staging/Dialogflow/v2/samples/V2/AgentsClient/train_agent.php b/owl-bot-staging/Dialogflow/v2/samples/V2/AgentsClient/train_agent.php deleted file mode 100644 index 2e6e02c83dd9..000000000000 --- a/owl-bot-staging/Dialogflow/v2/samples/V2/AgentsClient/train_agent.php +++ /dev/null @@ -1,94 +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(); - - // Prepare the request message. - $request = (new TrainAgentRequest()) - ->setParent($formattedParent); - - // Call the API and handle any network failures. - try { - /** @var OperationResponse $response */ - $response = $agentsClient->trainAgent($request); - $response->pollUntilComplete(); - - if ($response->operationSucceeded()) { - printf('Operation completed successfully.' . PHP_EOL); - } else { - /** @var Status $error */ - $error = $response->getError(); - printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); - } - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} - -/** - * Helper to execute the sample. - * - * This sample has been automatically generated and should be regarded as a code - * template only. It will require modifications to work: - * - It may require correct/in-range values for request initialization. - * - It may require specifying regional endpoints when creating the service client, - * please see the apiEndpoint client configuration option for more details. - */ -function callSample(): void -{ - $formattedParent = AgentsClient::projectName('[PROJECT]'); - - train_agent_sample($formattedParent); -} -// [END dialogflow_v2_generated_Agents_TrainAgent_sync] diff --git a/owl-bot-staging/Dialogflow/v2/samples/V2/AnswerRecordsClient/get_location.php b/owl-bot-staging/Dialogflow/v2/samples/V2/AnswerRecordsClient/get_location.php deleted file mode 100644 index 70c4576c0fa6..000000000000 --- a/owl-bot-staging/Dialogflow/v2/samples/V2/AnswerRecordsClient/get_location.php +++ /dev/null @@ -1,57 +0,0 @@ -getLocation($request); - printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} -// [END dialogflow_v2_generated_AnswerRecords_GetLocation_sync] diff --git a/owl-bot-staging/Dialogflow/v2/samples/V2/AnswerRecordsClient/list_answer_records.php b/owl-bot-staging/Dialogflow/v2/samples/V2/AnswerRecordsClient/list_answer_records.php deleted file mode 100644 index d95f35aa965c..000000000000 --- a/owl-bot-staging/Dialogflow/v2/samples/V2/AnswerRecordsClient/list_answer_records.php +++ /dev/null @@ -1,79 +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(); - - // Prepare the request message. - $request = (new ListAnswerRecordsRequest()) - ->setParent($formattedParent); - - // Call the API and handle any network failures. - try { - /** @var PagedListResponse $response */ - $response = $answerRecordsClient->listAnswerRecords($request); - - /** @var AnswerRecord $element */ - foreach ($response as $element) { - printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString()); - } - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} - -/** - * Helper to execute the sample. - * - * This sample has been automatically generated and should be regarded as a code - * template only. It will require modifications to work: - * - It may require correct/in-range values for request initialization. - * - It may require specifying regional endpoints when creating the service client, - * please see the apiEndpoint client configuration option for more details. - */ -function callSample(): void -{ - $formattedParent = AnswerRecordsClient::projectName('[PROJECT]'); - - list_answer_records_sample($formattedParent); -} -// [END dialogflow_v2_generated_AnswerRecords_ListAnswerRecords_sync] diff --git a/owl-bot-staging/Dialogflow/v2/samples/V2/AnswerRecordsClient/list_locations.php b/owl-bot-staging/Dialogflow/v2/samples/V2/AnswerRecordsClient/list_locations.php deleted file mode 100644 index cb03fe82bf84..000000000000 --- a/owl-bot-staging/Dialogflow/v2/samples/V2/AnswerRecordsClient/list_locations.php +++ /dev/null @@ -1,62 +0,0 @@ -listLocations($request); - - /** @var Location $element */ - foreach ($response as $element) { - printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString()); - } - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} -// [END dialogflow_v2_generated_AnswerRecords_ListLocations_sync] diff --git a/owl-bot-staging/Dialogflow/v2/samples/V2/AnswerRecordsClient/update_answer_record.php b/owl-bot-staging/Dialogflow/v2/samples/V2/AnswerRecordsClient/update_answer_record.php deleted file mode 100644 index b9775cbec198..000000000000 --- a/owl-bot-staging/Dialogflow/v2/samples/V2/AnswerRecordsClient/update_answer_record.php +++ /dev/null @@ -1,65 +0,0 @@ -setAnswerFeedback($answerRecordAnswerFeedback); - $updateMask = new FieldMask(); - $request = (new UpdateAnswerRecordRequest()) - ->setAnswerRecord($answerRecord) - ->setUpdateMask($updateMask); - - // Call the API and handle any network failures. - try { - /** @var AnswerRecord $response */ - $response = $answerRecordsClient->updateAnswerRecord($request); - printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} -// [END dialogflow_v2_generated_AnswerRecords_UpdateAnswerRecord_sync] diff --git a/owl-bot-staging/Dialogflow/v2/samples/V2/ContextsClient/create_context.php b/owl-bot-staging/Dialogflow/v2/samples/V2/ContextsClient/create_context.php deleted file mode 100644 index 5d2652b53362..000000000000 --- a/owl-bot-staging/Dialogflow/v2/samples/V2/ContextsClient/create_context.php +++ /dev/null @@ -1,99 +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 the request message. - $context = (new Context()) - ->setName($contextName); - $request = (new CreateContextRequest()) - ->setParent($formattedParent) - ->setContext($context); - - // Call the API and handle any network failures. - try { - /** @var Context $response */ - $response = $contextsClient->createContext($request); - printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} - -/** - * Helper to execute the sample. - * - * This sample has been automatically generated and should be regarded as a code - * template only. It will require modifications to work: - * - It may require correct/in-range values for request initialization. - * - It may require specifying regional endpoints when creating the service client, - * please see the apiEndpoint client configuration option for more details. - */ -function callSample(): void -{ - $formattedParent = ContextsClient::sessionName('[PROJECT]', '[SESSION]'); - $contextName = '[NAME]'; - - create_context_sample($formattedParent, $contextName); -} -// [END dialogflow_v2_generated_Contexts_CreateContext_sync] diff --git a/owl-bot-staging/Dialogflow/v2/samples/V2/ContextsClient/delete_all_contexts.php b/owl-bot-staging/Dialogflow/v2/samples/V2/ContextsClient/delete_all_contexts.php deleted file mode 100644 index b73e52474e95..000000000000 --- a/owl-bot-staging/Dialogflow/v2/samples/V2/ContextsClient/delete_all_contexts.php +++ /dev/null @@ -1,74 +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(); - - // Prepare the request message. - $request = (new DeleteAllContextsRequest()) - ->setParent($formattedParent); - - // Call the API and handle any network failures. - try { - $contextsClient->deleteAllContexts($request); - printf('Call completed successfully.' . PHP_EOL); - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} - -/** - * Helper to execute the sample. - * - * This sample has been automatically generated and should be regarded as a code - * template only. It will require modifications to work: - * - It may require correct/in-range values for request initialization. - * - It may require specifying regional endpoints when creating the service client, - * please see the apiEndpoint client configuration option for more details. - */ -function callSample(): void -{ - $formattedParent = ContextsClient::sessionName('[PROJECT]', '[SESSION]'); - - delete_all_contexts_sample($formattedParent); -} -// [END dialogflow_v2_generated_Contexts_DeleteAllContexts_sync] diff --git a/owl-bot-staging/Dialogflow/v2/samples/V2/ContextsClient/delete_context.php b/owl-bot-staging/Dialogflow/v2/samples/V2/ContextsClient/delete_context.php deleted file mode 100644 index c9eebb23580c..000000000000 --- a/owl-bot-staging/Dialogflow/v2/samples/V2/ContextsClient/delete_context.php +++ /dev/null @@ -1,74 +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(); - - // Prepare the request message. - $request = (new DeleteContextRequest()) - ->setName($formattedName); - - // Call the API and handle any network failures. - try { - $contextsClient->deleteContext($request); - printf('Call completed successfully.' . PHP_EOL); - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} - -/** - * Helper to execute the sample. - * - * This sample has been automatically generated and should be regarded as a code - * template only. It will require modifications to work: - * - It may require correct/in-range values for request initialization. - * - It may require specifying regional endpoints when creating the service client, - * please see the apiEndpoint client configuration option for more details. - */ -function callSample(): void -{ - $formattedName = ContextsClient::contextName('[PROJECT]', '[SESSION]', '[CONTEXT]'); - - delete_context_sample($formattedName); -} -// [END dialogflow_v2_generated_Contexts_DeleteContext_sync] diff --git a/owl-bot-staging/Dialogflow/v2/samples/V2/ContextsClient/get_context.php b/owl-bot-staging/Dialogflow/v2/samples/V2/ContextsClient/get_context.php deleted file mode 100644 index a658eca64e24..000000000000 --- a/owl-bot-staging/Dialogflow/v2/samples/V2/ContextsClient/get_context.php +++ /dev/null @@ -1,76 +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(); - - // Prepare the request message. - $request = (new GetContextRequest()) - ->setName($formattedName); - - // Call the API and handle any network failures. - try { - /** @var Context $response */ - $response = $contextsClient->getContext($request); - printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} - -/** - * Helper to execute the sample. - * - * This sample has been automatically generated and should be regarded as a code - * template only. It will require modifications to work: - * - It may require correct/in-range values for request initialization. - * - It may require specifying regional endpoints when creating the service client, - * please see the apiEndpoint client configuration option for more details. - */ -function callSample(): void -{ - $formattedName = ContextsClient::contextName('[PROJECT]', '[SESSION]', '[CONTEXT]'); - - get_context_sample($formattedName); -} -// [END dialogflow_v2_generated_Contexts_GetContext_sync] diff --git a/owl-bot-staging/Dialogflow/v2/samples/V2/ContextsClient/get_location.php b/owl-bot-staging/Dialogflow/v2/samples/V2/ContextsClient/get_location.php deleted file mode 100644 index 346717181fa2..000000000000 --- a/owl-bot-staging/Dialogflow/v2/samples/V2/ContextsClient/get_location.php +++ /dev/null @@ -1,57 +0,0 @@ -getLocation($request); - printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} -// [END dialogflow_v2_generated_Contexts_GetLocation_sync] diff --git a/owl-bot-staging/Dialogflow/v2/samples/V2/ContextsClient/list_contexts.php b/owl-bot-staging/Dialogflow/v2/samples/V2/ContextsClient/list_contexts.php deleted file mode 100644 index 736dc8412972..000000000000 --- a/owl-bot-staging/Dialogflow/v2/samples/V2/ContextsClient/list_contexts.php +++ /dev/null @@ -1,81 +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(); - - // Prepare the request message. - $request = (new ListContextsRequest()) - ->setParent($formattedParent); - - // Call the API and handle any network failures. - try { - /** @var PagedListResponse $response */ - $response = $contextsClient->listContexts($request); - - /** @var Context $element */ - foreach ($response as $element) { - printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString()); - } - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} - -/** - * Helper to execute the sample. - * - * This sample has been automatically generated and should be regarded as a code - * template only. It will require modifications to work: - * - It may require correct/in-range values for request initialization. - * - It may require specifying regional endpoints when creating the service client, - * please see the apiEndpoint client configuration option for more details. - */ -function callSample(): void -{ - $formattedParent = ContextsClient::sessionName('[PROJECT]', '[SESSION]'); - - list_contexts_sample($formattedParent); -} -// [END dialogflow_v2_generated_Contexts_ListContexts_sync] diff --git a/owl-bot-staging/Dialogflow/v2/samples/V2/ContextsClient/list_locations.php b/owl-bot-staging/Dialogflow/v2/samples/V2/ContextsClient/list_locations.php deleted file mode 100644 index d3359e3f5713..000000000000 --- a/owl-bot-staging/Dialogflow/v2/samples/V2/ContextsClient/list_locations.php +++ /dev/null @@ -1,62 +0,0 @@ -listLocations($request); - - /** @var Location $element */ - foreach ($response as $element) { - printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString()); - } - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} -// [END dialogflow_v2_generated_Contexts_ListLocations_sync] diff --git a/owl-bot-staging/Dialogflow/v2/samples/V2/ContextsClient/update_context.php b/owl-bot-staging/Dialogflow/v2/samples/V2/ContextsClient/update_context.php deleted file mode 100644 index 91568637832f..000000000000 --- a/owl-bot-staging/Dialogflow/v2/samples/V2/ContextsClient/update_context.php +++ /dev/null @@ -1,88 +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 the request message. - $context = (new Context()) - ->setName($contextName); - $request = (new UpdateContextRequest()) - ->setContext($context); - - // Call the API and handle any network failures. - try { - /** @var Context $response */ - $response = $contextsClient->updateContext($request); - printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} - -/** - * Helper to execute the sample. - * - * This sample has been automatically generated and should be regarded as a code - * template only. It will require modifications to work: - * - It may require correct/in-range values for request initialization. - * - It may require specifying regional endpoints when creating the service client, - * please see the apiEndpoint client configuration option for more details. - */ -function callSample(): void -{ - $contextName = '[NAME]'; - - update_context_sample($contextName); -} -// [END dialogflow_v2_generated_Contexts_UpdateContext_sync] diff --git a/owl-bot-staging/Dialogflow/v2/samples/V2/ConversationDatasetsClient/create_conversation_dataset.php b/owl-bot-staging/Dialogflow/v2/samples/V2/ConversationDatasetsClient/create_conversation_dataset.php deleted file mode 100644 index 955bcf40ffd0..000000000000 --- a/owl-bot-staging/Dialogflow/v2/samples/V2/ConversationDatasetsClient/create_conversation_dataset.php +++ /dev/null @@ -1,99 +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 the request message. - $conversationDataset = (new ConversationDataset()) - ->setDisplayName($conversationDatasetDisplayName); - $request = (new CreateConversationDatasetRequest()) - ->setParent($parent) - ->setConversationDataset($conversationDataset); - - // Call the API and handle any network failures. - try { - /** @var OperationResponse $response */ - $response = $conversationDatasetsClient->createConversationDataset($request); - $response->pollUntilComplete(); - - if ($response->operationSucceeded()) { - /** @var ConversationDataset $result */ - $result = $response->getResult(); - printf('Operation successful with response data: %s' . PHP_EOL, $result->serializeToJsonString()); - } else { - /** @var Status $error */ - $error = $response->getError(); - printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); - } - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} - -/** - * Helper to execute the sample. - * - * This sample has been automatically generated and should be regarded as a code - * template only. It will require modifications to work: - * - It may require correct/in-range values for request initialization. - * - It may require specifying regional endpoints when creating the service client, - * please see the apiEndpoint client configuration option for more details. - */ -function callSample(): void -{ - $parent = '[PARENT]'; - $conversationDatasetDisplayName = '[DISPLAY_NAME]'; - - create_conversation_dataset_sample($parent, $conversationDatasetDisplayName); -} -// [END dialogflow_v2_generated_ConversationDatasets_CreateConversationDataset_sync] diff --git a/owl-bot-staging/Dialogflow/v2/samples/V2/ConversationDatasetsClient/delete_conversation_dataset.php b/owl-bot-staging/Dialogflow/v2/samples/V2/ConversationDatasetsClient/delete_conversation_dataset.php deleted file mode 100644 index 8ad394a04734..000000000000 --- a/owl-bot-staging/Dialogflow/v2/samples/V2/ConversationDatasetsClient/delete_conversation_dataset.php +++ /dev/null @@ -1,95 +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(); - - // Prepare the request message. - $request = (new DeleteConversationDatasetRequest()) - ->setName($formattedName); - - // Call the API and handle any network failures. - try { - /** @var OperationResponse $response */ - $response = $conversationDatasetsClient->deleteConversationDataset($request); - $response->pollUntilComplete(); - - if ($response->operationSucceeded()) { - printf('Operation completed successfully.' . PHP_EOL); - } else { - /** @var Status $error */ - $error = $response->getError(); - printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); - } - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} - -/** - * Helper to execute the sample. - * - * This sample has been automatically generated and should be regarded as a code - * template only. It will require modifications to work: - * - It may require correct/in-range values for request initialization. - * - It may require specifying regional endpoints when creating the service client, - * please see the apiEndpoint client configuration option for more details. - */ -function callSample(): void -{ - $formattedName = ConversationDatasetsClient::conversationDatasetName( - '[PROJECT]', - '[LOCATION]', - '[CONVERSATION_DATASET]' - ); - - delete_conversation_dataset_sample($formattedName); -} -// [END dialogflow_v2_generated_ConversationDatasets_DeleteConversationDataset_sync] diff --git a/owl-bot-staging/Dialogflow/v2/samples/V2/ConversationDatasetsClient/get_conversation_dataset.php b/owl-bot-staging/Dialogflow/v2/samples/V2/ConversationDatasetsClient/get_conversation_dataset.php deleted file mode 100644 index 0523563c722d..000000000000 --- a/owl-bot-staging/Dialogflow/v2/samples/V2/ConversationDatasetsClient/get_conversation_dataset.php +++ /dev/null @@ -1,77 +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(); - - // Prepare the request message. - $request = (new GetConversationDatasetRequest()) - ->setName($formattedName); - - // Call the API and handle any network failures. - try { - /** @var ConversationDataset $response */ - $response = $conversationDatasetsClient->getConversationDataset($request); - printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} - -/** - * Helper to execute the sample. - * - * This sample has been automatically generated and should be regarded as a code - * template only. It will require modifications to work: - * - It may require correct/in-range values for request initialization. - * - It may require specifying regional endpoints when creating the service client, - * please see the apiEndpoint client configuration option for more details. - */ -function callSample(): void -{ - $formattedName = ConversationDatasetsClient::conversationDatasetName( - '[PROJECT]', - '[LOCATION]', - '[CONVERSATION_DATASET]' - ); - - get_conversation_dataset_sample($formattedName); -} -// [END dialogflow_v2_generated_ConversationDatasets_GetConversationDataset_sync] diff --git a/owl-bot-staging/Dialogflow/v2/samples/V2/ConversationDatasetsClient/get_location.php b/owl-bot-staging/Dialogflow/v2/samples/V2/ConversationDatasetsClient/get_location.php deleted file mode 100644 index 124ed9b01813..000000000000 --- a/owl-bot-staging/Dialogflow/v2/samples/V2/ConversationDatasetsClient/get_location.php +++ /dev/null @@ -1,57 +0,0 @@ -getLocation($request); - printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} -// [END dialogflow_v2_generated_ConversationDatasets_GetLocation_sync] diff --git a/owl-bot-staging/Dialogflow/v2/samples/V2/ConversationDatasetsClient/import_conversation_data.php b/owl-bot-staging/Dialogflow/v2/samples/V2/ConversationDatasetsClient/import_conversation_data.php deleted file mode 100644 index bc45b150ef6c..000000000000 --- a/owl-bot-staging/Dialogflow/v2/samples/V2/ConversationDatasetsClient/import_conversation_data.php +++ /dev/null @@ -1,103 +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 the request message. - $inputConfig = new InputConfig(); - $request = (new ImportConversationDataRequest()) - ->setName($formattedName) - ->setInputConfig($inputConfig); - - // Call the API and handle any network failures. - try { - /** @var OperationResponse $response */ - $response = $conversationDatasetsClient->importConversationData($request); - $response->pollUntilComplete(); - - if ($response->operationSucceeded()) { - /** @var ImportConversationDataOperationResponse $result */ - $result = $response->getResult(); - printf('Operation successful with response data: %s' . PHP_EOL, $result->serializeToJsonString()); - } else { - /** @var Status $error */ - $error = $response->getError(); - printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); - } - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} - -/** - * Helper to execute the sample. - * - * This sample has been automatically generated and should be regarded as a code - * template only. It will require modifications to work: - * - It may require correct/in-range values for request initialization. - * - It may require specifying regional endpoints when creating the service client, - * please see the apiEndpoint client configuration option for more details. - */ -function callSample(): void -{ - $formattedName = ConversationDatasetsClient::conversationDatasetName( - '[PROJECT]', - '[LOCATION]', - '[CONVERSATION_DATASET]' - ); - - import_conversation_data_sample($formattedName); -} -// [END dialogflow_v2_generated_ConversationDatasets_ImportConversationData_sync] diff --git a/owl-bot-staging/Dialogflow/v2/samples/V2/ConversationDatasetsClient/list_conversation_datasets.php b/owl-bot-staging/Dialogflow/v2/samples/V2/ConversationDatasetsClient/list_conversation_datasets.php deleted file mode 100644 index 3fa0e4aed3de..000000000000 --- a/owl-bot-staging/Dialogflow/v2/samples/V2/ConversationDatasetsClient/list_conversation_datasets.php +++ /dev/null @@ -1,78 +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(); - - // Prepare the request message. - $request = (new ListConversationDatasetsRequest()) - ->setParent($formattedParent); - - // Call the API and handle any network failures. - try { - /** @var PagedListResponse $response */ - $response = $conversationDatasetsClient->listConversationDatasets($request); - - /** @var ConversationDataset $element */ - foreach ($response as $element) { - printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString()); - } - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} - -/** - * Helper to execute the sample. - * - * This sample has been automatically generated and should be regarded as a code - * template only. It will require modifications to work: - * - It may require correct/in-range values for request initialization. - * - It may require specifying regional endpoints when creating the service client, - * please see the apiEndpoint client configuration option for more details. - */ -function callSample(): void -{ - $formattedParent = ConversationDatasetsClient::locationName('[PROJECT]', '[LOCATION]'); - - list_conversation_datasets_sample($formattedParent); -} -// [END dialogflow_v2_generated_ConversationDatasets_ListConversationDatasets_sync] diff --git a/owl-bot-staging/Dialogflow/v2/samples/V2/ConversationDatasetsClient/list_locations.php b/owl-bot-staging/Dialogflow/v2/samples/V2/ConversationDatasetsClient/list_locations.php deleted file mode 100644 index 38f568d30dad..000000000000 --- a/owl-bot-staging/Dialogflow/v2/samples/V2/ConversationDatasetsClient/list_locations.php +++ /dev/null @@ -1,62 +0,0 @@ -listLocations($request); - - /** @var Location $element */ - foreach ($response as $element) { - printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString()); - } - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} -// [END dialogflow_v2_generated_ConversationDatasets_ListLocations_sync] diff --git a/owl-bot-staging/Dialogflow/v2/samples/V2/ConversationModelsClient/create_conversation_model.php b/owl-bot-staging/Dialogflow/v2/samples/V2/ConversationModelsClient/create_conversation_model.php deleted file mode 100644 index c5b2699dc6f7..000000000000 --- a/owl-bot-staging/Dialogflow/v2/samples/V2/ConversationModelsClient/create_conversation_model.php +++ /dev/null @@ -1,112 +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 the request message. - $inputDataset = (new InputDataset()) - ->setDataset($formattedConversationModelDatasetsDataset); - $conversationModelDatasets = [$inputDataset,]; - $conversationModel = (new ConversationModel()) - ->setDisplayName($conversationModelDisplayName) - ->setDatasets($conversationModelDatasets); - $request = (new CreateConversationModelRequest()) - ->setConversationModel($conversationModel); - - // Call the API and handle any network failures. - try { - /** @var OperationResponse $response */ - $response = $conversationModelsClient->createConversationModel($request); - $response->pollUntilComplete(); - - if ($response->operationSucceeded()) { - /** @var ConversationModel $result */ - $result = $response->getResult(); - printf('Operation successful with response data: %s' . PHP_EOL, $result->serializeToJsonString()); - } else { - /** @var Status $error */ - $error = $response->getError(); - printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); - } - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} - -/** - * Helper to execute the sample. - * - * This sample has been automatically generated and should be regarded as a code - * template only. It will require modifications to work: - * - It may require correct/in-range values for request initialization. - * - It may require specifying regional endpoints when creating the service client, - * please see the apiEndpoint client configuration option for more details. - */ -function callSample(): void -{ - $conversationModelDisplayName = '[DISPLAY_NAME]'; - $formattedConversationModelDatasetsDataset = ConversationModelsClient::conversationDatasetName( - '[PROJECT]', - '[LOCATION]', - '[CONVERSATION_DATASET]' - ); - - create_conversation_model_sample( - $conversationModelDisplayName, - $formattedConversationModelDatasetsDataset - ); -} -// [END dialogflow_v2_generated_ConversationModels_CreateConversationModel_sync] diff --git a/owl-bot-staging/Dialogflow/v2/samples/V2/ConversationModelsClient/create_conversation_model_evaluation.php b/owl-bot-staging/Dialogflow/v2/samples/V2/ConversationModelsClient/create_conversation_model_evaluation.php deleted file mode 100644 index e81554b2f6aa..000000000000 --- a/owl-bot-staging/Dialogflow/v2/samples/V2/ConversationModelsClient/create_conversation_model_evaluation.php +++ /dev/null @@ -1,91 +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 the request message. - $conversationModelEvaluation = new ConversationModelEvaluation(); - $request = (new CreateConversationModelEvaluationRequest()) - ->setParent($formattedParent) - ->setConversationModelEvaluation($conversationModelEvaluation); - - // Call the API and handle any network failures. - try { - /** @var OperationResponse $response */ - $response = $conversationModelsClient->createConversationModelEvaluation($request); - $response->pollUntilComplete(); - - if ($response->operationSucceeded()) { - /** @var ConversationModelEvaluation $result */ - $result = $response->getResult(); - printf('Operation successful with response data: %s' . PHP_EOL, $result->serializeToJsonString()); - } else { - /** @var Status $error */ - $error = $response->getError(); - printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); - } - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} - -/** - * Helper to execute the sample. - * - * This sample has been automatically generated and should be regarded as a code - * template only. It will require modifications to work: - * - It may require correct/in-range values for request initialization. - * - It may require specifying regional endpoints when creating the service client, - * please see the apiEndpoint client configuration option for more details. - */ -function callSample(): void -{ - $formattedParent = ConversationModelsClient::conversationModelName( - '[PROJECT]', - '[LOCATION]', - '[CONVERSATION_MODEL]' - ); - - create_conversation_model_evaluation_sample($formattedParent); -} -// [END dialogflow_v2_generated_ConversationModels_CreateConversationModelEvaluation_sync] diff --git a/owl-bot-staging/Dialogflow/v2/samples/V2/ConversationModelsClient/delete_conversation_model.php b/owl-bot-staging/Dialogflow/v2/samples/V2/ConversationModelsClient/delete_conversation_model.php deleted file mode 100644 index ffe3e416fe12..000000000000 --- a/owl-bot-staging/Dialogflow/v2/samples/V2/ConversationModelsClient/delete_conversation_model.php +++ /dev/null @@ -1,89 +0,0 @@ -/conversationModels/` - */ -function delete_conversation_model_sample(string $name): void -{ - // Create a client. - $conversationModelsClient = new ConversationModelsClient(); - - // Prepare the request message. - $request = (new DeleteConversationModelRequest()) - ->setName($name); - - // Call the API and handle any network failures. - try { - /** @var OperationResponse $response */ - $response = $conversationModelsClient->deleteConversationModel($request); - $response->pollUntilComplete(); - - if ($response->operationSucceeded()) { - printf('Operation completed successfully.' . PHP_EOL); - } else { - /** @var Status $error */ - $error = $response->getError(); - printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); - } - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} - -/** - * Helper to execute the sample. - * - * This sample has been automatically generated and should be regarded as a code - * template only. It will require modifications to work: - * - It may require correct/in-range values for request initialization. - * - It may require specifying regional endpoints when creating the service client, - * please see the apiEndpoint client configuration option for more details. - */ -function callSample(): void -{ - $name = '[NAME]'; - - delete_conversation_model_sample($name); -} -// [END dialogflow_v2_generated_ConversationModels_DeleteConversationModel_sync] diff --git a/owl-bot-staging/Dialogflow/v2/samples/V2/ConversationModelsClient/deploy_conversation_model.php b/owl-bot-staging/Dialogflow/v2/samples/V2/ConversationModelsClient/deploy_conversation_model.php deleted file mode 100644 index 5562d6f483e4..000000000000 --- a/owl-bot-staging/Dialogflow/v2/samples/V2/ConversationModelsClient/deploy_conversation_model.php +++ /dev/null @@ -1,92 +0,0 @@ -/conversationModels/` - */ -function deploy_conversation_model_sample(string $name): void -{ - // Create a client. - $conversationModelsClient = new ConversationModelsClient(); - - // Prepare the request message. - $request = (new DeployConversationModelRequest()) - ->setName($name); - - // Call the API and handle any network failures. - try { - /** @var OperationResponse $response */ - $response = $conversationModelsClient->deployConversationModel($request); - $response->pollUntilComplete(); - - if ($response->operationSucceeded()) { - printf('Operation completed successfully.' . PHP_EOL); - } else { - /** @var Status $error */ - $error = $response->getError(); - printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); - } - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} - -/** - * Helper to execute the sample. - * - * This sample has been automatically generated and should be regarded as a code - * template only. It will require modifications to work: - * - It may require correct/in-range values for request initialization. - * - It may require specifying regional endpoints when creating the service client, - * please see the apiEndpoint client configuration option for more details. - */ -function callSample(): void -{ - $name = '[NAME]'; - - deploy_conversation_model_sample($name); -} -// [END dialogflow_v2_generated_ConversationModels_DeployConversationModel_sync] diff --git a/owl-bot-staging/Dialogflow/v2/samples/V2/ConversationModelsClient/get_conversation_model.php b/owl-bot-staging/Dialogflow/v2/samples/V2/ConversationModelsClient/get_conversation_model.php deleted file mode 100644 index 2d301dbde9b8..000000000000 --- a/owl-bot-staging/Dialogflow/v2/samples/V2/ConversationModelsClient/get_conversation_model.php +++ /dev/null @@ -1,71 +0,0 @@ -/conversationModels/` - */ -function get_conversation_model_sample(string $name): void -{ - // Create a client. - $conversationModelsClient = new ConversationModelsClient(); - - // Prepare the request message. - $request = (new GetConversationModelRequest()) - ->setName($name); - - // Call the API and handle any network failures. - try { - /** @var ConversationModel $response */ - $response = $conversationModelsClient->getConversationModel($request); - printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} - -/** - * Helper to execute the sample. - * - * This sample has been automatically generated and should be regarded as a code - * template only. It will require modifications to work: - * - It may require correct/in-range values for request initialization. - * - It may require specifying regional endpoints when creating the service client, - * please see the apiEndpoint client configuration option for more details. - */ -function callSample(): void -{ - $name = '[NAME]'; - - get_conversation_model_sample($name); -} -// [END dialogflow_v2_generated_ConversationModels_GetConversationModel_sync] diff --git a/owl-bot-staging/Dialogflow/v2/samples/V2/ConversationModelsClient/get_conversation_model_evaluation.php b/owl-bot-staging/Dialogflow/v2/samples/V2/ConversationModelsClient/get_conversation_model_evaluation.php deleted file mode 100644 index 573a526f7465..000000000000 --- a/owl-bot-staging/Dialogflow/v2/samples/V2/ConversationModelsClient/get_conversation_model_evaluation.php +++ /dev/null @@ -1,72 +0,0 @@ -/conversationModels//evaluations/` - */ -function get_conversation_model_evaluation_sample(string $name): void -{ - // Create a client. - $conversationModelsClient = new ConversationModelsClient(); - - // Prepare the request message. - $request = (new GetConversationModelEvaluationRequest()) - ->setName($name); - - // Call the API and handle any network failures. - try { - /** @var ConversationModelEvaluation $response */ - $response = $conversationModelsClient->getConversationModelEvaluation($request); - printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} - -/** - * Helper to execute the sample. - * - * This sample has been automatically generated and should be regarded as a code - * template only. It will require modifications to work: - * - It may require correct/in-range values for request initialization. - * - It may require specifying regional endpoints when creating the service client, - * please see the apiEndpoint client configuration option for more details. - */ -function callSample(): void -{ - $name = '[NAME]'; - - get_conversation_model_evaluation_sample($name); -} -// [END dialogflow_v2_generated_ConversationModels_GetConversationModelEvaluation_sync] diff --git a/owl-bot-staging/Dialogflow/v2/samples/V2/ConversationModelsClient/get_location.php b/owl-bot-staging/Dialogflow/v2/samples/V2/ConversationModelsClient/get_location.php deleted file mode 100644 index ae226f71c9a8..000000000000 --- a/owl-bot-staging/Dialogflow/v2/samples/V2/ConversationModelsClient/get_location.php +++ /dev/null @@ -1,57 +0,0 @@ -getLocation($request); - printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} -// [END dialogflow_v2_generated_ConversationModels_GetLocation_sync] diff --git a/owl-bot-staging/Dialogflow/v2/samples/V2/ConversationModelsClient/list_conversation_model_evaluations.php b/owl-bot-staging/Dialogflow/v2/samples/V2/ConversationModelsClient/list_conversation_model_evaluations.php deleted file mode 100644 index 6a4b9f7f115a..000000000000 --- a/owl-bot-staging/Dialogflow/v2/samples/V2/ConversationModelsClient/list_conversation_model_evaluations.php +++ /dev/null @@ -1,76 +0,0 @@ -/conversationModels/` - */ -function list_conversation_model_evaluations_sample(string $parent): void -{ - // Create a client. - $conversationModelsClient = new ConversationModelsClient(); - - // Prepare the request message. - $request = (new ListConversationModelEvaluationsRequest()) - ->setParent($parent); - - // Call the API and handle any network failures. - try { - /** @var PagedListResponse $response */ - $response = $conversationModelsClient->listConversationModelEvaluations($request); - - /** @var ConversationModelEvaluation $element */ - foreach ($response as $element) { - printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString()); - } - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} - -/** - * Helper to execute the sample. - * - * This sample has been automatically generated and should be regarded as a code - * template only. It will require modifications to work: - * - It may require correct/in-range values for request initialization. - * - It may require specifying regional endpoints when creating the service client, - * please see the apiEndpoint client configuration option for more details. - */ -function callSample(): void -{ - $parent = '[PARENT]'; - - list_conversation_model_evaluations_sample($parent); -} -// [END dialogflow_v2_generated_ConversationModels_ListConversationModelEvaluations_sync] diff --git a/owl-bot-staging/Dialogflow/v2/samples/V2/ConversationModelsClient/list_conversation_models.php b/owl-bot-staging/Dialogflow/v2/samples/V2/ConversationModelsClient/list_conversation_models.php deleted file mode 100644 index 6fa74df6595c..000000000000 --- a/owl-bot-staging/Dialogflow/v2/samples/V2/ConversationModelsClient/list_conversation_models.php +++ /dev/null @@ -1,76 +0,0 @@ -` - */ -function list_conversation_models_sample(string $parent): void -{ - // Create a client. - $conversationModelsClient = new ConversationModelsClient(); - - // Prepare the request message. - $request = (new ListConversationModelsRequest()) - ->setParent($parent); - - // Call the API and handle any network failures. - try { - /** @var PagedListResponse $response */ - $response = $conversationModelsClient->listConversationModels($request); - - /** @var ConversationModel $element */ - foreach ($response as $element) { - printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString()); - } - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} - -/** - * Helper to execute the sample. - * - * This sample has been automatically generated and should be regarded as a code - * template only. It will require modifications to work: - * - It may require correct/in-range values for request initialization. - * - It may require specifying regional endpoints when creating the service client, - * please see the apiEndpoint client configuration option for more details. - */ -function callSample(): void -{ - $parent = '[PARENT]'; - - list_conversation_models_sample($parent); -} -// [END dialogflow_v2_generated_ConversationModels_ListConversationModels_sync] diff --git a/owl-bot-staging/Dialogflow/v2/samples/V2/ConversationModelsClient/list_locations.php b/owl-bot-staging/Dialogflow/v2/samples/V2/ConversationModelsClient/list_locations.php deleted file mode 100644 index 03be700097b1..000000000000 --- a/owl-bot-staging/Dialogflow/v2/samples/V2/ConversationModelsClient/list_locations.php +++ /dev/null @@ -1,62 +0,0 @@ -listLocations($request); - - /** @var Location $element */ - foreach ($response as $element) { - printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString()); - } - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} -// [END dialogflow_v2_generated_ConversationModels_ListLocations_sync] diff --git a/owl-bot-staging/Dialogflow/v2/samples/V2/ConversationModelsClient/undeploy_conversation_model.php b/owl-bot-staging/Dialogflow/v2/samples/V2/ConversationModelsClient/undeploy_conversation_model.php deleted file mode 100644 index a50478e6c970..000000000000 --- a/owl-bot-staging/Dialogflow/v2/samples/V2/ConversationModelsClient/undeploy_conversation_model.php +++ /dev/null @@ -1,92 +0,0 @@ -/conversationModels/` - */ -function undeploy_conversation_model_sample(string $name): void -{ - // Create a client. - $conversationModelsClient = new ConversationModelsClient(); - - // Prepare the request message. - $request = (new UndeployConversationModelRequest()) - ->setName($name); - - // Call the API and handle any network failures. - try { - /** @var OperationResponse $response */ - $response = $conversationModelsClient->undeployConversationModel($request); - $response->pollUntilComplete(); - - if ($response->operationSucceeded()) { - printf('Operation completed successfully.' . PHP_EOL); - } else { - /** @var Status $error */ - $error = $response->getError(); - printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); - } - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} - -/** - * Helper to execute the sample. - * - * This sample has been automatically generated and should be regarded as a code - * template only. It will require modifications to work: - * - It may require correct/in-range values for request initialization. - * - It may require specifying regional endpoints when creating the service client, - * please see the apiEndpoint client configuration option for more details. - */ -function callSample(): void -{ - $name = '[NAME]'; - - undeploy_conversation_model_sample($name); -} -// [END dialogflow_v2_generated_ConversationModels_UndeployConversationModel_sync] diff --git a/owl-bot-staging/Dialogflow/v2/samples/V2/ConversationProfilesClient/clear_suggestion_feature_config.php b/owl-bot-staging/Dialogflow/v2/samples/V2/ConversationProfilesClient/clear_suggestion_feature_config.php deleted file mode 100644 index 1badc11b0579..000000000000 --- a/owl-bot-staging/Dialogflow/v2/samples/V2/ConversationProfilesClient/clear_suggestion_feature_config.php +++ /dev/null @@ -1,110 +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(); - - // Prepare the request message. - $request = (new ClearSuggestionFeatureConfigRequest()) - ->setConversationProfile($conversationProfile) - ->setParticipantRole($participantRole) - ->setSuggestionFeatureType($suggestionFeatureType); - - // Call the API and handle any network failures. - try { - /** @var OperationResponse $response */ - $response = $conversationProfilesClient->clearSuggestionFeatureConfig($request); - $response->pollUntilComplete(); - - if ($response->operationSucceeded()) { - /** @var ConversationProfile $result */ - $result = $response->getResult(); - printf('Operation successful with response data: %s' . PHP_EOL, $result->serializeToJsonString()); - } else { - /** @var Status $error */ - $error = $response->getError(); - printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); - } - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} - -/** - * Helper to execute the sample. - * - * This sample has been automatically generated and should be regarded as a code - * template only. It will require modifications to work: - * - It may require correct/in-range values for request initialization. - * - It may require specifying regional endpoints when creating the service client, - * please see the apiEndpoint client configuration option for more details. - */ -function callSample(): void -{ - $conversationProfile = '[CONVERSATION_PROFILE]'; - $participantRole = Role::ROLE_UNSPECIFIED; - $suggestionFeatureType = Type::TYPE_UNSPECIFIED; - - clear_suggestion_feature_config_sample( - $conversationProfile, - $participantRole, - $suggestionFeatureType - ); -} -// [END dialogflow_v2_generated_ConversationProfiles_ClearSuggestionFeatureConfig_sync] diff --git a/owl-bot-staging/Dialogflow/v2/samples/V2/ConversationProfilesClient/create_conversation_profile.php b/owl-bot-staging/Dialogflow/v2/samples/V2/ConversationProfilesClient/create_conversation_profile.php deleted file mode 100644 index 32902b894190..000000000000 --- a/owl-bot-staging/Dialogflow/v2/samples/V2/ConversationProfilesClient/create_conversation_profile.php +++ /dev/null @@ -1,84 +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 the request message. - $conversationProfile = (new ConversationProfile()) - ->setDisplayName($conversationProfileDisplayName); - $request = (new CreateConversationProfileRequest()) - ->setParent($formattedParent) - ->setConversationProfile($conversationProfile); - - // Call the API and handle any network failures. - try { - /** @var ConversationProfile $response */ - $response = $conversationProfilesClient->createConversationProfile($request); - printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} - -/** - * Helper to execute the sample. - * - * This sample has been automatically generated and should be regarded as a code - * template only. It will require modifications to work: - * - It may require correct/in-range values for request initialization. - * - It may require specifying regional endpoints when creating the service client, - * please see the apiEndpoint client configuration option for more details. - */ -function callSample(): void -{ - $formattedParent = ConversationProfilesClient::projectName('[PROJECT]'); - $conversationProfileDisplayName = '[DISPLAY_NAME]'; - - create_conversation_profile_sample($formattedParent, $conversationProfileDisplayName); -} -// [END dialogflow_v2_generated_ConversationProfiles_CreateConversationProfile_sync] diff --git a/owl-bot-staging/Dialogflow/v2/samples/V2/ConversationProfilesClient/delete_conversation_profile.php b/owl-bot-staging/Dialogflow/v2/samples/V2/ConversationProfilesClient/delete_conversation_profile.php deleted file mode 100644 index f6eb0db3ebf3..000000000000 --- a/owl-bot-staging/Dialogflow/v2/samples/V2/ConversationProfilesClient/delete_conversation_profile.php +++ /dev/null @@ -1,74 +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(); - - // Prepare the request message. - $request = (new DeleteConversationProfileRequest()) - ->setName($formattedName); - - // Call the API and handle any network failures. - try { - $conversationProfilesClient->deleteConversationProfile($request); - printf('Call completed successfully.' . PHP_EOL); - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} - -/** - * Helper to execute the sample. - * - * This sample has been automatically generated and should be regarded as a code - * template only. It will require modifications to work: - * - It may require correct/in-range values for request initialization. - * - It may require specifying regional endpoints when creating the service client, - * please see the apiEndpoint client configuration option for more details. - */ -function callSample(): void -{ - $formattedName = ConversationProfilesClient::conversationProfileName( - '[PROJECT]', - '[CONVERSATION_PROFILE]' - ); - - delete_conversation_profile_sample($formattedName); -} -// [END dialogflow_v2_generated_ConversationProfiles_DeleteConversationProfile_sync] diff --git a/owl-bot-staging/Dialogflow/v2/samples/V2/ConversationProfilesClient/get_conversation_profile.php b/owl-bot-staging/Dialogflow/v2/samples/V2/ConversationProfilesClient/get_conversation_profile.php deleted file mode 100644 index cf84747196f0..000000000000 --- a/owl-bot-staging/Dialogflow/v2/samples/V2/ConversationProfilesClient/get_conversation_profile.php +++ /dev/null @@ -1,76 +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(); - - // Prepare the request message. - $request = (new GetConversationProfileRequest()) - ->setName($formattedName); - - // Call the API and handle any network failures. - try { - /** @var ConversationProfile $response */ - $response = $conversationProfilesClient->getConversationProfile($request); - printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} - -/** - * Helper to execute the sample. - * - * This sample has been automatically generated and should be regarded as a code - * template only. It will require modifications to work: - * - It may require correct/in-range values for request initialization. - * - It may require specifying regional endpoints when creating the service client, - * please see the apiEndpoint client configuration option for more details. - */ -function callSample(): void -{ - $formattedName = ConversationProfilesClient::conversationProfileName( - '[PROJECT]', - '[CONVERSATION_PROFILE]' - ); - - get_conversation_profile_sample($formattedName); -} -// [END dialogflow_v2_generated_ConversationProfiles_GetConversationProfile_sync] diff --git a/owl-bot-staging/Dialogflow/v2/samples/V2/ConversationProfilesClient/get_location.php b/owl-bot-staging/Dialogflow/v2/samples/V2/ConversationProfilesClient/get_location.php deleted file mode 100644 index b9ff1675582d..000000000000 --- a/owl-bot-staging/Dialogflow/v2/samples/V2/ConversationProfilesClient/get_location.php +++ /dev/null @@ -1,57 +0,0 @@ -getLocation($request); - printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} -// [END dialogflow_v2_generated_ConversationProfiles_GetLocation_sync] diff --git a/owl-bot-staging/Dialogflow/v2/samples/V2/ConversationProfilesClient/list_conversation_profiles.php b/owl-bot-staging/Dialogflow/v2/samples/V2/ConversationProfilesClient/list_conversation_profiles.php deleted file mode 100644 index 81ec5677dd0e..000000000000 --- a/owl-bot-staging/Dialogflow/v2/samples/V2/ConversationProfilesClient/list_conversation_profiles.php +++ /dev/null @@ -1,77 +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(); - - // Prepare the request message. - $request = (new ListConversationProfilesRequest()) - ->setParent($formattedParent); - - // Call the API and handle any network failures. - try { - /** @var PagedListResponse $response */ - $response = $conversationProfilesClient->listConversationProfiles($request); - - /** @var ConversationProfile $element */ - foreach ($response as $element) { - printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString()); - } - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} - -/** - * Helper to execute the sample. - * - * This sample has been automatically generated and should be regarded as a code - * template only. It will require modifications to work: - * - It may require correct/in-range values for request initialization. - * - It may require specifying regional endpoints when creating the service client, - * please see the apiEndpoint client configuration option for more details. - */ -function callSample(): void -{ - $formattedParent = ConversationProfilesClient::projectName('[PROJECT]'); - - list_conversation_profiles_sample($formattedParent); -} -// [END dialogflow_v2_generated_ConversationProfiles_ListConversationProfiles_sync] diff --git a/owl-bot-staging/Dialogflow/v2/samples/V2/ConversationProfilesClient/list_locations.php b/owl-bot-staging/Dialogflow/v2/samples/V2/ConversationProfilesClient/list_locations.php deleted file mode 100644 index 9b8a0bdc0b97..000000000000 --- a/owl-bot-staging/Dialogflow/v2/samples/V2/ConversationProfilesClient/list_locations.php +++ /dev/null @@ -1,62 +0,0 @@ -listLocations($request); - - /** @var Location $element */ - foreach ($response as $element) { - printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString()); - } - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} -// [END dialogflow_v2_generated_ConversationProfiles_ListLocations_sync] diff --git a/owl-bot-staging/Dialogflow/v2/samples/V2/ConversationProfilesClient/set_suggestion_feature_config.php b/owl-bot-staging/Dialogflow/v2/samples/V2/ConversationProfilesClient/set_suggestion_feature_config.php deleted file mode 100644 index d2918d9418a1..000000000000 --- a/owl-bot-staging/Dialogflow/v2/samples/V2/ConversationProfilesClient/set_suggestion_feature_config.php +++ /dev/null @@ -1,111 +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 the request message. - $suggestionFeatureConfig = new SuggestionFeatureConfig(); - $request = (new SetSuggestionFeatureConfigRequest()) - ->setConversationProfile($conversationProfile) - ->setParticipantRole($participantRole) - ->setSuggestionFeatureConfig($suggestionFeatureConfig); - - // Call the API and handle any network failures. - try { - /** @var OperationResponse $response */ - $response = $conversationProfilesClient->setSuggestionFeatureConfig($request); - $response->pollUntilComplete(); - - if ($response->operationSucceeded()) { - /** @var ConversationProfile $result */ - $result = $response->getResult(); - printf('Operation successful with response data: %s' . PHP_EOL, $result->serializeToJsonString()); - } else { - /** @var Status $error */ - $error = $response->getError(); - printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); - } - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} - -/** - * Helper to execute the sample. - * - * This sample has been automatically generated and should be regarded as a code - * template only. It will require modifications to work: - * - It may require correct/in-range values for request initialization. - * - It may require specifying regional endpoints when creating the service client, - * please see the apiEndpoint client configuration option for more details. - */ -function callSample(): void -{ - $conversationProfile = '[CONVERSATION_PROFILE]'; - $participantRole = Role::ROLE_UNSPECIFIED; - - set_suggestion_feature_config_sample($conversationProfile, $participantRole); -} -// [END dialogflow_v2_generated_ConversationProfiles_SetSuggestionFeatureConfig_sync] diff --git a/owl-bot-staging/Dialogflow/v2/samples/V2/ConversationProfilesClient/update_conversation_profile.php b/owl-bot-staging/Dialogflow/v2/samples/V2/ConversationProfilesClient/update_conversation_profile.php deleted file mode 100644 index 40602907b0dd..000000000000 --- a/owl-bot-staging/Dialogflow/v2/samples/V2/ConversationProfilesClient/update_conversation_profile.php +++ /dev/null @@ -1,80 +0,0 @@ -setDisplayName($conversationProfileDisplayName); - $updateMask = new FieldMask(); - $request = (new UpdateConversationProfileRequest()) - ->setConversationProfile($conversationProfile) - ->setUpdateMask($updateMask); - - // Call the API and handle any network failures. - try { - /** @var ConversationProfile $response */ - $response = $conversationProfilesClient->updateConversationProfile($request); - printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} - -/** - * Helper to execute the sample. - * - * This sample has been automatically generated and should be regarded as a code - * template only. It will require modifications to work: - * - It may require correct/in-range values for request initialization. - * - It may require specifying regional endpoints when creating the service client, - * please see the apiEndpoint client configuration option for more details. - */ -function callSample(): void -{ - $conversationProfileDisplayName = '[DISPLAY_NAME]'; - - update_conversation_profile_sample($conversationProfileDisplayName); -} -// [END dialogflow_v2_generated_ConversationProfiles_UpdateConversationProfile_sync] diff --git a/owl-bot-staging/Dialogflow/v2/samples/V2/ConversationsClient/complete_conversation.php b/owl-bot-staging/Dialogflow/v2/samples/V2/ConversationsClient/complete_conversation.php deleted file mode 100644 index 3102ad42d45b..000000000000 --- a/owl-bot-staging/Dialogflow/v2/samples/V2/ConversationsClient/complete_conversation.php +++ /dev/null @@ -1,74 +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(); - - // Prepare the request message. - $request = (new CompleteConversationRequest()) - ->setName($formattedName); - - // Call the API and handle any network failures. - try { - /** @var Conversation $response */ - $response = $conversationsClient->completeConversation($request); - printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} - -/** - * Helper to execute the sample. - * - * This sample has been automatically generated and should be regarded as a code - * template only. It will require modifications to work: - * - It may require correct/in-range values for request initialization. - * - It may require specifying regional endpoints when creating the service client, - * please see the apiEndpoint client configuration option for more details. - */ -function callSample(): void -{ - $formattedName = ConversationsClient::conversationName('[PROJECT]', '[CONVERSATION]'); - - complete_conversation_sample($formattedName); -} -// [END dialogflow_v2_generated_Conversations_CompleteConversation_sync] diff --git a/owl-bot-staging/Dialogflow/v2/samples/V2/ConversationsClient/create_conversation.php b/owl-bot-staging/Dialogflow/v2/samples/V2/ConversationsClient/create_conversation.php deleted file mode 100644 index 241269388f57..000000000000 --- a/owl-bot-staging/Dialogflow/v2/samples/V2/ConversationsClient/create_conversation.php +++ /dev/null @@ -1,106 +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 the request message. - $conversation = (new Conversation()) - ->setConversationProfile($formattedConversationConversationProfile); - $request = (new CreateConversationRequest()) - ->setParent($formattedParent) - ->setConversation($conversation); - - // Call the API and handle any network failures. - try { - /** @var Conversation $response */ - $response = $conversationsClient->createConversation($request); - printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} - -/** - * Helper to execute the sample. - * - * This sample has been automatically generated and should be regarded as a code - * template only. It will require modifications to work: - * - It may require correct/in-range values for request initialization. - * - It may require specifying regional endpoints when creating the service client, - * please see the apiEndpoint client configuration option for more details. - */ -function callSample(): void -{ - $formattedParent = ConversationsClient::projectName('[PROJECT]'); - $formattedConversationConversationProfile = ConversationsClient::conversationProfileName( - '[PROJECT]', - '[CONVERSATION_PROFILE]' - ); - - create_conversation_sample($formattedParent, $formattedConversationConversationProfile); -} -// [END dialogflow_v2_generated_Conversations_CreateConversation_sync] diff --git a/owl-bot-staging/Dialogflow/v2/samples/V2/ConversationsClient/generate_stateless_suggestion.php b/owl-bot-staging/Dialogflow/v2/samples/V2/ConversationsClient/generate_stateless_suggestion.php deleted file mode 100644 index 3f0c6871bbf6..000000000000 --- a/owl-bot-staging/Dialogflow/v2/samples/V2/ConversationsClient/generate_stateless_suggestion.php +++ /dev/null @@ -1,73 +0,0 @@ -/locations/`. Please see - * {@see ConversationsClient::locationName()} for help formatting this field. - */ -function generate_stateless_suggestion_sample(string $formattedParent): void -{ - // Create a client. - $conversationsClient = new ConversationsClient(); - - // Prepare the request message. - $request = (new GenerateStatelessSuggestionRequest()) - ->setParent($formattedParent); - - // Call the API and handle any network failures. - try { - /** @var GenerateStatelessSuggestionResponse $response */ - $response = $conversationsClient->generateStatelessSuggestion($request); - printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} - -/** - * Helper to execute the sample. - * - * This sample has been automatically generated and should be regarded as a code - * template only. It will require modifications to work: - * - It may require correct/in-range values for request initialization. - * - It may require specifying regional endpoints when creating the service client, - * please see the apiEndpoint client configuration option for more details. - */ -function callSample(): void -{ - $formattedParent = ConversationsClient::locationName('[PROJECT]', '[LOCATION]'); - - generate_stateless_suggestion_sample($formattedParent); -} -// [END dialogflow_v2_generated_Conversations_GenerateStatelessSuggestion_sync] diff --git a/owl-bot-staging/Dialogflow/v2/samples/V2/ConversationsClient/generate_stateless_summary.php b/owl-bot-staging/Dialogflow/v2/samples/V2/ConversationsClient/generate_stateless_summary.php deleted file mode 100644 index d24784c144fb..000000000000 --- a/owl-bot-staging/Dialogflow/v2/samples/V2/ConversationsClient/generate_stateless_summary.php +++ /dev/null @@ -1,99 +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 the request message. - $message = (new Message()) - ->setContent($statelessConversationMessagesContent); - $statelessConversationMessages = [$message,]; - $statelessConversation = (new MinimalConversation()) - ->setMessages($statelessConversationMessages) - ->setParent($formattedStatelessConversationParent); - $conversationProfile = (new ConversationProfile()) - ->setDisplayName($conversationProfileDisplayName); - $request = (new GenerateStatelessSummaryRequest()) - ->setStatelessConversation($statelessConversation) - ->setConversationProfile($conversationProfile); - - // Call the API and handle any network failures. - try { - /** @var GenerateStatelessSummaryResponse $response */ - $response = $conversationsClient->generateStatelessSummary($request); - printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} - -/** - * Helper to execute the sample. - * - * This sample has been automatically generated and should be regarded as a code - * template only. It will require modifications to work: - * - It may require correct/in-range values for request initialization. - * - It may require specifying regional endpoints when creating the service client, - * please see the apiEndpoint client configuration option for more details. - */ -function callSample(): void -{ - $statelessConversationMessagesContent = '[CONTENT]'; - $formattedStatelessConversationParent = ConversationsClient::locationName( - '[PROJECT]', - '[LOCATION]' - ); - $conversationProfileDisplayName = '[DISPLAY_NAME]'; - - generate_stateless_summary_sample( - $statelessConversationMessagesContent, - $formattedStatelessConversationParent, - $conversationProfileDisplayName - ); -} -// [END dialogflow_v2_generated_Conversations_GenerateStatelessSummary_sync] diff --git a/owl-bot-staging/Dialogflow/v2/samples/V2/ConversationsClient/get_conversation.php b/owl-bot-staging/Dialogflow/v2/samples/V2/ConversationsClient/get_conversation.php deleted file mode 100644 index 0a12e2bf87d0..000000000000 --- a/owl-bot-staging/Dialogflow/v2/samples/V2/ConversationsClient/get_conversation.php +++ /dev/null @@ -1,73 +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(); - - // Prepare the request message. - $request = (new GetConversationRequest()) - ->setName($formattedName); - - // Call the API and handle any network failures. - try { - /** @var Conversation $response */ - $response = $conversationsClient->getConversation($request); - printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} - -/** - * Helper to execute the sample. - * - * This sample has been automatically generated and should be regarded as a code - * template only. It will require modifications to work: - * - It may require correct/in-range values for request initialization. - * - It may require specifying regional endpoints when creating the service client, - * please see the apiEndpoint client configuration option for more details. - */ -function callSample(): void -{ - $formattedName = ConversationsClient::conversationName('[PROJECT]', '[CONVERSATION]'); - - get_conversation_sample($formattedName); -} -// [END dialogflow_v2_generated_Conversations_GetConversation_sync] diff --git a/owl-bot-staging/Dialogflow/v2/samples/V2/ConversationsClient/get_location.php b/owl-bot-staging/Dialogflow/v2/samples/V2/ConversationsClient/get_location.php deleted file mode 100644 index 3967209951a4..000000000000 --- a/owl-bot-staging/Dialogflow/v2/samples/V2/ConversationsClient/get_location.php +++ /dev/null @@ -1,57 +0,0 @@ -getLocation($request); - printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} -// [END dialogflow_v2_generated_Conversations_GetLocation_sync] diff --git a/owl-bot-staging/Dialogflow/v2/samples/V2/ConversationsClient/list_conversations.php b/owl-bot-staging/Dialogflow/v2/samples/V2/ConversationsClient/list_conversations.php deleted file mode 100644 index 82614a642265..000000000000 --- a/owl-bot-staging/Dialogflow/v2/samples/V2/ConversationsClient/list_conversations.php +++ /dev/null @@ -1,77 +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(); - - // Prepare the request message. - $request = (new ListConversationsRequest()) - ->setParent($formattedParent); - - // Call the API and handle any network failures. - try { - /** @var PagedListResponse $response */ - $response = $conversationsClient->listConversations($request); - - /** @var Conversation $element */ - foreach ($response as $element) { - printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString()); - } - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} - -/** - * Helper to execute the sample. - * - * This sample has been automatically generated and should be regarded as a code - * template only. It will require modifications to work: - * - It may require correct/in-range values for request initialization. - * - It may require specifying regional endpoints when creating the service client, - * please see the apiEndpoint client configuration option for more details. - */ -function callSample(): void -{ - $formattedParent = ConversationsClient::projectName('[PROJECT]'); - - list_conversations_sample($formattedParent); -} -// [END dialogflow_v2_generated_Conversations_ListConversations_sync] diff --git a/owl-bot-staging/Dialogflow/v2/samples/V2/ConversationsClient/list_locations.php b/owl-bot-staging/Dialogflow/v2/samples/V2/ConversationsClient/list_locations.php deleted file mode 100644 index c6b6c1518fa1..000000000000 --- a/owl-bot-staging/Dialogflow/v2/samples/V2/ConversationsClient/list_locations.php +++ /dev/null @@ -1,62 +0,0 @@ -listLocations($request); - - /** @var Location $element */ - foreach ($response as $element) { - printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString()); - } - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} -// [END dialogflow_v2_generated_Conversations_ListLocations_sync] diff --git a/owl-bot-staging/Dialogflow/v2/samples/V2/ConversationsClient/list_messages.php b/owl-bot-staging/Dialogflow/v2/samples/V2/ConversationsClient/list_messages.php deleted file mode 100644 index b4f6aa376b9a..000000000000 --- a/owl-bot-staging/Dialogflow/v2/samples/V2/ConversationsClient/list_messages.php +++ /dev/null @@ -1,82 +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(); - - // Prepare the request message. - $request = (new ListMessagesRequest()) - ->setParent($formattedParent); - - // Call the API and handle any network failures. - try { - /** @var PagedListResponse $response */ - $response = $conversationsClient->listMessages($request); - - /** @var Message $element */ - foreach ($response as $element) { - printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString()); - } - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} - -/** - * Helper to execute the sample. - * - * This sample has been automatically generated and should be regarded as a code - * template only. It will require modifications to work: - * - It may require correct/in-range values for request initialization. - * - It may require specifying regional endpoints when creating the service client, - * please see the apiEndpoint client configuration option for more details. - */ -function callSample(): void -{ - $formattedParent = ConversationsClient::conversationName('[PROJECT]', '[CONVERSATION]'); - - list_messages_sample($formattedParent); -} -// [END dialogflow_v2_generated_Conversations_ListMessages_sync] diff --git a/owl-bot-staging/Dialogflow/v2/samples/V2/ConversationsClient/search_knowledge.php b/owl-bot-staging/Dialogflow/v2/samples/V2/ConversationsClient/search_knowledge.php deleted file mode 100644 index 7eb22022ffde..000000000000 --- a/owl-bot-staging/Dialogflow/v2/samples/V2/ConversationsClient/search_knowledge.php +++ /dev/null @@ -1,92 +0,0 @@ -/locations//conversationProfiles/`. Please see - * {@see ConversationsClient::conversationProfileName()} for help formatting this field. - */ -function search_knowledge_sample( - string $queryText, - string $queryLanguageCode, - string $formattedConversationProfile -): void { - // Create a client. - $conversationsClient = new ConversationsClient(); - - // Prepare the request message. - $query = (new TextInput()) - ->setText($queryText) - ->setLanguageCode($queryLanguageCode); - $request = (new SearchKnowledgeRequest()) - ->setQuery($query) - ->setConversationProfile($formattedConversationProfile); - - // Call the API and handle any network failures. - try { - /** @var SearchKnowledgeResponse $response */ - $response = $conversationsClient->searchKnowledge($request); - printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} - -/** - * Helper to execute the sample. - * - * This sample has been automatically generated and should be regarded as a code - * template only. It will require modifications to work: - * - It may require correct/in-range values for request initialization. - * - It may require specifying regional endpoints when creating the service client, - * please see the apiEndpoint client configuration option for more details. - */ -function callSample(): void -{ - $queryText = '[TEXT]'; - $queryLanguageCode = '[LANGUAGE_CODE]'; - $formattedConversationProfile = ConversationsClient::conversationProfileName( - '[PROJECT]', - '[CONVERSATION_PROFILE]' - ); - - search_knowledge_sample($queryText, $queryLanguageCode, $formattedConversationProfile); -} -// [END dialogflow_v2_generated_Conversations_SearchKnowledge_sync] diff --git a/owl-bot-staging/Dialogflow/v2/samples/V2/ConversationsClient/suggest_conversation_summary.php b/owl-bot-staging/Dialogflow/v2/samples/V2/ConversationsClient/suggest_conversation_summary.php deleted file mode 100644 index 60ddb69da08f..000000000000 --- a/owl-bot-staging/Dialogflow/v2/samples/V2/ConversationsClient/suggest_conversation_summary.php +++ /dev/null @@ -1,75 +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(); - - // Prepare the request message. - $request = (new SuggestConversationSummaryRequest()) - ->setConversation($formattedConversation); - - // Call the API and handle any network failures. - try { - /** @var SuggestConversationSummaryResponse $response */ - $response = $conversationsClient->suggestConversationSummary($request); - printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} - -/** - * Helper to execute the sample. - * - * This sample has been automatically generated and should be regarded as a code - * template only. It will require modifications to work: - * - It may require correct/in-range values for request initialization. - * - It may require specifying regional endpoints when creating the service client, - * please see the apiEndpoint client configuration option for more details. - */ -function callSample(): void -{ - $formattedConversation = ConversationsClient::conversationName('[PROJECT]', '[CONVERSATION]'); - - suggest_conversation_summary_sample($formattedConversation); -} -// [END dialogflow_v2_generated_Conversations_SuggestConversationSummary_sync] diff --git a/owl-bot-staging/Dialogflow/v2/samples/V2/DocumentsClient/create_document.php b/owl-bot-staging/Dialogflow/v2/samples/V2/DocumentsClient/create_document.php deleted file mode 100644 index be4a2bd29543..000000000000 --- a/owl-bot-staging/Dialogflow/v2/samples/V2/DocumentsClient/create_document.php +++ /dev/null @@ -1,116 +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 the request message. - $documentKnowledgeTypes = [$documentKnowledgeTypesElement,]; - $document = (new Document()) - ->setDisplayName($documentDisplayName) - ->setMimeType($documentMimeType) - ->setKnowledgeTypes($documentKnowledgeTypes); - $request = (new CreateDocumentRequest()) - ->setParent($formattedParent) - ->setDocument($document); - - // Call the API and handle any network failures. - try { - /** @var OperationResponse $response */ - $response = $documentsClient->createDocument($request); - $response->pollUntilComplete(); - - if ($response->operationSucceeded()) { - /** @var Document $result */ - $result = $response->getResult(); - printf('Operation successful with response data: %s' . PHP_EOL, $result->serializeToJsonString()); - } else { - /** @var Status $error */ - $error = $response->getError(); - printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); - } - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} - -/** - * Helper to execute the sample. - * - * This sample has been automatically generated and should be regarded as a code - * template only. It will require modifications to work: - * - It may require correct/in-range values for request initialization. - * - It may require specifying regional endpoints when creating the service client, - * please see the apiEndpoint client configuration option for more details. - */ -function callSample(): void -{ - $formattedParent = DocumentsClient::knowledgeBaseName('[PROJECT]', '[KNOWLEDGE_BASE]'); - $documentDisplayName = '[DISPLAY_NAME]'; - $documentMimeType = '[MIME_TYPE]'; - $documentKnowledgeTypesElement = KnowledgeType::KNOWLEDGE_TYPE_UNSPECIFIED; - - create_document_sample( - $formattedParent, - $documentDisplayName, - $documentMimeType, - $documentKnowledgeTypesElement - ); -} -// [END dialogflow_v2_generated_Documents_CreateDocument_sync] diff --git a/owl-bot-staging/Dialogflow/v2/samples/V2/DocumentsClient/delete_document.php b/owl-bot-staging/Dialogflow/v2/samples/V2/DocumentsClient/delete_document.php deleted file mode 100644 index 7bf0a0877466..000000000000 --- a/owl-bot-staging/Dialogflow/v2/samples/V2/DocumentsClient/delete_document.php +++ /dev/null @@ -1,91 +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(); - - // Prepare the request message. - $request = (new DeleteDocumentRequest()) - ->setName($formattedName); - - // Call the API and handle any network failures. - try { - /** @var OperationResponse $response */ - $response = $documentsClient->deleteDocument($request); - $response->pollUntilComplete(); - - if ($response->operationSucceeded()) { - printf('Operation completed successfully.' . PHP_EOL); - } else { - /** @var Status $error */ - $error = $response->getError(); - printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); - } - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} - -/** - * Helper to execute the sample. - * - * This sample has been automatically generated and should be regarded as a code - * template only. It will require modifications to work: - * - It may require correct/in-range values for request initialization. - * - It may require specifying regional endpoints when creating the service client, - * please see the apiEndpoint client configuration option for more details. - */ -function callSample(): void -{ - $formattedName = DocumentsClient::documentName('[PROJECT]', '[KNOWLEDGE_BASE]', '[DOCUMENT]'); - - delete_document_sample($formattedName); -} -// [END dialogflow_v2_generated_Documents_DeleteDocument_sync] diff --git a/owl-bot-staging/Dialogflow/v2/samples/V2/DocumentsClient/export_document.php b/owl-bot-staging/Dialogflow/v2/samples/V2/DocumentsClient/export_document.php deleted file mode 100644 index 598b09f2b032..000000000000 --- a/owl-bot-staging/Dialogflow/v2/samples/V2/DocumentsClient/export_document.php +++ /dev/null @@ -1,94 +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(); - - // Prepare the request message. - $request = (new ExportDocumentRequest()) - ->setName($formattedName); - - // Call the API and handle any network failures. - try { - /** @var OperationResponse $response */ - $response = $documentsClient->exportDocument($request); - $response->pollUntilComplete(); - - if ($response->operationSucceeded()) { - /** @var Document $result */ - $result = $response->getResult(); - printf('Operation successful with response data: %s' . PHP_EOL, $result->serializeToJsonString()); - } else { - /** @var Status $error */ - $error = $response->getError(); - printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); - } - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} - -/** - * Helper to execute the sample. - * - * This sample has been automatically generated and should be regarded as a code - * template only. It will require modifications to work: - * - It may require correct/in-range values for request initialization. - * - It may require specifying regional endpoints when creating the service client, - * please see the apiEndpoint client configuration option for more details. - */ -function callSample(): void -{ - $formattedName = DocumentsClient::documentName('[PROJECT]', '[KNOWLEDGE_BASE]', '[DOCUMENT]'); - - export_document_sample($formattedName); -} -// [END dialogflow_v2_generated_Documents_ExportDocument_sync] diff --git a/owl-bot-staging/Dialogflow/v2/samples/V2/DocumentsClient/get_document.php b/owl-bot-staging/Dialogflow/v2/samples/V2/DocumentsClient/get_document.php deleted file mode 100644 index cc429086cfe6..000000000000 --- a/owl-bot-staging/Dialogflow/v2/samples/V2/DocumentsClient/get_document.php +++ /dev/null @@ -1,73 +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(); - - // Prepare the request message. - $request = (new GetDocumentRequest()) - ->setName($formattedName); - - // Call the API and handle any network failures. - try { - /** @var Document $response */ - $response = $documentsClient->getDocument($request); - printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} - -/** - * Helper to execute the sample. - * - * This sample has been automatically generated and should be regarded as a code - * template only. It will require modifications to work: - * - It may require correct/in-range values for request initialization. - * - It may require specifying regional endpoints when creating the service client, - * please see the apiEndpoint client configuration option for more details. - */ -function callSample(): void -{ - $formattedName = DocumentsClient::documentName('[PROJECT]', '[KNOWLEDGE_BASE]', '[DOCUMENT]'); - - get_document_sample($formattedName); -} -// [END dialogflow_v2_generated_Documents_GetDocument_sync] diff --git a/owl-bot-staging/Dialogflow/v2/samples/V2/DocumentsClient/get_location.php b/owl-bot-staging/Dialogflow/v2/samples/V2/DocumentsClient/get_location.php deleted file mode 100644 index 60bb4949ad03..000000000000 --- a/owl-bot-staging/Dialogflow/v2/samples/V2/DocumentsClient/get_location.php +++ /dev/null @@ -1,57 +0,0 @@ -getLocation($request); - printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} -// [END dialogflow_v2_generated_Documents_GetLocation_sync] diff --git a/owl-bot-staging/Dialogflow/v2/samples/V2/DocumentsClient/import_documents.php b/owl-bot-staging/Dialogflow/v2/samples/V2/DocumentsClient/import_documents.php deleted file mode 100644 index 923510d53be7..000000000000 --- a/owl-bot-staging/Dialogflow/v2/samples/V2/DocumentsClient/import_documents.php +++ /dev/null @@ -1,114 +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 the request message. - $documentTemplateKnowledgeTypes = [$documentTemplateKnowledgeTypesElement,]; - $documentTemplate = (new ImportDocumentTemplate()) - ->setMimeType($documentTemplateMimeType) - ->setKnowledgeTypes($documentTemplateKnowledgeTypes); - $request = (new ImportDocumentsRequest()) - ->setParent($formattedParent) - ->setDocumentTemplate($documentTemplate); - - // Call the API and handle any network failures. - try { - /** @var OperationResponse $response */ - $response = $documentsClient->importDocuments($request); - $response->pollUntilComplete(); - - if ($response->operationSucceeded()) { - /** @var ImportDocumentsResponse $result */ - $result = $response->getResult(); - printf('Operation successful with response data: %s' . PHP_EOL, $result->serializeToJsonString()); - } else { - /** @var Status $error */ - $error = $response->getError(); - printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); - } - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} - -/** - * Helper to execute the sample. - * - * This sample has been automatically generated and should be regarded as a code - * template only. It will require modifications to work: - * - It may require correct/in-range values for request initialization. - * - It may require specifying regional endpoints when creating the service client, - * please see the apiEndpoint client configuration option for more details. - */ -function callSample(): void -{ - $formattedParent = DocumentsClient::knowledgeBaseName('[PROJECT]', '[KNOWLEDGE_BASE]'); - $documentTemplateMimeType = '[MIME_TYPE]'; - $documentTemplateKnowledgeTypesElement = KnowledgeType::KNOWLEDGE_TYPE_UNSPECIFIED; - - import_documents_sample( - $formattedParent, - $documentTemplateMimeType, - $documentTemplateKnowledgeTypesElement - ); -} -// [END dialogflow_v2_generated_Documents_ImportDocuments_sync] diff --git a/owl-bot-staging/Dialogflow/v2/samples/V2/DocumentsClient/list_documents.php b/owl-bot-staging/Dialogflow/v2/samples/V2/DocumentsClient/list_documents.php deleted file mode 100644 index 14f4aeb72a6b..000000000000 --- a/owl-bot-staging/Dialogflow/v2/samples/V2/DocumentsClient/list_documents.php +++ /dev/null @@ -1,78 +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(); - - // Prepare the request message. - $request = (new ListDocumentsRequest()) - ->setParent($formattedParent); - - // Call the API and handle any network failures. - try { - /** @var PagedListResponse $response */ - $response = $documentsClient->listDocuments($request); - - /** @var Document $element */ - foreach ($response as $element) { - printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString()); - } - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} - -/** - * Helper to execute the sample. - * - * This sample has been automatically generated and should be regarded as a code - * template only. It will require modifications to work: - * - It may require correct/in-range values for request initialization. - * - It may require specifying regional endpoints when creating the service client, - * please see the apiEndpoint client configuration option for more details. - */ -function callSample(): void -{ - $formattedParent = DocumentsClient::knowledgeBaseName('[PROJECT]', '[KNOWLEDGE_BASE]'); - - list_documents_sample($formattedParent); -} -// [END dialogflow_v2_generated_Documents_ListDocuments_sync] diff --git a/owl-bot-staging/Dialogflow/v2/samples/V2/DocumentsClient/list_locations.php b/owl-bot-staging/Dialogflow/v2/samples/V2/DocumentsClient/list_locations.php deleted file mode 100644 index 22cb179b8124..000000000000 --- a/owl-bot-staging/Dialogflow/v2/samples/V2/DocumentsClient/list_locations.php +++ /dev/null @@ -1,62 +0,0 @@ -listLocations($request); - - /** @var Location $element */ - foreach ($response as $element) { - printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString()); - } - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} -// [END dialogflow_v2_generated_Documents_ListLocations_sync] diff --git a/owl-bot-staging/Dialogflow/v2/samples/V2/DocumentsClient/reload_document.php b/owl-bot-staging/Dialogflow/v2/samples/V2/DocumentsClient/reload_document.php deleted file mode 100644 index c5eacb4d763e..000000000000 --- a/owl-bot-staging/Dialogflow/v2/samples/V2/DocumentsClient/reload_document.php +++ /dev/null @@ -1,99 +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(); - - // Prepare the request message. - $request = (new ReloadDocumentRequest()) - ->setName($formattedName); - - // Call the API and handle any network failures. - try { - /** @var OperationResponse $response */ - $response = $documentsClient->reloadDocument($request); - $response->pollUntilComplete(); - - if ($response->operationSucceeded()) { - /** @var Document $result */ - $result = $response->getResult(); - printf('Operation successful with response data: %s' . PHP_EOL, $result->serializeToJsonString()); - } else { - /** @var Status $error */ - $error = $response->getError(); - printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); - } - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} - -/** - * Helper to execute the sample. - * - * This sample has been automatically generated and should be regarded as a code - * template only. It will require modifications to work: - * - It may require correct/in-range values for request initialization. - * - It may require specifying regional endpoints when creating the service client, - * please see the apiEndpoint client configuration option for more details. - */ -function callSample(): void -{ - $formattedName = DocumentsClient::documentName('[PROJECT]', '[KNOWLEDGE_BASE]', '[DOCUMENT]'); - - reload_document_sample($formattedName); -} -// [END dialogflow_v2_generated_Documents_ReloadDocument_sync] diff --git a/owl-bot-staging/Dialogflow/v2/samples/V2/DocumentsClient/update_document.php b/owl-bot-staging/Dialogflow/v2/samples/V2/DocumentsClient/update_document.php deleted file mode 100644 index 2f8341f476aa..000000000000 --- a/owl-bot-staging/Dialogflow/v2/samples/V2/DocumentsClient/update_document.php +++ /dev/null @@ -1,104 +0,0 @@ -setDisplayName($documentDisplayName) - ->setMimeType($documentMimeType) - ->setKnowledgeTypes($documentKnowledgeTypes); - $request = (new UpdateDocumentRequest()) - ->setDocument($document); - - // Call the API and handle any network failures. - try { - /** @var OperationResponse $response */ - $response = $documentsClient->updateDocument($request); - $response->pollUntilComplete(); - - if ($response->operationSucceeded()) { - /** @var Document $result */ - $result = $response->getResult(); - printf('Operation successful with response data: %s' . PHP_EOL, $result->serializeToJsonString()); - } else { - /** @var Status $error */ - $error = $response->getError(); - printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); - } - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} - -/** - * Helper to execute the sample. - * - * This sample has been automatically generated and should be regarded as a code - * template only. It will require modifications to work: - * - It may require correct/in-range values for request initialization. - * - It may require specifying regional endpoints when creating the service client, - * please see the apiEndpoint client configuration option for more details. - */ -function callSample(): void -{ - $documentDisplayName = '[DISPLAY_NAME]'; - $documentMimeType = '[MIME_TYPE]'; - $documentKnowledgeTypesElement = KnowledgeType::KNOWLEDGE_TYPE_UNSPECIFIED; - - update_document_sample($documentDisplayName, $documentMimeType, $documentKnowledgeTypesElement); -} -// [END dialogflow_v2_generated_Documents_UpdateDocument_sync] diff --git a/owl-bot-staging/Dialogflow/v2/samples/V2/EncryptionSpecServiceClient/get_encryption_spec.php b/owl-bot-staging/Dialogflow/v2/samples/V2/EncryptionSpecServiceClient/get_encryption_spec.php deleted file mode 100644 index 4c85980a36ce..000000000000 --- a/owl-bot-staging/Dialogflow/v2/samples/V2/EncryptionSpecServiceClient/get_encryption_spec.php +++ /dev/null @@ -1,71 +0,0 @@ -setName($formattedName); - - // Call the API and handle any network failures. - try { - /** @var EncryptionSpec $response */ - $response = $encryptionSpecServiceClient->getEncryptionSpec($request); - printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} - -/** - * Helper to execute the sample. - * - * This sample has been automatically generated and should be regarded as a code - * template only. It will require modifications to work: - * - It may require correct/in-range values for request initialization. - * - It may require specifying regional endpoints when creating the service client, - * please see the apiEndpoint client configuration option for more details. - */ -function callSample(): void -{ - $formattedName = EncryptionSpecServiceClient::encryptionSpecName('[PROJECT]', '[LOCATION]'); - - get_encryption_spec_sample($formattedName); -} -// [END dialogflow_v2_generated_EncryptionSpecService_GetEncryptionSpec_sync] diff --git a/owl-bot-staging/Dialogflow/v2/samples/V2/EncryptionSpecServiceClient/get_location.php b/owl-bot-staging/Dialogflow/v2/samples/V2/EncryptionSpecServiceClient/get_location.php deleted file mode 100644 index 05eb0090ee99..000000000000 --- a/owl-bot-staging/Dialogflow/v2/samples/V2/EncryptionSpecServiceClient/get_location.php +++ /dev/null @@ -1,57 +0,0 @@ -getLocation($request); - printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} -// [END dialogflow_v2_generated_EncryptionSpecService_GetLocation_sync] diff --git a/owl-bot-staging/Dialogflow/v2/samples/V2/EncryptionSpecServiceClient/initialize_encryption_spec.php b/owl-bot-staging/Dialogflow/v2/samples/V2/EncryptionSpecServiceClient/initialize_encryption_spec.php deleted file mode 100644 index dcd0b036c07f..000000000000 --- a/owl-bot-staging/Dialogflow/v2/samples/V2/EncryptionSpecServiceClient/initialize_encryption_spec.php +++ /dev/null @@ -1,93 +0,0 @@ -setKmsKey($encryptionSpecKmsKey); - $request = (new InitializeEncryptionSpecRequest()) - ->setEncryptionSpec($encryptionSpec); - - // Call the API and handle any network failures. - try { - /** @var OperationResponse $response */ - $response = $encryptionSpecServiceClient->initializeEncryptionSpec($request); - $response->pollUntilComplete(); - - if ($response->operationSucceeded()) { - /** @var InitializeEncryptionSpecResponse $result */ - $result = $response->getResult(); - printf('Operation successful with response data: %s' . PHP_EOL, $result->serializeToJsonString()); - } else { - /** @var Status $error */ - $error = $response->getError(); - printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); - } - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} - -/** - * Helper to execute the sample. - * - * This sample has been automatically generated and should be regarded as a code - * template only. It will require modifications to work: - * - It may require correct/in-range values for request initialization. - * - It may require specifying regional endpoints when creating the service client, - * please see the apiEndpoint client configuration option for more details. - */ -function callSample(): void -{ - $encryptionSpecKmsKey = '[KMS_KEY]'; - - initialize_encryption_spec_sample($encryptionSpecKmsKey); -} -// [END dialogflow_v2_generated_EncryptionSpecService_InitializeEncryptionSpec_sync] diff --git a/owl-bot-staging/Dialogflow/v2/samples/V2/EncryptionSpecServiceClient/list_locations.php b/owl-bot-staging/Dialogflow/v2/samples/V2/EncryptionSpecServiceClient/list_locations.php deleted file mode 100644 index faea8028b38d..000000000000 --- a/owl-bot-staging/Dialogflow/v2/samples/V2/EncryptionSpecServiceClient/list_locations.php +++ /dev/null @@ -1,62 +0,0 @@ -listLocations($request); - - /** @var Location $element */ - foreach ($response as $element) { - printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString()); - } - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} -// [END dialogflow_v2_generated_EncryptionSpecService_ListLocations_sync] diff --git a/owl-bot-staging/Dialogflow/v2/samples/V2/EntityTypesClient/batch_create_entities.php b/owl-bot-staging/Dialogflow/v2/samples/V2/EntityTypesClient/batch_create_entities.php deleted file mode 100644 index d925001f0c3b..000000000000 --- a/owl-bot-staging/Dialogflow/v2/samples/V2/EntityTypesClient/batch_create_entities.php +++ /dev/null @@ -1,125 +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 the request message. - $entitiesSynonyms = [$entitiesSynonymsElement,]; - $entity = (new Entity()) - ->setValue($entitiesValue) - ->setSynonyms($entitiesSynonyms); - $entities = [$entity,]; - $request = (new BatchCreateEntitiesRequest()) - ->setParent($formattedParent) - ->setEntities($entities); - - // Call the API and handle any network failures. - try { - /** @var OperationResponse $response */ - $response = $entityTypesClient->batchCreateEntities($request); - $response->pollUntilComplete(); - - if ($response->operationSucceeded()) { - printf('Operation completed successfully.' . PHP_EOL); - } else { - /** @var Status $error */ - $error = $response->getError(); - printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); - } - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} - -/** - * Helper to execute the sample. - * - * This sample has been automatically generated and should be regarded as a code - * template only. It will require modifications to work: - * - It may require correct/in-range values for request initialization. - * - It may require specifying regional endpoints when creating the service client, - * please see the apiEndpoint client configuration option for more details. - */ -function callSample(): void -{ - $formattedParent = EntityTypesClient::entityTypeName('[PROJECT]', '[ENTITY_TYPE]'); - $entitiesValue = '[VALUE]'; - $entitiesSynonymsElement = '[SYNONYMS]'; - - batch_create_entities_sample($formattedParent, $entitiesValue, $entitiesSynonymsElement); -} -// [END dialogflow_v2_generated_EntityTypes_BatchCreateEntities_sync] diff --git a/owl-bot-staging/Dialogflow/v2/samples/V2/EntityTypesClient/batch_delete_entities.php b/owl-bot-staging/Dialogflow/v2/samples/V2/EntityTypesClient/batch_delete_entities.php deleted file mode 100644 index 4cb1b6f1483f..000000000000 --- a/owl-bot-staging/Dialogflow/v2/samples/V2/EntityTypesClient/batch_delete_entities.php +++ /dev/null @@ -1,100 +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 the request message. - $entityValues = [$entityValuesElement,]; - $request = (new BatchDeleteEntitiesRequest()) - ->setParent($formattedParent) - ->setEntityValues($entityValues); - - // Call the API and handle any network failures. - try { - /** @var OperationResponse $response */ - $response = $entityTypesClient->batchDeleteEntities($request); - $response->pollUntilComplete(); - - if ($response->operationSucceeded()) { - printf('Operation completed successfully.' . PHP_EOL); - } else { - /** @var Status $error */ - $error = $response->getError(); - printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); - } - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} - -/** - * Helper to execute the sample. - * - * This sample has been automatically generated and should be regarded as a code - * template only. It will require modifications to work: - * - It may require correct/in-range values for request initialization. - * - It may require specifying regional endpoints when creating the service client, - * please see the apiEndpoint client configuration option for more details. - */ -function callSample(): void -{ - $formattedParent = EntityTypesClient::entityTypeName('[PROJECT]', '[ENTITY_TYPE]'); - $entityValuesElement = '[ENTITY_VALUES]'; - - batch_delete_entities_sample($formattedParent, $entityValuesElement); -} -// [END dialogflow_v2_generated_EntityTypes_BatchDeleteEntities_sync] diff --git a/owl-bot-staging/Dialogflow/v2/samples/V2/EntityTypesClient/batch_delete_entity_types.php b/owl-bot-staging/Dialogflow/v2/samples/V2/EntityTypesClient/batch_delete_entity_types.php deleted file mode 100644 index b2b9b48c0985..000000000000 --- a/owl-bot-staging/Dialogflow/v2/samples/V2/EntityTypesClient/batch_delete_entity_types.php +++ /dev/null @@ -1,101 +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 the request message. - $entityTypeNames = [$entityTypeNamesElement,]; - $request = (new BatchDeleteEntityTypesRequest()) - ->setParent($formattedParent) - ->setEntityTypeNames($entityTypeNames); - - // Call the API and handle any network failures. - try { - /** @var OperationResponse $response */ - $response = $entityTypesClient->batchDeleteEntityTypes($request); - $response->pollUntilComplete(); - - if ($response->operationSucceeded()) { - printf('Operation completed successfully.' . PHP_EOL); - } else { - /** @var Status $error */ - $error = $response->getError(); - printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); - } - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} - -/** - * Helper to execute the sample. - * - * This sample has been automatically generated and should be regarded as a code - * template only. It will require modifications to work: - * - It may require correct/in-range values for request initialization. - * - It may require specifying regional endpoints when creating the service client, - * please see the apiEndpoint client configuration option for more details. - */ -function callSample(): void -{ - $formattedParent = EntityTypesClient::agentName('[PROJECT]'); - $entityTypeNamesElement = '[ENTITY_TYPE_NAMES]'; - - batch_delete_entity_types_sample($formattedParent, $entityTypeNamesElement); -} -// [END dialogflow_v2_generated_EntityTypes_BatchDeleteEntityTypes_sync] diff --git a/owl-bot-staging/Dialogflow/v2/samples/V2/EntityTypesClient/batch_update_entities.php b/owl-bot-staging/Dialogflow/v2/samples/V2/EntityTypesClient/batch_update_entities.php deleted file mode 100644 index 4232b5c93fc5..000000000000 --- a/owl-bot-staging/Dialogflow/v2/samples/V2/EntityTypesClient/batch_update_entities.php +++ /dev/null @@ -1,128 +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 the request message. - $entitiesSynonyms = [$entitiesSynonymsElement,]; - $entity = (new Entity()) - ->setValue($entitiesValue) - ->setSynonyms($entitiesSynonyms); - $entities = [$entity,]; - $request = (new BatchUpdateEntitiesRequest()) - ->setParent($formattedParent) - ->setEntities($entities); - - // Call the API and handle any network failures. - try { - /** @var OperationResponse $response */ - $response = $entityTypesClient->batchUpdateEntities($request); - $response->pollUntilComplete(); - - if ($response->operationSucceeded()) { - printf('Operation completed successfully.' . PHP_EOL); - } else { - /** @var Status $error */ - $error = $response->getError(); - printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); - } - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} - -/** - * Helper to execute the sample. - * - * This sample has been automatically generated and should be regarded as a code - * template only. It will require modifications to work: - * - It may require correct/in-range values for request initialization. - * - It may require specifying regional endpoints when creating the service client, - * please see the apiEndpoint client configuration option for more details. - */ -function callSample(): void -{ - $formattedParent = EntityTypesClient::entityTypeName('[PROJECT]', '[ENTITY_TYPE]'); - $entitiesValue = '[VALUE]'; - $entitiesSynonymsElement = '[SYNONYMS]'; - - batch_update_entities_sample($formattedParent, $entitiesValue, $entitiesSynonymsElement); -} -// [END dialogflow_v2_generated_EntityTypes_BatchUpdateEntities_sync] diff --git a/owl-bot-staging/Dialogflow/v2/samples/V2/EntityTypesClient/batch_update_entity_types.php b/owl-bot-staging/Dialogflow/v2/samples/V2/EntityTypesClient/batch_update_entity_types.php deleted file mode 100644 index abdbef28737a..000000000000 --- a/owl-bot-staging/Dialogflow/v2/samples/V2/EntityTypesClient/batch_update_entity_types.php +++ /dev/null @@ -1,97 +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(); - - // Prepare the request message. - $request = (new BatchUpdateEntityTypesRequest()) - ->setParent($formattedParent); - - // Call the API and handle any network failures. - try { - /** @var OperationResponse $response */ - $response = $entityTypesClient->batchUpdateEntityTypes($request); - $response->pollUntilComplete(); - - if ($response->operationSucceeded()) { - /** @var BatchUpdateEntityTypesResponse $result */ - $result = $response->getResult(); - printf('Operation successful with response data: %s' . PHP_EOL, $result->serializeToJsonString()); - } else { - /** @var Status $error */ - $error = $response->getError(); - printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); - } - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} - -/** - * Helper to execute the sample. - * - * This sample has been automatically generated and should be regarded as a code - * template only. It will require modifications to work: - * - It may require correct/in-range values for request initialization. - * - It may require specifying regional endpoints when creating the service client, - * please see the apiEndpoint client configuration option for more details. - */ -function callSample(): void -{ - $formattedParent = EntityTypesClient::agentName('[PROJECT]'); - - batch_update_entity_types_sample($formattedParent); -} -// [END dialogflow_v2_generated_EntityTypes_BatchUpdateEntityTypes_sync] diff --git a/owl-bot-staging/Dialogflow/v2/samples/V2/EntityTypesClient/create_entity_type.php b/owl-bot-staging/Dialogflow/v2/samples/V2/EntityTypesClient/create_entity_type.php deleted file mode 100644 index e9bb50968276..000000000000 --- a/owl-bot-staging/Dialogflow/v2/samples/V2/EntityTypesClient/create_entity_type.php +++ /dev/null @@ -1,88 +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 the request message. - $entityType = (new EntityType()) - ->setDisplayName($entityTypeDisplayName) - ->setKind($entityTypeKind); - $request = (new CreateEntityTypeRequest()) - ->setParent($formattedParent) - ->setEntityType($entityType); - - // Call the API and handle any network failures. - try { - /** @var EntityType $response */ - $response = $entityTypesClient->createEntityType($request); - printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} - -/** - * Helper to execute the sample. - * - * This sample has been automatically generated and should be regarded as a code - * template only. It will require modifications to work: - * - It may require correct/in-range values for request initialization. - * - It may require specifying regional endpoints when creating the service client, - * please see the apiEndpoint client configuration option for more details. - */ -function callSample(): void -{ - $formattedParent = EntityTypesClient::agentName('[PROJECT]'); - $entityTypeDisplayName = '[DISPLAY_NAME]'; - $entityTypeKind = Kind::KIND_UNSPECIFIED; - - create_entity_type_sample($formattedParent, $entityTypeDisplayName, $entityTypeKind); -} -// [END dialogflow_v2_generated_EntityTypes_CreateEntityType_sync] diff --git a/owl-bot-staging/Dialogflow/v2/samples/V2/EntityTypesClient/delete_entity_type.php b/owl-bot-staging/Dialogflow/v2/samples/V2/EntityTypesClient/delete_entity_type.php deleted file mode 100644 index 2f1bc44659cd..000000000000 --- a/owl-bot-staging/Dialogflow/v2/samples/V2/EntityTypesClient/delete_entity_type.php +++ /dev/null @@ -1,74 +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(); - - // Prepare the request message. - $request = (new DeleteEntityTypeRequest()) - ->setName($formattedName); - - // Call the API and handle any network failures. - try { - $entityTypesClient->deleteEntityType($request); - printf('Call completed successfully.' . PHP_EOL); - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} - -/** - * Helper to execute the sample. - * - * This sample has been automatically generated and should be regarded as a code - * template only. It will require modifications to work: - * - It may require correct/in-range values for request initialization. - * - It may require specifying regional endpoints when creating the service client, - * please see the apiEndpoint client configuration option for more details. - */ -function callSample(): void -{ - $formattedName = EntityTypesClient::entityTypeName('[PROJECT]', '[ENTITY_TYPE]'); - - delete_entity_type_sample($formattedName); -} -// [END dialogflow_v2_generated_EntityTypes_DeleteEntityType_sync] diff --git a/owl-bot-staging/Dialogflow/v2/samples/V2/EntityTypesClient/get_entity_type.php b/owl-bot-staging/Dialogflow/v2/samples/V2/EntityTypesClient/get_entity_type.php deleted file mode 100644 index cfcc6758d825..000000000000 --- a/owl-bot-staging/Dialogflow/v2/samples/V2/EntityTypesClient/get_entity_type.php +++ /dev/null @@ -1,72 +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(); - - // Prepare the request message. - $request = (new GetEntityTypeRequest()) - ->setName($formattedName); - - // Call the API and handle any network failures. - try { - /** @var EntityType $response */ - $response = $entityTypesClient->getEntityType($request); - printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} - -/** - * Helper to execute the sample. - * - * This sample has been automatically generated and should be regarded as a code - * template only. It will require modifications to work: - * - It may require correct/in-range values for request initialization. - * - It may require specifying regional endpoints when creating the service client, - * please see the apiEndpoint client configuration option for more details. - */ -function callSample(): void -{ - $formattedName = EntityTypesClient::entityTypeName('[PROJECT]', '[ENTITY_TYPE]'); - - get_entity_type_sample($formattedName); -} -// [END dialogflow_v2_generated_EntityTypes_GetEntityType_sync] diff --git a/owl-bot-staging/Dialogflow/v2/samples/V2/EntityTypesClient/get_location.php b/owl-bot-staging/Dialogflow/v2/samples/V2/EntityTypesClient/get_location.php deleted file mode 100644 index 065cbfb35c8c..000000000000 --- a/owl-bot-staging/Dialogflow/v2/samples/V2/EntityTypesClient/get_location.php +++ /dev/null @@ -1,57 +0,0 @@ -getLocation($request); - printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} -// [END dialogflow_v2_generated_EntityTypes_GetLocation_sync] diff --git a/owl-bot-staging/Dialogflow/v2/samples/V2/EntityTypesClient/list_entity_types.php b/owl-bot-staging/Dialogflow/v2/samples/V2/EntityTypesClient/list_entity_types.php deleted file mode 100644 index 6c450e73334d..000000000000 --- a/owl-bot-staging/Dialogflow/v2/samples/V2/EntityTypesClient/list_entity_types.php +++ /dev/null @@ -1,77 +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(); - - // Prepare the request message. - $request = (new ListEntityTypesRequest()) - ->setParent($formattedParent); - - // Call the API and handle any network failures. - try { - /** @var PagedListResponse $response */ - $response = $entityTypesClient->listEntityTypes($request); - - /** @var EntityType $element */ - foreach ($response as $element) { - printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString()); - } - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} - -/** - * Helper to execute the sample. - * - * This sample has been automatically generated and should be regarded as a code - * template only. It will require modifications to work: - * - It may require correct/in-range values for request initialization. - * - It may require specifying regional endpoints when creating the service client, - * please see the apiEndpoint client configuration option for more details. - */ -function callSample(): void -{ - $formattedParent = EntityTypesClient::agentName('[PROJECT]'); - - list_entity_types_sample($formattedParent); -} -// [END dialogflow_v2_generated_EntityTypes_ListEntityTypes_sync] diff --git a/owl-bot-staging/Dialogflow/v2/samples/V2/EntityTypesClient/list_locations.php b/owl-bot-staging/Dialogflow/v2/samples/V2/EntityTypesClient/list_locations.php deleted file mode 100644 index 7759f46bfa04..000000000000 --- a/owl-bot-staging/Dialogflow/v2/samples/V2/EntityTypesClient/list_locations.php +++ /dev/null @@ -1,62 +0,0 @@ -listLocations($request); - - /** @var Location $element */ - foreach ($response as $element) { - printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString()); - } - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} -// [END dialogflow_v2_generated_EntityTypes_ListLocations_sync] diff --git a/owl-bot-staging/Dialogflow/v2/samples/V2/EntityTypesClient/update_entity_type.php b/owl-bot-staging/Dialogflow/v2/samples/V2/EntityTypesClient/update_entity_type.php deleted file mode 100644 index ac45a4db42be..000000000000 --- a/owl-bot-staging/Dialogflow/v2/samples/V2/EntityTypesClient/update_entity_type.php +++ /dev/null @@ -1,80 +0,0 @@ -setDisplayName($entityTypeDisplayName) - ->setKind($entityTypeKind); - $request = (new UpdateEntityTypeRequest()) - ->setEntityType($entityType); - - // Call the API and handle any network failures. - try { - /** @var EntityType $response */ - $response = $entityTypesClient->updateEntityType($request); - printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} - -/** - * Helper to execute the sample. - * - * This sample has been automatically generated and should be regarded as a code - * template only. It will require modifications to work: - * - It may require correct/in-range values for request initialization. - * - It may require specifying regional endpoints when creating the service client, - * please see the apiEndpoint client configuration option for more details. - */ -function callSample(): void -{ - $entityTypeDisplayName = '[DISPLAY_NAME]'; - $entityTypeKind = Kind::KIND_UNSPECIFIED; - - update_entity_type_sample($entityTypeDisplayName, $entityTypeKind); -} -// [END dialogflow_v2_generated_EntityTypes_UpdateEntityType_sync] diff --git a/owl-bot-staging/Dialogflow/v2/samples/V2/EnvironmentsClient/create_environment.php b/owl-bot-staging/Dialogflow/v2/samples/V2/EnvironmentsClient/create_environment.php deleted file mode 100644 index 414eb6379819..000000000000 --- a/owl-bot-staging/Dialogflow/v2/samples/V2/EnvironmentsClient/create_environment.php +++ /dev/null @@ -1,80 +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 the request message. - $environment = new Environment(); - $request = (new CreateEnvironmentRequest()) - ->setParent($formattedParent) - ->setEnvironment($environment) - ->setEnvironmentId($environmentId); - - // Call the API and handle any network failures. - try { - /** @var Environment $response */ - $response = $environmentsClient->createEnvironment($request); - printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} - -/** - * Helper to execute the sample. - * - * This sample has been automatically generated and should be regarded as a code - * template only. It will require modifications to work: - * - It may require correct/in-range values for request initialization. - * - It may require specifying regional endpoints when creating the service client, - * please see the apiEndpoint client configuration option for more details. - */ -function callSample(): void -{ - $formattedParent = EnvironmentsClient::agentName('[PROJECT]'); - $environmentId = '[ENVIRONMENT_ID]'; - - create_environment_sample($formattedParent, $environmentId); -} -// [END dialogflow_v2_generated_Environments_CreateEnvironment_sync] diff --git a/owl-bot-staging/Dialogflow/v2/samples/V2/EnvironmentsClient/delete_environment.php b/owl-bot-staging/Dialogflow/v2/samples/V2/EnvironmentsClient/delete_environment.php deleted file mode 100644 index 70e12ffa46a0..000000000000 --- a/owl-bot-staging/Dialogflow/v2/samples/V2/EnvironmentsClient/delete_environment.php +++ /dev/null @@ -1,76 +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(); - - // Prepare the request message. - $request = (new DeleteEnvironmentRequest()) - ->setName($formattedName); - - // Call the API and handle any network failures. - try { - $environmentsClient->deleteEnvironment($request); - printf('Call completed successfully.' . PHP_EOL); - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} - -/** - * Helper to execute the sample. - * - * This sample has been automatically generated and should be regarded as a code - * template only. It will require modifications to work: - * - It may require correct/in-range values for request initialization. - * - It may require specifying regional endpoints when creating the service client, - * please see the apiEndpoint client configuration option for more details. - */ -function callSample(): void -{ - $formattedName = EnvironmentsClient::environmentName('[PROJECT]', '[ENVIRONMENT]'); - - delete_environment_sample($formattedName); -} -// [END dialogflow_v2_generated_Environments_DeleteEnvironment_sync] diff --git a/owl-bot-staging/Dialogflow/v2/samples/V2/EnvironmentsClient/get_environment.php b/owl-bot-staging/Dialogflow/v2/samples/V2/EnvironmentsClient/get_environment.php deleted file mode 100644 index 2b20b35a876e..000000000000 --- a/owl-bot-staging/Dialogflow/v2/samples/V2/EnvironmentsClient/get_environment.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_sample(string $formattedName): void -{ - // Create a client. - $environmentsClient = new EnvironmentsClient(); - - // Prepare the request message. - $request = (new GetEnvironmentRequest()) - ->setName($formattedName); - - // Call the API and handle any network failures. - try { - /** @var Environment $response */ - $response = $environmentsClient->getEnvironment($request); - printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} - -/** - * Helper to execute the sample. - * - * This sample has been automatically generated and should be regarded as a code - * template only. It will require modifications to work: - * - It may require correct/in-range values for request initialization. - * - It may require specifying regional endpoints when creating the service client, - * please see the apiEndpoint client configuration option for more details. - */ -function callSample(): void -{ - $formattedName = EnvironmentsClient::environmentName('[PROJECT]', '[ENVIRONMENT]'); - - get_environment_sample($formattedName); -} -// [END dialogflow_v2_generated_Environments_GetEnvironment_sync] diff --git a/owl-bot-staging/Dialogflow/v2/samples/V2/EnvironmentsClient/get_environment_history.php b/owl-bot-staging/Dialogflow/v2/samples/V2/EnvironmentsClient/get_environment_history.php deleted file mode 100644 index f10f6dbbeea6..000000000000 --- a/owl-bot-staging/Dialogflow/v2/samples/V2/EnvironmentsClient/get_environment_history.php +++ /dev/null @@ -1,83 +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(); - - // Prepare the request message. - $request = (new GetEnvironmentHistoryRequest()) - ->setParent($formattedParent); - - // Call the API and handle any network failures. - try { - /** @var PagedListResponse $response */ - $response = $environmentsClient->getEnvironmentHistory($request); - - /** @var Entry $element */ - foreach ($response as $element) { - printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString()); - } - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} - -/** - * Helper to execute the sample. - * - * This sample has been automatically generated and should be regarded as a code - * template only. It will require modifications to work: - * - It may require correct/in-range values for request initialization. - * - It may require specifying regional endpoints when creating the service client, - * please see the apiEndpoint client configuration option for more details. - */ -function callSample(): void -{ - $formattedParent = EnvironmentsClient::environmentName('[PROJECT]', '[ENVIRONMENT]'); - - get_environment_history_sample($formattedParent); -} -// [END dialogflow_v2_generated_Environments_GetEnvironmentHistory_sync] diff --git a/owl-bot-staging/Dialogflow/v2/samples/V2/EnvironmentsClient/get_location.php b/owl-bot-staging/Dialogflow/v2/samples/V2/EnvironmentsClient/get_location.php deleted file mode 100644 index 47ddbfb408ee..000000000000 --- a/owl-bot-staging/Dialogflow/v2/samples/V2/EnvironmentsClient/get_location.php +++ /dev/null @@ -1,57 +0,0 @@ -getLocation($request); - printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} -// [END dialogflow_v2_generated_Environments_GetLocation_sync] diff --git a/owl-bot-staging/Dialogflow/v2/samples/V2/EnvironmentsClient/list_environments.php b/owl-bot-staging/Dialogflow/v2/samples/V2/EnvironmentsClient/list_environments.php deleted file mode 100644 index cf3aaca72049..000000000000 --- a/owl-bot-staging/Dialogflow/v2/samples/V2/EnvironmentsClient/list_environments.php +++ /dev/null @@ -1,80 +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(); - - // Prepare the request message. - $request = (new ListEnvironmentsRequest()) - ->setParent($formattedParent); - - // Call the API and handle any network failures. - try { - /** @var PagedListResponse $response */ - $response = $environmentsClient->listEnvironments($request); - - /** @var Environment $element */ - foreach ($response as $element) { - printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString()); - } - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} - -/** - * Helper to execute the sample. - * - * This sample has been automatically generated and should be regarded as a code - * template only. It will require modifications to work: - * - It may require correct/in-range values for request initialization. - * - It may require specifying regional endpoints when creating the service client, - * please see the apiEndpoint client configuration option for more details. - */ -function callSample(): void -{ - $formattedParent = EnvironmentsClient::agentName('[PROJECT]'); - - list_environments_sample($formattedParent); -} -// [END dialogflow_v2_generated_Environments_ListEnvironments_sync] diff --git a/owl-bot-staging/Dialogflow/v2/samples/V2/EnvironmentsClient/list_locations.php b/owl-bot-staging/Dialogflow/v2/samples/V2/EnvironmentsClient/list_locations.php deleted file mode 100644 index 67b91e16d141..000000000000 --- a/owl-bot-staging/Dialogflow/v2/samples/V2/EnvironmentsClient/list_locations.php +++ /dev/null @@ -1,62 +0,0 @@ -listLocations($request); - - /** @var Location $element */ - foreach ($response as $element) { - printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString()); - } - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} -// [END dialogflow_v2_generated_Environments_ListLocations_sync] diff --git a/owl-bot-staging/Dialogflow/v2/samples/V2/EnvironmentsClient/update_environment.php b/owl-bot-staging/Dialogflow/v2/samples/V2/EnvironmentsClient/update_environment.php deleted file mode 100644 index d8c7b8d1b9f1..000000000000 --- a/owl-bot-staging/Dialogflow/v2/samples/V2/EnvironmentsClient/update_environment.php +++ /dev/null @@ -1,73 +0,0 @@ -setEnvironment($environment) - ->setUpdateMask($updateMask); - - // Call the API and handle any network failures. - try { - /** @var Environment $response */ - $response = $environmentsClient->updateEnvironment($request); - printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} -// [END dialogflow_v2_generated_Environments_UpdateEnvironment_sync] diff --git a/owl-bot-staging/Dialogflow/v2/samples/V2/FulfillmentsClient/get_fulfillment.php b/owl-bot-staging/Dialogflow/v2/samples/V2/FulfillmentsClient/get_fulfillment.php deleted file mode 100644 index 95c8a447eb92..000000000000 --- a/owl-bot-staging/Dialogflow/v2/samples/V2/FulfillmentsClient/get_fulfillment.php +++ /dev/null @@ -1,72 +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(); - - // Prepare the request message. - $request = (new GetFulfillmentRequest()) - ->setName($formattedName); - - // Call the API and handle any network failures. - try { - /** @var Fulfillment $response */ - $response = $fulfillmentsClient->getFulfillment($request); - printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} - -/** - * Helper to execute the sample. - * - * This sample has been automatically generated and should be regarded as a code - * template only. It will require modifications to work: - * - It may require correct/in-range values for request initialization. - * - It may require specifying regional endpoints when creating the service client, - * please see the apiEndpoint client configuration option for more details. - */ -function callSample(): void -{ - $formattedName = FulfillmentsClient::fulfillmentName('[PROJECT]'); - - get_fulfillment_sample($formattedName); -} -// [END dialogflow_v2_generated_Fulfillments_GetFulfillment_sync] diff --git a/owl-bot-staging/Dialogflow/v2/samples/V2/FulfillmentsClient/get_location.php b/owl-bot-staging/Dialogflow/v2/samples/V2/FulfillmentsClient/get_location.php deleted file mode 100644 index 220f98998443..000000000000 --- a/owl-bot-staging/Dialogflow/v2/samples/V2/FulfillmentsClient/get_location.php +++ /dev/null @@ -1,57 +0,0 @@ -getLocation($request); - printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} -// [END dialogflow_v2_generated_Fulfillments_GetLocation_sync] diff --git a/owl-bot-staging/Dialogflow/v2/samples/V2/FulfillmentsClient/list_locations.php b/owl-bot-staging/Dialogflow/v2/samples/V2/FulfillmentsClient/list_locations.php deleted file mode 100644 index 88eba160adee..000000000000 --- a/owl-bot-staging/Dialogflow/v2/samples/V2/FulfillmentsClient/list_locations.php +++ /dev/null @@ -1,62 +0,0 @@ -listLocations($request); - - /** @var Location $element */ - foreach ($response as $element) { - printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString()); - } - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} -// [END dialogflow_v2_generated_Fulfillments_ListLocations_sync] diff --git a/owl-bot-staging/Dialogflow/v2/samples/V2/FulfillmentsClient/update_fulfillment.php b/owl-bot-staging/Dialogflow/v2/samples/V2/FulfillmentsClient/update_fulfillment.php deleted file mode 100644 index fd7c92fe1f9f..000000000000 --- a/owl-bot-staging/Dialogflow/v2/samples/V2/FulfillmentsClient/update_fulfillment.php +++ /dev/null @@ -1,81 +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 the request message. - $fulfillment = (new Fulfillment()) - ->setName($fulfillmentName); - $updateMask = new FieldMask(); - $request = (new UpdateFulfillmentRequest()) - ->setFulfillment($fulfillment) - ->setUpdateMask($updateMask); - - // Call the API and handle any network failures. - try { - /** @var Fulfillment $response */ - $response = $fulfillmentsClient->updateFulfillment($request); - printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} - -/** - * Helper to execute the sample. - * - * This sample has been automatically generated and should be regarded as a code - * template only. It will require modifications to work: - * - It may require correct/in-range values for request initialization. - * - It may require specifying regional endpoints when creating the service client, - * please see the apiEndpoint client configuration option for more details. - */ -function callSample(): void -{ - $fulfillmentName = '[NAME]'; - - update_fulfillment_sample($fulfillmentName); -} -// [END dialogflow_v2_generated_Fulfillments_UpdateFulfillment_sync] diff --git a/owl-bot-staging/Dialogflow/v2/samples/V2/GeneratorsClient/create_generator.php b/owl-bot-staging/Dialogflow/v2/samples/V2/GeneratorsClient/create_generator.php deleted file mode 100644 index a4bef654c828..000000000000 --- a/owl-bot-staging/Dialogflow/v2/samples/V2/GeneratorsClient/create_generator.php +++ /dev/null @@ -1,74 +0,0 @@ -/locations/` - * Please see {@see GeneratorsClient::projectName()} for help formatting this field. - */ -function create_generator_sample(string $formattedParent): void -{ - // Create a client. - $generatorsClient = new GeneratorsClient(); - - // Prepare the request message. - $generator = new Generator(); - $request = (new CreateGeneratorRequest()) - ->setParent($formattedParent) - ->setGenerator($generator); - - // Call the API and handle any network failures. - try { - /** @var Generator $response */ - $response = $generatorsClient->createGenerator($request); - printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} - -/** - * Helper to execute the sample. - * - * This sample has been automatically generated and should be regarded as a code - * template only. It will require modifications to work: - * - It may require correct/in-range values for request initialization. - * - It may require specifying regional endpoints when creating the service client, - * please see the apiEndpoint client configuration option for more details. - */ -function callSample(): void -{ - $formattedParent = GeneratorsClient::projectName('[PROJECT]'); - - create_generator_sample($formattedParent); -} -// [END dialogflow_v2_generated_Generators_CreateGenerator_sync] diff --git a/owl-bot-staging/Dialogflow/v2/samples/V2/GeneratorsClient/delete_generator.php b/owl-bot-staging/Dialogflow/v2/samples/V2/GeneratorsClient/delete_generator.php deleted file mode 100644 index 73293152827d..000000000000 --- a/owl-bot-staging/Dialogflow/v2/samples/V2/GeneratorsClient/delete_generator.php +++ /dev/null @@ -1,70 +0,0 @@ -/locations//generators/` - * Please see {@see GeneratorsClient::generatorName()} for help formatting this field. - */ -function delete_generator_sample(string $formattedName): void -{ - // Create a client. - $generatorsClient = new GeneratorsClient(); - - // Prepare the request message. - $request = (new DeleteGeneratorRequest()) - ->setName($formattedName); - - // Call the API and handle any network failures. - try { - $generatorsClient->deleteGenerator($request); - printf('Call completed successfully.' . PHP_EOL); - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} - -/** - * Helper to execute the sample. - * - * This sample has been automatically generated and should be regarded as a code - * template only. It will require modifications to work: - * - It may require correct/in-range values for request initialization. - * - It may require specifying regional endpoints when creating the service client, - * please see the apiEndpoint client configuration option for more details. - */ -function callSample(): void -{ - $formattedName = GeneratorsClient::generatorName('[PROJECT]', '[LOCATION]', '[GENERATOR]'); - - delete_generator_sample($formattedName); -} -// [END dialogflow_v2_generated_Generators_DeleteGenerator_sync] diff --git a/owl-bot-staging/Dialogflow/v2/samples/V2/GeneratorsClient/get_generator.php b/owl-bot-staging/Dialogflow/v2/samples/V2/GeneratorsClient/get_generator.php deleted file mode 100644 index d532ba546bd4..000000000000 --- a/owl-bot-staging/Dialogflow/v2/samples/V2/GeneratorsClient/get_generator.php +++ /dev/null @@ -1,72 +0,0 @@ -/locations/`/generators/` - * Please see {@see GeneratorsClient::generatorName()} for help formatting this field. - */ -function get_generator_sample(string $formattedName): void -{ - // Create a client. - $generatorsClient = new GeneratorsClient(); - - // Prepare the request message. - $request = (new GetGeneratorRequest()) - ->setName($formattedName); - - // Call the API and handle any network failures. - try { - /** @var Generator $response */ - $response = $generatorsClient->getGenerator($request); - printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} - -/** - * Helper to execute the sample. - * - * This sample has been automatically generated and should be regarded as a code - * template only. It will require modifications to work: - * - It may require correct/in-range values for request initialization. - * - It may require specifying regional endpoints when creating the service client, - * please see the apiEndpoint client configuration option for more details. - */ -function callSample(): void -{ - $formattedName = GeneratorsClient::generatorName('[PROJECT]', '[LOCATION]', '[GENERATOR]'); - - get_generator_sample($formattedName); -} -// [END dialogflow_v2_generated_Generators_GetGenerator_sync] diff --git a/owl-bot-staging/Dialogflow/v2/samples/V2/GeneratorsClient/get_location.php b/owl-bot-staging/Dialogflow/v2/samples/V2/GeneratorsClient/get_location.php deleted file mode 100644 index 2f4b34e83ed5..000000000000 --- a/owl-bot-staging/Dialogflow/v2/samples/V2/GeneratorsClient/get_location.php +++ /dev/null @@ -1,57 +0,0 @@ -getLocation($request); - printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} -// [END dialogflow_v2_generated_Generators_GetLocation_sync] diff --git a/owl-bot-staging/Dialogflow/v2/samples/V2/GeneratorsClient/list_generators.php b/owl-bot-staging/Dialogflow/v2/samples/V2/GeneratorsClient/list_generators.php deleted file mode 100644 index 213b49176cb7..000000000000 --- a/owl-bot-staging/Dialogflow/v2/samples/V2/GeneratorsClient/list_generators.php +++ /dev/null @@ -1,77 +0,0 @@ -/locations/` - * Please see {@see GeneratorsClient::projectName()} for help formatting this field. - */ -function list_generators_sample(string $formattedParent): void -{ - // Create a client. - $generatorsClient = new GeneratorsClient(); - - // Prepare the request message. - $request = (new ListGeneratorsRequest()) - ->setParent($formattedParent); - - // Call the API and handle any network failures. - try { - /** @var PagedListResponse $response */ - $response = $generatorsClient->listGenerators($request); - - /** @var Generator $element */ - foreach ($response as $element) { - printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString()); - } - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} - -/** - * Helper to execute the sample. - * - * This sample has been automatically generated and should be regarded as a code - * template only. It will require modifications to work: - * - It may require correct/in-range values for request initialization. - * - It may require specifying regional endpoints when creating the service client, - * please see the apiEndpoint client configuration option for more details. - */ -function callSample(): void -{ - $formattedParent = GeneratorsClient::projectName('[PROJECT]'); - - list_generators_sample($formattedParent); -} -// [END dialogflow_v2_generated_Generators_ListGenerators_sync] diff --git a/owl-bot-staging/Dialogflow/v2/samples/V2/GeneratorsClient/list_locations.php b/owl-bot-staging/Dialogflow/v2/samples/V2/GeneratorsClient/list_locations.php deleted file mode 100644 index e39e4235af79..000000000000 --- a/owl-bot-staging/Dialogflow/v2/samples/V2/GeneratorsClient/list_locations.php +++ /dev/null @@ -1,62 +0,0 @@ -listLocations($request); - - /** @var Location $element */ - foreach ($response as $element) { - printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString()); - } - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} -// [END dialogflow_v2_generated_Generators_ListLocations_sync] diff --git a/owl-bot-staging/Dialogflow/v2/samples/V2/GeneratorsClient/update_generator.php b/owl-bot-staging/Dialogflow/v2/samples/V2/GeneratorsClient/update_generator.php deleted file mode 100644 index 35b3dfc6538b..000000000000 --- a/owl-bot-staging/Dialogflow/v2/samples/V2/GeneratorsClient/update_generator.php +++ /dev/null @@ -1,59 +0,0 @@ -setGenerator($generator); - - // Call the API and handle any network failures. - try { - /** @var Generator $response */ - $response = $generatorsClient->updateGenerator($request); - printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} -// [END dialogflow_v2_generated_Generators_UpdateGenerator_sync] diff --git a/owl-bot-staging/Dialogflow/v2/samples/V2/IntentsClient/batch_delete_intents.php b/owl-bot-staging/Dialogflow/v2/samples/V2/IntentsClient/batch_delete_intents.php deleted file mode 100644 index f229786f6052..000000000000 --- a/owl-bot-staging/Dialogflow/v2/samples/V2/IntentsClient/batch_delete_intents.php +++ /dev/null @@ -1,101 +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 the request message. - $intent = (new Intent()) - ->setDisplayName($intentsDisplayName); - $intents = [$intent,]; - $request = (new BatchDeleteIntentsRequest()) - ->setParent($formattedParent) - ->setIntents($intents); - - // Call the API and handle any network failures. - try { - /** @var OperationResponse $response */ - $response = $intentsClient->batchDeleteIntents($request); - $response->pollUntilComplete(); - - if ($response->operationSucceeded()) { - printf('Operation completed successfully.' . PHP_EOL); - } else { - /** @var Status $error */ - $error = $response->getError(); - printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); - } - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} - -/** - * Helper to execute the sample. - * - * This sample has been automatically generated and should be regarded as a code - * template only. It will require modifications to work: - * - It may require correct/in-range values for request initialization. - * - It may require specifying regional endpoints when creating the service client, - * please see the apiEndpoint client configuration option for more details. - */ -function callSample(): void -{ - $formattedParent = IntentsClient::agentName('[PROJECT]'); - $intentsDisplayName = '[DISPLAY_NAME]'; - - batch_delete_intents_sample($formattedParent, $intentsDisplayName); -} -// [END dialogflow_v2_generated_Intents_BatchDeleteIntents_sync] diff --git a/owl-bot-staging/Dialogflow/v2/samples/V2/IntentsClient/batch_update_intents.php b/owl-bot-staging/Dialogflow/v2/samples/V2/IntentsClient/batch_update_intents.php deleted file mode 100644 index c81cebdfc54a..000000000000 --- a/owl-bot-staging/Dialogflow/v2/samples/V2/IntentsClient/batch_update_intents.php +++ /dev/null @@ -1,97 +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(); - - // Prepare the request message. - $request = (new BatchUpdateIntentsRequest()) - ->setParent($formattedParent); - - // Call the API and handle any network failures. - try { - /** @var OperationResponse $response */ - $response = $intentsClient->batchUpdateIntents($request); - $response->pollUntilComplete(); - - if ($response->operationSucceeded()) { - /** @var BatchUpdateIntentsResponse $result */ - $result = $response->getResult(); - printf('Operation successful with response data: %s' . PHP_EOL, $result->serializeToJsonString()); - } else { - /** @var Status $error */ - $error = $response->getError(); - printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); - } - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} - -/** - * Helper to execute the sample. - * - * This sample has been automatically generated and should be regarded as a code - * template only. It will require modifications to work: - * - It may require correct/in-range values for request initialization. - * - It may require specifying regional endpoints when creating the service client, - * please see the apiEndpoint client configuration option for more details. - */ -function callSample(): void -{ - $formattedParent = IntentsClient::agentName('[PROJECT]'); - - batch_update_intents_sample($formattedParent); -} -// [END dialogflow_v2_generated_Intents_BatchUpdateIntents_sync] diff --git a/owl-bot-staging/Dialogflow/v2/samples/V2/IntentsClient/create_intent.php b/owl-bot-staging/Dialogflow/v2/samples/V2/IntentsClient/create_intent.php deleted file mode 100644 index a1dec96ef2a4..000000000000 --- a/owl-bot-staging/Dialogflow/v2/samples/V2/IntentsClient/create_intent.php +++ /dev/null @@ -1,81 +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 the request message. - $intent = (new Intent()) - ->setDisplayName($intentDisplayName); - $request = (new CreateIntentRequest()) - ->setParent($formattedParent) - ->setIntent($intent); - - // Call the API and handle any network failures. - try { - /** @var Intent $response */ - $response = $intentsClient->createIntent($request); - printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} - -/** - * Helper to execute the sample. - * - * This sample has been automatically generated and should be regarded as a code - * template only. It will require modifications to work: - * - It may require correct/in-range values for request initialization. - * - It may require specifying regional endpoints when creating the service client, - * please see the apiEndpoint client configuration option for more details. - */ -function callSample(): void -{ - $formattedParent = IntentsClient::agentName('[PROJECT]'); - $intentDisplayName = '[DISPLAY_NAME]'; - - create_intent_sample($formattedParent, $intentDisplayName); -} -// [END dialogflow_v2_generated_Intents_CreateIntent_sync] diff --git a/owl-bot-staging/Dialogflow/v2/samples/V2/IntentsClient/delete_intent.php b/owl-bot-staging/Dialogflow/v2/samples/V2/IntentsClient/delete_intent.php deleted file mode 100644 index 96cee57c1820..000000000000 --- a/owl-bot-staging/Dialogflow/v2/samples/V2/IntentsClient/delete_intent.php +++ /dev/null @@ -1,75 +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(); - - // Prepare the request message. - $request = (new DeleteIntentRequest()) - ->setName($formattedName); - - // Call the API and handle any network failures. - try { - $intentsClient->deleteIntent($request); - printf('Call completed successfully.' . PHP_EOL); - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} - -/** - * Helper to execute the sample. - * - * This sample has been automatically generated and should be regarded as a code - * template only. It will require modifications to work: - * - It may require correct/in-range values for request initialization. - * - It may require specifying regional endpoints when creating the service client, - * please see the apiEndpoint client configuration option for more details. - */ -function callSample(): void -{ - $formattedName = IntentsClient::intentName('[PROJECT]', '[INTENT]'); - - delete_intent_sample($formattedName); -} -// [END dialogflow_v2_generated_Intents_DeleteIntent_sync] diff --git a/owl-bot-staging/Dialogflow/v2/samples/V2/IntentsClient/get_intent.php b/owl-bot-staging/Dialogflow/v2/samples/V2/IntentsClient/get_intent.php deleted file mode 100644 index ef16a6691463..000000000000 --- a/owl-bot-staging/Dialogflow/v2/samples/V2/IntentsClient/get_intent.php +++ /dev/null @@ -1,72 +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(); - - // Prepare the request message. - $request = (new GetIntentRequest()) - ->setName($formattedName); - - // Call the API and handle any network failures. - try { - /** @var Intent $response */ - $response = $intentsClient->getIntent($request); - printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} - -/** - * Helper to execute the sample. - * - * This sample has been automatically generated and should be regarded as a code - * template only. It will require modifications to work: - * - It may require correct/in-range values for request initialization. - * - It may require specifying regional endpoints when creating the service client, - * please see the apiEndpoint client configuration option for more details. - */ -function callSample(): void -{ - $formattedName = IntentsClient::intentName('[PROJECT]', '[INTENT]'); - - get_intent_sample($formattedName); -} -// [END dialogflow_v2_generated_Intents_GetIntent_sync] diff --git a/owl-bot-staging/Dialogflow/v2/samples/V2/IntentsClient/get_location.php b/owl-bot-staging/Dialogflow/v2/samples/V2/IntentsClient/get_location.php deleted file mode 100644 index 3f9878d2c29f..000000000000 --- a/owl-bot-staging/Dialogflow/v2/samples/V2/IntentsClient/get_location.php +++ /dev/null @@ -1,57 +0,0 @@ -getLocation($request); - printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} -// [END dialogflow_v2_generated_Intents_GetLocation_sync] diff --git a/owl-bot-staging/Dialogflow/v2/samples/V2/IntentsClient/list_intents.php b/owl-bot-staging/Dialogflow/v2/samples/V2/IntentsClient/list_intents.php deleted file mode 100644 index 9e33c6e33fcb..000000000000 --- a/owl-bot-staging/Dialogflow/v2/samples/V2/IntentsClient/list_intents.php +++ /dev/null @@ -1,85 +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(); - - // Prepare the request message. - $request = (new ListIntentsRequest()) - ->setParent($formattedParent); - - // Call the API and handle any network failures. - try { - /** @var PagedListResponse $response */ - $response = $intentsClient->listIntents($request); - - /** @var Intent $element */ - foreach ($response as $element) { - printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString()); - } - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} - -/** - * Helper to execute the sample. - * - * This sample has been automatically generated and should be regarded as a code - * template only. It will require modifications to work: - * - It may require correct/in-range values for request initialization. - * - It may require specifying regional endpoints when creating the service client, - * please see the apiEndpoint client configuration option for more details. - */ -function callSample(): void -{ - $formattedParent = IntentsClient::agentName('[PROJECT]'); - - list_intents_sample($formattedParent); -} -// [END dialogflow_v2_generated_Intents_ListIntents_sync] diff --git a/owl-bot-staging/Dialogflow/v2/samples/V2/IntentsClient/list_locations.php b/owl-bot-staging/Dialogflow/v2/samples/V2/IntentsClient/list_locations.php deleted file mode 100644 index 24744e08050e..000000000000 --- a/owl-bot-staging/Dialogflow/v2/samples/V2/IntentsClient/list_locations.php +++ /dev/null @@ -1,62 +0,0 @@ -listLocations($request); - - /** @var Location $element */ - foreach ($response as $element) { - printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString()); - } - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} -// [END dialogflow_v2_generated_Intents_ListLocations_sync] diff --git a/owl-bot-staging/Dialogflow/v2/samples/V2/IntentsClient/update_intent.php b/owl-bot-staging/Dialogflow/v2/samples/V2/IntentsClient/update_intent.php deleted file mode 100644 index f72c59d23643..000000000000 --- a/owl-bot-staging/Dialogflow/v2/samples/V2/IntentsClient/update_intent.php +++ /dev/null @@ -1,76 +0,0 @@ -setDisplayName($intentDisplayName); - $request = (new UpdateIntentRequest()) - ->setIntent($intent); - - // Call the API and handle any network failures. - try { - /** @var Intent $response */ - $response = $intentsClient->updateIntent($request); - printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} - -/** - * Helper to execute the sample. - * - * This sample has been automatically generated and should be regarded as a code - * template only. It will require modifications to work: - * - It may require correct/in-range values for request initialization. - * - It may require specifying regional endpoints when creating the service client, - * please see the apiEndpoint client configuration option for more details. - */ -function callSample(): void -{ - $intentDisplayName = '[DISPLAY_NAME]'; - - update_intent_sample($intentDisplayName); -} -// [END dialogflow_v2_generated_Intents_UpdateIntent_sync] diff --git a/owl-bot-staging/Dialogflow/v2/samples/V2/KnowledgeBasesClient/create_knowledge_base.php b/owl-bot-staging/Dialogflow/v2/samples/V2/KnowledgeBasesClient/create_knowledge_base.php deleted file mode 100644 index 7a064e189d1b..000000000000 --- a/owl-bot-staging/Dialogflow/v2/samples/V2/KnowledgeBasesClient/create_knowledge_base.php +++ /dev/null @@ -1,80 +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 the request message. - $knowledgeBase = (new KnowledgeBase()) - ->setDisplayName($knowledgeBaseDisplayName); - $request = (new CreateKnowledgeBaseRequest()) - ->setParent($formattedParent) - ->setKnowledgeBase($knowledgeBase); - - // Call the API and handle any network failures. - try { - /** @var KnowledgeBase $response */ - $response = $knowledgeBasesClient->createKnowledgeBase($request); - printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} - -/** - * Helper to execute the sample. - * - * This sample has been automatically generated and should be regarded as a code - * template only. It will require modifications to work: - * - It may require correct/in-range values for request initialization. - * - It may require specifying regional endpoints when creating the service client, - * please see the apiEndpoint client configuration option for more details. - */ -function callSample(): void -{ - $formattedParent = KnowledgeBasesClient::projectName('[PROJECT]'); - $knowledgeBaseDisplayName = '[DISPLAY_NAME]'; - - create_knowledge_base_sample($formattedParent, $knowledgeBaseDisplayName); -} -// [END dialogflow_v2_generated_KnowledgeBases_CreateKnowledgeBase_sync] diff --git a/owl-bot-staging/Dialogflow/v2/samples/V2/KnowledgeBasesClient/delete_knowledge_base.php b/owl-bot-staging/Dialogflow/v2/samples/V2/KnowledgeBasesClient/delete_knowledge_base.php deleted file mode 100644 index c7615ccd188d..000000000000 --- a/owl-bot-staging/Dialogflow/v2/samples/V2/KnowledgeBasesClient/delete_knowledge_base.php +++ /dev/null @@ -1,71 +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(); - - // Prepare the request message. - $request = (new DeleteKnowledgeBaseRequest()) - ->setName($formattedName); - - // Call the API and handle any network failures. - try { - $knowledgeBasesClient->deleteKnowledgeBase($request); - printf('Call completed successfully.' . PHP_EOL); - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} - -/** - * Helper to execute the sample. - * - * This sample has been automatically generated and should be regarded as a code - * template only. It will require modifications to work: - * - It may require correct/in-range values for request initialization. - * - It may require specifying regional endpoints when creating the service client, - * please see the apiEndpoint client configuration option for more details. - */ -function callSample(): void -{ - $formattedName = KnowledgeBasesClient::knowledgeBaseName('[PROJECT]', '[KNOWLEDGE_BASE]'); - - delete_knowledge_base_sample($formattedName); -} -// [END dialogflow_v2_generated_KnowledgeBases_DeleteKnowledgeBase_sync] diff --git a/owl-bot-staging/Dialogflow/v2/samples/V2/KnowledgeBasesClient/get_knowledge_base.php b/owl-bot-staging/Dialogflow/v2/samples/V2/KnowledgeBasesClient/get_knowledge_base.php deleted file mode 100644 index b673f45f01ce..000000000000 --- a/owl-bot-staging/Dialogflow/v2/samples/V2/KnowledgeBasesClient/get_knowledge_base.php +++ /dev/null @@ -1,73 +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(); - - // Prepare the request message. - $request = (new GetKnowledgeBaseRequest()) - ->setName($formattedName); - - // Call the API and handle any network failures. - try { - /** @var KnowledgeBase $response */ - $response = $knowledgeBasesClient->getKnowledgeBase($request); - printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} - -/** - * Helper to execute the sample. - * - * This sample has been automatically generated and should be regarded as a code - * template only. It will require modifications to work: - * - It may require correct/in-range values for request initialization. - * - It may require specifying regional endpoints when creating the service client, - * please see the apiEndpoint client configuration option for more details. - */ -function callSample(): void -{ - $formattedName = KnowledgeBasesClient::knowledgeBaseName('[PROJECT]', '[KNOWLEDGE_BASE]'); - - get_knowledge_base_sample($formattedName); -} -// [END dialogflow_v2_generated_KnowledgeBases_GetKnowledgeBase_sync] diff --git a/owl-bot-staging/Dialogflow/v2/samples/V2/KnowledgeBasesClient/get_location.php b/owl-bot-staging/Dialogflow/v2/samples/V2/KnowledgeBasesClient/get_location.php deleted file mode 100644 index 7ddf260013a7..000000000000 --- a/owl-bot-staging/Dialogflow/v2/samples/V2/KnowledgeBasesClient/get_location.php +++ /dev/null @@ -1,57 +0,0 @@ -getLocation($request); - printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} -// [END dialogflow_v2_generated_KnowledgeBases_GetLocation_sync] diff --git a/owl-bot-staging/Dialogflow/v2/samples/V2/KnowledgeBasesClient/list_knowledge_bases.php b/owl-bot-staging/Dialogflow/v2/samples/V2/KnowledgeBasesClient/list_knowledge_bases.php deleted file mode 100644 index 49af5e5193c6..000000000000 --- a/owl-bot-staging/Dialogflow/v2/samples/V2/KnowledgeBasesClient/list_knowledge_bases.php +++ /dev/null @@ -1,77 +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(); - - // Prepare the request message. - $request = (new ListKnowledgeBasesRequest()) - ->setParent($formattedParent); - - // Call the API and handle any network failures. - try { - /** @var PagedListResponse $response */ - $response = $knowledgeBasesClient->listKnowledgeBases($request); - - /** @var KnowledgeBase $element */ - foreach ($response as $element) { - printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString()); - } - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} - -/** - * Helper to execute the sample. - * - * This sample has been automatically generated and should be regarded as a code - * template only. It will require modifications to work: - * - It may require correct/in-range values for request initialization. - * - It may require specifying regional endpoints when creating the service client, - * please see the apiEndpoint client configuration option for more details. - */ -function callSample(): void -{ - $formattedParent = KnowledgeBasesClient::projectName('[PROJECT]'); - - list_knowledge_bases_sample($formattedParent); -} -// [END dialogflow_v2_generated_KnowledgeBases_ListKnowledgeBases_sync] diff --git a/owl-bot-staging/Dialogflow/v2/samples/V2/KnowledgeBasesClient/list_locations.php b/owl-bot-staging/Dialogflow/v2/samples/V2/KnowledgeBasesClient/list_locations.php deleted file mode 100644 index 34a9e8a99fe5..000000000000 --- a/owl-bot-staging/Dialogflow/v2/samples/V2/KnowledgeBasesClient/list_locations.php +++ /dev/null @@ -1,62 +0,0 @@ -listLocations($request); - - /** @var Location $element */ - foreach ($response as $element) { - printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString()); - } - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} -// [END dialogflow_v2_generated_KnowledgeBases_ListLocations_sync] diff --git a/owl-bot-staging/Dialogflow/v2/samples/V2/KnowledgeBasesClient/update_knowledge_base.php b/owl-bot-staging/Dialogflow/v2/samples/V2/KnowledgeBasesClient/update_knowledge_base.php deleted file mode 100644 index 86966ede92cd..000000000000 --- a/owl-bot-staging/Dialogflow/v2/samples/V2/KnowledgeBasesClient/update_knowledge_base.php +++ /dev/null @@ -1,73 +0,0 @@ -setDisplayName($knowledgeBaseDisplayName); - $request = (new UpdateKnowledgeBaseRequest()) - ->setKnowledgeBase($knowledgeBase); - - // Call the API and handle any network failures. - try { - /** @var KnowledgeBase $response */ - $response = $knowledgeBasesClient->updateKnowledgeBase($request); - printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} - -/** - * Helper to execute the sample. - * - * This sample has been automatically generated and should be regarded as a code - * template only. It will require modifications to work: - * - It may require correct/in-range values for request initialization. - * - It may require specifying regional endpoints when creating the service client, - * please see the apiEndpoint client configuration option for more details. - */ -function callSample(): void -{ - $knowledgeBaseDisplayName = '[DISPLAY_NAME]'; - - update_knowledge_base_sample($knowledgeBaseDisplayName); -} -// [END dialogflow_v2_generated_KnowledgeBases_UpdateKnowledgeBase_sync] diff --git a/owl-bot-staging/Dialogflow/v2/samples/V2/ParticipantsClient/analyze_content.php b/owl-bot-staging/Dialogflow/v2/samples/V2/ParticipantsClient/analyze_content.php deleted file mode 100644 index 9c001a950d22..000000000000 --- a/owl-bot-staging/Dialogflow/v2/samples/V2/ParticipantsClient/analyze_content.php +++ /dev/null @@ -1,82 +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(); - - // Prepare the request message. - $request = (new AnalyzeContentRequest()) - ->setParticipant($formattedParticipant); - - // Call the API and handle any network failures. - try { - /** @var AnalyzeContentResponse $response */ - $response = $participantsClient->analyzeContent($request); - printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} - -/** - * Helper to execute the sample. - * - * This sample has been automatically generated and should be regarded as a code - * template only. It will require modifications to work: - * - It may require correct/in-range values for request initialization. - * - It may require specifying regional endpoints when creating the service client, - * please see the apiEndpoint client configuration option for more details. - */ -function callSample(): void -{ - $formattedParticipant = ParticipantsClient::participantName( - '[PROJECT]', - '[CONVERSATION]', - '[PARTICIPANT]' - ); - - analyze_content_sample($formattedParticipant); -} -// [END dialogflow_v2_generated_Participants_AnalyzeContent_sync] diff --git a/owl-bot-staging/Dialogflow/v2/samples/V2/ParticipantsClient/create_participant.php b/owl-bot-staging/Dialogflow/v2/samples/V2/ParticipantsClient/create_participant.php deleted file mode 100644 index 1fe86c08bb57..000000000000 --- a/owl-bot-staging/Dialogflow/v2/samples/V2/ParticipantsClient/create_participant.php +++ /dev/null @@ -1,75 +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 the request message. - $participant = new Participant(); - $request = (new CreateParticipantRequest()) - ->setParent($formattedParent) - ->setParticipant($participant); - - // Call the API and handle any network failures. - try { - /** @var Participant $response */ - $response = $participantsClient->createParticipant($request); - printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} - -/** - * Helper to execute the sample. - * - * This sample has been automatically generated and should be regarded as a code - * template only. It will require modifications to work: - * - It may require correct/in-range values for request initialization. - * - It may require specifying regional endpoints when creating the service client, - * please see the apiEndpoint client configuration option for more details. - */ -function callSample(): void -{ - $formattedParent = ParticipantsClient::conversationName('[PROJECT]', '[CONVERSATION]'); - - create_participant_sample($formattedParent); -} -// [END dialogflow_v2_generated_Participants_CreateParticipant_sync] diff --git a/owl-bot-staging/Dialogflow/v2/samples/V2/ParticipantsClient/get_location.php b/owl-bot-staging/Dialogflow/v2/samples/V2/ParticipantsClient/get_location.php deleted file mode 100644 index 20d03909d7cc..000000000000 --- a/owl-bot-staging/Dialogflow/v2/samples/V2/ParticipantsClient/get_location.php +++ /dev/null @@ -1,57 +0,0 @@ -getLocation($request); - printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} -// [END dialogflow_v2_generated_Participants_GetLocation_sync] diff --git a/owl-bot-staging/Dialogflow/v2/samples/V2/ParticipantsClient/get_participant.php b/owl-bot-staging/Dialogflow/v2/samples/V2/ParticipantsClient/get_participant.php deleted file mode 100644 index aa179288ba83..000000000000 --- a/owl-bot-staging/Dialogflow/v2/samples/V2/ParticipantsClient/get_participant.php +++ /dev/null @@ -1,77 +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(); - - // Prepare the request message. - $request = (new GetParticipantRequest()) - ->setName($formattedName); - - // Call the API and handle any network failures. - try { - /** @var Participant $response */ - $response = $participantsClient->getParticipant($request); - printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} - -/** - * Helper to execute the sample. - * - * This sample has been automatically generated and should be regarded as a code - * template only. It will require modifications to work: - * - It may require correct/in-range values for request initialization. - * - It may require specifying regional endpoints when creating the service client, - * please see the apiEndpoint client configuration option for more details. - */ -function callSample(): void -{ - $formattedName = ParticipantsClient::participantName( - '[PROJECT]', - '[CONVERSATION]', - '[PARTICIPANT]' - ); - - get_participant_sample($formattedName); -} -// [END dialogflow_v2_generated_Participants_GetParticipant_sync] diff --git a/owl-bot-staging/Dialogflow/v2/samples/V2/ParticipantsClient/list_locations.php b/owl-bot-staging/Dialogflow/v2/samples/V2/ParticipantsClient/list_locations.php deleted file mode 100644 index d912ac4f5d82..000000000000 --- a/owl-bot-staging/Dialogflow/v2/samples/V2/ParticipantsClient/list_locations.php +++ /dev/null @@ -1,62 +0,0 @@ -listLocations($request); - - /** @var Location $element */ - foreach ($response as $element) { - printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString()); - } - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} -// [END dialogflow_v2_generated_Participants_ListLocations_sync] diff --git a/owl-bot-staging/Dialogflow/v2/samples/V2/ParticipantsClient/list_participants.php b/owl-bot-staging/Dialogflow/v2/samples/V2/ParticipantsClient/list_participants.php deleted file mode 100644 index 2e7598014278..000000000000 --- a/owl-bot-staging/Dialogflow/v2/samples/V2/ParticipantsClient/list_participants.php +++ /dev/null @@ -1,78 +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(); - - // Prepare the request message. - $request = (new ListParticipantsRequest()) - ->setParent($formattedParent); - - // Call the API and handle any network failures. - try { - /** @var PagedListResponse $response */ - $response = $participantsClient->listParticipants($request); - - /** @var Participant $element */ - foreach ($response as $element) { - printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString()); - } - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} - -/** - * Helper to execute the sample. - * - * This sample has been automatically generated and should be regarded as a code - * template only. It will require modifications to work: - * - It may require correct/in-range values for request initialization. - * - It may require specifying regional endpoints when creating the service client, - * please see the apiEndpoint client configuration option for more details. - */ -function callSample(): void -{ - $formattedParent = ParticipantsClient::conversationName('[PROJECT]', '[CONVERSATION]'); - - list_participants_sample($formattedParent); -} -// [END dialogflow_v2_generated_Participants_ListParticipants_sync] diff --git a/owl-bot-staging/Dialogflow/v2/samples/V2/ParticipantsClient/streaming_analyze_content.php b/owl-bot-staging/Dialogflow/v2/samples/V2/ParticipantsClient/streaming_analyze_content.php deleted file mode 100644 index feaa5a96d29a..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 the request message. - $request = (new StreamingAnalyzeContentRequest()) - ->setParticipant($formattedParticipant); - - // Call the API and handle any network failures. - try { - /** @var BidiStream $stream */ - $stream = $participantsClient->streamingAnalyzeContent(); - $stream->writeAll([$request,]); - - /** @var StreamingAnalyzeContentResponse $element */ - foreach ($stream->closeWriteAndReadAll() as $element) { - printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString()); - } - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} - -/** - * Helper to execute the sample. - * - * This sample has been automatically generated and should be regarded as a code - * template only. It will require modifications to work: - * - It may require correct/in-range values for request initialization. - * - It may require specifying regional endpoints when creating the service client, - * please see the apiEndpoint client configuration option for more details. - */ -function callSample(): void -{ - $formattedParticipant = ParticipantsClient::participantName( - '[PROJECT]', - '[CONVERSATION]', - '[PARTICIPANT]' - ); - - streaming_analyze_content_sample($formattedParticipant); -} -// [END dialogflow_v2_generated_Participants_StreamingAnalyzeContent_sync] diff --git a/owl-bot-staging/Dialogflow/v2/samples/V2/ParticipantsClient/suggest_articles.php b/owl-bot-staging/Dialogflow/v2/samples/V2/ParticipantsClient/suggest_articles.php deleted file mode 100644 index e1a3cba75cf1..000000000000 --- a/owl-bot-staging/Dialogflow/v2/samples/V2/ParticipantsClient/suggest_articles.php +++ /dev/null @@ -1,78 +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(); - - // Prepare the request message. - $request = (new SuggestArticlesRequest()) - ->setParent($formattedParent); - - // Call the API and handle any network failures. - try { - /** @var SuggestArticlesResponse $response */ - $response = $participantsClient->suggestArticles($request); - printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} - -/** - * Helper to execute the sample. - * - * This sample has been automatically generated and should be regarded as a code - * template only. It will require modifications to work: - * - It may require correct/in-range values for request initialization. - * - It may require specifying regional endpoints when creating the service client, - * please see the apiEndpoint client configuration option for more details. - */ -function callSample(): void -{ - $formattedParent = ParticipantsClient::participantName( - '[PROJECT]', - '[CONVERSATION]', - '[PARTICIPANT]' - ); - - suggest_articles_sample($formattedParent); -} -// [END dialogflow_v2_generated_Participants_SuggestArticles_sync] diff --git a/owl-bot-staging/Dialogflow/v2/samples/V2/ParticipantsClient/suggest_faq_answers.php b/owl-bot-staging/Dialogflow/v2/samples/V2/ParticipantsClient/suggest_faq_answers.php deleted file mode 100644 index 7f75844f05cf..000000000000 --- a/owl-bot-staging/Dialogflow/v2/samples/V2/ParticipantsClient/suggest_faq_answers.php +++ /dev/null @@ -1,78 +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(); - - // Prepare the request message. - $request = (new SuggestFaqAnswersRequest()) - ->setParent($formattedParent); - - // Call the API and handle any network failures. - try { - /** @var SuggestFaqAnswersResponse $response */ - $response = $participantsClient->suggestFaqAnswers($request); - printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} - -/** - * Helper to execute the sample. - * - * This sample has been automatically generated and should be regarded as a code - * template only. It will require modifications to work: - * - It may require correct/in-range values for request initialization. - * - It may require specifying regional endpoints when creating the service client, - * please see the apiEndpoint client configuration option for more details. - */ -function callSample(): void -{ - $formattedParent = ParticipantsClient::participantName( - '[PROJECT]', - '[CONVERSATION]', - '[PARTICIPANT]' - ); - - suggest_faq_answers_sample($formattedParent); -} -// [END dialogflow_v2_generated_Participants_SuggestFaqAnswers_sync] diff --git a/owl-bot-staging/Dialogflow/v2/samples/V2/ParticipantsClient/suggest_knowledge_assist.php b/owl-bot-staging/Dialogflow/v2/samples/V2/ParticipantsClient/suggest_knowledge_assist.php deleted file mode 100644 index be42b7b7fb31..000000000000 --- a/owl-bot-staging/Dialogflow/v2/samples/V2/ParticipantsClient/suggest_knowledge_assist.php +++ /dev/null @@ -1,77 +0,0 @@ -/locations//conversations//participants/`. Please see - * {@see ParticipantsClient::participantName()} for help formatting this field. - */ -function suggest_knowledge_assist_sample(string $formattedParent): void -{ - // Create a client. - $participantsClient = new ParticipantsClient(); - - // Prepare the request message. - $request = (new SuggestKnowledgeAssistRequest()) - ->setParent($formattedParent); - - // Call the API and handle any network failures. - try { - /** @var SuggestKnowledgeAssistResponse $response */ - $response = $participantsClient->suggestKnowledgeAssist($request); - printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} - -/** - * Helper to execute the sample. - * - * This sample has been automatically generated and should be regarded as a code - * template only. It will require modifications to work: - * - It may require correct/in-range values for request initialization. - * - It may require specifying regional endpoints when creating the service client, - * please see the apiEndpoint client configuration option for more details. - */ -function callSample(): void -{ - $formattedParent = ParticipantsClient::participantName( - '[PROJECT]', - '[CONVERSATION]', - '[PARTICIPANT]' - ); - - suggest_knowledge_assist_sample($formattedParent); -} -// [END dialogflow_v2_generated_Participants_SuggestKnowledgeAssist_sync] diff --git a/owl-bot-staging/Dialogflow/v2/samples/V2/ParticipantsClient/suggest_smart_replies.php b/owl-bot-staging/Dialogflow/v2/samples/V2/ParticipantsClient/suggest_smart_replies.php deleted file mode 100644 index 6fd2a66e94f1..000000000000 --- a/owl-bot-staging/Dialogflow/v2/samples/V2/ParticipantsClient/suggest_smart_replies.php +++ /dev/null @@ -1,78 +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(); - - // Prepare the request message. - $request = (new SuggestSmartRepliesRequest()) - ->setParent($formattedParent); - - // Call the API and handle any network failures. - try { - /** @var SuggestSmartRepliesResponse $response */ - $response = $participantsClient->suggestSmartReplies($request); - printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} - -/** - * Helper to execute the sample. - * - * This sample has been automatically generated and should be regarded as a code - * template only. It will require modifications to work: - * - It may require correct/in-range values for request initialization. - * - It may require specifying regional endpoints when creating the service client, - * please see the apiEndpoint client configuration option for more details. - */ -function callSample(): void -{ - $formattedParent = ParticipantsClient::participantName( - '[PROJECT]', - '[CONVERSATION]', - '[PARTICIPANT]' - ); - - suggest_smart_replies_sample($formattedParent); -} -// [END dialogflow_v2_generated_Participants_SuggestSmartReplies_sync] diff --git a/owl-bot-staging/Dialogflow/v2/samples/V2/ParticipantsClient/update_participant.php b/owl-bot-staging/Dialogflow/v2/samples/V2/ParticipantsClient/update_participant.php deleted file mode 100644 index ba42bea1b21b..000000000000 --- a/owl-bot-staging/Dialogflow/v2/samples/V2/ParticipantsClient/update_participant.php +++ /dev/null @@ -1,62 +0,0 @@ -setParticipant($participant) - ->setUpdateMask($updateMask); - - // Call the API and handle any network failures. - try { - /** @var Participant $response */ - $response = $participantsClient->updateParticipant($request); - printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} -// [END dialogflow_v2_generated_Participants_UpdateParticipant_sync] diff --git a/owl-bot-staging/Dialogflow/v2/samples/V2/SessionEntityTypesClient/create_session_entity_type.php b/owl-bot-staging/Dialogflow/v2/samples/V2/SessionEntityTypesClient/create_session_entity_type.php deleted file mode 100644 index 876b536688d9..000000000000 --- a/owl-bot-staging/Dialogflow/v2/samples/V2/SessionEntityTypesClient/create_session_entity_type.php +++ /dev/null @@ -1,141 +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 the request message. - $sessionEntityTypeEntitiesSynonyms = [$sessionEntityTypeEntitiesSynonymsElement,]; - $entity = (new Entity()) - ->setValue($sessionEntityTypeEntitiesValue) - ->setSynonyms($sessionEntityTypeEntitiesSynonyms); - $sessionEntityTypeEntities = [$entity,]; - $sessionEntityType = (new SessionEntityType()) - ->setName($sessionEntityTypeName) - ->setEntityOverrideMode($sessionEntityTypeEntityOverrideMode) - ->setEntities($sessionEntityTypeEntities); - $request = (new CreateSessionEntityTypeRequest()) - ->setParent($formattedParent) - ->setSessionEntityType($sessionEntityType); - - // Call the API and handle any network failures. - try { - /** @var SessionEntityType $response */ - $response = $sessionEntityTypesClient->createSessionEntityType($request); - printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} - -/** - * Helper to execute the sample. - * - * This sample has been automatically generated and should be regarded as a code - * template only. It will require modifications to work: - * - It may require correct/in-range values for request initialization. - * - It may require specifying regional endpoints when creating the service client, - * please see the apiEndpoint client configuration option for more details. - */ -function callSample(): void -{ - $formattedParent = SessionEntityTypesClient::sessionName('[PROJECT]', '[SESSION]'); - $sessionEntityTypeName = '[NAME]'; - $sessionEntityTypeEntityOverrideMode = EntityOverrideMode::ENTITY_OVERRIDE_MODE_UNSPECIFIED; - $sessionEntityTypeEntitiesValue = '[VALUE]'; - $sessionEntityTypeEntitiesSynonymsElement = '[SYNONYMS]'; - - create_session_entity_type_sample( - $formattedParent, - $sessionEntityTypeName, - $sessionEntityTypeEntityOverrideMode, - $sessionEntityTypeEntitiesValue, - $sessionEntityTypeEntitiesSynonymsElement - ); -} -// [END dialogflow_v2_generated_SessionEntityTypes_CreateSessionEntityType_sync] diff --git a/owl-bot-staging/Dialogflow/v2/samples/V2/SessionEntityTypesClient/delete_session_entity_type.php b/owl-bot-staging/Dialogflow/v2/samples/V2/SessionEntityTypesClient/delete_session_entity_type.php deleted file mode 100644 index 56e42e7169cf..000000000000 --- a/owl-bot-staging/Dialogflow/v2/samples/V2/SessionEntityTypesClient/delete_session_entity_type.php +++ /dev/null @@ -1,83 +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(); - - // Prepare the request message. - $request = (new DeleteSessionEntityTypeRequest()) - ->setName($formattedName); - - // Call the API and handle any network failures. - try { - $sessionEntityTypesClient->deleteSessionEntityType($request); - printf('Call completed successfully.' . PHP_EOL); - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} - -/** - * Helper to execute the sample. - * - * This sample has been automatically generated and should be regarded as a code - * template only. It will require modifications to work: - * - It may require correct/in-range values for request initialization. - * - It may require specifying regional endpoints when creating the service client, - * please see the apiEndpoint client configuration option for more details. - */ -function callSample(): void -{ - $formattedName = SessionEntityTypesClient::sessionEntityTypeName( - '[PROJECT]', - '[SESSION]', - '[ENTITY_TYPE]' - ); - - delete_session_entity_type_sample($formattedName); -} -// [END dialogflow_v2_generated_SessionEntityTypes_DeleteSessionEntityType_sync] diff --git a/owl-bot-staging/Dialogflow/v2/samples/V2/SessionEntityTypesClient/get_location.php b/owl-bot-staging/Dialogflow/v2/samples/V2/SessionEntityTypesClient/get_location.php deleted file mode 100644 index 4d09a7ff386c..000000000000 --- a/owl-bot-staging/Dialogflow/v2/samples/V2/SessionEntityTypesClient/get_location.php +++ /dev/null @@ -1,57 +0,0 @@ -getLocation($request); - printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} -// [END dialogflow_v2_generated_SessionEntityTypes_GetLocation_sync] diff --git a/owl-bot-staging/Dialogflow/v2/samples/V2/SessionEntityTypesClient/get_session_entity_type.php b/owl-bot-staging/Dialogflow/v2/samples/V2/SessionEntityTypesClient/get_session_entity_type.php deleted file mode 100644 index 44ea277d7807..000000000000 --- a/owl-bot-staging/Dialogflow/v2/samples/V2/SessionEntityTypesClient/get_session_entity_type.php +++ /dev/null @@ -1,85 +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(); - - // Prepare the request message. - $request = (new GetSessionEntityTypeRequest()) - ->setName($formattedName); - - // Call the API and handle any network failures. - try { - /** @var SessionEntityType $response */ - $response = $sessionEntityTypesClient->getSessionEntityType($request); - printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} - -/** - * Helper to execute the sample. - * - * This sample has been automatically generated and should be regarded as a code - * template only. It will require modifications to work: - * - It may require correct/in-range values for request initialization. - * - It may require specifying regional endpoints when creating the service client, - * please see the apiEndpoint client configuration option for more details. - */ -function callSample(): void -{ - $formattedName = SessionEntityTypesClient::sessionEntityTypeName( - '[PROJECT]', - '[SESSION]', - '[ENTITY_TYPE]' - ); - - get_session_entity_type_sample($formattedName); -} -// [END dialogflow_v2_generated_SessionEntityTypes_GetSessionEntityType_sync] diff --git a/owl-bot-staging/Dialogflow/v2/samples/V2/SessionEntityTypesClient/list_locations.php b/owl-bot-staging/Dialogflow/v2/samples/V2/SessionEntityTypesClient/list_locations.php deleted file mode 100644 index 83342535fab3..000000000000 --- a/owl-bot-staging/Dialogflow/v2/samples/V2/SessionEntityTypesClient/list_locations.php +++ /dev/null @@ -1,62 +0,0 @@ -listLocations($request); - - /** @var Location $element */ - foreach ($response as $element) { - printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString()); - } - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} -// [END dialogflow_v2_generated_SessionEntityTypes_ListLocations_sync] diff --git a/owl-bot-staging/Dialogflow/v2/samples/V2/SessionEntityTypesClient/list_session_entity_types.php b/owl-bot-staging/Dialogflow/v2/samples/V2/SessionEntityTypesClient/list_session_entity_types.php deleted file mode 100644 index e777cf8ec9b6..000000000000 --- a/owl-bot-staging/Dialogflow/v2/samples/V2/SessionEntityTypesClient/list_session_entity_types.php +++ /dev/null @@ -1,85 +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(); - - // Prepare the request message. - $request = (new ListSessionEntityTypesRequest()) - ->setParent($formattedParent); - - // Call the API and handle any network failures. - try { - /** @var PagedListResponse $response */ - $response = $sessionEntityTypesClient->listSessionEntityTypes($request); - - /** @var SessionEntityType $element */ - foreach ($response as $element) { - printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString()); - } - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} - -/** - * Helper to execute the sample. - * - * This sample has been automatically generated and should be regarded as a code - * template only. It will require modifications to work: - * - It may require correct/in-range values for request initialization. - * - It may require specifying regional endpoints when creating the service client, - * please see the apiEndpoint client configuration option for more details. - */ -function callSample(): void -{ - $formattedParent = SessionEntityTypesClient::sessionName('[PROJECT]', '[SESSION]'); - - list_session_entity_types_sample($formattedParent); -} -// [END dialogflow_v2_generated_SessionEntityTypes_ListSessionEntityTypes_sync] diff --git a/owl-bot-staging/Dialogflow/v2/samples/V2/SessionEntityTypesClient/update_session_entity_type.php b/owl-bot-staging/Dialogflow/v2/samples/V2/SessionEntityTypesClient/update_session_entity_type.php deleted file mode 100644 index dba3d72c969c..000000000000 --- a/owl-bot-staging/Dialogflow/v2/samples/V2/SessionEntityTypesClient/update_session_entity_type.php +++ /dev/null @@ -1,127 +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 the request message. - $sessionEntityTypeEntitiesSynonyms = [$sessionEntityTypeEntitiesSynonymsElement,]; - $entity = (new Entity()) - ->setValue($sessionEntityTypeEntitiesValue) - ->setSynonyms($sessionEntityTypeEntitiesSynonyms); - $sessionEntityTypeEntities = [$entity,]; - $sessionEntityType = (new SessionEntityType()) - ->setName($sessionEntityTypeName) - ->setEntityOverrideMode($sessionEntityTypeEntityOverrideMode) - ->setEntities($sessionEntityTypeEntities); - $request = (new UpdateSessionEntityTypeRequest()) - ->setSessionEntityType($sessionEntityType); - - // Call the API and handle any network failures. - try { - /** @var SessionEntityType $response */ - $response = $sessionEntityTypesClient->updateSessionEntityType($request); - printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} - -/** - * Helper to execute the sample. - * - * This sample has been automatically generated and should be regarded as a code - * template only. It will require modifications to work: - * - It may require correct/in-range values for request initialization. - * - It may require specifying regional endpoints when creating the service client, - * please see the apiEndpoint client configuration option for more details. - */ -function callSample(): void -{ - $sessionEntityTypeName = '[NAME]'; - $sessionEntityTypeEntityOverrideMode = EntityOverrideMode::ENTITY_OVERRIDE_MODE_UNSPECIFIED; - $sessionEntityTypeEntitiesValue = '[VALUE]'; - $sessionEntityTypeEntitiesSynonymsElement = '[SYNONYMS]'; - - update_session_entity_type_sample( - $sessionEntityTypeName, - $sessionEntityTypeEntityOverrideMode, - $sessionEntityTypeEntitiesValue, - $sessionEntityTypeEntitiesSynonymsElement - ); -} -// [END dialogflow_v2_generated_SessionEntityTypes_UpdateSessionEntityType_sync] diff --git a/owl-bot-staging/Dialogflow/v2/samples/V2/SessionsClient/detect_intent.php b/owl-bot-staging/Dialogflow/v2/samples/V2/SessionsClient/detect_intent.php deleted file mode 100644 index de8d2c6f8ecd..000000000000 --- a/owl-bot-staging/Dialogflow/v2/samples/V2/SessionsClient/detect_intent.php +++ /dev/null @@ -1,104 +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 the request message. - $queryInput = new QueryInput(); - $request = (new DetectIntentRequest()) - ->setSession($formattedSession) - ->setQueryInput($queryInput); - - // Call the API and handle any network failures. - try { - /** @var DetectIntentResponse $response */ - $response = $sessionsClient->detectIntent($request); - printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} - -/** - * Helper to execute the sample. - * - * This sample has been automatically generated and should be regarded as a code - * template only. It will require modifications to work: - * - It may require correct/in-range values for request initialization. - * - It may require specifying regional endpoints when creating the service client, - * please see the apiEndpoint client configuration option for more details. - */ -function callSample(): void -{ - $formattedSession = SessionsClient::sessionName('[PROJECT]', '[SESSION]'); - - detect_intent_sample($formattedSession); -} -// [END dialogflow_v2_generated_Sessions_DetectIntent_sync] diff --git a/owl-bot-staging/Dialogflow/v2/samples/V2/SessionsClient/get_location.php b/owl-bot-staging/Dialogflow/v2/samples/V2/SessionsClient/get_location.php deleted file mode 100644 index e6b03e26b4d8..000000000000 --- a/owl-bot-staging/Dialogflow/v2/samples/V2/SessionsClient/get_location.php +++ /dev/null @@ -1,57 +0,0 @@ -getLocation($request); - printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} -// [END dialogflow_v2_generated_Sessions_GetLocation_sync] diff --git a/owl-bot-staging/Dialogflow/v2/samples/V2/SessionsClient/list_locations.php b/owl-bot-staging/Dialogflow/v2/samples/V2/SessionsClient/list_locations.php deleted file mode 100644 index e0ccfedb46cc..000000000000 --- a/owl-bot-staging/Dialogflow/v2/samples/V2/SessionsClient/list_locations.php +++ /dev/null @@ -1,62 +0,0 @@ -listLocations($request); - - /** @var Location $element */ - foreach ($response as $element) { - printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString()); - } - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} -// [END dialogflow_v2_generated_Sessions_ListLocations_sync] diff --git a/owl-bot-staging/Dialogflow/v2/samples/V2/SessionsClient/streaming_detect_intent.php b/owl-bot-staging/Dialogflow/v2/samples/V2/SessionsClient/streaming_detect_intent.php deleted file mode 100644 index 784c55b77a3b..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 the request message. - $queryInput = new QueryInput(); - $request = (new StreamingDetectIntentRequest()) - ->setSession($formattedSession) - ->setQueryInput($queryInput); - - // Call the API and handle any network failures. - try { - /** @var BidiStream $stream */ - $stream = $sessionsClient->streamingDetectIntent(); - $stream->writeAll([$request,]); - - /** @var StreamingDetectIntentResponse $element */ - foreach ($stream->closeWriteAndReadAll() as $element) { - printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString()); - } - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} - -/** - * Helper to execute the sample. - * - * This sample has been automatically generated and should be regarded as a code - * template only. It will require modifications to work: - * - It may require correct/in-range values for request initialization. - * - It may require specifying regional endpoints when creating the service client, - * please see the apiEndpoint client configuration option for more details. - */ -function callSample(): void -{ - $formattedSession = SessionsClient::sessionName('[PROJECT]', '[SESSION]'); - - streaming_detect_intent_sample($formattedSession); -} -// [END dialogflow_v2_generated_Sessions_StreamingDetectIntent_sync] diff --git a/owl-bot-staging/Dialogflow/v2/samples/V2/VersionsClient/create_version.php b/owl-bot-staging/Dialogflow/v2/samples/V2/VersionsClient/create_version.php deleted file mode 100644 index b52e31d7088d..000000000000 --- a/owl-bot-staging/Dialogflow/v2/samples/V2/VersionsClient/create_version.php +++ /dev/null @@ -1,79 +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 the request message. - $version = new Version(); - $request = (new CreateVersionRequest()) - ->setParent($formattedParent) - ->setVersion($version); - - // Call the API and handle any network failures. - try { - /** @var Version $response */ - $response = $versionsClient->createVersion($request); - printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} - -/** - * Helper to execute the sample. - * - * This sample has been automatically generated and should be regarded as a code - * template only. It will require modifications to work: - * - It may require correct/in-range values for request initialization. - * - It may require specifying regional endpoints when creating the service client, - * please see the apiEndpoint client configuration option for more details. - */ -function callSample(): void -{ - $formattedParent = VersionsClient::agentName('[PROJECT]'); - - create_version_sample($formattedParent); -} -// [END dialogflow_v2_generated_Versions_CreateVersion_sync] diff --git a/owl-bot-staging/Dialogflow/v2/samples/V2/VersionsClient/delete_version.php b/owl-bot-staging/Dialogflow/v2/samples/V2/VersionsClient/delete_version.php deleted file mode 100644 index 51810e52ef2b..000000000000 --- a/owl-bot-staging/Dialogflow/v2/samples/V2/VersionsClient/delete_version.php +++ /dev/null @@ -1,74 +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(); - - // Prepare the request message. - $request = (new DeleteVersionRequest()) - ->setName($formattedName); - - // Call the API and handle any network failures. - try { - $versionsClient->deleteVersion($request); - printf('Call completed successfully.' . PHP_EOL); - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} - -/** - * Helper to execute the sample. - * - * This sample has been automatically generated and should be regarded as a code - * template only. It will require modifications to work: - * - It may require correct/in-range values for request initialization. - * - It may require specifying regional endpoints when creating the service client, - * please see the apiEndpoint client configuration option for more details. - */ -function callSample(): void -{ - $formattedName = VersionsClient::versionName('[PROJECT]', '[VERSION]'); - - delete_version_sample($formattedName); -} -// [END dialogflow_v2_generated_Versions_DeleteVersion_sync] diff --git a/owl-bot-staging/Dialogflow/v2/samples/V2/VersionsClient/get_location.php b/owl-bot-staging/Dialogflow/v2/samples/V2/VersionsClient/get_location.php deleted file mode 100644 index 2a3a70d0bd2e..000000000000 --- a/owl-bot-staging/Dialogflow/v2/samples/V2/VersionsClient/get_location.php +++ /dev/null @@ -1,57 +0,0 @@ -getLocation($request); - printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} -// [END dialogflow_v2_generated_Versions_GetLocation_sync] diff --git a/owl-bot-staging/Dialogflow/v2/samples/V2/VersionsClient/get_version.php b/owl-bot-staging/Dialogflow/v2/samples/V2/VersionsClient/get_version.php deleted file mode 100644 index fdc635a6c1d1..000000000000 --- a/owl-bot-staging/Dialogflow/v2/samples/V2/VersionsClient/get_version.php +++ /dev/null @@ -1,76 +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(); - - // Prepare the request message. - $request = (new GetVersionRequest()) - ->setName($formattedName); - - // Call the API and handle any network failures. - try { - /** @var Version $response */ - $response = $versionsClient->getVersion($request); - printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} - -/** - * Helper to execute the sample. - * - * This sample has been automatically generated and should be regarded as a code - * template only. It will require modifications to work: - * - It may require correct/in-range values for request initialization. - * - It may require specifying regional endpoints when creating the service client, - * please see the apiEndpoint client configuration option for more details. - */ -function callSample(): void -{ - $formattedName = VersionsClient::versionName('[PROJECT]', '[VERSION]'); - - get_version_sample($formattedName); -} -// [END dialogflow_v2_generated_Versions_GetVersion_sync] diff --git a/owl-bot-staging/Dialogflow/v2/samples/V2/VersionsClient/list_locations.php b/owl-bot-staging/Dialogflow/v2/samples/V2/VersionsClient/list_locations.php deleted file mode 100644 index ae96aa834904..000000000000 --- a/owl-bot-staging/Dialogflow/v2/samples/V2/VersionsClient/list_locations.php +++ /dev/null @@ -1,62 +0,0 @@ -listLocations($request); - - /** @var Location $element */ - foreach ($response as $element) { - printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString()); - } - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} -// [END dialogflow_v2_generated_Versions_ListLocations_sync] diff --git a/owl-bot-staging/Dialogflow/v2/samples/V2/VersionsClient/list_versions.php b/owl-bot-staging/Dialogflow/v2/samples/V2/VersionsClient/list_versions.php deleted file mode 100644 index 72bc7027b63b..000000000000 --- a/owl-bot-staging/Dialogflow/v2/samples/V2/VersionsClient/list_versions.php +++ /dev/null @@ -1,80 +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(); - - // Prepare the request message. - $request = (new ListVersionsRequest()) - ->setParent($formattedParent); - - // Call the API and handle any network failures. - try { - /** @var PagedListResponse $response */ - $response = $versionsClient->listVersions($request); - - /** @var Version $element */ - foreach ($response as $element) { - printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString()); - } - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} - -/** - * Helper to execute the sample. - * - * This sample has been automatically generated and should be regarded as a code - * template only. It will require modifications to work: - * - It may require correct/in-range values for request initialization. - * - It may require specifying regional endpoints when creating the service client, - * please see the apiEndpoint client configuration option for more details. - */ -function callSample(): void -{ - $formattedParent = VersionsClient::agentName('[PROJECT]'); - - list_versions_sample($formattedParent); -} -// [END dialogflow_v2_generated_Versions_ListVersions_sync] diff --git a/owl-bot-staging/Dialogflow/v2/samples/V2/VersionsClient/update_version.php b/owl-bot-staging/Dialogflow/v2/samples/V2/VersionsClient/update_version.php deleted file mode 100644 index a67372ff48b5..000000000000 --- a/owl-bot-staging/Dialogflow/v2/samples/V2/VersionsClient/update_version.php +++ /dev/null @@ -1,66 +0,0 @@ -setVersion($version) - ->setUpdateMask($updateMask); - - // Call the API and handle any network failures. - try { - /** @var Version $response */ - $response = $versionsClient->updateVersion($request); - printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} -// [END dialogflow_v2_generated_Versions_UpdateVersion_sync] diff --git a/owl-bot-staging/Dialogflow/v2/src/V2/AgentsClient.php b/owl-bot-staging/Dialogflow/v2/src/V2/AgentsClient.php deleted file mode 100644 index 56409c3c99e8..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 AgentsClient::deleteAgentAsync()} . - * - * @example samples/V2/AgentsClient/delete_agent.php - * - * @param DeleteAgentRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @throws ApiException Thrown if the API call fails. - */ - public function deleteAgent(DeleteAgentRequest $request, array $callOptions = []): void - { - $this->startApiCall('DeleteAgent', $request, $callOptions)->wait(); - } - - /** - * Exports the specified agent to a ZIP file. - * - * This method is a [long-running - * operation](https://cloud.google.com/dialogflow/es/docs/how/long-running-operations). - * The returned `Operation` type has the following method-specific fields: - * - * - `metadata`: An empty [Struct - * message](https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#struct) - * - `response`: - * [ExportAgentResponse][google.cloud.dialogflow.v2.ExportAgentResponse] - * - * The async variant is {@see AgentsClient::exportAgentAsync()} . - * - * @example samples/V2/AgentsClient/export_agent.php - * - * @param ExportAgentRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return OperationResponse - * - * @throws ApiException Thrown if the API call fails. - */ - public function exportAgent(ExportAgentRequest $request, array $callOptions = []): OperationResponse - { - return $this->startApiCall('ExportAgent', $request, $callOptions)->wait(); - } - - /** - * Retrieves the specified agent. - * - * The async variant is {@see AgentsClient::getAgentAsync()} . - * - * @example samples/V2/AgentsClient/get_agent.php - * - * @param GetAgentRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return Agent - * - * @throws ApiException Thrown if the API call fails. - */ - public function getAgent(GetAgentRequest $request, array $callOptions = []): Agent - { - return $this->startApiCall('GetAgent', $request, $callOptions)->wait(); - } - - /** - * Gets agent validation result. Agent validation is performed during - * training time and is updated automatically when training is completed. - * - * The async variant is {@see AgentsClient::getValidationResultAsync()} . - * - * @example samples/V2/AgentsClient/get_validation_result.php - * - * @param GetValidationResultRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return ValidationResult - * - * @throws ApiException Thrown if the API call fails. - */ - public function getValidationResult(GetValidationResultRequest $request, array $callOptions = []): ValidationResult - { - return $this->startApiCall('GetValidationResult', $request, $callOptions)->wait(); - } - - /** - * Imports the specified agent from a ZIP file. - * - * Uploads new intents and entity types without deleting the existing ones. - * Intents and entity types with the same name are replaced with the new - * versions from - * [ImportAgentRequest][google.cloud.dialogflow.v2.ImportAgentRequest]. After - * the import, the imported draft agent will be trained automatically (unless - * disabled in agent settings). However, once the import is done, training may - * not be completed yet. Please call - * [TrainAgent][google.cloud.dialogflow.v2.Agents.TrainAgent] and wait for the - * operation it returns in order to train explicitly. - * - * This method is a [long-running - * operation](https://cloud.google.com/dialogflow/es/docs/how/long-running-operations). - * The returned `Operation` type has the following method-specific fields: - * - * - `metadata`: An empty [Struct - * message](https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#struct) - * - `response`: An [Empty - * message](https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#empty) - * - * The operation only tracks when importing is complete, not when it is done - * training. - * - * Note: You should always train an agent prior to sending it queries. See the - * [training - * documentation](https://cloud.google.com/dialogflow/es/docs/training). - * - * The async variant is {@see AgentsClient::importAgentAsync()} . - * - * @example samples/V2/AgentsClient/import_agent.php - * - * @param ImportAgentRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return OperationResponse - * - * @throws ApiException Thrown if the API call fails. - */ - public function importAgent(ImportAgentRequest $request, array $callOptions = []): OperationResponse - { - return $this->startApiCall('ImportAgent', $request, $callOptions)->wait(); - } - - /** - * Restores the specified agent from a ZIP file. - * - * Replaces the current agent version with a new one. All the intents and - * entity types in the older version are deleted. After the restore, the - * restored draft agent will be trained automatically (unless disabled in - * agent settings). However, once the restore is done, training may not be - * completed yet. Please call - * [TrainAgent][google.cloud.dialogflow.v2.Agents.TrainAgent] and wait for the - * operation it returns in order to train explicitly. - * - * This method is a [long-running - * operation](https://cloud.google.com/dialogflow/es/docs/how/long-running-operations). - * The returned `Operation` type has the following method-specific fields: - * - * - `metadata`: An empty [Struct - * message](https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#struct) - * - `response`: An [Empty - * message](https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#empty) - * - * The operation only tracks when restoring is complete, not when it is done - * training. - * - * Note: You should always train an agent prior to sending it queries. See the - * [training - * documentation](https://cloud.google.com/dialogflow/es/docs/training). - * - * The async variant is {@see AgentsClient::restoreAgentAsync()} . - * - * @example samples/V2/AgentsClient/restore_agent.php - * - * @param RestoreAgentRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return OperationResponse - * - * @throws ApiException Thrown if the API call fails. - */ - public function restoreAgent(RestoreAgentRequest $request, array $callOptions = []): OperationResponse - { - return $this->startApiCall('RestoreAgent', $request, $callOptions)->wait(); - } - - /** - * Returns the list of agents. - * - * Since there is at most one conversational agent per project, this method is - * useful primarily for listing all agents across projects the caller has - * access to. One can achieve that with a wildcard project collection id "-". - * Refer to [List - * Sub-Collections](https://cloud.google.com/apis/design/design_patterns#list_sub-collections). - * - * The async variant is {@see AgentsClient::searchAgentsAsync()} . - * - * @example samples/V2/AgentsClient/search_agents.php - * - * @param SearchAgentsRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return PagedListResponse - * - * @throws ApiException Thrown if the API call fails. - */ - public function searchAgents(SearchAgentsRequest $request, array $callOptions = []): PagedListResponse - { - return $this->startApiCall('SearchAgents', $request, $callOptions); - } - - /** - * Creates/updates the specified agent. - * - * Note: You should always train an agent prior to sending it queries. See the - * [training - * documentation](https://cloud.google.com/dialogflow/es/docs/training). - * - * The async variant is {@see AgentsClient::setAgentAsync()} . - * - * @example samples/V2/AgentsClient/set_agent.php - * - * @param SetAgentRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return Agent - * - * @throws ApiException Thrown if the API call fails. - */ - public function setAgent(SetAgentRequest $request, array $callOptions = []): Agent - { - return $this->startApiCall('SetAgent', $request, $callOptions)->wait(); - } - - /** - * Trains the specified agent. - * - * This method is a [long-running - * operation](https://cloud.google.com/dialogflow/es/docs/how/long-running-operations). - * The returned `Operation` type has the following method-specific fields: - * - * - `metadata`: An empty [Struct - * message](https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#struct) - * - `response`: An [Empty - * message](https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#empty) - * - * Note: You should always train an agent prior to sending it queries. See the - * [training - * documentation](https://cloud.google.com/dialogflow/es/docs/training). - * - * The async variant is {@see AgentsClient::trainAgentAsync()} . - * - * @example samples/V2/AgentsClient/train_agent.php - * - * @param TrainAgentRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return OperationResponse - * - * @throws ApiException Thrown if the API call fails. - */ - public function trainAgent(TrainAgentRequest $request, array $callOptions = []): OperationResponse - { - return $this->startApiCall('TrainAgent', $request, $callOptions)->wait(); - } - - /** - * Gets information about a location. - * - * The async variant is {@see AgentsClient::getLocationAsync()} . - * - * @example samples/V2/AgentsClient/get_location.php - * - * @param GetLocationRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return Location - * - * @throws ApiException Thrown if the API call fails. - */ - public function getLocation(GetLocationRequest $request, array $callOptions = []): Location - { - return $this->startApiCall('GetLocation', $request, $callOptions)->wait(); - } - - /** - * Lists information about the supported locations for this service. - * - * The async variant is {@see AgentsClient::listLocationsAsync()} . - * - * @example samples/V2/AgentsClient/list_locations.php - * - * @param ListLocationsRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return PagedListResponse - * - * @throws ApiException Thrown if the API call fails. - */ - public function listLocations(ListLocationsRequest $request, array $callOptions = []): PagedListResponse - { - return $this->startApiCall('ListLocations', $request, $callOptions); - } -} diff --git a/owl-bot-staging/Dialogflow/v2/src/V2/Client/AnswerRecordsClient.php b/owl-bot-staging/Dialogflow/v2/src/V2/Client/AnswerRecordsClient.php deleted file mode 100644 index f228a3e5ca51..000000000000 --- a/owl-bot-staging/Dialogflow/v2/src/V2/Client/AnswerRecordsClient.php +++ /dev/null @@ -1,718 +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 agent - * resource. - * - * @param string $project - * - * @return string The formatted agent resource. - */ - public static function agentName(string $project): string - { - return self::getPathTemplate('agent')->render([ - 'project' => $project, - ]); - } - - /** - * Formats a string containing the fully-qualified path to represent a - * answer_record resource. - * - * @param string $project - * @param string $answerRecord - * - * @return string The formatted answer_record resource. - */ - public static function answerRecordName(string $project, string $answerRecord): string - { - return self::getPathTemplate('answerRecord')->render([ - 'project' => $project, - 'answer_record' => $answerRecord, - ]); - } - - /** - * Formats a string containing the fully-qualified path to represent a context - * resource. - * - * @param string $project - * @param string $session - * @param string $context - * - * @return string The formatted context resource. - */ - public static function contextName(string $project, string $session, string $context): string - { - return self::getPathTemplate('context')->render([ - 'project' => $project, - 'session' => $session, - 'context' => $context, - ]); - } - - /** - * Formats a string containing the fully-qualified path to represent a intent - * resource. - * - * @param string $project - * @param string $intent - * - * @return string The formatted intent resource. - */ - public static function intentName(string $project, string $intent): string - { - return self::getPathTemplate('intent')->render([ - 'project' => $project, - 'intent' => $intent, - ]); - } - - /** - * Formats a string containing the fully-qualified path to represent a location - * resource. - * - * @param string $project - * @param string $location - * - * @return string The formatted location resource. - */ - public static function locationName(string $project, string $location): string - { - return self::getPathTemplate('location')->render([ - 'project' => $project, - 'location' => $location, - ]); - } - - /** - * Formats a string containing the fully-qualified path to represent a project - * resource. - * - * @param string $project - * - * @return string The formatted project resource. - */ - public static function projectName(string $project): string - { - return self::getPathTemplate('project')->render([ - 'project' => $project, - ]); - } - - /** - * Formats a string containing the fully-qualified path to represent a - * project_agent resource. - * - * @param string $project - * - * @return string The formatted project_agent resource. - */ - public static function projectAgentName(string $project): string - { - return self::getPathTemplate('projectAgent')->render([ - 'project' => $project, - ]); - } - - /** - * Formats a string containing the fully-qualified path to represent a - * project_answer_record resource. - * - * @param string $project - * @param string $answerRecord - * - * @return string The formatted project_answer_record resource. - */ - public static function projectAnswerRecordName(string $project, string $answerRecord): string - { - return self::getPathTemplate('projectAnswerRecord')->render([ - 'project' => $project, - 'answer_record' => $answerRecord, - ]); - } - - /** - * Formats a string containing the fully-qualified path to represent a - * project_environment_user_session resource. - * - * @param string $project - * @param string $environment - * @param string $user - * @param string $session - * - * @return string The formatted project_environment_user_session resource. - */ - public static function projectEnvironmentUserSessionName(string $project, string $environment, string $user, string $session): string - { - return self::getPathTemplate('projectEnvironmentUserSession')->render([ - 'project' => $project, - 'environment' => $environment, - 'user' => $user, - 'session' => $session, - ]); - } - - /** - * Formats a string containing the fully-qualified path to represent a - * project_environment_user_session_context resource. - * - * @param string $project - * @param string $environment - * @param string $user - * @param string $session - * @param string $context - * - * @return string The formatted project_environment_user_session_context resource. - */ - public static function projectEnvironmentUserSessionContextName(string $project, string $environment, string $user, string $session, string $context): string - { - return self::getPathTemplate('projectEnvironmentUserSessionContext')->render([ - 'project' => $project, - 'environment' => $environment, - 'user' => $user, - 'session' => $session, - 'context' => $context, - ]); - } - - /** - * Formats a string containing the fully-qualified path to represent a - * project_intent resource. - * - * @param string $project - * @param string $intent - * - * @return string The formatted project_intent resource. - */ - public static function projectIntentName(string $project, string $intent): string - { - return self::getPathTemplate('projectIntent')->render([ - 'project' => $project, - 'intent' => $intent, - ]); - } - - /** - * Formats a string containing the fully-qualified path to represent a - * project_location_agent resource. - * - * @param string $project - * @param string $location - * - * @return string The formatted project_location_agent resource. - */ - public static function projectLocationAgentName(string $project, string $location): string - { - return self::getPathTemplate('projectLocationAgent')->render([ - 'project' => $project, - 'location' => $location, - ]); - } - - /** - * Formats a string containing the fully-qualified path to represent a - * project_location_answer_record resource. - * - * @param string $project - * @param string $location - * @param string $answerRecord - * - * @return string The formatted project_location_answer_record resource. - */ - public static function projectLocationAnswerRecordName(string $project, string $location, string $answerRecord): string - { - return self::getPathTemplate('projectLocationAnswerRecord')->render([ - 'project' => $project, - 'location' => $location, - 'answer_record' => $answerRecord, - ]); - } - - /** - * Formats a string containing the fully-qualified path to represent a - * project_location_environment_user_session resource. - * - * @param string $project - * @param string $location - * @param string $environment - * @param string $user - * @param string $session - * - * @return string The formatted project_location_environment_user_session resource. - */ - public static function projectLocationEnvironmentUserSessionName(string $project, string $location, string $environment, string $user, string $session): string - { - return self::getPathTemplate('projectLocationEnvironmentUserSession')->render([ - 'project' => $project, - 'location' => $location, - 'environment' => $environment, - 'user' => $user, - 'session' => $session, - ]); - } - - /** - * Formats a string containing the fully-qualified path to represent a - * project_location_environment_user_session_context resource. - * - * @param string $project - * @param string $location - * @param string $environment - * @param string $user - * @param string $session - * @param string $context - * - * @return string The formatted project_location_environment_user_session_context resource. - */ - public static function projectLocationEnvironmentUserSessionContextName(string $project, string $location, string $environment, string $user, string $session, string $context): string - { - return self::getPathTemplate('projectLocationEnvironmentUserSessionContext')->render([ - 'project' => $project, - 'location' => $location, - 'environment' => $environment, - 'user' => $user, - 'session' => $session, - 'context' => $context, - ]); - } - - /** - * Formats a string containing the fully-qualified path to represent a - * project_location_intent resource. - * - * @param string $project - * @param string $location - * @param string $intent - * - * @return string The formatted project_location_intent resource. - */ - public static function projectLocationIntentName(string $project, string $location, string $intent): string - { - return self::getPathTemplate('projectLocationIntent')->render([ - 'project' => $project, - 'location' => $location, - 'intent' => $intent, - ]); - } - - /** - * Formats a string containing the fully-qualified path to represent a - * project_location_session resource. - * - * @param string $project - * @param string $location - * @param string $session - * - * @return string The formatted project_location_session resource. - */ - public static function projectLocationSessionName(string $project, string $location, string $session): string - { - return self::getPathTemplate('projectLocationSession')->render([ - 'project' => $project, - 'location' => $location, - 'session' => $session, - ]); - } - - /** - * Formats a string containing the fully-qualified path to represent a - * project_location_session_context resource. - * - * @param string $project - * @param string $location - * @param string $session - * @param string $context - * - * @return string The formatted project_location_session_context resource. - */ - public static function projectLocationSessionContextName(string $project, string $location, string $session, string $context): string - { - return self::getPathTemplate('projectLocationSessionContext')->render([ - 'project' => $project, - 'location' => $location, - 'session' => $session, - 'context' => $context, - ]); - } - - /** - * Formats a string containing the fully-qualified path to represent a - * project_session resource. - * - * @param string $project - * @param string $session - * - * @return string The formatted project_session resource. - */ - public static function projectSessionName(string $project, string $session): string - { - return self::getPathTemplate('projectSession')->render([ - 'project' => $project, - 'session' => $session, - ]); - } - - /** - * Formats a string containing the fully-qualified path to represent a - * project_session_context resource. - * - * @param string $project - * @param string $session - * @param string $context - * - * @return string The formatted project_session_context resource. - */ - public static function projectSessionContextName(string $project, string $session, string $context): string - { - return self::getPathTemplate('projectSessionContext')->render([ - 'project' => $project, - 'session' => $session, - 'context' => $context, - ]); - } - - /** - * Formats a string containing the fully-qualified path to represent a session - * resource. - * - * @param string $project - * @param string $session - * - * @return string The formatted session resource. - */ - public static function sessionName(string $project, string $session): string - { - return self::getPathTemplate('session')->render([ - 'project' => $project, - 'session' => $session, - ]); - } - - /** - * Parses a formatted name string and returns an associative array of the components in the name. - * The following name formats are supported: - * Template: Pattern - * - agent: projects/{project}/agent - * - answerRecord: projects/{project}/answerRecords/{answer_record} - * - context: projects/{project}/agent/sessions/{session}/contexts/{context} - * - intent: projects/{project}/agent/intents/{intent} - * - location: projects/{project}/locations/{location} - * - project: projects/{project} - * - projectAgent: projects/{project}/agent - * - projectAnswerRecord: projects/{project}/answerRecords/{answer_record} - * - projectEnvironmentUserSession: projects/{project}/agent/environments/{environment}/users/{user}/sessions/{session} - * - projectEnvironmentUserSessionContext: projects/{project}/agent/environments/{environment}/users/{user}/sessions/{session}/contexts/{context} - * - projectIntent: projects/{project}/agent/intents/{intent} - * - projectLocationAgent: projects/{project}/locations/{location}/agent - * - projectLocationAnswerRecord: projects/{project}/locations/{location}/answerRecords/{answer_record} - * - projectLocationEnvironmentUserSession: projects/{project}/locations/{location}/agent/environments/{environment}/users/{user}/sessions/{session} - * - projectLocationEnvironmentUserSessionContext: projects/{project}/locations/{location}/agent/environments/{environment}/users/{user}/sessions/{session}/contexts/{context} - * - projectLocationIntent: projects/{project}/locations/{location}/agent/intents/{intent} - * - projectLocationSession: projects/{project}/locations/{location}/agent/sessions/{session} - * - projectLocationSessionContext: projects/{project}/locations/{location}/agent/sessions/{session}/contexts/{context} - * - projectSession: projects/{project}/agent/sessions/{session} - * - projectSessionContext: projects/{project}/agent/sessions/{session}/contexts/{context} - * - session: projects/{project}/agent/sessions/{session} - * - * 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 AnswerRecordsClient::listAnswerRecordsAsync()} . - * - * @example samples/V2/AnswerRecordsClient/list_answer_records.php - * - * @param ListAnswerRecordsRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return PagedListResponse - * - * @throws ApiException Thrown if the API call fails. - */ - public function listAnswerRecords(ListAnswerRecordsRequest $request, array $callOptions = []): PagedListResponse - { - return $this->startApiCall('ListAnswerRecords', $request, $callOptions); - } - - /** - * Updates the specified answer record. - * - * The async variant is {@see AnswerRecordsClient::updateAnswerRecordAsync()} . - * - * @example samples/V2/AnswerRecordsClient/update_answer_record.php - * - * @param UpdateAnswerRecordRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return AnswerRecord - * - * @throws ApiException Thrown if the API call fails. - */ - public function updateAnswerRecord(UpdateAnswerRecordRequest $request, array $callOptions = []): AnswerRecord - { - return $this->startApiCall('UpdateAnswerRecord', $request, $callOptions)->wait(); - } - - /** - * Gets information about a location. - * - * The async variant is {@see AnswerRecordsClient::getLocationAsync()} . - * - * @example samples/V2/AnswerRecordsClient/get_location.php - * - * @param GetLocationRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return Location - * - * @throws ApiException Thrown if the API call fails. - */ - public function getLocation(GetLocationRequest $request, array $callOptions = []): Location - { - return $this->startApiCall('GetLocation', $request, $callOptions)->wait(); - } - - /** - * Lists information about the supported locations for this service. - * - * The async variant is {@see AnswerRecordsClient::listLocationsAsync()} . - * - * @example samples/V2/AnswerRecordsClient/list_locations.php - * - * @param ListLocationsRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return PagedListResponse - * - * @throws ApiException Thrown if the API call fails. - */ - public function listLocations(ListLocationsRequest $request, array $callOptions = []): PagedListResponse - { - return $this->startApiCall('ListLocations', $request, $callOptions); - } -} diff --git a/owl-bot-staging/Dialogflow/v2/src/V2/Client/ContextsClient.php b/owl-bot-staging/Dialogflow/v2/src/V2/Client/ContextsClient.php deleted file mode 100644 index d49a60c2729e..000000000000 --- a/owl-bot-staging/Dialogflow/v2/src/V2/Client/ContextsClient.php +++ /dev/null @@ -1,630 +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 ContextsClient::createContextAsync()} . - * - * @example samples/V2/ContextsClient/create_context.php - * - * @param CreateContextRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return Context - * - * @throws ApiException Thrown if the API call fails. - */ - public function createContext(CreateContextRequest $request, array $callOptions = []): Context - { - return $this->startApiCall('CreateContext', $request, $callOptions)->wait(); - } - - /** - * Deletes all active contexts in the specified session. - * - * The async variant is {@see ContextsClient::deleteAllContextsAsync()} . - * - * @example samples/V2/ContextsClient/delete_all_contexts.php - * - * @param DeleteAllContextsRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @throws ApiException Thrown if the API call fails. - */ - public function deleteAllContexts(DeleteAllContextsRequest $request, array $callOptions = []): void - { - $this->startApiCall('DeleteAllContexts', $request, $callOptions)->wait(); - } - - /** - * Deletes the specified context. - * - * The async variant is {@see ContextsClient::deleteContextAsync()} . - * - * @example samples/V2/ContextsClient/delete_context.php - * - * @param DeleteContextRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @throws ApiException Thrown if the API call fails. - */ - public function deleteContext(DeleteContextRequest $request, array $callOptions = []): void - { - $this->startApiCall('DeleteContext', $request, $callOptions)->wait(); - } - - /** - * Retrieves the specified context. - * - * The async variant is {@see ContextsClient::getContextAsync()} . - * - * @example samples/V2/ContextsClient/get_context.php - * - * @param GetContextRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return Context - * - * @throws ApiException Thrown if the API call fails. - */ - public function getContext(GetContextRequest $request, array $callOptions = []): Context - { - return $this->startApiCall('GetContext', $request, $callOptions)->wait(); - } - - /** - * Returns the list of all contexts in the specified session. - * - * The async variant is {@see ContextsClient::listContextsAsync()} . - * - * @example samples/V2/ContextsClient/list_contexts.php - * - * @param ListContextsRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return PagedListResponse - * - * @throws ApiException Thrown if the API call fails. - */ - public function listContexts(ListContextsRequest $request, array $callOptions = []): PagedListResponse - { - return $this->startApiCall('ListContexts', $request, $callOptions); - } - - /** - * Updates the specified context. - * - * The async variant is {@see ContextsClient::updateContextAsync()} . - * - * @example samples/V2/ContextsClient/update_context.php - * - * @param UpdateContextRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return Context - * - * @throws ApiException Thrown if the API call fails. - */ - public function updateContext(UpdateContextRequest $request, array $callOptions = []): Context - { - return $this->startApiCall('UpdateContext', $request, $callOptions)->wait(); - } - - /** - * Gets information about a location. - * - * The async variant is {@see ContextsClient::getLocationAsync()} . - * - * @example samples/V2/ContextsClient/get_location.php - * - * @param GetLocationRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return Location - * - * @throws ApiException Thrown if the API call fails. - */ - public function getLocation(GetLocationRequest $request, array $callOptions = []): Location - { - return $this->startApiCall('GetLocation', $request, $callOptions)->wait(); - } - - /** - * Lists information about the supported locations for this service. - * - * The async variant is {@see ContextsClient::listLocationsAsync()} . - * - * @example samples/V2/ContextsClient/list_locations.php - * - * @param ListLocationsRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return PagedListResponse - * - * @throws ApiException Thrown if the API call fails. - */ - public function listLocations(ListLocationsRequest $request, array $callOptions = []): PagedListResponse - { - return $this->startApiCall('ListLocations', $request, $callOptions); - } -} diff --git a/owl-bot-staging/Dialogflow/v2/src/V2/Client/ConversationDatasetsClient.php b/owl-bot-staging/Dialogflow/v2/src/V2/Client/ConversationDatasetsClient.php deleted file mode 100644 index 6002f4ac4287..000000000000 --- a/owl-bot-staging/Dialogflow/v2/src/V2/Client/ConversationDatasetsClient.php +++ /dev/null @@ -1,505 +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 ConversationDatasetsClient::createConversationDatasetAsync()} . - * - * @example samples/V2/ConversationDatasetsClient/create_conversation_dataset.php - * - * @param CreateConversationDatasetRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return OperationResponse - * - * @throws ApiException Thrown if the API call fails. - */ - public function createConversationDataset(CreateConversationDatasetRequest $request, array $callOptions = []): OperationResponse - { - return $this->startApiCall('CreateConversationDataset', $request, $callOptions)->wait(); - } - - /** - * Deletes the specified conversation dataset. - * - * This method is a [long-running - * operation](https://cloud.google.com/dialogflow/es/docs/how/long-running-operations). - * The returned `Operation` type has the following method-specific fields: - * - * - `metadata`: - * [DeleteConversationDatasetOperationMetadata][google.cloud.dialogflow.v2.DeleteConversationDatasetOperationMetadata] - * - `response`: An [Empty - * message](https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#empty) - * - * The async variant is - * {@see ConversationDatasetsClient::deleteConversationDatasetAsync()} . - * - * @example samples/V2/ConversationDatasetsClient/delete_conversation_dataset.php - * - * @param DeleteConversationDatasetRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return OperationResponse - * - * @throws ApiException Thrown if the API call fails. - */ - public function deleteConversationDataset(DeleteConversationDatasetRequest $request, array $callOptions = []): OperationResponse - { - return $this->startApiCall('DeleteConversationDataset', $request, $callOptions)->wait(); - } - - /** - * Retrieves the specified conversation dataset. - * - * The async variant is - * {@see ConversationDatasetsClient::getConversationDatasetAsync()} . - * - * @example samples/V2/ConversationDatasetsClient/get_conversation_dataset.php - * - * @param GetConversationDatasetRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return ConversationDataset - * - * @throws ApiException Thrown if the API call fails. - */ - public function getConversationDataset(GetConversationDatasetRequest $request, array $callOptions = []): ConversationDataset - { - return $this->startApiCall('GetConversationDataset', $request, $callOptions)->wait(); - } - - /** - * Import data into the specified conversation dataset. Note that it - * is not allowed to import data to a conversation dataset that - * already has data in it. - * - * This method is a [long-running - * operation](https://cloud.google.com/dialogflow/es/docs/how/long-running-operations). - * The returned `Operation` type has the following method-specific fields: - * - * - `metadata`: - * [ImportConversationDataOperationMetadata][google.cloud.dialogflow.v2.ImportConversationDataOperationMetadata] - * - `response`: - * [ImportConversationDataOperationResponse][google.cloud.dialogflow.v2.ImportConversationDataOperationResponse] - * - * The async variant is - * {@see ConversationDatasetsClient::importConversationDataAsync()} . - * - * @example samples/V2/ConversationDatasetsClient/import_conversation_data.php - * - * @param ImportConversationDataRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return OperationResponse - * - * @throws ApiException Thrown if the API call fails. - */ - public function importConversationData(ImportConversationDataRequest $request, array $callOptions = []): OperationResponse - { - return $this->startApiCall('ImportConversationData', $request, $callOptions)->wait(); - } - - /** - * Returns the list of all conversation datasets in the specified - * project and location. - * - * The async variant is - * {@see ConversationDatasetsClient::listConversationDatasetsAsync()} . - * - * @example samples/V2/ConversationDatasetsClient/list_conversation_datasets.php - * - * @param ListConversationDatasetsRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return PagedListResponse - * - * @throws ApiException Thrown if the API call fails. - */ - public function listConversationDatasets(ListConversationDatasetsRequest $request, array $callOptions = []): PagedListResponse - { - return $this->startApiCall('ListConversationDatasets', $request, $callOptions); - } - - /** - * Gets information about a location. - * - * The async variant is {@see ConversationDatasetsClient::getLocationAsync()} . - * - * @example samples/V2/ConversationDatasetsClient/get_location.php - * - * @param GetLocationRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return Location - * - * @throws ApiException Thrown if the API call fails. - */ - public function getLocation(GetLocationRequest $request, array $callOptions = []): Location - { - return $this->startApiCall('GetLocation', $request, $callOptions)->wait(); - } - - /** - * Lists information about the supported locations for this service. - * - * The async variant is {@see ConversationDatasetsClient::listLocationsAsync()} . - * - * @example samples/V2/ConversationDatasetsClient/list_locations.php - * - * @param ListLocationsRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return PagedListResponse - * - * @throws ApiException Thrown if the API call fails. - */ - public function listLocations(ListLocationsRequest $request, array $callOptions = []): PagedListResponse - { - return $this->startApiCall('ListLocations', $request, $callOptions); - } -} diff --git a/owl-bot-staging/Dialogflow/v2/src/V2/Client/ConversationModelsClient.php b/owl-bot-staging/Dialogflow/v2/src/V2/Client/ConversationModelsClient.php deleted file mode 100644 index 39d7ae400931..000000000000 --- a/owl-bot-staging/Dialogflow/v2/src/V2/Client/ConversationModelsClient.php +++ /dev/null @@ -1,795 +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 ConversationModelsClient::createConversationModelAsync()} . - * - * @example samples/V2/ConversationModelsClient/create_conversation_model.php - * - * @param CreateConversationModelRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return OperationResponse - * - * @throws ApiException Thrown if the API call fails. - */ - public function createConversationModel(CreateConversationModelRequest $request, array $callOptions = []): OperationResponse - { - return $this->startApiCall('CreateConversationModel', $request, $callOptions)->wait(); - } - - /** - * Creates evaluation of a conversation model. - * - * The async variant is - * {@see ConversationModelsClient::createConversationModelEvaluationAsync()} . - * - * @example samples/V2/ConversationModelsClient/create_conversation_model_evaluation.php - * - * @param CreateConversationModelEvaluationRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return OperationResponse - * - * @throws ApiException Thrown if the API call fails. - */ - public function createConversationModelEvaluation(CreateConversationModelEvaluationRequest $request, array $callOptions = []): OperationResponse - { - return $this->startApiCall('CreateConversationModelEvaluation', $request, $callOptions)->wait(); - } - - /** - * Deletes a model. - * - * This method is a [long-running - * operation](https://cloud.google.com/dialogflow/es/docs/how/long-running-operations). - * The returned `Operation` type has the following method-specific fields: - * - * - `metadata`: - * [DeleteConversationModelOperationMetadata][google.cloud.dialogflow.v2.DeleteConversationModelOperationMetadata] - * - `response`: An [Empty - * message](https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#empty) - * - * The async variant is - * {@see ConversationModelsClient::deleteConversationModelAsync()} . - * - * @example samples/V2/ConversationModelsClient/delete_conversation_model.php - * - * @param DeleteConversationModelRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return OperationResponse - * - * @throws ApiException Thrown if the API call fails. - */ - public function deleteConversationModel(DeleteConversationModelRequest $request, array $callOptions = []): OperationResponse - { - return $this->startApiCall('DeleteConversationModel', $request, $callOptions)->wait(); - } - - /** - * Deploys a model. If a model is already deployed, deploying it - * has no effect. A model can only serve prediction requests after it gets - * deployed. For article suggestion, custom model will not be used unless - * it is deployed. - * - * This method is a [long-running - * operation](https://cloud.google.com/dialogflow/es/docs/how/long-running-operations). - * The returned `Operation` type has the following method-specific fields: - * - * - `metadata`: - * [DeployConversationModelOperationMetadata][google.cloud.dialogflow.v2.DeployConversationModelOperationMetadata] - * - `response`: An [Empty - * message](https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#empty) - * - * The async variant is - * {@see ConversationModelsClient::deployConversationModelAsync()} . - * - * @example samples/V2/ConversationModelsClient/deploy_conversation_model.php - * - * @param DeployConversationModelRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return OperationResponse - * - * @throws ApiException Thrown if the API call fails. - */ - public function deployConversationModel(DeployConversationModelRequest $request, array $callOptions = []): OperationResponse - { - return $this->startApiCall('DeployConversationModel', $request, $callOptions)->wait(); - } - - /** - * Gets conversation model. - * - * The async variant is - * {@see ConversationModelsClient::getConversationModelAsync()} . - * - * @example samples/V2/ConversationModelsClient/get_conversation_model.php - * - * @param GetConversationModelRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return ConversationModel - * - * @throws ApiException Thrown if the API call fails. - */ - public function getConversationModel(GetConversationModelRequest $request, array $callOptions = []): ConversationModel - { - return $this->startApiCall('GetConversationModel', $request, $callOptions)->wait(); - } - - /** - * Gets an evaluation of conversation model. - * - * The async variant is - * {@see ConversationModelsClient::getConversationModelEvaluationAsync()} . - * - * @example samples/V2/ConversationModelsClient/get_conversation_model_evaluation.php - * - * @param GetConversationModelEvaluationRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return ConversationModelEvaluation - * - * @throws ApiException Thrown if the API call fails. - */ - public function getConversationModelEvaluation(GetConversationModelEvaluationRequest $request, array $callOptions = []): ConversationModelEvaluation - { - return $this->startApiCall('GetConversationModelEvaluation', $request, $callOptions)->wait(); - } - - /** - * Lists evaluations of a conversation model. - * - * The async variant is - * {@see ConversationModelsClient::listConversationModelEvaluationsAsync()} . - * - * @example samples/V2/ConversationModelsClient/list_conversation_model_evaluations.php - * - * @param ListConversationModelEvaluationsRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return PagedListResponse - * - * @throws ApiException Thrown if the API call fails. - */ - public function listConversationModelEvaluations(ListConversationModelEvaluationsRequest $request, array $callOptions = []): PagedListResponse - { - return $this->startApiCall('ListConversationModelEvaluations', $request, $callOptions); - } - - /** - * Lists conversation models. - * - * The async variant is - * {@see ConversationModelsClient::listConversationModelsAsync()} . - * - * @example samples/V2/ConversationModelsClient/list_conversation_models.php - * - * @param ListConversationModelsRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return PagedListResponse - * - * @throws ApiException Thrown if the API call fails. - */ - public function listConversationModels(ListConversationModelsRequest $request, array $callOptions = []): PagedListResponse - { - return $this->startApiCall('ListConversationModels', $request, $callOptions); - } - - /** - * Undeploys a model. If the model is not deployed this method has no effect. - * If the model is currently being used: - * - For article suggestion, article suggestion will fallback to the default - * model if model is undeployed. - * - * This method is a [long-running - * operation](https://cloud.google.com/dialogflow/es/docs/how/long-running-operations). - * The returned `Operation` type has the following method-specific fields: - * - * - `metadata`: - * [UndeployConversationModelOperationMetadata][google.cloud.dialogflow.v2.UndeployConversationModelOperationMetadata] - * - `response`: An [Empty - * message](https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#empty) - * - * The async variant is - * {@see ConversationModelsClient::undeployConversationModelAsync()} . - * - * @example samples/V2/ConversationModelsClient/undeploy_conversation_model.php - * - * @param UndeployConversationModelRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return OperationResponse - * - * @throws ApiException Thrown if the API call fails. - */ - public function undeployConversationModel(UndeployConversationModelRequest $request, array $callOptions = []): OperationResponse - { - return $this->startApiCall('UndeployConversationModel', $request, $callOptions)->wait(); - } - - /** - * Gets information about a location. - * - * The async variant is {@see ConversationModelsClient::getLocationAsync()} . - * - * @example samples/V2/ConversationModelsClient/get_location.php - * - * @param GetLocationRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return Location - * - * @throws ApiException Thrown if the API call fails. - */ - public function getLocation(GetLocationRequest $request, array $callOptions = []): Location - { - return $this->startApiCall('GetLocation', $request, $callOptions)->wait(); - } - - /** - * Lists information about the supported locations for this service. - * - * The async variant is {@see ConversationModelsClient::listLocationsAsync()} . - * - * @example samples/V2/ConversationModelsClient/list_locations.php - * - * @param ListLocationsRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return PagedListResponse - * - * @throws ApiException Thrown if the API call fails. - */ - public function listLocations(ListLocationsRequest $request, array $callOptions = []): PagedListResponse - { - return $this->startApiCall('ListLocations', $request, $callOptions); - } -} diff --git a/owl-bot-staging/Dialogflow/v2/src/V2/Client/ConversationProfilesClient.php b/owl-bot-staging/Dialogflow/v2/src/V2/Client/ConversationProfilesClient.php deleted file mode 100644 index f6e4a010a80b..000000000000 --- a/owl-bot-staging/Dialogflow/v2/src/V2/Client/ConversationProfilesClient.php +++ /dev/null @@ -1,882 +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 generator - * resource. - * - * @param string $project - * @param string $location - * @param string $generator - * - * @return string The formatted generator resource. - */ - public static function generatorName(string $project, string $location, string $generator): string - { - return self::getPathTemplate('generator')->render([ - 'project' => $project, - 'location' => $location, - 'generator' => $generator, - ]); - } - - /** - * Formats a string containing the fully-qualified path to represent a - * knowledge_base resource. - * - * @param string $project - * @param string $knowledgeBase - * - * @return string The formatted knowledge_base resource. - */ - public static function knowledgeBaseName(string $project, string $knowledgeBase): string - { - return self::getPathTemplate('knowledgeBase')->render([ - 'project' => $project, - 'knowledge_base' => $knowledgeBase, - ]); - } - - /** - * Formats a string containing the fully-qualified path to represent a location - * resource. - * - * @param string $project - * @param string $location - * - * @return string The formatted location resource. - */ - public static function locationName(string $project, string $location): string - { - return self::getPathTemplate('location')->render([ - 'project' => $project, - 'location' => $location, - ]); - } - - /** - * Formats a string containing the fully-qualified path to represent a project - * resource. - * - * @param string $project - * - * @return string The formatted project resource. - */ - public static function projectName(string $project): string - { - return self::getPathTemplate('project')->render([ - 'project' => $project, - ]); - } - - /** - * Formats a string containing the fully-qualified path to represent a - * project_agent resource. - * - * @param string $project - * - * @return string The formatted project_agent resource. - */ - public static function projectAgentName(string $project): string - { - return self::getPathTemplate('projectAgent')->render([ - 'project' => $project, - ]); - } - - /** - * Formats a string containing the fully-qualified path to represent a - * project_conversation_model resource. - * - * @param string $project - * @param string $conversationModel - * - * @return string The formatted project_conversation_model resource. - */ - public static function projectConversationModelName(string $project, string $conversationModel): string - { - return self::getPathTemplate('projectConversationModel')->render([ - 'project' => $project, - 'conversation_model' => $conversationModel, - ]); - } - - /** - * Formats a string containing the fully-qualified path to represent a - * project_conversation_profile resource. - * - * @param string $project - * @param string $conversationProfile - * - * @return string The formatted project_conversation_profile resource. - */ - public static function projectConversationProfileName(string $project, string $conversationProfile): string - { - return self::getPathTemplate('projectConversationProfile')->render([ - 'project' => $project, - 'conversation_profile' => $conversationProfile, - ]); - } - - /** - * Formats a string containing the fully-qualified path to represent a - * project_knowledge_base resource. - * - * @param string $project - * @param string $knowledgeBase - * - * @return string The formatted project_knowledge_base resource. - */ - public static function projectKnowledgeBaseName(string $project, string $knowledgeBase): string - { - return self::getPathTemplate('projectKnowledgeBase')->render([ - 'project' => $project, - 'knowledge_base' => $knowledgeBase, - ]); - } - - /** - * Formats a string containing the fully-qualified path to represent a - * project_knowledge_base_document resource. - * - * @param string $project - * @param string $knowledgeBase - * @param string $document - * - * @return string The formatted project_knowledge_base_document resource. - */ - public static function projectKnowledgeBaseDocumentName(string $project, string $knowledgeBase, string $document): string - { - return self::getPathTemplate('projectKnowledgeBaseDocument')->render([ - 'project' => $project, - 'knowledge_base' => $knowledgeBase, - 'document' => $document, - ]); - } - - /** - * Formats a string containing the fully-qualified path to represent a - * project_location_agent resource. - * - * @param string $project - * @param string $location - * - * @return string The formatted project_location_agent resource. - */ - public static function projectLocationAgentName(string $project, string $location): string - { - return self::getPathTemplate('projectLocationAgent')->render([ - 'project' => $project, - 'location' => $location, - ]); - } - - /** - * Formats a string containing the fully-qualified path to represent a - * project_location_conversation_model resource. - * - * @param string $project - * @param string $location - * @param string $conversationModel - * - * @return string The formatted project_location_conversation_model resource. - */ - public static function projectLocationConversationModelName(string $project, string $location, string $conversationModel): string - { - return self::getPathTemplate('projectLocationConversationModel')->render([ - 'project' => $project, - 'location' => $location, - 'conversation_model' => $conversationModel, - ]); - } - - /** - * Formats a string containing the fully-qualified path to represent a - * project_location_conversation_profile resource. - * - * @param string $project - * @param string $location - * @param string $conversationProfile - * - * @return string The formatted project_location_conversation_profile resource. - */ - public static function projectLocationConversationProfileName(string $project, string $location, string $conversationProfile): string - { - return self::getPathTemplate('projectLocationConversationProfile')->render([ - 'project' => $project, - 'location' => $location, - 'conversation_profile' => $conversationProfile, - ]); - } - - /** - * Formats a string containing the fully-qualified path to represent a - * project_location_knowledge_base resource. - * - * @param string $project - * @param string $location - * @param string $knowledgeBase - * - * @return string The formatted project_location_knowledge_base resource. - */ - public static function projectLocationKnowledgeBaseName(string $project, string $location, string $knowledgeBase): string - { - return self::getPathTemplate('projectLocationKnowledgeBase')->render([ - 'project' => $project, - 'location' => $location, - 'knowledge_base' => $knowledgeBase, - ]); - } - - /** - * Formats a string containing the fully-qualified path to represent a - * project_location_knowledge_base_document resource. - * - * @param string $project - * @param string $location - * @param string $knowledgeBase - * @param string $document - * - * @return string The formatted project_location_knowledge_base_document resource. - */ - public static function projectLocationKnowledgeBaseDocumentName(string $project, string $location, string $knowledgeBase, string $document): string - { - return self::getPathTemplate('projectLocationKnowledgeBaseDocument')->render([ - 'project' => $project, - 'location' => $location, - 'knowledge_base' => $knowledgeBase, - 'document' => $document, - ]); - } - - /** - * Parses a formatted name string and returns an associative array of the components in the name. - * The following name formats are supported: - * Template: Pattern - * - agent: projects/{project}/agent - * - cXSecuritySettings: projects/{project}/locations/{location}/securitySettings/{security_settings} - * - conversationModel: projects/{project}/locations/{location}/conversationModels/{conversation_model} - * - conversationProfile: projects/{project}/conversationProfiles/{conversation_profile} - * - document: projects/{project}/knowledgeBases/{knowledge_base}/documents/{document} - * - generator: projects/{project}/locations/{location}/generators/{generator} - * - knowledgeBase: projects/{project}/knowledgeBases/{knowledge_base} - * - location: projects/{project}/locations/{location} - * - 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 ConversationProfilesClient::clearSuggestionFeatureConfigAsync()} . - * - * @example samples/V2/ConversationProfilesClient/clear_suggestion_feature_config.php - * - * @param ClearSuggestionFeatureConfigRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return OperationResponse - * - * @throws ApiException Thrown if the API call fails. - */ - public function clearSuggestionFeatureConfig(ClearSuggestionFeatureConfigRequest $request, array $callOptions = []): OperationResponse - { - return $this->startApiCall('ClearSuggestionFeatureConfig', $request, $callOptions)->wait(); - } - - /** - * Creates a conversation profile in the specified project. - * - * [ConversationProfile.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 ConversationProfilesClient::createConversationProfileAsync()} . - * - * @example samples/V2/ConversationProfilesClient/create_conversation_profile.php - * - * @param CreateConversationProfileRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return ConversationProfile - * - * @throws ApiException Thrown if the API call fails. - */ - public function createConversationProfile(CreateConversationProfileRequest $request, array $callOptions = []): ConversationProfile - { - return $this->startApiCall('CreateConversationProfile', $request, $callOptions)->wait(); - } - - /** - * Deletes the specified conversation profile. - * - * The async variant is - * {@see ConversationProfilesClient::deleteConversationProfileAsync()} . - * - * @example samples/V2/ConversationProfilesClient/delete_conversation_profile.php - * - * @param DeleteConversationProfileRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @throws ApiException Thrown if the API call fails. - */ - public function deleteConversationProfile(DeleteConversationProfileRequest $request, array $callOptions = []): void - { - $this->startApiCall('DeleteConversationProfile', $request, $callOptions)->wait(); - } - - /** - * Retrieves the specified conversation profile. - * - * The async variant is - * {@see ConversationProfilesClient::getConversationProfileAsync()} . - * - * @example samples/V2/ConversationProfilesClient/get_conversation_profile.php - * - * @param GetConversationProfileRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return ConversationProfile - * - * @throws ApiException Thrown if the API call fails. - */ - public function getConversationProfile(GetConversationProfileRequest $request, array $callOptions = []): ConversationProfile - { - return $this->startApiCall('GetConversationProfile', $request, $callOptions)->wait(); - } - - /** - * Returns the list of all conversation profiles in the specified project. - * - * The async variant is - * {@see ConversationProfilesClient::listConversationProfilesAsync()} . - * - * @example samples/V2/ConversationProfilesClient/list_conversation_profiles.php - * - * @param ListConversationProfilesRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return PagedListResponse - * - * @throws ApiException Thrown if the API call fails. - */ - public function listConversationProfiles(ListConversationProfilesRequest $request, array $callOptions = []): PagedListResponse - { - return $this->startApiCall('ListConversationProfiles', $request, $callOptions); - } - - /** - * Adds or updates a suggestion feature in a conversation profile. - * If the conversation profile contains the type of suggestion feature for - * the participant role, it will update it. Otherwise it will insert the - * suggestion feature. - * - * This method is a [long-running - * operation](https://cloud.google.com/dialogflow/es/docs/how/long-running-operations). - * The returned `Operation` type has the following method-specific fields: - * - * - `metadata`: - * [SetSuggestionFeatureConfigOperationMetadata][google.cloud.dialogflow.v2.SetSuggestionFeatureConfigOperationMetadata] - * - `response`: - * [ConversationProfile][google.cloud.dialogflow.v2.ConversationProfile] - * - * If a long running operation to add or update suggestion feature - * config for the same conversation profile, participant role and suggestion - * feature type exists, please cancel the existing long running operation - * before sending such request, otherwise the request will be rejected. - * - * The async variant is - * {@see ConversationProfilesClient::setSuggestionFeatureConfigAsync()} . - * - * @example samples/V2/ConversationProfilesClient/set_suggestion_feature_config.php - * - * @param SetSuggestionFeatureConfigRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return OperationResponse - * - * @throws ApiException Thrown if the API call fails. - */ - public function setSuggestionFeatureConfig(SetSuggestionFeatureConfigRequest $request, array $callOptions = []): OperationResponse - { - return $this->startApiCall('SetSuggestionFeatureConfig', $request, $callOptions)->wait(); - } - - /** - * Updates the specified conversation profile. - * - * [ConversationProfile.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 ConversationProfilesClient::updateConversationProfileAsync()} . - * - * @example samples/V2/ConversationProfilesClient/update_conversation_profile.php - * - * @param UpdateConversationProfileRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return ConversationProfile - * - * @throws ApiException Thrown if the API call fails. - */ - public function updateConversationProfile(UpdateConversationProfileRequest $request, array $callOptions = []): ConversationProfile - { - return $this->startApiCall('UpdateConversationProfile', $request, $callOptions)->wait(); - } - - /** - * Gets information about a location. - * - * The async variant is {@see ConversationProfilesClient::getLocationAsync()} . - * - * @example samples/V2/ConversationProfilesClient/get_location.php - * - * @param GetLocationRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return Location - * - * @throws ApiException Thrown if the API call fails. - */ - public function getLocation(GetLocationRequest $request, array $callOptions = []): Location - { - return $this->startApiCall('GetLocation', $request, $callOptions)->wait(); - } - - /** - * Lists information about the supported locations for this service. - * - * The async variant is {@see ConversationProfilesClient::listLocationsAsync()} . - * - * @example samples/V2/ConversationProfilesClient/list_locations.php - * - * @param ListLocationsRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return PagedListResponse - * - * @throws ApiException Thrown if the API call fails. - */ - public function listLocations(ListLocationsRequest $request, array $callOptions = []): PagedListResponse - { - return $this->startApiCall('ListLocations', $request, $callOptions); - } -} diff --git a/owl-bot-staging/Dialogflow/v2/src/V2/Client/ConversationsClient.php b/owl-bot-staging/Dialogflow/v2/src/V2/Client/ConversationsClient.php deleted file mode 100644 index b8c52c90cc26..000000000000 --- a/owl-bot-staging/Dialogflow/v2/src/V2/Client/ConversationsClient.php +++ /dev/null @@ -1,1013 +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 generator - * resource. - * - * @param string $project - * @param string $location - * @param string $generator - * - * @return string The formatted generator resource. - */ - public static function generatorName(string $project, string $location, string $generator): string - { - return self::getPathTemplate('generator')->render([ - 'project' => $project, - 'location' => $location, - 'generator' => $generator, - ]); - } - - /** - * Formats a string containing the fully-qualified path to represent a - * knowledge_base resource. - * - * @param string $project - * @param string $knowledgeBase - * - * @return string The formatted knowledge_base resource. - */ - public static function knowledgeBaseName(string $project, string $knowledgeBase): string - { - return self::getPathTemplate('knowledgeBase')->render([ - 'project' => $project, - 'knowledge_base' => $knowledgeBase, - ]); - } - - /** - * Formats a string containing the fully-qualified path to represent a location - * resource. - * - * @param string $project - * @param string $location - * - * @return string The formatted location resource. - */ - public static function locationName(string $project, string $location): string - { - return self::getPathTemplate('location')->render([ - 'project' => $project, - 'location' => $location, - ]); - } - - /** - * Formats a string containing the fully-qualified path to represent a message - * resource. - * - * @param string $project - * @param string $conversation - * @param string $message - * - * @return string The formatted message resource. - */ - public static function messageName(string $project, string $conversation, string $message): string - { - return self::getPathTemplate('message')->render([ - 'project' => $project, - 'conversation' => $conversation, - 'message' => $message, - ]); - } - - /** - * Formats a string containing the fully-qualified path to represent a 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} - * - generator: projects/{project}/locations/{location}/generators/{generator} - * - knowledgeBase: projects/{project}/knowledgeBases/{knowledge_base} - * - location: projects/{project}/locations/{location} - * - message: projects/{project}/conversations/{conversation}/messages/{message} - * - 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 ConversationsClient::completeConversationAsync()} . - * - * @example samples/V2/ConversationsClient/complete_conversation.php - * - * @param CompleteConversationRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return Conversation - * - * @throws ApiException Thrown if the API call fails. - */ - public function completeConversation(CompleteConversationRequest $request, array $callOptions = []): Conversation - { - return $this->startApiCall('CompleteConversation', $request, $callOptions)->wait(); - } - - /** - * Creates a new conversation. Conversations are auto-completed after 24 - * hours. - * - * Conversation Lifecycle: - * There are two stages during a conversation: Automated Agent Stage and - * Assist Stage. - * - * For Automated Agent Stage, there will be a dialogflow agent responding to - * user queries. - * - * For Assist Stage, there's no dialogflow agent responding to user queries. - * But we will provide suggestions which are generated from conversation. - * - * If - * [Conversation.conversation_profile][google.cloud.dialogflow.v2.Conversation.conversation_profile] - * is configured for a dialogflow agent, conversation will start from - * `Automated Agent Stage`, otherwise, it will start from `Assist Stage`. And - * during `Automated Agent Stage`, once an - * [Intent][google.cloud.dialogflow.v2.Intent] with - * [Intent.live_agent_handoff][google.cloud.dialogflow.v2.Intent.live_agent_handoff] - * is triggered, conversation will transfer to Assist Stage. - * - * The async variant is {@see ConversationsClient::createConversationAsync()} . - * - * @example samples/V2/ConversationsClient/create_conversation.php - * - * @param CreateConversationRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return Conversation - * - * @throws ApiException Thrown if the API call fails. - */ - public function createConversation(CreateConversationRequest $request, array $callOptions = []): Conversation - { - return $this->startApiCall('CreateConversation', $request, $callOptions)->wait(); - } - - /** - * Generates and returns a suggestion for a conversation that does not have a - * resource created for it. - * - * The async variant is - * {@see ConversationsClient::generateStatelessSuggestionAsync()} . - * - * @example samples/V2/ConversationsClient/generate_stateless_suggestion.php - * - * @param GenerateStatelessSuggestionRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return GenerateStatelessSuggestionResponse - * - * @throws ApiException Thrown if the API call fails. - */ - public function generateStatelessSuggestion(GenerateStatelessSuggestionRequest $request, array $callOptions = []): GenerateStatelessSuggestionResponse - { - return $this->startApiCall('GenerateStatelessSuggestion', $request, $callOptions)->wait(); - } - - /** - * Generates and returns a summary for a conversation that does not have a - * resource created for it. - * - * The async variant is {@see ConversationsClient::generateStatelessSummaryAsync()} - * . - * - * @example samples/V2/ConversationsClient/generate_stateless_summary.php - * - * @param GenerateStatelessSummaryRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return GenerateStatelessSummaryResponse - * - * @throws ApiException Thrown if the API call fails. - */ - public function generateStatelessSummary(GenerateStatelessSummaryRequest $request, array $callOptions = []): GenerateStatelessSummaryResponse - { - return $this->startApiCall('GenerateStatelessSummary', $request, $callOptions)->wait(); - } - - /** - * Retrieves the specific conversation. - * - * The async variant is {@see ConversationsClient::getConversationAsync()} . - * - * @example samples/V2/ConversationsClient/get_conversation.php - * - * @param GetConversationRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return Conversation - * - * @throws ApiException Thrown if the API call fails. - */ - public function getConversation(GetConversationRequest $request, array $callOptions = []): Conversation - { - return $this->startApiCall('GetConversation', $request, $callOptions)->wait(); - } - - /** - * Returns the list of all conversations in the specified project. - * - * The async variant is {@see ConversationsClient::listConversationsAsync()} . - * - * @example samples/V2/ConversationsClient/list_conversations.php - * - * @param ListConversationsRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return PagedListResponse - * - * @throws ApiException Thrown if the API call fails. - */ - public function listConversations(ListConversationsRequest $request, array $callOptions = []): PagedListResponse - { - return $this->startApiCall('ListConversations', $request, $callOptions); - } - - /** - * Lists messages that belong to a given conversation. - * `messages` are ordered by `create_time` in descending order. To fetch - * updates without duplication, send request with filter - * `create_time_epoch_microseconds > - * [first item's create_time of previous request]` and empty page_token. - * - * The async variant is {@see ConversationsClient::listMessagesAsync()} . - * - * @example samples/V2/ConversationsClient/list_messages.php - * - * @param ListMessagesRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return PagedListResponse - * - * @throws ApiException Thrown if the API call fails. - */ - public function listMessages(ListMessagesRequest $request, array $callOptions = []): PagedListResponse - { - return $this->startApiCall('ListMessages', $request, $callOptions); - } - - /** - * Get answers for the given query based on knowledge documents. - * - * The async variant is {@see ConversationsClient::searchKnowledgeAsync()} . - * - * @example samples/V2/ConversationsClient/search_knowledge.php - * - * @param SearchKnowledgeRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return SearchKnowledgeResponse - * - * @throws ApiException Thrown if the API call fails. - */ - public function searchKnowledge(SearchKnowledgeRequest $request, array $callOptions = []): SearchKnowledgeResponse - { - return $this->startApiCall('SearchKnowledge', $request, $callOptions)->wait(); - } - - /** - * Suggests summary for a conversation based on specific historical messages. - * The range of the messages to be used for summary can be specified in the - * request. - * - * The async variant is - * {@see ConversationsClient::suggestConversationSummaryAsync()} . - * - * @example samples/V2/ConversationsClient/suggest_conversation_summary.php - * - * @param SuggestConversationSummaryRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return SuggestConversationSummaryResponse - * - * @throws ApiException Thrown if the API call fails. - */ - public function suggestConversationSummary(SuggestConversationSummaryRequest $request, array $callOptions = []): SuggestConversationSummaryResponse - { - return $this->startApiCall('SuggestConversationSummary', $request, $callOptions)->wait(); - } - - /** - * Gets information about a location. - * - * The async variant is {@see ConversationsClient::getLocationAsync()} . - * - * @example samples/V2/ConversationsClient/get_location.php - * - * @param GetLocationRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return Location - * - * @throws ApiException Thrown if the API call fails. - */ - public function getLocation(GetLocationRequest $request, array $callOptions = []): Location - { - return $this->startApiCall('GetLocation', $request, $callOptions)->wait(); - } - - /** - * Lists information about the supported locations for this service. - * - * The async variant is {@see ConversationsClient::listLocationsAsync()} . - * - * @example samples/V2/ConversationsClient/list_locations.php - * - * @param ListLocationsRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return PagedListResponse - * - * @throws ApiException Thrown if the API call fails. - */ - public function listLocations(ListLocationsRequest $request, array $callOptions = []): PagedListResponse - { - return $this->startApiCall('ListLocations', $request, $callOptions); - } -} diff --git a/owl-bot-staging/Dialogflow/v2/src/V2/Client/DocumentsClient.php b/owl-bot-staging/Dialogflow/v2/src/V2/Client/DocumentsClient.php deleted file mode 100644 index 421d7cb533e4..000000000000 --- a/owl-bot-staging/Dialogflow/v2/src/V2/Client/DocumentsClient.php +++ /dev/null @@ -1,689 +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 DocumentsClient::createDocumentAsync()} . - * - * @example samples/V2/DocumentsClient/create_document.php - * - * @param CreateDocumentRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return OperationResponse - * - * @throws ApiException Thrown if the API call fails. - */ - public function createDocument(CreateDocumentRequest $request, array $callOptions = []): OperationResponse - { - return $this->startApiCall('CreateDocument', $request, $callOptions)->wait(); - } - - /** - * Deletes the specified document. - * - * This method is a [long-running - * operation](https://cloud.google.com/dialogflow/cx/docs/how/long-running-operation). - * The returned `Operation` type has the following method-specific fields: - * - * - `metadata`: - * [KnowledgeOperationMetadata][google.cloud.dialogflow.v2.KnowledgeOperationMetadata] - * - `response`: An [Empty - * message](https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#empty) - * - * The async variant is {@see DocumentsClient::deleteDocumentAsync()} . - * - * @example samples/V2/DocumentsClient/delete_document.php - * - * @param DeleteDocumentRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return OperationResponse - * - * @throws ApiException Thrown if the API call fails. - */ - public function deleteDocument(DeleteDocumentRequest $request, array $callOptions = []): OperationResponse - { - return $this->startApiCall('DeleteDocument', $request, $callOptions)->wait(); - } - - /** - * Exports a smart messaging candidate document into the specified - * destination. - * - * This method is a [long-running - * operation](https://cloud.google.com/dialogflow/cx/docs/how/long-running-operation). - * The returned `Operation` type has the following method-specific fields: - * - * - `metadata`: - * [KnowledgeOperationMetadata][google.cloud.dialogflow.v2.KnowledgeOperationMetadata] - * - `response`: [Document][google.cloud.dialogflow.v2.Document] - * - * The async variant is {@see DocumentsClient::exportDocumentAsync()} . - * - * @example samples/V2/DocumentsClient/export_document.php - * - * @param ExportDocumentRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return OperationResponse - * - * @throws ApiException Thrown if the API call fails. - */ - public function exportDocument(ExportDocumentRequest $request, array $callOptions = []): OperationResponse - { - return $this->startApiCall('ExportDocument', $request, $callOptions)->wait(); - } - - /** - * Retrieves the specified document. - * - * The async variant is {@see DocumentsClient::getDocumentAsync()} . - * - * @example samples/V2/DocumentsClient/get_document.php - * - * @param GetDocumentRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return Document - * - * @throws ApiException Thrown if the API call fails. - */ - public function getDocument(GetDocumentRequest $request, array $callOptions = []): Document - { - return $this->startApiCall('GetDocument', $request, $callOptions)->wait(); - } - - /** - * Creates documents by importing data from external sources. - * Dialogflow supports up to 350 documents in each request. If you try to - * import more, Dialogflow will return an error. - * - * This method is a [long-running - * operation](https://cloud.google.com/dialogflow/cx/docs/how/long-running-operation). - * The returned `Operation` type has the following method-specific fields: - * - * - `metadata`: - * [KnowledgeOperationMetadata][google.cloud.dialogflow.v2.KnowledgeOperationMetadata] - * - `response`: - * [ImportDocumentsResponse][google.cloud.dialogflow.v2.ImportDocumentsResponse] - * - * The async variant is {@see DocumentsClient::importDocumentsAsync()} . - * - * @example samples/V2/DocumentsClient/import_documents.php - * - * @param ImportDocumentsRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return OperationResponse - * - * @throws ApiException Thrown if the API call fails. - */ - public function importDocuments(ImportDocumentsRequest $request, array $callOptions = []): OperationResponse - { - return $this->startApiCall('ImportDocuments', $request, $callOptions)->wait(); - } - - /** - * Returns the list of all documents of the knowledge base. - * - * The async variant is {@see DocumentsClient::listDocumentsAsync()} . - * - * @example samples/V2/DocumentsClient/list_documents.php - * - * @param ListDocumentsRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return PagedListResponse - * - * @throws ApiException Thrown if the API call fails. - */ - public function listDocuments(ListDocumentsRequest $request, array $callOptions = []): PagedListResponse - { - return $this->startApiCall('ListDocuments', $request, $callOptions); - } - - /** - * Reloads the specified document from its specified source, content_uri or - * content. The previously loaded content of the document will be deleted. - * Note: Even when the content of the document has not changed, there still - * may be side effects because of internal implementation changes. - * - * This method is a [long-running - * operation](https://cloud.google.com/dialogflow/cx/docs/how/long-running-operation). - * The returned `Operation` type has the following method-specific fields: - * - * - `metadata`: - * [KnowledgeOperationMetadata][google.cloud.dialogflow.v2.KnowledgeOperationMetadata] - * - `response`: [Document][google.cloud.dialogflow.v2.Document] - * - * Note: The `projects.agent.knowledgeBases.documents` resource is deprecated; - * only use `projects.knowledgeBases.documents`. - * - * The async variant is {@see DocumentsClient::reloadDocumentAsync()} . - * - * @example samples/V2/DocumentsClient/reload_document.php - * - * @param ReloadDocumentRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return OperationResponse - * - * @throws ApiException Thrown if the API call fails. - */ - public function reloadDocument(ReloadDocumentRequest $request, array $callOptions = []): OperationResponse - { - return $this->startApiCall('ReloadDocument', $request, $callOptions)->wait(); - } - - /** - * Updates the specified document. - * - * This method is a [long-running - * operation](https://cloud.google.com/dialogflow/cx/docs/how/long-running-operation). - * The returned `Operation` type has the following method-specific fields: - * - * - `metadata`: - * [KnowledgeOperationMetadata][google.cloud.dialogflow.v2.KnowledgeOperationMetadata] - * - `response`: [Document][google.cloud.dialogflow.v2.Document] - * - * The async variant is {@see DocumentsClient::updateDocumentAsync()} . - * - * @example samples/V2/DocumentsClient/update_document.php - * - * @param UpdateDocumentRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return OperationResponse - * - * @throws ApiException Thrown if the API call fails. - */ - public function updateDocument(UpdateDocumentRequest $request, array $callOptions = []): OperationResponse - { - return $this->startApiCall('UpdateDocument', $request, $callOptions)->wait(); - } - - /** - * Gets information about a location. - * - * The async variant is {@see DocumentsClient::getLocationAsync()} . - * - * @example samples/V2/DocumentsClient/get_location.php - * - * @param GetLocationRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return Location - * - * @throws ApiException Thrown if the API call fails. - */ - public function getLocation(GetLocationRequest $request, array $callOptions = []): Location - { - return $this->startApiCall('GetLocation', $request, $callOptions)->wait(); - } - - /** - * Lists information about the supported locations for this service. - * - * The async variant is {@see DocumentsClient::listLocationsAsync()} . - * - * @example samples/V2/DocumentsClient/list_locations.php - * - * @param ListLocationsRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return PagedListResponse - * - * @throws ApiException Thrown if the API call fails. - */ - public function listLocations(ListLocationsRequest $request, array $callOptions = []): PagedListResponse - { - return $this->startApiCall('ListLocations', $request, $callOptions); - } -} diff --git a/owl-bot-staging/Dialogflow/v2/src/V2/Client/EncryptionSpecServiceClient.php b/owl-bot-staging/Dialogflow/v2/src/V2/Client/EncryptionSpecServiceClient.php deleted file mode 100644 index 547b5b510197..000000000000 --- a/owl-bot-staging/Dialogflow/v2/src/V2/Client/EncryptionSpecServiceClient.php +++ /dev/null @@ -1,365 +0,0 @@ - self::SERVICE_NAME, - 'apiEndpoint' => self::SERVICE_ADDRESS . ':' . self::DEFAULT_SERVICE_PORT, - 'clientConfig' => __DIR__ . '/../resources/encryption_spec_service_client_config.json', - 'descriptorsConfigPath' => __DIR__ . '/../resources/encryption_spec_service_descriptor_config.php', - 'gcpApiConfigPath' => __DIR__ . '/../resources/encryption_spec_service_grpc_config.json', - 'credentialsConfig' => [ - 'defaultScopes' => self::$serviceScopes, - ], - 'transportConfig' => [ - 'rest' => [ - 'restClientConfigPath' => __DIR__ . '/../resources/encryption_spec_service_rest_client_config.php', - ], - ], - ]; - } - - /** - * Return an OperationsClient object with the same endpoint as $this. - * - * @return OperationsClient - */ - public function getOperationsClient() - { - return $this->operationsClient; - } - - /** - * Resume an existing long running operation that was previously started by a long - * running API method. If $methodName is not provided, or does not match a long - * running API method, then the operation can still be resumed, but the - * OperationResponse object will not deserialize the final response. - * - * @param string $operationName The name of the long running operation - * @param string $methodName The name of the method used to start the operation - * - * @return OperationResponse - */ - public function resumeOperation($operationName, $methodName = null) - { - $options = 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 - * encryption_spec resource. - * - * @param string $project - * @param string $location - * - * @return string The formatted encryption_spec resource. - */ - public static function encryptionSpecName(string $project, string $location): string - { - return self::getPathTemplate('encryptionSpec')->render([ - 'project' => $project, - 'location' => $location, - ]); - } - - /** - * Parses a formatted name string and returns an associative array of the components in the name. - * The following name formats are supported: - * Template: Pattern - * - encryptionSpec: projects/{project}/locations/{location}/encryptionSpec - * - * The optional $template argument can be supplied to specify a particular pattern, - * and must match one of the templates listed above. If no $template argument is - * provided, or if the $template argument does not match one of the templates - * listed, then parseName will check each of the supported templates, and return - * the first match. - * - * @param string $formattedName The formatted name string - * @param string $template Optional name of template to match - * - * @return array An associative array from name component IDs to component values. - * - * @throws ValidationException If $formattedName could not be matched. - */ - public static function parseName(string $formattedName, string $template = null): array - { - return self::parseFormattedName($formattedName, $template); - } - - /** - * Constructor. - * - * @param array $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); - } - - /** - * Gets location-level encryption key specification. - * - * The async variant is - * {@see EncryptionSpecServiceClient::getEncryptionSpecAsync()} . - * - * @example samples/V2/EncryptionSpecServiceClient/get_encryption_spec.php - * - * @param GetEncryptionSpecRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return EncryptionSpec - * - * @throws ApiException Thrown if the API call fails. - */ - public function getEncryptionSpec(GetEncryptionSpecRequest $request, array $callOptions = []): EncryptionSpec - { - return $this->startApiCall('GetEncryptionSpec', $request, $callOptions)->wait(); - } - - /** - * Initializes a location-level encryption key specification. An error will - * be thrown if the location has resources already created before the - * initialization. Once the encryption specification is initialized at a - * location, it is immutable and all newly created resources under the - * location will be encrypted with the existing specification. - * - * The async variant is - * {@see EncryptionSpecServiceClient::initializeEncryptionSpecAsync()} . - * - * @example samples/V2/EncryptionSpecServiceClient/initialize_encryption_spec.php - * - * @param InitializeEncryptionSpecRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return OperationResponse - * - * @throws ApiException Thrown if the API call fails. - */ - public function initializeEncryptionSpec(InitializeEncryptionSpecRequest $request, array $callOptions = []): OperationResponse - { - return $this->startApiCall('InitializeEncryptionSpec', $request, $callOptions)->wait(); - } - - /** - * Gets information about a location. - * - * The async variant is {@see EncryptionSpecServiceClient::getLocationAsync()} . - * - * @example samples/V2/EncryptionSpecServiceClient/get_location.php - * - * @param GetLocationRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return Location - * - * @throws ApiException Thrown if the API call fails. - */ - public function getLocation(GetLocationRequest $request, array $callOptions = []): Location - { - return $this->startApiCall('GetLocation', $request, $callOptions)->wait(); - } - - /** - * Lists information about the supported locations for this service. - * - * The async variant is {@see EncryptionSpecServiceClient::listLocationsAsync()} . - * - * @example samples/V2/EncryptionSpecServiceClient/list_locations.php - * - * @param ListLocationsRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return PagedListResponse - * - * @throws ApiException Thrown if the API call fails. - */ - public function listLocations(ListLocationsRequest $request, array $callOptions = []): PagedListResponse - { - return $this->startApiCall('ListLocations', $request, $callOptions); - } -} diff --git a/owl-bot-staging/Dialogflow/v2/src/V2/Client/EntityTypesClient.php b/owl-bot-staging/Dialogflow/v2/src/V2/Client/EntityTypesClient.php deleted file mode 100644 index d19c1303cbd9..000000000000 --- a/owl-bot-staging/Dialogflow/v2/src/V2/Client/EntityTypesClient.php +++ /dev/null @@ -1,752 +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 EntityTypesClient::batchCreateEntitiesAsync()} . - * - * @example samples/V2/EntityTypesClient/batch_create_entities.php - * - * @param BatchCreateEntitiesRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return OperationResponse - * - * @throws ApiException Thrown if the API call fails. - */ - public function batchCreateEntities(BatchCreateEntitiesRequest $request, array $callOptions = []): OperationResponse - { - return $this->startApiCall('BatchCreateEntities', $request, $callOptions)->wait(); - } - - /** - * Deletes entities in the specified entity type. - * - * This method is a [long-running - * operation](https://cloud.google.com/dialogflow/es/docs/how/long-running-operations). - * The returned `Operation` type has the following method-specific fields: - * - * - `metadata`: An empty [Struct - * message](https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#struct) - * - `response`: An [Empty - * message](https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#empty) - * - * Note: You should always train an agent prior to sending it queries. See the - * [training - * documentation](https://cloud.google.com/dialogflow/es/docs/training). - * - * The async variant is {@see EntityTypesClient::batchDeleteEntitiesAsync()} . - * - * @example samples/V2/EntityTypesClient/batch_delete_entities.php - * - * @param BatchDeleteEntitiesRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return OperationResponse - * - * @throws ApiException Thrown if the API call fails. - */ - public function batchDeleteEntities(BatchDeleteEntitiesRequest $request, array $callOptions = []): OperationResponse - { - return $this->startApiCall('BatchDeleteEntities', $request, $callOptions)->wait(); - } - - /** - * Deletes entity types in the specified agent. - * - * This method is a [long-running - * operation](https://cloud.google.com/dialogflow/es/docs/how/long-running-operations). - * The returned `Operation` type has the following method-specific fields: - * - * - `metadata`: An empty [Struct - * message](https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#struct) - * - `response`: An [Empty - * message](https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#empty) - * - * Note: You should always train an agent prior to sending it queries. See the - * [training - * documentation](https://cloud.google.com/dialogflow/es/docs/training). - * - * The async variant is {@see EntityTypesClient::batchDeleteEntityTypesAsync()} . - * - * @example samples/V2/EntityTypesClient/batch_delete_entity_types.php - * - * @param BatchDeleteEntityTypesRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return OperationResponse - * - * @throws ApiException Thrown if the API call fails. - */ - public function batchDeleteEntityTypes(BatchDeleteEntityTypesRequest $request, array $callOptions = []): OperationResponse - { - return $this->startApiCall('BatchDeleteEntityTypes', $request, $callOptions)->wait(); - } - - /** - * Updates or creates multiple entities in the specified entity type. This - * method does not affect entities in the entity type that aren't explicitly - * specified in the request. - * - * This method is a [long-running - * operation](https://cloud.google.com/dialogflow/es/docs/how/long-running-operations). - * The returned `Operation` type has the following method-specific fields: - * - * - `metadata`: An empty [Struct - * message](https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#struct) - * - `response`: An [Empty - * message](https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#empty) - * - * Note: You should always train an agent prior to sending it queries. See the - * [training - * documentation](https://cloud.google.com/dialogflow/es/docs/training). - * - * - * The async variant is {@see EntityTypesClient::batchUpdateEntitiesAsync()} . - * - * @example samples/V2/EntityTypesClient/batch_update_entities.php - * - * @param BatchUpdateEntitiesRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return OperationResponse - * - * @throws ApiException Thrown if the API call fails. - */ - public function batchUpdateEntities(BatchUpdateEntitiesRequest $request, array $callOptions = []): OperationResponse - { - return $this->startApiCall('BatchUpdateEntities', $request, $callOptions)->wait(); - } - - /** - * Updates/Creates multiple entity types in the specified agent. - * - * This method is a [long-running - * operation](https://cloud.google.com/dialogflow/es/docs/how/long-running-operations). - * The returned `Operation` type has the following method-specific fields: - * - * - `metadata`: An empty [Struct - * message](https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#struct) - * - `response`: - * [BatchUpdateEntityTypesResponse][google.cloud.dialogflow.v2.BatchUpdateEntityTypesResponse] - * - * Note: You should always train an agent prior to sending it queries. See the - * [training - * documentation](https://cloud.google.com/dialogflow/es/docs/training). - * - * The async variant is {@see EntityTypesClient::batchUpdateEntityTypesAsync()} . - * - * @example samples/V2/EntityTypesClient/batch_update_entity_types.php - * - * @param BatchUpdateEntityTypesRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return OperationResponse - * - * @throws ApiException Thrown if the API call fails. - */ - public function batchUpdateEntityTypes(BatchUpdateEntityTypesRequest $request, array $callOptions = []): OperationResponse - { - return $this->startApiCall('BatchUpdateEntityTypes', $request, $callOptions)->wait(); - } - - /** - * Creates an entity type in the specified agent. - * - * Note: You should always train an agent prior to sending it queries. See the - * [training - * documentation](https://cloud.google.com/dialogflow/es/docs/training). - * - * The async variant is {@see EntityTypesClient::createEntityTypeAsync()} . - * - * @example samples/V2/EntityTypesClient/create_entity_type.php - * - * @param CreateEntityTypeRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return EntityType - * - * @throws ApiException Thrown if the API call fails. - */ - public function createEntityType(CreateEntityTypeRequest $request, array $callOptions = []): EntityType - { - return $this->startApiCall('CreateEntityType', $request, $callOptions)->wait(); - } - - /** - * Deletes the specified entity type. - * - * Note: You should always train an agent prior to sending it queries. See the - * [training - * documentation](https://cloud.google.com/dialogflow/es/docs/training). - * - * The async variant is {@see EntityTypesClient::deleteEntityTypeAsync()} . - * - * @example samples/V2/EntityTypesClient/delete_entity_type.php - * - * @param DeleteEntityTypeRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @throws ApiException Thrown if the API call fails. - */ - public function deleteEntityType(DeleteEntityTypeRequest $request, array $callOptions = []): void - { - $this->startApiCall('DeleteEntityType', $request, $callOptions)->wait(); - } - - /** - * Retrieves the specified entity type. - * - * The async variant is {@see EntityTypesClient::getEntityTypeAsync()} . - * - * @example samples/V2/EntityTypesClient/get_entity_type.php - * - * @param GetEntityTypeRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return EntityType - * - * @throws ApiException Thrown if the API call fails. - */ - public function getEntityType(GetEntityTypeRequest $request, array $callOptions = []): EntityType - { - return $this->startApiCall('GetEntityType', $request, $callOptions)->wait(); - } - - /** - * Returns the list of all entity types in the specified agent. - * - * The async variant is {@see EntityTypesClient::listEntityTypesAsync()} . - * - * @example samples/V2/EntityTypesClient/list_entity_types.php - * - * @param ListEntityTypesRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return PagedListResponse - * - * @throws ApiException Thrown if the API call fails. - */ - public function listEntityTypes(ListEntityTypesRequest $request, array $callOptions = []): PagedListResponse - { - return $this->startApiCall('ListEntityTypes', $request, $callOptions); - } - - /** - * Updates the specified entity type. - * - * Note: You should always train an agent prior to sending it queries. See the - * [training - * documentation](https://cloud.google.com/dialogflow/es/docs/training). - * - * The async variant is {@see EntityTypesClient::updateEntityTypeAsync()} . - * - * @example samples/V2/EntityTypesClient/update_entity_type.php - * - * @param UpdateEntityTypeRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return EntityType - * - * @throws ApiException Thrown if the API call fails. - */ - public function updateEntityType(UpdateEntityTypeRequest $request, array $callOptions = []): EntityType - { - return $this->startApiCall('UpdateEntityType', $request, $callOptions)->wait(); - } - - /** - * Gets information about a location. - * - * The async variant is {@see EntityTypesClient::getLocationAsync()} . - * - * @example samples/V2/EntityTypesClient/get_location.php - * - * @param GetLocationRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return Location - * - * @throws ApiException Thrown if the API call fails. - */ - public function getLocation(GetLocationRequest $request, array $callOptions = []): Location - { - return $this->startApiCall('GetLocation', $request, $callOptions)->wait(); - } - - /** - * Lists information about the supported locations for this service. - * - * The async variant is {@see EntityTypesClient::listLocationsAsync()} . - * - * @example samples/V2/EntityTypesClient/list_locations.php - * - * @param ListLocationsRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return PagedListResponse - * - * @throws ApiException Thrown if the API call fails. - */ - public function listLocations(ListLocationsRequest $request, array $callOptions = []): PagedListResponse - { - return $this->startApiCall('ListLocations', $request, $callOptions); - } -} diff --git a/owl-bot-staging/Dialogflow/v2/src/V2/Client/EnvironmentsClient.php b/owl-bot-staging/Dialogflow/v2/src/V2/Client/EnvironmentsClient.php deleted file mode 100644 index a7ec1436739a..000000000000 --- a/owl-bot-staging/Dialogflow/v2/src/V2/Client/EnvironmentsClient.php +++ /dev/null @@ -1,639 +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 EnvironmentsClient::createEnvironmentAsync()} . - * - * @example samples/V2/EnvironmentsClient/create_environment.php - * - * @param CreateEnvironmentRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return Environment - * - * @throws ApiException Thrown if the API call fails. - */ - public function createEnvironment(CreateEnvironmentRequest $request, array $callOptions = []): Environment - { - return $this->startApiCall('CreateEnvironment', $request, $callOptions)->wait(); - } - - /** - * Deletes the specified agent environment. - * - * The async variant is {@see EnvironmentsClient::deleteEnvironmentAsync()} . - * - * @example samples/V2/EnvironmentsClient/delete_environment.php - * - * @param DeleteEnvironmentRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @throws ApiException Thrown if the API call fails. - */ - public function deleteEnvironment(DeleteEnvironmentRequest $request, array $callOptions = []): void - { - $this->startApiCall('DeleteEnvironment', $request, $callOptions)->wait(); - } - - /** - * Retrieves the specified agent environment. - * - * The async variant is {@see EnvironmentsClient::getEnvironmentAsync()} . - * - * @example samples/V2/EnvironmentsClient/get_environment.php - * - * @param GetEnvironmentRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return Environment - * - * @throws ApiException Thrown if the API call fails. - */ - public function getEnvironment(GetEnvironmentRequest $request, array $callOptions = []): Environment - { - return $this->startApiCall('GetEnvironment', $request, $callOptions)->wait(); - } - - /** - * Gets the history of the specified environment. - * - * The async variant is {@see EnvironmentsClient::getEnvironmentHistoryAsync()} . - * - * @example samples/V2/EnvironmentsClient/get_environment_history.php - * - * @param GetEnvironmentHistoryRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return PagedListResponse - * - * @throws ApiException Thrown if the API call fails. - */ - public function getEnvironmentHistory(GetEnvironmentHistoryRequest $request, array $callOptions = []): PagedListResponse - { - return $this->startApiCall('GetEnvironmentHistory', $request, $callOptions); - } - - /** - * Returns the list of all non-default environments of the specified agent. - * - * The async variant is {@see EnvironmentsClient::listEnvironmentsAsync()} . - * - * @example samples/V2/EnvironmentsClient/list_environments.php - * - * @param ListEnvironmentsRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return PagedListResponse - * - * @throws ApiException Thrown if the API call fails. - */ - public function listEnvironments(ListEnvironmentsRequest $request, array $callOptions = []): PagedListResponse - { - return $this->startApiCall('ListEnvironments', $request, $callOptions); - } - - /** - * Updates the specified agent environment. - * - * This method allows you to deploy new agent versions into the environment. - * When an environment is pointed to a new agent version by setting - * `environment.agent_version`, the environment is temporarily set to the - * `LOADING` state. During that time, the environment continues serving the - * previous version of the agent. After the new agent version is done loading, - * the environment is set back to the `RUNNING` state. - * You can use "-" as Environment ID in environment name to update an agent - * version in the default environment. WARNING: this will negate all recent - * changes to the draft agent and can't be undone. You may want to save the - * draft agent to a version before calling this method. - * - * The async variant is {@see EnvironmentsClient::updateEnvironmentAsync()} . - * - * @example samples/V2/EnvironmentsClient/update_environment.php - * - * @param UpdateEnvironmentRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return Environment - * - * @throws ApiException Thrown if the API call fails. - */ - public function updateEnvironment(UpdateEnvironmentRequest $request, array $callOptions = []): Environment - { - return $this->startApiCall('UpdateEnvironment', $request, $callOptions)->wait(); - } - - /** - * Gets information about a location. - * - * The async variant is {@see EnvironmentsClient::getLocationAsync()} . - * - * @example samples/V2/EnvironmentsClient/get_location.php - * - * @param GetLocationRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return Location - * - * @throws ApiException Thrown if the API call fails. - */ - public function getLocation(GetLocationRequest $request, array $callOptions = []): Location - { - return $this->startApiCall('GetLocation', $request, $callOptions)->wait(); - } - - /** - * Lists information about the supported locations for this service. - * - * The async variant is {@see EnvironmentsClient::listLocationsAsync()} . - * - * @example samples/V2/EnvironmentsClient/list_locations.php - * - * @param ListLocationsRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return PagedListResponse - * - * @throws ApiException Thrown if the API call fails. - */ - public function listLocations(ListLocationsRequest $request, array $callOptions = []): PagedListResponse - { - return $this->startApiCall('ListLocations', $request, $callOptions); - } -} diff --git a/owl-bot-staging/Dialogflow/v2/src/V2/Client/FulfillmentsClient.php b/owl-bot-staging/Dialogflow/v2/src/V2/Client/FulfillmentsClient.php deleted file mode 100644 index 96a756a831c7..000000000000 --- a/owl-bot-staging/Dialogflow/v2/src/V2/Client/FulfillmentsClient.php +++ /dev/null @@ -1,356 +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 FulfillmentsClient::getFulfillmentAsync()} . - * - * @example samples/V2/FulfillmentsClient/get_fulfillment.php - * - * @param GetFulfillmentRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return Fulfillment - * - * @throws ApiException Thrown if the API call fails. - */ - public function getFulfillment(GetFulfillmentRequest $request, array $callOptions = []): Fulfillment - { - return $this->startApiCall('GetFulfillment', $request, $callOptions)->wait(); - } - - /** - * Updates the fulfillment. - * - * The async variant is {@see FulfillmentsClient::updateFulfillmentAsync()} . - * - * @example samples/V2/FulfillmentsClient/update_fulfillment.php - * - * @param UpdateFulfillmentRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return Fulfillment - * - * @throws ApiException Thrown if the API call fails. - */ - public function updateFulfillment(UpdateFulfillmentRequest $request, array $callOptions = []): Fulfillment - { - return $this->startApiCall('UpdateFulfillment', $request, $callOptions)->wait(); - } - - /** - * Gets information about a location. - * - * The async variant is {@see FulfillmentsClient::getLocationAsync()} . - * - * @example samples/V2/FulfillmentsClient/get_location.php - * - * @param GetLocationRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return Location - * - * @throws ApiException Thrown if the API call fails. - */ - public function getLocation(GetLocationRequest $request, array $callOptions = []): Location - { - return $this->startApiCall('GetLocation', $request, $callOptions)->wait(); - } - - /** - * Lists information about the supported locations for this service. - * - * The async variant is {@see FulfillmentsClient::listLocationsAsync()} . - * - * @example samples/V2/FulfillmentsClient/list_locations.php - * - * @param ListLocationsRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return PagedListResponse - * - * @throws ApiException Thrown if the API call fails. - */ - public function listLocations(ListLocationsRequest $request, array $callOptions = []): PagedListResponse - { - return $this->startApiCall('ListLocations', $request, $callOptions); - } -} diff --git a/owl-bot-staging/Dialogflow/v2/src/V2/Client/GeneratorsClient.php b/owl-bot-staging/Dialogflow/v2/src/V2/Client/GeneratorsClient.php deleted file mode 100644 index 495de526bd8e..000000000000 --- a/owl-bot-staging/Dialogflow/v2/src/V2/Client/GeneratorsClient.php +++ /dev/null @@ -1,428 +0,0 @@ - self::SERVICE_NAME, - 'apiEndpoint' => self::SERVICE_ADDRESS . ':' . self::DEFAULT_SERVICE_PORT, - 'clientConfig' => __DIR__ . '/../resources/generators_client_config.json', - 'descriptorsConfigPath' => __DIR__ . '/../resources/generators_descriptor_config.php', - 'gcpApiConfigPath' => __DIR__ . '/../resources/generators_grpc_config.json', - 'credentialsConfig' => [ - 'defaultScopes' => self::$serviceScopes, - ], - 'transportConfig' => [ - 'rest' => [ - 'restClientConfigPath' => __DIR__ . '/../resources/generators_rest_client_config.php', - ], - ], - ]; - } - - /** - * Formats a string containing the fully-qualified path to represent a generator - * resource. - * - * @param string $project - * @param string $location - * @param string $generator - * - * @return string The formatted generator resource. - */ - public static function generatorName(string $project, string $location, string $generator): string - { - return self::getPathTemplate('generator')->render([ - 'project' => $project, - 'location' => $location, - 'generator' => $generator, - ]); - } - - /** - * Formats a string containing the fully-qualified path to represent a project - * resource. - * - * @param string $project - * - * @return string The formatted project resource. - */ - public static function projectName(string $project): string - { - return self::getPathTemplate('project')->render([ - 'project' => $project, - ]); - } - - /** - * Parses a formatted name string and returns an associative array of the components in the name. - * The following name formats are supported: - * Template: Pattern - * - generator: projects/{project}/locations/{location}/generators/{generator} - * - project: projects/{project} - * - * 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 generator. - * - * The async variant is {@see GeneratorsClient::createGeneratorAsync()} . - * - * @example samples/V2/GeneratorsClient/create_generator.php - * - * @param CreateGeneratorRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return Generator - * - * @throws ApiException Thrown if the API call fails. - */ - public function createGenerator(CreateGeneratorRequest $request, array $callOptions = []): Generator - { - return $this->startApiCall('CreateGenerator', $request, $callOptions)->wait(); - } - - /** - * Deletes a generator. - * - * The async variant is {@see GeneratorsClient::deleteGeneratorAsync()} . - * - * @example samples/V2/GeneratorsClient/delete_generator.php - * - * @param DeleteGeneratorRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @throws ApiException Thrown if the API call fails. - */ - public function deleteGenerator(DeleteGeneratorRequest $request, array $callOptions = []): void - { - $this->startApiCall('DeleteGenerator', $request, $callOptions)->wait(); - } - - /** - * Retrieves a generator. - * - * The async variant is {@see GeneratorsClient::getGeneratorAsync()} . - * - * @example samples/V2/GeneratorsClient/get_generator.php - * - * @param GetGeneratorRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return Generator - * - * @throws ApiException Thrown if the API call fails. - */ - public function getGenerator(GetGeneratorRequest $request, array $callOptions = []): Generator - { - return $this->startApiCall('GetGenerator', $request, $callOptions)->wait(); - } - - /** - * Lists generators. - * - * The async variant is {@see GeneratorsClient::listGeneratorsAsync()} . - * - * @example samples/V2/GeneratorsClient/list_generators.php - * - * @param ListGeneratorsRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return PagedListResponse - * - * @throws ApiException Thrown if the API call fails. - */ - public function listGenerators(ListGeneratorsRequest $request, array $callOptions = []): PagedListResponse - { - return $this->startApiCall('ListGenerators', $request, $callOptions); - } - - /** - * Updates a generator. - * - * The async variant is {@see GeneratorsClient::updateGeneratorAsync()} . - * - * @example samples/V2/GeneratorsClient/update_generator.php - * - * @param UpdateGeneratorRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return Generator - * - * @throws ApiException Thrown if the API call fails. - */ - public function updateGenerator(UpdateGeneratorRequest $request, array $callOptions = []): Generator - { - return $this->startApiCall('UpdateGenerator', $request, $callOptions)->wait(); - } - - /** - * Gets information about a location. - * - * The async variant is {@see GeneratorsClient::getLocationAsync()} . - * - * @example samples/V2/GeneratorsClient/get_location.php - * - * @param GetLocationRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return Location - * - * @throws ApiException Thrown if the API call fails. - */ - public function getLocation(GetLocationRequest $request, array $callOptions = []): Location - { - return $this->startApiCall('GetLocation', $request, $callOptions)->wait(); - } - - /** - * Lists information about the supported locations for this service. - * - * The async variant is {@see GeneratorsClient::listLocationsAsync()} . - * - * @example samples/V2/GeneratorsClient/list_locations.php - * - * @param ListLocationsRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return PagedListResponse - * - * @throws ApiException Thrown if the API call fails. - */ - public function listLocations(ListLocationsRequest $request, array $callOptions = []): PagedListResponse - { - return $this->startApiCall('ListLocations', $request, $callOptions); - } -} diff --git a/owl-bot-staging/Dialogflow/v2/src/V2/Client/IntentsClient.php b/owl-bot-staging/Dialogflow/v2/src/V2/Client/IntentsClient.php deleted file mode 100644 index 7e58694cb49f..000000000000 --- a/owl-bot-staging/Dialogflow/v2/src/V2/Client/IntentsClient.php +++ /dev/null @@ -1,839 +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 IntentsClient::batchDeleteIntentsAsync()} . - * - * @example samples/V2/IntentsClient/batch_delete_intents.php - * - * @param BatchDeleteIntentsRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return OperationResponse - * - * @throws ApiException Thrown if the API call fails. - */ - public function batchDeleteIntents(BatchDeleteIntentsRequest $request, array $callOptions = []): OperationResponse - { - return $this->startApiCall('BatchDeleteIntents', $request, $callOptions)->wait(); - } - - /** - * Updates/Creates multiple intents in the specified agent. - * - * This method is a [long-running - * operation](https://cloud.google.com/dialogflow/es/docs/how/long-running-operations). - * The returned `Operation` type has the following method-specific fields: - * - * - `metadata`: An empty [Struct - * message](https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#struct) - * - `response`: - * [BatchUpdateIntentsResponse][google.cloud.dialogflow.v2.BatchUpdateIntentsResponse] - * - * Note: You should always train an agent prior to sending it queries. See the - * [training - * documentation](https://cloud.google.com/dialogflow/es/docs/training). - * - * The async variant is {@see IntentsClient::batchUpdateIntentsAsync()} . - * - * @example samples/V2/IntentsClient/batch_update_intents.php - * - * @param BatchUpdateIntentsRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return OperationResponse - * - * @throws ApiException Thrown if the API call fails. - */ - public function batchUpdateIntents(BatchUpdateIntentsRequest $request, array $callOptions = []): OperationResponse - { - return $this->startApiCall('BatchUpdateIntents', $request, $callOptions)->wait(); - } - - /** - * Creates an intent in the specified agent. - * - * Note: You should always train an agent prior to sending it queries. See the - * [training - * documentation](https://cloud.google.com/dialogflow/es/docs/training). - * - * The async variant is {@see IntentsClient::createIntentAsync()} . - * - * @example samples/V2/IntentsClient/create_intent.php - * - * @param CreateIntentRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return Intent - * - * @throws ApiException Thrown if the API call fails. - */ - public function createIntent(CreateIntentRequest $request, array $callOptions = []): Intent - { - return $this->startApiCall('CreateIntent', $request, $callOptions)->wait(); - } - - /** - * Deletes the specified intent and its direct or indirect followup intents. - * - * Note: You should always train an agent prior to sending it queries. See the - * [training - * documentation](https://cloud.google.com/dialogflow/es/docs/training). - * - * The async variant is {@see IntentsClient::deleteIntentAsync()} . - * - * @example samples/V2/IntentsClient/delete_intent.php - * - * @param DeleteIntentRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @throws ApiException Thrown if the API call fails. - */ - public function deleteIntent(DeleteIntentRequest $request, array $callOptions = []): void - { - $this->startApiCall('DeleteIntent', $request, $callOptions)->wait(); - } - - /** - * Retrieves the specified intent. - * - * The async variant is {@see IntentsClient::getIntentAsync()} . - * - * @example samples/V2/IntentsClient/get_intent.php - * - * @param GetIntentRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return Intent - * - * @throws ApiException Thrown if the API call fails. - */ - public function getIntent(GetIntentRequest $request, array $callOptions = []): Intent - { - return $this->startApiCall('GetIntent', $request, $callOptions)->wait(); - } - - /** - * Returns the list of all intents in the specified agent. - * - * The async variant is {@see IntentsClient::listIntentsAsync()} . - * - * @example samples/V2/IntentsClient/list_intents.php - * - * @param ListIntentsRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return PagedListResponse - * - * @throws ApiException Thrown if the API call fails. - */ - public function listIntents(ListIntentsRequest $request, array $callOptions = []): PagedListResponse - { - return $this->startApiCall('ListIntents', $request, $callOptions); - } - - /** - * Updates the specified intent. - * - * Note: You should always train an agent prior to sending it queries. See the - * [training - * documentation](https://cloud.google.com/dialogflow/es/docs/training). - * - * The async variant is {@see IntentsClient::updateIntentAsync()} . - * - * @example samples/V2/IntentsClient/update_intent.php - * - * @param UpdateIntentRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return Intent - * - * @throws ApiException Thrown if the API call fails. - */ - public function updateIntent(UpdateIntentRequest $request, array $callOptions = []): Intent - { - return $this->startApiCall('UpdateIntent', $request, $callOptions)->wait(); - } - - /** - * Gets information about a location. - * - * The async variant is {@see IntentsClient::getLocationAsync()} . - * - * @example samples/V2/IntentsClient/get_location.php - * - * @param GetLocationRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return Location - * - * @throws ApiException Thrown if the API call fails. - */ - public function getLocation(GetLocationRequest $request, array $callOptions = []): Location - { - return $this->startApiCall('GetLocation', $request, $callOptions)->wait(); - } - - /** - * Lists information about the supported locations for this service. - * - * The async variant is {@see IntentsClient::listLocationsAsync()} . - * - * @example samples/V2/IntentsClient/list_locations.php - * - * @param ListLocationsRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return PagedListResponse - * - * @throws ApiException Thrown if the API call fails. - */ - public function listLocations(ListLocationsRequest $request, array $callOptions = []): PagedListResponse - { - return $this->startApiCall('ListLocations', $request, $callOptions); - } -} diff --git a/owl-bot-staging/Dialogflow/v2/src/V2/Client/KnowledgeBasesClient.php b/owl-bot-staging/Dialogflow/v2/src/V2/Client/KnowledgeBasesClient.php deleted file mode 100644 index 33757f9b233b..000000000000 --- a/owl-bot-staging/Dialogflow/v2/src/V2/Client/KnowledgeBasesClient.php +++ /dev/null @@ -1,479 +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 KnowledgeBasesClient::createKnowledgeBaseAsync()} . - * - * @example samples/V2/KnowledgeBasesClient/create_knowledge_base.php - * - * @param CreateKnowledgeBaseRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return KnowledgeBase - * - * @throws ApiException Thrown if the API call fails. - */ - public function createKnowledgeBase(CreateKnowledgeBaseRequest $request, array $callOptions = []): KnowledgeBase - { - return $this->startApiCall('CreateKnowledgeBase', $request, $callOptions)->wait(); - } - - /** - * Deletes the specified knowledge base. - * - * The async variant is {@see KnowledgeBasesClient::deleteKnowledgeBaseAsync()} . - * - * @example samples/V2/KnowledgeBasesClient/delete_knowledge_base.php - * - * @param DeleteKnowledgeBaseRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @throws ApiException Thrown if the API call fails. - */ - public function deleteKnowledgeBase(DeleteKnowledgeBaseRequest $request, array $callOptions = []): void - { - $this->startApiCall('DeleteKnowledgeBase', $request, $callOptions)->wait(); - } - - /** - * Retrieves the specified knowledge base. - * - * The async variant is {@see KnowledgeBasesClient::getKnowledgeBaseAsync()} . - * - * @example samples/V2/KnowledgeBasesClient/get_knowledge_base.php - * - * @param GetKnowledgeBaseRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return KnowledgeBase - * - * @throws ApiException Thrown if the API call fails. - */ - public function getKnowledgeBase(GetKnowledgeBaseRequest $request, array $callOptions = []): KnowledgeBase - { - return $this->startApiCall('GetKnowledgeBase', $request, $callOptions)->wait(); - } - - /** - * Returns the list of all knowledge bases of the specified agent. - * - * The async variant is {@see KnowledgeBasesClient::listKnowledgeBasesAsync()} . - * - * @example samples/V2/KnowledgeBasesClient/list_knowledge_bases.php - * - * @param ListKnowledgeBasesRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return PagedListResponse - * - * @throws ApiException Thrown if the API call fails. - */ - public function listKnowledgeBases(ListKnowledgeBasesRequest $request, array $callOptions = []): PagedListResponse - { - return $this->startApiCall('ListKnowledgeBases', $request, $callOptions); - } - - /** - * Updates the specified knowledge base. - * - * The async variant is {@see KnowledgeBasesClient::updateKnowledgeBaseAsync()} . - * - * @example samples/V2/KnowledgeBasesClient/update_knowledge_base.php - * - * @param UpdateKnowledgeBaseRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return KnowledgeBase - * - * @throws ApiException Thrown if the API call fails. - */ - public function updateKnowledgeBase(UpdateKnowledgeBaseRequest $request, array $callOptions = []): KnowledgeBase - { - return $this->startApiCall('UpdateKnowledgeBase', $request, $callOptions)->wait(); - } - - /** - * Gets information about a location. - * - * The async variant is {@see KnowledgeBasesClient::getLocationAsync()} . - * - * @example samples/V2/KnowledgeBasesClient/get_location.php - * - * @param GetLocationRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return Location - * - * @throws ApiException Thrown if the API call fails. - */ - public function getLocation(GetLocationRequest $request, array $callOptions = []): Location - { - return $this->startApiCall('GetLocation', $request, $callOptions)->wait(); - } - - /** - * Lists information about the supported locations for this service. - * - * The async variant is {@see KnowledgeBasesClient::listLocationsAsync()} . - * - * @example samples/V2/KnowledgeBasesClient/list_locations.php - * - * @param ListLocationsRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return PagedListResponse - * - * @throws ApiException Thrown if the API call fails. - */ - public function listLocations(ListLocationsRequest $request, array $callOptions = []): PagedListResponse - { - return $this->startApiCall('ListLocations', $request, $callOptions); - } -} diff --git a/owl-bot-staging/Dialogflow/v2/src/V2/Client/ParticipantsClient.php b/owl-bot-staging/Dialogflow/v2/src/V2/Client/ParticipantsClient.php deleted file mode 100644 index f0ee8afbdf01..000000000000 --- a/owl-bot-staging/Dialogflow/v2/src/V2/Client/ParticipantsClient.php +++ /dev/null @@ -1,1057 +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 ParticipantsClient::analyzeContentAsync()} . - * - * @example samples/V2/ParticipantsClient/analyze_content.php - * - * @param AnalyzeContentRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return AnalyzeContentResponse - * - * @throws ApiException Thrown if the API call fails. - */ - public function analyzeContent(AnalyzeContentRequest $request, array $callOptions = []): AnalyzeContentResponse - { - return $this->startApiCall('AnalyzeContent', $request, $callOptions)->wait(); - } - - /** - * Creates a new participant in a conversation. - * - * The async variant is {@see ParticipantsClient::createParticipantAsync()} . - * - * @example samples/V2/ParticipantsClient/create_participant.php - * - * @param CreateParticipantRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return Participant - * - * @throws ApiException Thrown if the API call fails. - */ - public function createParticipant(CreateParticipantRequest $request, array $callOptions = []): Participant - { - return $this->startApiCall('CreateParticipant', $request, $callOptions)->wait(); - } - - /** - * Retrieves a conversation participant. - * - * The async variant is {@see ParticipantsClient::getParticipantAsync()} . - * - * @example samples/V2/ParticipantsClient/get_participant.php - * - * @param GetParticipantRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return Participant - * - * @throws ApiException Thrown if the API call fails. - */ - public function getParticipant(GetParticipantRequest $request, array $callOptions = []): Participant - { - return $this->startApiCall('GetParticipant', $request, $callOptions)->wait(); - } - - /** - * Returns the list of all participants in the specified conversation. - * - * The async variant is {@see ParticipantsClient::listParticipantsAsync()} . - * - * @example samples/V2/ParticipantsClient/list_participants.php - * - * @param ListParticipantsRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return PagedListResponse - * - * @throws ApiException Thrown if the API call fails. - */ - public function listParticipants(ListParticipantsRequest $request, array $callOptions = []): PagedListResponse - { - return $this->startApiCall('ListParticipants', $request, $callOptions); - } - - /** - * Adds a text (chat, for example), or audio (phone recording, for example) - * message from a participant into the conversation. - * Note: This method is only available through the gRPC API (not REST). - * - * The top-level message sent to the client by the server is - * `StreamingAnalyzeContentResponse`. Multiple response messages can be - * returned in order. The first one or more messages contain the - * `recognition_result` field. Each result represents a more complete - * transcript of what the user said. The next message contains the - * `reply_text` field and potentially the `reply_audio` field. The message can - * also contain the `automated_agent_reply` field. - * - * Note: Always use agent versions for production traffic - * sent to virtual agents. See [Versions and - * environments](https://cloud.google.com/dialogflow/es/docs/agents-versions). - * - * @example samples/V2/ParticipantsClient/streaming_analyze_content.php - * - * @param array $callOptions { - * Optional. - * - * @type int $timeoutMillis - * Timeout to use for this call. - * } - * - * @return BidiStream - * - * @throws ApiException Thrown if the API call fails. - */ - public function streamingAnalyzeContent(array $callOptions = []): BidiStream - { - return $this->startApiCall('StreamingAnalyzeContent', null, $callOptions); - } - - /** - * Gets suggested articles for a participant based on specific historical - * messages. - * - * The async variant is {@see ParticipantsClient::suggestArticlesAsync()} . - * - * @example samples/V2/ParticipantsClient/suggest_articles.php - * - * @param SuggestArticlesRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return SuggestArticlesResponse - * - * @throws ApiException Thrown if the API call fails. - */ - public function suggestArticles(SuggestArticlesRequest $request, array $callOptions = []): SuggestArticlesResponse - { - return $this->startApiCall('SuggestArticles', $request, $callOptions)->wait(); - } - - /** - * Gets suggested faq answers for a participant based on specific historical - * messages. - * - * The async variant is {@see ParticipantsClient::suggestFaqAnswersAsync()} . - * - * @example samples/V2/ParticipantsClient/suggest_faq_answers.php - * - * @param SuggestFaqAnswersRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return SuggestFaqAnswersResponse - * - * @throws ApiException Thrown if the API call fails. - */ - public function suggestFaqAnswers(SuggestFaqAnswersRequest $request, array $callOptions = []): SuggestFaqAnswersResponse - { - return $this->startApiCall('SuggestFaqAnswers', $request, $callOptions)->wait(); - } - - /** - * Gets knowledge assist suggestions based on historical messages. - * - * The async variant is {@see ParticipantsClient::suggestKnowledgeAssistAsync()} . - * - * @example samples/V2/ParticipantsClient/suggest_knowledge_assist.php - * - * @param SuggestKnowledgeAssistRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return SuggestKnowledgeAssistResponse - * - * @throws ApiException Thrown if the API call fails. - */ - public function suggestKnowledgeAssist(SuggestKnowledgeAssistRequest $request, array $callOptions = []): SuggestKnowledgeAssistResponse - { - return $this->startApiCall('SuggestKnowledgeAssist', $request, $callOptions)->wait(); - } - - /** - * Gets smart replies for a participant based on specific historical - * messages. - * - * The async variant is {@see ParticipantsClient::suggestSmartRepliesAsync()} . - * - * @example samples/V2/ParticipantsClient/suggest_smart_replies.php - * - * @param SuggestSmartRepliesRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return SuggestSmartRepliesResponse - * - * @throws ApiException Thrown if the API call fails. - */ - public function suggestSmartReplies(SuggestSmartRepliesRequest $request, array $callOptions = []): SuggestSmartRepliesResponse - { - return $this->startApiCall('SuggestSmartReplies', $request, $callOptions)->wait(); - } - - /** - * Updates the specified participant. - * - * The async variant is {@see ParticipantsClient::updateParticipantAsync()} . - * - * @example samples/V2/ParticipantsClient/update_participant.php - * - * @param UpdateParticipantRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return Participant - * - * @throws ApiException Thrown if the API call fails. - */ - public function updateParticipant(UpdateParticipantRequest $request, array $callOptions = []): Participant - { - return $this->startApiCall('UpdateParticipant', $request, $callOptions)->wait(); - } - - /** - * Gets information about a location. - * - * The async variant is {@see ParticipantsClient::getLocationAsync()} . - * - * @example samples/V2/ParticipantsClient/get_location.php - * - * @param GetLocationRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return Location - * - * @throws ApiException Thrown if the API call fails. - */ - public function getLocation(GetLocationRequest $request, array $callOptions = []): Location - { - return $this->startApiCall('GetLocation', $request, $callOptions)->wait(); - } - - /** - * Lists information about the supported locations for this service. - * - * The async variant is {@see ParticipantsClient::listLocationsAsync()} . - * - * @example samples/V2/ParticipantsClient/list_locations.php - * - * @param ListLocationsRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return PagedListResponse - * - * @throws ApiException Thrown if the API call fails. - */ - public function listLocations(ListLocationsRequest $request, array $callOptions = []): PagedListResponse - { - return $this->startApiCall('ListLocations', $request, $callOptions); - } -} diff --git a/owl-bot-staging/Dialogflow/v2/src/V2/Client/SessionEntityTypesClient.php b/owl-bot-staging/Dialogflow/v2/src/V2/Client/SessionEntityTypesClient.php deleted file mode 100644 index d5cefd23e243..000000000000 --- a/owl-bot-staging/Dialogflow/v2/src/V2/Client/SessionEntityTypesClient.php +++ /dev/null @@ -1,631 +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 SessionEntityTypesClient::createSessionEntityTypeAsync()} . - * - * @example samples/V2/SessionEntityTypesClient/create_session_entity_type.php - * - * @param CreateSessionEntityTypeRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return SessionEntityType - * - * @throws ApiException Thrown if the API call fails. - */ - public function createSessionEntityType(CreateSessionEntityTypeRequest $request, array $callOptions = []): SessionEntityType - { - return $this->startApiCall('CreateSessionEntityType', $request, $callOptions)->wait(); - } - - /** - * Deletes the specified session entity type. - * - * This method doesn't work with Google Assistant integration. - * Contact Dialogflow support if you need to use session entities - * with Google Assistant integration. - * - * The async variant is - * {@see SessionEntityTypesClient::deleteSessionEntityTypeAsync()} . - * - * @example samples/V2/SessionEntityTypesClient/delete_session_entity_type.php - * - * @param DeleteSessionEntityTypeRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @throws ApiException Thrown if the API call fails. - */ - public function deleteSessionEntityType(DeleteSessionEntityTypeRequest $request, array $callOptions = []): void - { - $this->startApiCall('DeleteSessionEntityType', $request, $callOptions)->wait(); - } - - /** - * Retrieves the specified session entity type. - * - * This method doesn't work with Google Assistant integration. - * Contact Dialogflow support if you need to use session entities - * with Google Assistant integration. - * - * The async variant is - * {@see SessionEntityTypesClient::getSessionEntityTypeAsync()} . - * - * @example samples/V2/SessionEntityTypesClient/get_session_entity_type.php - * - * @param GetSessionEntityTypeRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return SessionEntityType - * - * @throws ApiException Thrown if the API call fails. - */ - public function getSessionEntityType(GetSessionEntityTypeRequest $request, array $callOptions = []): SessionEntityType - { - return $this->startApiCall('GetSessionEntityType', $request, $callOptions)->wait(); - } - - /** - * Returns the list of all session entity types in the specified session. - * - * This method doesn't work with Google Assistant integration. - * Contact Dialogflow support if you need to use session entities - * with Google Assistant integration. - * - * The async variant is - * {@see SessionEntityTypesClient::listSessionEntityTypesAsync()} . - * - * @example samples/V2/SessionEntityTypesClient/list_session_entity_types.php - * - * @param ListSessionEntityTypesRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return PagedListResponse - * - * @throws ApiException Thrown if the API call fails. - */ - public function listSessionEntityTypes(ListSessionEntityTypesRequest $request, array $callOptions = []): PagedListResponse - { - return $this->startApiCall('ListSessionEntityTypes', $request, $callOptions); - } - - /** - * Updates the specified session entity type. - * - * This method doesn't work with Google Assistant integration. - * Contact Dialogflow support if you need to use session entities - * with Google Assistant integration. - * - * The async variant is - * {@see SessionEntityTypesClient::updateSessionEntityTypeAsync()} . - * - * @example samples/V2/SessionEntityTypesClient/update_session_entity_type.php - * - * @param UpdateSessionEntityTypeRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return SessionEntityType - * - * @throws ApiException Thrown if the API call fails. - */ - public function updateSessionEntityType(UpdateSessionEntityTypeRequest $request, array $callOptions = []): SessionEntityType - { - return $this->startApiCall('UpdateSessionEntityType', $request, $callOptions)->wait(); - } - - /** - * Gets information about a location. - * - * The async variant is {@see SessionEntityTypesClient::getLocationAsync()} . - * - * @example samples/V2/SessionEntityTypesClient/get_location.php - * - * @param GetLocationRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return Location - * - * @throws ApiException Thrown if the API call fails. - */ - public function getLocation(GetLocationRequest $request, array $callOptions = []): Location - { - return $this->startApiCall('GetLocation', $request, $callOptions)->wait(); - } - - /** - * Lists information about the supported locations for this service. - * - * The async variant is {@see SessionEntityTypesClient::listLocationsAsync()} . - * - * @example samples/V2/SessionEntityTypesClient/list_locations.php - * - * @param ListLocationsRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return PagedListResponse - * - * @throws ApiException Thrown if the API call fails. - */ - public function listLocations(ListLocationsRequest $request, array $callOptions = []): PagedListResponse - { - return $this->startApiCall('ListLocations', $request, $callOptions); - } -} diff --git a/owl-bot-staging/Dialogflow/v2/src/V2/Client/SessionsClient.php b/owl-bot-staging/Dialogflow/v2/src/V2/Client/SessionsClient.php deleted file mode 100644 index 5dd0ff20ee69..000000000000 --- a/owl-bot-staging/Dialogflow/v2/src/V2/Client/SessionsClient.php +++ /dev/null @@ -1,656 +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 SessionsClient::detectIntentAsync()} . - * - * @example samples/V2/SessionsClient/detect_intent.php - * - * @param DetectIntentRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return DetectIntentResponse - * - * @throws ApiException Thrown if the API call fails. - */ - public function detectIntent(DetectIntentRequest $request, array $callOptions = []): DetectIntentResponse - { - return $this->startApiCall('DetectIntent', $request, $callOptions)->wait(); - } - - /** - * Processes a natural language query in audio format in a streaming fashion - * and returns structured, actionable data as a result. This method is only - * available via the gRPC API (not REST). - * - * If you might use - * [Agent Assist](https://cloud.google.com/dialogflow/docs/#aa) - * or other CCAI products now or in the future, consider using - * [StreamingAnalyzeContent][google.cloud.dialogflow.v2.Participants.StreamingAnalyzeContent] - * instead of `StreamingDetectIntent`. `StreamingAnalyzeContent` has - * additional functionality for Agent Assist and other CCAI products. - * - * Note: Always use agent versions for production traffic. - * See [Versions and - * environments](https://cloud.google.com/dialogflow/es/docs/agents-versions). - * - * @example samples/V2/SessionsClient/streaming_detect_intent.php - * - * @param array $callOptions { - * Optional. - * - * @type int $timeoutMillis - * Timeout to use for this call. - * } - * - * @return BidiStream - * - * @throws ApiException Thrown if the API call fails. - */ - public function streamingDetectIntent(array $callOptions = []): BidiStream - { - return $this->startApiCall('StreamingDetectIntent', null, $callOptions); - } - - /** - * Gets information about a location. - * - * The async variant is {@see SessionsClient::getLocationAsync()} . - * - * @example samples/V2/SessionsClient/get_location.php - * - * @param GetLocationRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return Location - * - * @throws ApiException Thrown if the API call fails. - */ - public function getLocation(GetLocationRequest $request, array $callOptions = []): Location - { - return $this->startApiCall('GetLocation', $request, $callOptions)->wait(); - } - - /** - * Lists information about the supported locations for this service. - * - * The async variant is {@see SessionsClient::listLocationsAsync()} . - * - * @example samples/V2/SessionsClient/list_locations.php - * - * @param ListLocationsRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return PagedListResponse - * - * @throws ApiException Thrown if the API call fails. - */ - public function listLocations(ListLocationsRequest $request, array $callOptions = []): PagedListResponse - { - return $this->startApiCall('ListLocations', $request, $callOptions); - } -} diff --git a/owl-bot-staging/Dialogflow/v2/src/V2/Client/VersionsClient.php b/owl-bot-staging/Dialogflow/v2/src/V2/Client/VersionsClient.php deleted file mode 100644 index 4e190441373c..000000000000 --- a/owl-bot-staging/Dialogflow/v2/src/V2/Client/VersionsClient.php +++ /dev/null @@ -1,500 +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 VersionsClient::createVersionAsync()} . - * - * @example samples/V2/VersionsClient/create_version.php - * - * @param CreateVersionRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return Version - * - * @throws ApiException Thrown if the API call fails. - */ - public function createVersion(CreateVersionRequest $request, array $callOptions = []): Version - { - return $this->startApiCall('CreateVersion', $request, $callOptions)->wait(); - } - - /** - * Delete the specified agent version. - * - * The async variant is {@see VersionsClient::deleteVersionAsync()} . - * - * @example samples/V2/VersionsClient/delete_version.php - * - * @param DeleteVersionRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @throws ApiException Thrown if the API call fails. - */ - public function deleteVersion(DeleteVersionRequest $request, array $callOptions = []): void - { - $this->startApiCall('DeleteVersion', $request, $callOptions)->wait(); - } - - /** - * Retrieves the specified agent version. - * - * The async variant is {@see VersionsClient::getVersionAsync()} . - * - * @example samples/V2/VersionsClient/get_version.php - * - * @param GetVersionRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return Version - * - * @throws ApiException Thrown if the API call fails. - */ - public function getVersion(GetVersionRequest $request, array $callOptions = []): Version - { - return $this->startApiCall('GetVersion', $request, $callOptions)->wait(); - } - - /** - * Returns the list of all versions of the specified agent. - * - * The async variant is {@see VersionsClient::listVersionsAsync()} . - * - * @example samples/V2/VersionsClient/list_versions.php - * - * @param ListVersionsRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return PagedListResponse - * - * @throws ApiException Thrown if the API call fails. - */ - public function listVersions(ListVersionsRequest $request, array $callOptions = []): PagedListResponse - { - return $this->startApiCall('ListVersions', $request, $callOptions); - } - - /** - * Updates the specified agent version. - * - * Note that this method does not allow you to update the state of the agent - * the given version points to. It allows you to update only mutable - * properties of the version resource. - * - * The async variant is {@see VersionsClient::updateVersionAsync()} . - * - * @example samples/V2/VersionsClient/update_version.php - * - * @param UpdateVersionRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return Version - * - * @throws ApiException Thrown if the API call fails. - */ - public function updateVersion(UpdateVersionRequest $request, array $callOptions = []): Version - { - return $this->startApiCall('UpdateVersion', $request, $callOptions)->wait(); - } - - /** - * Gets information about a location. - * - * The async variant is {@see VersionsClient::getLocationAsync()} . - * - * @example samples/V2/VersionsClient/get_location.php - * - * @param GetLocationRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return Location - * - * @throws ApiException Thrown if the API call fails. - */ - public function getLocation(GetLocationRequest $request, array $callOptions = []): Location - { - return $this->startApiCall('GetLocation', $request, $callOptions)->wait(); - } - - /** - * Lists information about the supported locations for this service. - * - * The async variant is {@see VersionsClient::listLocationsAsync()} . - * - * @example samples/V2/VersionsClient/list_locations.php - * - * @param ListLocationsRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return PagedListResponse - * - * @throws ApiException Thrown if the API call fails. - */ - public function listLocations(ListLocationsRequest $request, array $callOptions = []): PagedListResponse - { - return $this->startApiCall('ListLocations', $request, $callOptions); - } -} diff --git a/owl-bot-staging/Dialogflow/v2/src/V2/ContextsClient.php b/owl-bot-staging/Dialogflow/v2/src/V2/ContextsClient.php deleted file mode 100644 index 3ba108241d02..000000000000 --- a/owl-bot-staging/Dialogflow/v2/src/V2/ContextsClient.php +++ /dev/null @@ -1,34 +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. - * - * @deprecated Please use the new service client {@see \Google\Cloud\Dialogflow\V2\Client\AgentsClient}. - */ -class AgentsGapicClient -{ - use GapicClientTrait; - - /** The name of the service. */ - const SERVICE_NAME = 'google.cloud.dialogflow.v2.Agents'; - - /** - * The default address of the service. - * - * @deprecated SERVICE_ADDRESS_TEMPLATE should be used instead. - */ - const SERVICE_ADDRESS = 'dialogflow.googleapis.com'; - - /** The address template of the service. */ - private const SERVICE_ADDRESS_TEMPLATE = 'dialogflow.UNIVERSE_DOMAIN'; - - /** The default port of the service. */ - 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 329eacc35532..000000000000 --- a/owl-bot-staging/Dialogflow/v2/src/V2/Gapic/AnswerRecordsGapicClient.php +++ /dev/null @@ -1,1147 +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. - * - * @deprecated Please use the new service client {@see \Google\Cloud\Dialogflow\V2\Client\AnswerRecordsClient}. - */ -class AnswerRecordsGapicClient -{ - use GapicClientTrait; - - /** The name of the service. */ - const SERVICE_NAME = 'google.cloud.dialogflow.v2.AnswerRecords'; - - /** - * The default address of the service. - * - * @deprecated SERVICE_ADDRESS_TEMPLATE should be used instead. - */ - const SERVICE_ADDRESS = 'dialogflow.googleapis.com'; - - /** The address template of the service. */ - private const SERVICE_ADDRESS_TEMPLATE = 'dialogflow.UNIVERSE_DOMAIN'; - - /** The default port of the service. */ - 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 $answerRecordNameTemplate; - - private static $contextNameTemplate; - - private static $intentNameTemplate; - - private static $locationNameTemplate; - - private static $projectNameTemplate; - - private static $projectAgentNameTemplate; - - private static $projectAnswerRecordNameTemplate; - - private static $projectEnvironmentUserSessionNameTemplate; - - private static $projectEnvironmentUserSessionContextNameTemplate; - - private static $projectIntentNameTemplate; - - private static $projectLocationAgentNameTemplate; - - private static $projectLocationAnswerRecordNameTemplate; - - 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 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 getAgentNameTemplate() - { - if (self::$agentNameTemplate == null) { - self::$agentNameTemplate = new PathTemplate('projects/{project}/agent'); - } - - return self::$agentNameTemplate; - } - - private static function getAnswerRecordNameTemplate() - { - if (self::$answerRecordNameTemplate == null) { - self::$answerRecordNameTemplate = new PathTemplate('projects/{project}/answerRecords/{answer_record}'); - } - - return self::$answerRecordNameTemplate; - } - - 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 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 getProjectAnswerRecordNameTemplate() - { - if (self::$projectAnswerRecordNameTemplate == null) { - self::$projectAnswerRecordNameTemplate = new PathTemplate('projects/{project}/answerRecords/{answer_record}'); - } - - return self::$projectAnswerRecordNameTemplate; - } - - 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 getProjectLocationAnswerRecordNameTemplate() - { - if (self::$projectLocationAnswerRecordNameTemplate == null) { - self::$projectLocationAnswerRecordNameTemplate = new PathTemplate('projects/{project}/locations/{location}/answerRecords/{answer_record}'); - } - - return self::$projectLocationAnswerRecordNameTemplate; - } - - 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(), - 'answerRecord' => self::getAnswerRecordNameTemplate(), - 'context' => self::getContextNameTemplate(), - 'intent' => self::getIntentNameTemplate(), - 'location' => self::getLocationNameTemplate(), - 'project' => self::getProjectNameTemplate(), - 'projectAgent' => self::getProjectAgentNameTemplate(), - 'projectAnswerRecord' => self::getProjectAnswerRecordNameTemplate(), - 'projectEnvironmentUserSession' => self::getProjectEnvironmentUserSessionNameTemplate(), - 'projectEnvironmentUserSessionContext' => self::getProjectEnvironmentUserSessionContextNameTemplate(), - 'projectIntent' => self::getProjectIntentNameTemplate(), - 'projectLocationAgent' => self::getProjectLocationAgentNameTemplate(), - 'projectLocationAnswerRecord' => self::getProjectLocationAnswerRecordNameTemplate(), - '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 - * 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 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 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_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_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_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, - ]); - } - - /** - * 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 - * - answerRecord: projects/{project}/answerRecords/{answer_record} - * - context: projects/{project}/agent/sessions/{session}/contexts/{context} - * - intent: projects/{project}/agent/intents/{intent} - * - location: projects/{project}/locations/{location} - * - project: projects/{project} - * - projectAgent: projects/{project}/agent - * - projectAnswerRecord: projects/{project}/answerRecords/{answer_record} - * - projectEnvironmentUserSession: projects/{project}/agent/environments/{environment}/users/{user}/sessions/{session} - * - projectEnvironmentUserSessionContext: projects/{project}/agent/environments/{environment}/users/{user}/sessions/{session}/contexts/{context} - * - projectIntent: projects/{project}/agent/intents/{intent} - * - projectLocationAgent: projects/{project}/locations/{location}/agent - * - projectLocationAnswerRecord: projects/{project}/locations/{location}/answerRecords/{answer_record} - * - projectLocationEnvironmentUserSession: projects/{project}/locations/{location}/agent/environments/{environment}/users/{user}/sessions/{session} - * - projectLocationEnvironmentUserSessionContext: projects/{project}/locations/{location}/agent/environments/{environment}/users/{user}/sessions/{session}/contexts/{context} - * - projectLocationIntent: projects/{project}/locations/{location}/agent/intents/{intent} - * - projectLocationSession: projects/{project}/locations/{location}/agent/sessions/{session} - * - projectLocationSessionContext: projects/{project}/locations/{location}/agent/sessions/{session}/contexts/{context} - * - projectSession: projects/{project}/agent/sessions/{session} - * - projectSessionContext: projects/{project}/agent/sessions/{session}/contexts/{context} - * - session: projects/{project}/agent/sessions/{session} - * - * 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 c2e879fee6d7..000000000000 --- a/owl-bot-staging/Dialogflow/v2/src/V2/Gapic/ContextsGapicClient.php +++ /dev/null @@ -1,983 +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. - * - * @deprecated Please use the new service client {@see \Google\Cloud\Dialogflow\V2\Client\ContextsClient}. - */ -class ContextsGapicClient -{ - use GapicClientTrait; - - /** The name of the service. */ - const SERVICE_NAME = 'google.cloud.dialogflow.v2.Contexts'; - - /** - * The default address of the service. - * - * @deprecated SERVICE_ADDRESS_TEMPLATE should be used instead. - */ - const SERVICE_ADDRESS = 'dialogflow.googleapis.com'; - - /** The address template of the service. */ - private const SERVICE_ADDRESS_TEMPLATE = 'dialogflow.UNIVERSE_DOMAIN'; - - /** The default port of the service. */ - 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 08b5398c9e65..000000000000 --- a/owl-bot-staging/Dialogflow/v2/src/V2/Gapic/ConversationDatasetsGapicClient.php +++ /dev/null @@ -1,822 +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. - * - * @deprecated Please use the new service client {@see \Google\Cloud\Dialogflow\V2\Client\ConversationDatasetsClient}. - */ -class ConversationDatasetsGapicClient -{ - use GapicClientTrait; - - /** The name of the service. */ - const SERVICE_NAME = 'google.cloud.dialogflow.v2.ConversationDatasets'; - - /** - * The default address of the service. - * - * @deprecated SERVICE_ADDRESS_TEMPLATE should be used instead. - */ - const SERVICE_ADDRESS = 'dialogflow.googleapis.com'; - - /** The address template of the service. */ - private const SERVICE_ADDRESS_TEMPLATE = 'dialogflow.UNIVERSE_DOMAIN'; - - /** The default port of the service. */ - 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 3b58307a1bc1..000000000000 --- a/owl-bot-staging/Dialogflow/v2/src/V2/Gapic/ConversationModelsGapicClient.php +++ /dev/null @@ -1,1332 +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. - * - * @deprecated Please use the new service client {@see \Google\Cloud\Dialogflow\V2\Client\ConversationModelsClient}. - */ -class ConversationModelsGapicClient -{ - use GapicClientTrait; - - /** The name of the service. */ - const SERVICE_NAME = 'google.cloud.dialogflow.v2.ConversationModels'; - - /** - * The default address of the service. - * - * @deprecated SERVICE_ADDRESS_TEMPLATE should be used instead. - */ - const SERVICE_ADDRESS = 'dialogflow.googleapis.com'; - - /** The address template of the service. */ - private const SERVICE_ADDRESS_TEMPLATE = 'dialogflow.UNIVERSE_DOMAIN'; - - /** The default port of the service. */ - 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 36264e361e3a..000000000000 --- a/owl-bot-staging/Dialogflow/v2/src/V2/Gapic/ConversationProfilesGapicClient.php +++ /dev/null @@ -1,1426 +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. - * - * @deprecated Please use the new service client {@see \Google\Cloud\Dialogflow\V2\Client\ConversationProfilesClient}. - */ -class ConversationProfilesGapicClient -{ - use GapicClientTrait; - - /** The name of the service. */ - const SERVICE_NAME = 'google.cloud.dialogflow.v2.ConversationProfiles'; - - /** - * The default address of the service. - * - * @deprecated SERVICE_ADDRESS_TEMPLATE should be used instead. - */ - const SERVICE_ADDRESS = 'dialogflow.googleapis.com'; - - /** The address template of the service. */ - private const SERVICE_ADDRESS_TEMPLATE = 'dialogflow.UNIVERSE_DOMAIN'; - - /** The default port of the service. */ - 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 $generatorNameTemplate; - - 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 getGeneratorNameTemplate() - { - if (self::$generatorNameTemplate == null) { - self::$generatorNameTemplate = new PathTemplate('projects/{project}/locations/{location}/generators/{generator}'); - } - - return self::$generatorNameTemplate; - } - - 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(), - 'generator' => self::getGeneratorNameTemplate(), - '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 generator - * resource. - * - * @param string $project - * @param string $location - * @param string $generator - * - * @return string The formatted generator resource. - */ - public static function generatorName($project, $location, $generator) - { - return self::getGeneratorNameTemplate()->render([ - 'project' => $project, - 'location' => $location, - 'generator' => $generator, - ]); - } - - /** - * Formats a string containing the fully-qualified path to represent a - * knowledge_base resource. - * - * @param string $project - * @param string $knowledgeBase - * - * @return string The formatted knowledge_base resource. - */ - public static function knowledgeBaseName($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} - * - generator: projects/{project}/locations/{location}/generators/{generator} - * - 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 2f57d9cb22db..000000000000 --- a/owl-bot-staging/Dialogflow/v2/src/V2/Gapic/ConversationsGapicClient.php +++ /dev/null @@ -1,1753 +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. - * - * @deprecated Please use the new service client {@see \Google\Cloud\Dialogflow\V2\Client\ConversationsClient}. - */ -class ConversationsGapicClient -{ - use GapicClientTrait; - - /** The name of the service. */ - const SERVICE_NAME = 'google.cloud.dialogflow.v2.Conversations'; - - /** - * The default address of the service. - * - * @deprecated SERVICE_ADDRESS_TEMPLATE should be used instead. - */ - const SERVICE_ADDRESS = 'dialogflow.googleapis.com'; - - /** The address template of the service. */ - private const SERVICE_ADDRESS_TEMPLATE = 'dialogflow.UNIVERSE_DOMAIN'; - - /** The default port of the service. */ - 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 $generatorNameTemplate; - - 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 getGeneratorNameTemplate() - { - if (self::$generatorNameTemplate == null) { - self::$generatorNameTemplate = new PathTemplate('projects/{project}/locations/{location}/generators/{generator}'); - } - - return self::$generatorNameTemplate; - } - - 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(), - 'generator' => self::getGeneratorNameTemplate(), - '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 generator - * resource. - * - * @param string $project - * @param string $location - * @param string $generator - * - * @return string The formatted generator resource. - */ - public static function generatorName($project, $location, $generator) - { - return self::getGeneratorNameTemplate()->render([ - 'project' => $project, - 'location' => $location, - 'generator' => $generator, - ]); - } - - /** - * Formats a string containing the fully-qualified path to represent a - * knowledge_base resource. - * - * @param string $project - * @param string $knowledgeBase - * - * @return string The formatted knowledge_base resource. - */ - public static function knowledgeBaseName($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} - * - generator: projects/{project}/locations/{location}/generators/{generator} - * - knowledgeBase: projects/{project}/knowledgeBases/{knowledge_base} - * - location: projects/{project}/locations/{location} - * - message: projects/{project}/conversations/{conversation}/messages/{message} - * - 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 suggestion for a conversation that does not have a - * resource created for it. - * - * Sample code: - * ``` - * $conversationsClient = new ConversationsClient(); - * try { - * $formattedParent = $conversationsClient->locationName('[PROJECT]', '[LOCATION]'); - * $response = $conversationsClient->generateStatelessSuggestion($formattedParent); - * } finally { - * $conversationsClient->close(); - * } - * ``` - * - * @param string $parent Required. The parent resource to charge for the Suggestion's generation. - * Format: `projects//locations/`. - * @param array $optionalArgs { - * Optional. - * - * @type Generator $generator - * Uncreated generator. It should be a complete generator that includes all - * information about the generator. - * @type string $generatorName - * The resource name of the existing created generator. Format: - * `projects//locations//generators/` - * @type ConversationContext $conversationContext - * Optional. Context of the conversation, including transcripts. - * @type int[] $triggerEvents - * Optional. A list of trigger events. Generator will be triggered only if - * it's trigger event is included here. - * For allowed values, use constants defined on {@see \Google\Cloud\Dialogflow\V2\TriggerEvent} - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. 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\GenerateStatelessSuggestionResponse - * - * @throws ApiException if the remote call fails - */ - public function generateStatelessSuggestion($parent, array $optionalArgs = []) - { - $request = new GenerateStatelessSuggestionRequest(); - $requestParamHeaders = []; - $request->setParent($parent); - $requestParamHeaders['parent'] = $parent; - if (isset($optionalArgs['generator'])) { - $request->setGenerator($optionalArgs['generator']); - } - - if (isset($optionalArgs['generatorName'])) { - $request->setGeneratorName($optionalArgs['generatorName']); - } - - if (isset($optionalArgs['conversationContext'])) { - $request->setConversationContext($optionalArgs['conversationContext']); - } - - if (isset($optionalArgs['triggerEvents'])) { - $request->setTriggerEvents($optionalArgs['triggerEvents']); - } - - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startCall('GenerateStatelessSuggestion', GenerateStatelessSuggestionResponse::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 - * Optional. The name of the latest conversation message used as context for - * generating a Summary. If empty, the latest message of the conversation will - * be used. The format is specific to the user and the names of the messages - * provided. - * @type int $maxContextSize - * Optional. Max number of messages prior to and including - * [latest_message] to use as context when compiling the - * suggestion. By default 500 and at most 1000. - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. 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 - * Optional. A filter expression that filters conversations listed in the - * response. Only `lifecycle_state` can be filtered on in this way. For - * example, the following expression only returns `COMPLETED` conversations: - * - * `lifecycle_state = "COMPLETED"` - * - * For more information about filtering, see - * [API Filtering](https://aip.dev/160). - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. 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); - } - - /** - * Get answers for the given query based on knowledge documents. - * - * Sample code: - * ``` - * $conversationsClient = new ConversationsClient(); - * try { - * $query = new TextInput(); - * $formattedConversationProfile = $conversationsClient->conversationProfileName('[PROJECT]', '[CONVERSATION_PROFILE]'); - * $response = $conversationsClient->searchKnowledge($query, $formattedConversationProfile); - * } finally { - * $conversationsClient->close(); - * } - * ``` - * - * @param TextInput $query Required. The natural language text query for knowledge search. - * @param string $conversationProfile Required. The conversation profile used to configure the search. - * Format: `projects//locations//conversationProfiles/`. - * @param array $optionalArgs { - * Optional. - * - * @type string $parent - * Required. The parent resource contains the conversation profile - * Format: 'projects/' or `projects//locations/`. - * @type string $sessionId - * Required. The ID of the search session. - * The session_id can be combined with Dialogflow V3 Agent ID retrieved from - * conversation profile or on its own to identify a search session. The search - * history of the same session will impact the search result. It's up to the - * API caller to choose an appropriate `Session ID`. It can be a random number - * or some type of session identifiers (preferably hashed). The length must - * not exceed 36 characters. - * @type string $conversation - * Optional. The conversation (between human agent and end user) where the - * search request is triggered. Format: `projects//locations//conversations/`. - * @type string $latestMessage - * Optional. The name of the latest conversation message when the request is - * triggered. - * Format: `projects//locations//conversations//messages/`. - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. 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\SearchKnowledgeResponse - * - * @throws ApiException if the remote call fails - */ - public function searchKnowledge($query, $conversationProfile, array $optionalArgs = []) - { - $request = new SearchKnowledgeRequest(); - $requestParamHeaders = []; - $request->setQuery($query); - $request->setConversationProfile($conversationProfile); - if (isset($optionalArgs['parent'])) { - $request->setParent($optionalArgs['parent']); - $requestParamHeaders['parent'] = $optionalArgs['parent']; - } - - if (isset($optionalArgs['sessionId'])) { - $request->setSessionId($optionalArgs['sessionId']); - } - - if (isset($optionalArgs['conversation'])) { - $request->setConversation($optionalArgs['conversation']); - $requestParamHeaders['conversation'] = $optionalArgs['conversation']; - } - - if (isset($optionalArgs['latestMessage'])) { - $request->setLatestMessage($optionalArgs['latestMessage']); - } - - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startCall('SearchKnowledge', SearchKnowledgeResponse::class, $optionalArgs, $request)->wait(); - } - - /** - * Suggests summary for a conversation based on specific historical messages. - * The range of the messages to be used for summary can be specified in the - * request. - * - * 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 - * Optional. The name of the latest conversation message used as context for - * compiling suggestion. If empty, the latest message of the conversation will - * be used. - * - * Format: `projects//locations//conversations//messages/`. - * @type int $contextSize - * Optional. Max number of messages prior to and including - * [latest_message] to use as context when compiling the - * suggestion. By default 500 and at most 1000. - * @type AssistQueryParameters $assistQueryParams - * Optional. 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 cd065940144e..000000000000 --- a/owl-bot-staging/Dialogflow/v2/src/V2/Gapic/DocumentsGapicClient.php +++ /dev/null @@ -1,1275 +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. - * - * @deprecated Please use the new service client {@see \Google\Cloud\Dialogflow\V2\Client\DocumentsClient}. - */ -class DocumentsGapicClient -{ - use GapicClientTrait; - - /** The name of the service. */ - const SERVICE_NAME = 'google.cloud.dialogflow.v2.Documents'; - - /** - * The default address of the service. - * - * @deprecated SERVICE_ADDRESS_TEMPLATE should be used instead. - */ - const SERVICE_ADDRESS = 'dialogflow.googleapis.com'; - - /** The address template of the service. */ - private const SERVICE_ADDRESS_TEMPLATE = 'dialogflow.UNIVERSE_DOMAIN'; - - /** The default port of the service. */ - 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/EncryptionSpecServiceGapicClient.php b/owl-bot-staging/Dialogflow/v2/src/V2/Gapic/EncryptionSpecServiceGapicClient.php deleted file mode 100644 index 85239fe35f1c..000000000000 --- a/owl-bot-staging/Dialogflow/v2/src/V2/Gapic/EncryptionSpecServiceGapicClient.php +++ /dev/null @@ -1,521 +0,0 @@ -encryptionSpecName('[PROJECT]', '[LOCATION]'); - * $response = $encryptionSpecServiceClient->getEncryptionSpec($formattedName); - * } finally { - * $encryptionSpecServiceClient->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. - * - * @deprecated Please use the new service client {@see \Google\Cloud\Dialogflow\V2\Client\EncryptionSpecServiceClient}. - */ -class EncryptionSpecServiceGapicClient -{ - use GapicClientTrait; - - /** The name of the service. */ - const SERVICE_NAME = 'google.cloud.dialogflow.v2.EncryptionSpecService'; - - /** - * The default address of the service. - * - * @deprecated SERVICE_ADDRESS_TEMPLATE should be used instead. - */ - const SERVICE_ADDRESS = 'dialogflow.googleapis.com'; - - /** The address template of the service. */ - private const SERVICE_ADDRESS_TEMPLATE = 'dialogflow.UNIVERSE_DOMAIN'; - - /** The default port of the service. */ - 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 $encryptionSpecNameTemplate; - - 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/encryption_spec_service_client_config.json', - 'descriptorsConfigPath' => __DIR__ . '/../resources/encryption_spec_service_descriptor_config.php', - 'gcpApiConfigPath' => __DIR__ . '/../resources/encryption_spec_service_grpc_config.json', - 'credentialsConfig' => [ - 'defaultScopes' => self::$serviceScopes, - ], - 'transportConfig' => [ - 'rest' => [ - 'restClientConfigPath' => __DIR__ . '/../resources/encryption_spec_service_rest_client_config.php', - ], - ], - ]; - } - - private static function getEncryptionSpecNameTemplate() - { - if (self::$encryptionSpecNameTemplate == null) { - self::$encryptionSpecNameTemplate = new PathTemplate('projects/{project}/locations/{location}/encryptionSpec'); - } - - return self::$encryptionSpecNameTemplate; - } - - private static function getPathTemplateMap() - { - if (self::$pathTemplateMap == null) { - self::$pathTemplateMap = [ - 'encryptionSpec' => self::getEncryptionSpecNameTemplate(), - ]; - } - - return self::$pathTemplateMap; - } - - /** - * Formats a string containing the fully-qualified path to represent a - * encryption_spec resource. - * - * @param string $project - * @param string $location - * - * @return string The formatted encryption_spec resource. - */ - public static function encryptionSpecName($project, $location) - { - return self::getEncryptionSpecNameTemplate()->render([ - 'project' => $project, - 'location' => $location, - ]); - } - - /** - * Parses a formatted name string and returns an associative array of the components in the name. - * The following name formats are supported: - * Template: Pattern - * - encryptionSpec: projects/{project}/locations/{location}/encryptionSpec - * - * The optional $template argument can be supplied to specify a particular pattern, - * and must match one of the templates listed above. If no $template argument is - * provided, or if the $template argument does not match one of the templates - * listed, then parseName will check each of the supported templates, and return - * the first match. - * - * @param string $formattedName The formatted name string - * @param string $template Optional name of template to match - * - * @return array An associative array from name component IDs to component values. - * - * @throws ValidationException If $formattedName could not be matched. - */ - public static function parseName($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); - } - - /** - * Gets location-level encryption key specification. - * - * Sample code: - * ``` - * $encryptionSpecServiceClient = new EncryptionSpecServiceClient(); - * try { - * $formattedName = $encryptionSpecServiceClient->encryptionSpecName('[PROJECT]', '[LOCATION]'); - * $response = $encryptionSpecServiceClient->getEncryptionSpec($formattedName); - * } finally { - * $encryptionSpecServiceClient->close(); - * } - * ``` - * - * @param string $name Required. The name of the encryption spec resource to get. - * @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\EncryptionSpec - * - * @throws ApiException if the remote call fails - */ - public function getEncryptionSpec($name, array $optionalArgs = []) - { - $request = new GetEncryptionSpecRequest(); - $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('GetEncryptionSpec', EncryptionSpec::class, $optionalArgs, $request)->wait(); - } - - /** - * Initializes a location-level encryption key specification. An error will - * be thrown if the location has resources already created before the - * initialization. Once the encryption specification is initialized at a - * location, it is immutable and all newly created resources under the - * location will be encrypted with the existing specification. - * - * Sample code: - * ``` - * $encryptionSpecServiceClient = new EncryptionSpecServiceClient(); - * try { - * $encryptionSpec = new EncryptionSpec(); - * $operationResponse = $encryptionSpecServiceClient->initializeEncryptionSpec($encryptionSpec); - * $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 = $encryptionSpecServiceClient->initializeEncryptionSpec($encryptionSpec); - * $operationName = $operationResponse->getName(); - * // ... do other work - * $newOperationResponse = $encryptionSpecServiceClient->resumeOperation($operationName, 'initializeEncryptionSpec'); - * while (!$newOperationResponse->isDone()) { - * // ... do other work - * $newOperationResponse->reload(); - * } - * if ($newOperationResponse->operationSucceeded()) { - * $result = $newOperationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $newOperationResponse->getError(); - * // handleError($error) - * } - * } finally { - * $encryptionSpecServiceClient->close(); - * } - * ``` - * - * @param EncryptionSpec $encryptionSpec Required. The encryption spec used for CMEK encryption. It is required that - * the kms key is in the same region as the endpoint. The same key will be - * used for all provisioned resources, if encryption is available. If the - * kms_key_name is left empty, no encryption will be enforced. - * @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 initializeEncryptionSpec($encryptionSpec, array $optionalArgs = []) - { - $request = new InitializeEncryptionSpecRequest(); - $requestParamHeaders = []; - $request->setEncryptionSpec($encryptionSpec); - $requestParamHeaders['encryption_spec.name'] = $encryptionSpec->getName(); - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startOperationsCall('InitializeEncryptionSpec', $optionalArgs, $request, $this->getOperationsClient())->wait(); - } - - /** - * Gets information about a location. - * - * Sample code: - * ``` - * $encryptionSpecServiceClient = new EncryptionSpecServiceClient(); - * try { - * $response = $encryptionSpecServiceClient->getLocation(); - * } finally { - * $encryptionSpecServiceClient->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: - * ``` - * $encryptionSpecServiceClient = new EncryptionSpecServiceClient(); - * try { - * // Iterate over pages of elements - * $pagedResponse = $encryptionSpecServiceClient->listLocations(); - * foreach ($pagedResponse->iteratePages() as $page) { - * foreach ($page as $element) { - * // doSomethingWith($element); - * } - * } - * // Alternatively: - * // Iterate through all elements - * $pagedResponse = $encryptionSpecServiceClient->listLocations(); - * foreach ($pagedResponse->iterateAllElements() as $element) { - * // doSomethingWith($element); - * } - * } finally { - * $encryptionSpecServiceClient->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 900c5996f0b0..000000000000 --- a/owl-bot-staging/Dialogflow/v2/src/V2/Gapic/EntityTypesGapicClient.php +++ /dev/null @@ -1,1352 +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. - * - * @deprecated Please use the new service client {@see \Google\Cloud\Dialogflow\V2\Client\EntityTypesClient}. - */ -class EntityTypesGapicClient -{ - use GapicClientTrait; - - /** The name of the service. */ - const SERVICE_NAME = 'google.cloud.dialogflow.v2.EntityTypes'; - - /** - * The default address of the service. - * - * @deprecated SERVICE_ADDRESS_TEMPLATE should be used instead. - */ - const SERVICE_ADDRESS = 'dialogflow.googleapis.com'; - - /** The address template of the service. */ - private const SERVICE_ADDRESS_TEMPLATE = 'dialogflow.UNIVERSE_DOMAIN'; - - /** The default port of the service. */ - 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 983f31317e75..000000000000 --- a/owl-bot-staging/Dialogflow/v2/src/V2/Gapic/EnvironmentsGapicClient.php +++ /dev/null @@ -1,1060 +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. - * - * @deprecated Please use the new service client {@see \Google\Cloud\Dialogflow\V2\Client\EnvironmentsClient}. - */ -class EnvironmentsGapicClient -{ - use GapicClientTrait; - - /** The name of the service. */ - const SERVICE_NAME = 'google.cloud.dialogflow.v2.Environments'; - - /** - * The default address of the service. - * - * @deprecated SERVICE_ADDRESS_TEMPLATE should be used instead. - */ - const SERVICE_ADDRESS = 'dialogflow.googleapis.com'; - - /** The address template of the service. */ - private const SERVICE_ADDRESS_TEMPLATE = 'dialogflow.UNIVERSE_DOMAIN'; - - /** The default port of the service. */ - 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 cad836e9d04e..000000000000 --- a/owl-bot-staging/Dialogflow/v2/src/V2/Gapic/FulfillmentsGapicClient.php +++ /dev/null @@ -1,516 +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. - * - * @deprecated Please use the new service client {@see \Google\Cloud\Dialogflow\V2\Client\FulfillmentsClient}. - */ -class FulfillmentsGapicClient -{ - use GapicClientTrait; - - /** The name of the service. */ - const SERVICE_NAME = 'google.cloud.dialogflow.v2.Fulfillments'; - - /** - * The default address of the service. - * - * @deprecated SERVICE_ADDRESS_TEMPLATE should be used instead. - */ - const SERVICE_ADDRESS = 'dialogflow.googleapis.com'; - - /** The address template of the service. */ - private const SERVICE_ADDRESS_TEMPLATE = 'dialogflow.UNIVERSE_DOMAIN'; - - /** The default port of the service. */ - 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/GeneratorsGapicClient.php b/owl-bot-staging/Dialogflow/v2/src/V2/Gapic/GeneratorsGapicClient.php deleted file mode 100644 index 939895b41154..000000000000 --- a/owl-bot-staging/Dialogflow/v2/src/V2/Gapic/GeneratorsGapicClient.php +++ /dev/null @@ -1,668 +0,0 @@ -projectName('[PROJECT]'); - * $generator = new Generator(); - * $response = $generatorsClient->createGenerator($formattedParent, $generator); - * } finally { - * $generatorsClient->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. - * - * @deprecated Please use the new service client {@see \Google\Cloud\Dialogflow\V2\Client\GeneratorsClient}. - */ -class GeneratorsGapicClient -{ - use GapicClientTrait; - - /** The name of the service. */ - const SERVICE_NAME = 'google.cloud.dialogflow.v2.Generators'; - - /** - * The default address of the service. - * - * @deprecated SERVICE_ADDRESS_TEMPLATE should be used instead. - */ - const SERVICE_ADDRESS = 'dialogflow.googleapis.com'; - - /** The address template of the service. */ - private const SERVICE_ADDRESS_TEMPLATE = 'dialogflow.UNIVERSE_DOMAIN'; - - /** The default port of the service. */ - 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 $generatorNameTemplate; - - private static $projectNameTemplate; - - private static $pathTemplateMap; - - private static function getClientDefaults() - { - return [ - 'serviceName' => self::SERVICE_NAME, - 'apiEndpoint' => self::SERVICE_ADDRESS . ':' . self::DEFAULT_SERVICE_PORT, - 'clientConfig' => __DIR__ . '/../resources/generators_client_config.json', - 'descriptorsConfigPath' => __DIR__ . '/../resources/generators_descriptor_config.php', - 'gcpApiConfigPath' => __DIR__ . '/../resources/generators_grpc_config.json', - 'credentialsConfig' => [ - 'defaultScopes' => self::$serviceScopes, - ], - 'transportConfig' => [ - 'rest' => [ - 'restClientConfigPath' => __DIR__ . '/../resources/generators_rest_client_config.php', - ], - ], - ]; - } - - private static function getGeneratorNameTemplate() - { - if (self::$generatorNameTemplate == null) { - self::$generatorNameTemplate = new PathTemplate('projects/{project}/locations/{location}/generators/{generator}'); - } - - return self::$generatorNameTemplate; - } - - private static function getProjectNameTemplate() - { - if (self::$projectNameTemplate == null) { - self::$projectNameTemplate = new PathTemplate('projects/{project}'); - } - - return self::$projectNameTemplate; - } - - private static function getPathTemplateMap() - { - if (self::$pathTemplateMap == null) { - self::$pathTemplateMap = [ - 'generator' => self::getGeneratorNameTemplate(), - 'project' => self::getProjectNameTemplate(), - ]; - } - - return self::$pathTemplateMap; - } - - /** - * Formats a string containing the fully-qualified path to represent a generator - * resource. - * - * @param string $project - * @param string $location - * @param string $generator - * - * @return string The formatted generator resource. - */ - public static function generatorName($project, $location, $generator) - { - return self::getGeneratorNameTemplate()->render([ - 'project' => $project, - 'location' => $location, - 'generator' => $generator, - ]); - } - - /** - * Formats a string containing the fully-qualified path to represent a project - * resource. - * - * @param string $project - * - * @return string The formatted project resource. - */ - public static function projectName($project) - { - return self::getProjectNameTemplate()->render([ - 'project' => $project, - ]); - } - - /** - * Parses a formatted name string and returns an associative array of the components in the name. - * The following name formats are supported: - * Template: Pattern - * - generator: projects/{project}/locations/{location}/generators/{generator} - * - project: projects/{project} - * - * 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 generator. - * - * Sample code: - * ``` - * $generatorsClient = new GeneratorsClient(); - * try { - * $formattedParent = $generatorsClient->projectName('[PROJECT]'); - * $generator = new Generator(); - * $response = $generatorsClient->createGenerator($formattedParent, $generator); - * } finally { - * $generatorsClient->close(); - * } - * ``` - * - * @param string $parent Required. The project/location to create generator for. Format: - * `projects//locations/` - * @param Generator $generator Required. The generator to create. - * @param array $optionalArgs { - * Optional. - * - * @type string $generatorId - * Optional. The ID to use for the generator, which will become the final - * component of the generator's resource name. - * - * The generator ID must be compliant with the regression fomula - * `[a-zA-Z][a-zA-Z0-9_-]*` with the characters length in range of [3,64]. - * If the field is not provided, an Id will be auto-generated. - * If the field is provided, the caller is 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\Generator - * - * @throws ApiException if the remote call fails - */ - public function createGenerator($parent, $generator, array $optionalArgs = []) - { - $request = new CreateGeneratorRequest(); - $requestParamHeaders = []; - $request->setParent($parent); - $request->setGenerator($generator); - $requestParamHeaders['parent'] = $parent; - if (isset($optionalArgs['generatorId'])) { - $request->setGeneratorId($optionalArgs['generatorId']); - } - - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startCall('CreateGenerator', Generator::class, $optionalArgs, $request)->wait(); - } - - /** - * Deletes a generator. - * - * Sample code: - * ``` - * $generatorsClient = new GeneratorsClient(); - * try { - * $formattedName = $generatorsClient->generatorName('[PROJECT]', '[LOCATION]', '[GENERATOR]'); - * $generatorsClient->deleteGenerator($formattedName); - * } finally { - * $generatorsClient->close(); - * } - * ``` - * - * @param string $name Required. The generator resource name to delete. Format: - * `projects//locations//generators/` - * @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 deleteGenerator($name, array $optionalArgs = []) - { - $request = new DeleteGeneratorRequest(); - $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('DeleteGenerator', GPBEmpty::class, $optionalArgs, $request)->wait(); - } - - /** - * Retrieves a generator. - * - * Sample code: - * ``` - * $generatorsClient = new GeneratorsClient(); - * try { - * $formattedName = $generatorsClient->generatorName('[PROJECT]', '[LOCATION]', '[GENERATOR]'); - * $response = $generatorsClient->getGenerator($formattedName); - * } finally { - * $generatorsClient->close(); - * } - * ``` - * - * @param string $name Required. The generator resource name to retrieve. Format: - * `projects//locations/`/generators/` - * @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\Generator - * - * @throws ApiException if the remote call fails - */ - public function getGenerator($name, array $optionalArgs = []) - { - $request = new GetGeneratorRequest(); - $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('GetGenerator', Generator::class, $optionalArgs, $request)->wait(); - } - - /** - * Lists generators. - * - * Sample code: - * ``` - * $generatorsClient = new GeneratorsClient(); - * try { - * $formattedParent = $generatorsClient->projectName('[PROJECT]'); - * // Iterate over pages of elements - * $pagedResponse = $generatorsClient->listGenerators($formattedParent); - * foreach ($pagedResponse->iteratePages() as $page) { - * foreach ($page as $element) { - * // doSomethingWith($element); - * } - * } - * // Alternatively: - * // Iterate through all elements - * $pagedResponse = $generatorsClient->listGenerators($formattedParent); - * foreach ($pagedResponse->iterateAllElements() as $element) { - * // doSomethingWith($element); - * } - * } finally { - * $generatorsClient->close(); - * } - * ``` - * - * @param string $parent Required. The project/location to list generators 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 listGenerators($parent, array $optionalArgs = []) - { - $request = new ListGeneratorsRequest(); - $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('ListGenerators', $optionalArgs, ListGeneratorsResponse::class, $request); - } - - /** - * Updates a generator. - * - * Sample code: - * ``` - * $generatorsClient = new GeneratorsClient(); - * try { - * $generator = new Generator(); - * $response = $generatorsClient->updateGenerator($generator); - * } finally { - * $generatorsClient->close(); - * } - * ``` - * - * @param Generator $generator Required. The generator to update. - * The name field of generator is to identify the generator to update. - * @param array $optionalArgs { - * Optional. - * - * @type FieldMask $updateMask - * Optional. The list of fields to 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\Cloud\Dialogflow\V2\Generator - * - * @throws ApiException if the remote call fails - */ - public function updateGenerator($generator, array $optionalArgs = []) - { - $request = new UpdateGeneratorRequest(); - $requestParamHeaders = []; - $request->setGenerator($generator); - $requestParamHeaders['generator.name'] = $generator->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('UpdateGenerator', Generator::class, $optionalArgs, $request)->wait(); - } - - /** - * Gets information about a location. - * - * Sample code: - * ``` - * $generatorsClient = new GeneratorsClient(); - * try { - * $response = $generatorsClient->getLocation(); - * } finally { - * $generatorsClient->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: - * ``` - * $generatorsClient = new GeneratorsClient(); - * try { - * // Iterate over pages of elements - * $pagedResponse = $generatorsClient->listLocations(); - * foreach ($pagedResponse->iteratePages() as $page) { - * foreach ($page as $element) { - * // doSomethingWith($element); - * } - * } - * // Alternatively: - * // Iterate through all elements - * $pagedResponse = $generatorsClient->listLocations(); - * foreach ($pagedResponse->iterateAllElements() as $element) { - * // doSomethingWith($element); - * } - * } finally { - * $generatorsClient->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 edf60d9fd8ae..000000000000 --- a/owl-bot-staging/Dialogflow/v2/src/V2/Gapic/IntentsGapicClient.php +++ /dev/null @@ -1,1447 +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. - * - * @deprecated Please use the new service client {@see \Google\Cloud\Dialogflow\V2\Client\IntentsClient}. - */ -class IntentsGapicClient -{ - use GapicClientTrait; - - /** The name of the service. */ - const SERVICE_NAME = 'google.cloud.dialogflow.v2.Intents'; - - /** - * The default address of the service. - * - * @deprecated SERVICE_ADDRESS_TEMPLATE should be used instead. - */ - const SERVICE_ADDRESS = 'dialogflow.googleapis.com'; - - /** The address template of the service. */ - private const SERVICE_ADDRESS_TEMPLATE = 'dialogflow.UNIVERSE_DOMAIN'; - - /** The default port of the service. */ - 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 f6882c6a0759..000000000000 --- a/owl-bot-staging/Dialogflow/v2/src/V2/Gapic/KnowledgeBasesGapicClient.php +++ /dev/null @@ -1,781 +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. - * - * @deprecated Please use the new service client {@see \Google\Cloud\Dialogflow\V2\Client\KnowledgeBasesClient}. - */ -class KnowledgeBasesGapicClient -{ - use GapicClientTrait; - - /** The name of the service. */ - const SERVICE_NAME = 'google.cloud.dialogflow.v2.KnowledgeBases'; - - /** - * The default address of the service. - * - * @deprecated SERVICE_ADDRESS_TEMPLATE should be used instead. - */ - const SERVICE_ADDRESS = 'dialogflow.googleapis.com'; - - /** The address template of the service. */ - private const SERVICE_ADDRESS_TEMPLATE = 'dialogflow.UNIVERSE_DOMAIN'; - - /** The default port of the service. */ - 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 b50c7943d5d9..000000000000 --- a/owl-bot-staging/Dialogflow/v2/src/V2/Gapic/ParticipantsGapicClient.php +++ /dev/null @@ -1,1809 +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. - * - * @deprecated Please use the new service client {@see \Google\Cloud\Dialogflow\V2\Client\ParticipantsClient}. - */ -class ParticipantsGapicClient -{ - use GapicClientTrait; - - /** The name of the service. */ - const SERVICE_NAME = 'google.cloud.dialogflow.v2.Participants'; - - /** - * The default address of the service. - * - * @deprecated SERVICE_ADDRESS_TEMPLATE should be used instead. - */ - const SERVICE_ADDRESS = 'dialogflow.googleapis.com'; - - /** The address template of the service. */ - private const SERVICE_ADDRESS_TEMPLATE = 'dialogflow.UNIVERSE_DOMAIN'; - - /** The default port of the service. */ - 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 SuggestionInput $suggestionInput - * An input representing the selection of a suggestion. - * @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['suggestionInput'])) { - $request->setSuggestionInput($optionalArgs['suggestionInput']); - } - - 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 knowledge assist suggestions based on historical messages. - * - * Sample code: - * ``` - * $participantsClient = new ParticipantsClient(); - * try { - * $formattedParent = $participantsClient->participantName('[PROJECT]', '[CONVERSATION]', '[PARTICIPANT]'); - * $response = $participantsClient->suggestKnowledgeAssist($formattedParent); - * } finally { - * $participantsClient->close(); - * } - * ``` - * - * @param string $parent Required. The name of the participant to fetch suggestions for. - * Format: `projects//locations//conversations//participants/`. - * @param array $optionalArgs { - * Optional. - * - * @type string $latestMessage - * Optional. The name of the latest conversation message to compile - * suggestions for. If empty, it will be the latest message of the - * conversation. Format: `projects//locations//conversations//messages/`. - * @type int $contextSize - * Optional. Max number of messages prior to and including - * [latest_message][google.cloud.dialogflow.v2.SuggestKnowledgeAssistRequest.latest_message] - * to use as context when compiling the suggestion. The context size is by - * default 100 and at most 100. - * @type string $previousSuggestedQuery - * Optional. The previously suggested query for the given conversation. This - * helps identify whether the next suggestion we generate is resonably - * different from the previous one. This is useful to avoid similar - * suggestions within the conversation. - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. 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\SuggestKnowledgeAssistResponse - * - * @throws ApiException if the remote call fails - */ - public function suggestKnowledgeAssist($parent, array $optionalArgs = []) - { - $request = new SuggestKnowledgeAssistRequest(); - $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['previousSuggestedQuery'])) { - $request->setPreviousSuggestedQuery($optionalArgs['previousSuggestedQuery']); - } - - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startCall('SuggestKnowledgeAssist', SuggestKnowledgeAssistResponse::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 723714f78ba0..000000000000 --- a/owl-bot-staging/Dialogflow/v2/src/V2/Gapic/SessionEntityTypesGapicClient.php +++ /dev/null @@ -1,964 +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. - * - * @deprecated Please use the new service client {@see \Google\Cloud\Dialogflow\V2\Client\SessionEntityTypesClient}. - */ -class SessionEntityTypesGapicClient -{ - use GapicClientTrait; - - /** The name of the service. */ - const SERVICE_NAME = 'google.cloud.dialogflow.v2.SessionEntityTypes'; - - /** - * The default address of the service. - * - * @deprecated SERVICE_ADDRESS_TEMPLATE should be used instead. - */ - const SERVICE_ADDRESS = 'dialogflow.googleapis.com'; - - /** The address template of the service. */ - private const SERVICE_ADDRESS_TEMPLATE = 'dialogflow.UNIVERSE_DOMAIN'; - - /** The default port of the service. */ - 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 8c1852e41b29..000000000000 --- a/owl-bot-staging/Dialogflow/v2/src/V2/Gapic/SessionsGapicClient.php +++ /dev/null @@ -1,1051 +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. - * - * @deprecated Please use the new service client {@see \Google\Cloud\Dialogflow\V2\Client\SessionsClient}. - */ -class SessionsGapicClient -{ - use GapicClientTrait; - - /** The name of the service. */ - const SERVICE_NAME = 'google.cloud.dialogflow.v2.Sessions'; - - /** - * The default address of the service. - * - * @deprecated SERVICE_ADDRESS_TEMPLATE should be used instead. - */ - const SERVICE_ADDRESS = 'dialogflow.googleapis.com'; - - /** The address template of the service. */ - private const SERVICE_ADDRESS_TEMPLATE = 'dialogflow.UNIVERSE_DOMAIN'; - - /** The default port of the service. */ - 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 99ff31ee7c7c..000000000000 --- a/owl-bot-staging/Dialogflow/v2/src/V2/Gapic/VersionsGapicClient.php +++ /dev/null @@ -1,788 +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. - * - * @deprecated Please use the new service client {@see \Google\Cloud\Dialogflow\V2\Client\VersionsClient}. - */ -class VersionsGapicClient -{ - use GapicClientTrait; - - /** The name of the service. */ - const SERVICE_NAME = 'google.cloud.dialogflow.v2.Versions'; - - /** - * The default address of the service. - * - * @deprecated SERVICE_ADDRESS_TEMPLATE should be used instead. - */ - const SERVICE_ADDRESS = 'dialogflow.googleapis.com'; - - /** The address template of the service. */ - private const SERVICE_ADDRESS_TEMPLATE = 'dialogflow.UNIVERSE_DOMAIN'; - - /** The default port of the service. */ - 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/GeneratorsClient.php b/owl-bot-staging/Dialogflow/v2/src/V2/GeneratorsClient.php deleted file mode 100644 index 05b3a7e977c7..000000000000 --- a/owl-bot-staging/Dialogflow/v2/src/V2/GeneratorsClient.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 a9de4eed6e81..000000000000 --- a/owl-bot-staging/Dialogflow/v2/src/V2/resources/agents_rest_client_config.php +++ /dev/null @@ -1,270 +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 6b5eec4ed91a..000000000000 --- a/owl-bot-staging/Dialogflow/v2/src/V2/resources/answer_records_descriptor_config.php +++ /dev/null @@ -1,118 +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' => [ - 'agent' => 'projects/{project}/agent', - 'answerRecord' => 'projects/{project}/answerRecords/{answer_record}', - 'context' => 'projects/{project}/agent/sessions/{session}/contexts/{context}', - 'intent' => 'projects/{project}/agent/intents/{intent}', - 'location' => 'projects/{project}/locations/{location}', - 'project' => 'projects/{project}', - 'projectAgent' => 'projects/{project}/agent', - 'projectAnswerRecord' => 'projects/{project}/answerRecords/{answer_record}', - 'projectEnvironmentUserSession' => 'projects/{project}/agent/environments/{environment}/users/{user}/sessions/{session}', - 'projectEnvironmentUserSessionContext' => 'projects/{project}/agent/environments/{environment}/users/{user}/sessions/{session}/contexts/{context}', - 'projectIntent' => 'projects/{project}/agent/intents/{intent}', - 'projectLocationAgent' => 'projects/{project}/locations/{location}/agent', - 'projectLocationAnswerRecord' => 'projects/{project}/locations/{location}/answerRecords/{answer_record}', - 'projectLocationEnvironmentUserSession' => 'projects/{project}/locations/{location}/agent/environments/{environment}/users/{user}/sessions/{session}', - 'projectLocationEnvironmentUserSessionContext' => 'projects/{project}/locations/{location}/agent/environments/{environment}/users/{user}/sessions/{session}/contexts/{context}', - 'projectLocationIntent' => 'projects/{project}/locations/{location}/agent/intents/{intent}', - 'projectLocationSession' => 'projects/{project}/locations/{location}/agent/sessions/{session}', - 'projectLocationSessionContext' => 'projects/{project}/locations/{location}/agent/sessions/{session}/contexts/{context}', - 'projectSession' => 'projects/{project}/agent/sessions/{session}', - 'projectSessionContext' => 'projects/{project}/agent/sessions/{session}/contexts/{context}', - 'session' => 'projects/{project}/agent/sessions/{session}', - ], - ], - ], -]; 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 2e82c58294e8..000000000000 --- a/owl-bot-staging/Dialogflow/v2/src/V2/resources/answer_records_rest_client_config.php +++ /dev/null @@ -1,149 +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 a11b9c5d3e3d..000000000000 --- a/owl-bot-staging/Dialogflow/v2/src/V2/resources/contexts_descriptor_config.php +++ /dev/null @@ -1,155 +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 756ffcc0e54c..000000000000 --- a/owl-bot-staging/Dialogflow/v2/src/V2/resources/contexts_rest_client_config.php +++ /dev/null @@ -1,265 +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 7bbe37ad295a..000000000000 --- a/owl-bot-staging/Dialogflow/v2/src/V2/resources/conversation_datasets_descriptor_config.php +++ /dev/null @@ -1,155 +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 e94c777201ed..000000000000 --- a/owl-bot-staging/Dialogflow/v2/src/V2/resources/conversation_datasets_rest_client_config.php +++ /dev/null @@ -1,182 +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 fa73ebcd2d73..000000000000 --- a/owl-bot-staging/Dialogflow/v2/src/V2/resources/conversation_models_descriptor_config.php +++ /dev/null @@ -1,233 +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 b05e879c10ca..000000000000 --- a/owl-bot-staging/Dialogflow/v2/src/V2/resources/conversation_models_rest_client_config.php +++ /dev/null @@ -1,260 +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 ce49f95426be..000000000000 --- a/owl-bot-staging/Dialogflow/v2/src/V2/resources/conversation_profiles_descriptor_config.php +++ /dev/null @@ -1,190 +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}', - 'generator' => 'projects/{project}/locations/{location}/generators/{generator}', - '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 9c3334ecb6b2..000000000000 --- a/owl-bot-staging/Dialogflow/v2/src/V2/resources/conversation_profiles_rest_client_config.php +++ /dev/null @@ -1,240 +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 878520b39759..000000000000 --- a/owl-bot-staging/Dialogflow/v2/src/V2/resources/conversations_client_config.json +++ /dev/null @@ -1,89 +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" - }, - "GenerateStatelessSuggestion": { - "timeout_millis": 60000, - "retry_codes_name": "retry_policy_1_codes", - "retry_params_name": "retry_policy_1_params" - }, - "GenerateStatelessSummary": { - "timeout_millis": 60000, - "retry_codes_name": "retry_policy_1_codes", - "retry_params_name": "retry_policy_1_params" - }, - "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" - }, - "SearchKnowledge": { - "timeout_millis": 60000, - "retry_codes_name": "retry_policy_1_codes", - "retry_params_name": "retry_policy_1_params" - }, - "SuggestConversationSummary": { - "timeout_millis": 60000, - "retry_codes_name": "retry_policy_1_codes", - "retry_params_name": "retry_policy_1_params" - }, - "GetLocation": { - "timeout_millis": 60000, - "retry_codes_name": "retry_policy_1_codes", - "retry_params_name": "retry_policy_1_params" - }, - "ListLocations": { - "timeout_millis": 60000, - "retry_codes_name": "retry_policy_1_codes", - "retry_params_name": "retry_policy_1_params" - } - } - } - } -} diff --git a/owl-bot-staging/Dialogflow/v2/src/V2/resources/conversations_descriptor_config.php b/owl-bot-staging/Dialogflow/v2/src/V2/resources/conversations_descriptor_config.php deleted file mode 100644 index f9b401400daa..000000000000 --- a/owl-bot-staging/Dialogflow/v2/src/V2/resources/conversations_descriptor_config.php +++ /dev/null @@ -1,220 +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', - ], - ], - ], - ], - 'GenerateStatelessSuggestion' => [ - 'callType' => \Google\ApiCore\Call::UNARY_CALL, - 'responseType' => 'Google\Cloud\Dialogflow\V2\GenerateStatelessSuggestionResponse', - 'headerParams' => [ - [ - 'keyName' => 'parent', - 'fieldAccessors' => [ - 'getParent', - ], - ], - ], - ], - 'GenerateStatelessSummary' => [ - 'callType' => \Google\ApiCore\Call::UNARY_CALL, - 'responseType' => 'Google\Cloud\Dialogflow\V2\GenerateStatelessSummaryResponse', - 'headerParams' => [ - [ - 'keyName' => 'stateless_conversation.parent', - 'fieldAccessors' => [ - 'getStatelessConversation', - 'getParent', - ], - ], - ], - ], - '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', - ], - ], - ], - ], - 'SearchKnowledge' => [ - 'callType' => \Google\ApiCore\Call::UNARY_CALL, - 'responseType' => 'Google\Cloud\Dialogflow\V2\SearchKnowledgeResponse', - 'headerParams' => [ - [ - 'keyName' => 'parent', - 'fieldAccessors' => [ - 'getParent', - ], - ], - [ - 'keyName' => 'conversation', - 'fieldAccessors' => [ - 'getConversation', - ], - ], - ], - ], - 'SuggestConversationSummary' => [ - 'callType' => \Google\ApiCore\Call::UNARY_CALL, - 'responseType' => 'Google\Cloud\Dialogflow\V2\SuggestConversationSummaryResponse', - 'headerParams' => [ - [ - 'keyName' => 'conversation', - 'fieldAccessors' => [ - 'getConversation', - ], - ], - ], - ], - 'GetLocation' => [ - 'callType' => \Google\ApiCore\Call::UNARY_CALL, - 'responseType' => 'Google\Cloud\Location\Location', - 'headerParams' => [ - [ - 'keyName' => 'name', - 'fieldAccessors' => [ - 'getName', - ], - ], - ], - 'interfaceOverride' => 'google.cloud.location.Locations', - ], - 'ListLocations' => [ - 'pageStreaming' => [ - 'requestPageTokenGetMethod' => 'getPageToken', - 'requestPageTokenSetMethod' => 'setPageToken', - 'requestPageSizeGetMethod' => 'getPageSize', - 'requestPageSizeSetMethod' => 'setPageSize', - 'responsePageTokenGetMethod' => 'getNextPageToken', - 'resourcesGetMethod' => 'getLocations', - ], - 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, - 'responseType' => 'Google\Cloud\Location\ListLocationsResponse', - 'headerParams' => [ - [ - 'keyName' => 'name', - 'fieldAccessors' => [ - 'getName', - ], - ], - ], - 'interfaceOverride' => 'google.cloud.location.Locations', - ], - 'templateMap' => [ - 'agent' => 'projects/{project}/agent', - '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}', - 'generator' => 'projects/{project}/locations/{location}/generators/{generator}', - 'knowledgeBase' => 'projects/{project}/knowledgeBases/{knowledge_base}', - 'location' => 'projects/{project}/locations/{location}', - 'message' => 'projects/{project}/conversations/{conversation}/messages/{message}', - '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 a580c91404b4..000000000000 --- a/owl-bot-staging/Dialogflow/v2/src/V2/resources/conversations_rest_client_config.php +++ /dev/null @@ -1,280 +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', - ], - ], - ], - ], - 'GenerateStatelessSuggestion' => [ - 'method' => 'post', - 'uriTemplate' => '/v2/{parent=projects/*/locations/*}/statelessSuggestion:generate', - 'body' => '*', - 'placeholders' => [ - 'parent' => [ - 'getters' => [ - 'getParent', - ], - ], - ], - ], - 'GenerateStatelessSummary' => [ - 'method' => 'post', - 'uriTemplate' => '/v2/{stateless_conversation.parent=projects/*}/suggestions:generateStatelessSummary', - 'body' => '*', - 'additionalBindings' => [ - [ - 'method' => 'post', - 'uriTemplate' => '/v2/{stateless_conversation.parent=projects/*/locations/*}/suggestions:generateStatelessSummary', - 'body' => '*', - ], - ], - 'placeholders' => [ - 'stateless_conversation.parent' => [ - 'getters' => [ - 'getStatelessConversation', - 'getParent', - ], - ], - ], - ], - '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', - ], - ], - ], - ], - 'SearchKnowledge' => [ - 'method' => 'post', - 'uriTemplate' => '/v2/{parent=projects/*}/suggestions:searchKnowledge', - 'body' => '*', - 'additionalBindings' => [ - [ - 'method' => 'post', - 'uriTemplate' => '/v2/{parent=projects/*/locations/*}/suggestions:searchKnowledge', - 'body' => '*', - ], - [ - 'method' => 'post', - 'uriTemplate' => '/v2/{conversation=projects/*/conversations/*}/suggestions:searchKnowledge', - 'body' => '*', - ], - [ - 'method' => 'post', - 'uriTemplate' => '/v2/{conversation=projects/*/locations/*/conversations/*}/suggestions:searchKnowledge', - 'body' => '*', - ], - ], - 'placeholders' => [ - 'conversation' => [ - 'getters' => [ - 'getConversation', - ], - ], - 'parent' => [ - 'getters' => [ - 'getParent', - ], - ], - ], - ], - 'SuggestConversationSummary' => [ - 'method' => 'post', - 'uriTemplate' => '/v2/{conversation=projects/*/conversations/*}/suggestions:suggestConversationSummary', - 'body' => '*', - 'additionalBindings' => [ - [ - 'method' => 'post', - 'uriTemplate' => '/v2/{conversation=projects/*/locations/*/conversations/*}/suggestions:suggestConversationSummary', - 'body' => '*', - ], - ], - 'placeholders' => [ - 'conversation' => [ - 'getters' => [ - 'getConversation', - ], - ], - ], - ], - ], - 'google.cloud.location.Locations' => [ - 'GetLocation' => [ - 'method' => 'get', - 'uriTemplate' => '/v2/{name=projects/*/locations/*}', - 'placeholders' => [ - 'name' => [ - 'getters' => [ - 'getName', - ], - ], - ], - ], - 'ListLocations' => [ - 'method' => 'get', - 'uriTemplate' => '/v2/{name=projects/*}/locations', - 'placeholders' => [ - 'name' => [ - 'getters' => [ - 'getName', - ], - ], - ], - ], - ], - 'google.longrunning.Operations' => [ - 'CancelOperation' => [ - 'method' => 'post', - 'uriTemplate' => '/v2/{name=projects/*/operations/*}:cancel', - 'additionalBindings' => [ - [ - 'method' => 'post', - 'uriTemplate' => '/v2/{name=projects/*/locations/*/operations/*}:cancel', - ], - ], - 'placeholders' => [ - 'name' => [ - 'getters' => [ - 'getName', - ], - ], - ], - ], - 'GetOperation' => [ - 'method' => 'get', - 'uriTemplate' => '/v2/{name=projects/*/operations/*}', - 'additionalBindings' => [ - [ - 'method' => 'get', - 'uriTemplate' => '/v2/{name=projects/*/locations/*/operations/*}', - ], - ], - 'placeholders' => [ - 'name' => [ - 'getters' => [ - 'getName', - ], - ], - ], - ], - 'ListOperations' => [ - 'method' => 'get', - 'uriTemplate' => '/v2/{name=projects/*}/operations', - 'additionalBindings' => [ - [ - 'method' => 'get', - 'uriTemplate' => '/v2/{name=projects/*/locations/*}/operations', - ], - ], - 'placeholders' => [ - 'name' => [ - 'getters' => [ - 'getName', - ], - ], - ], - ], - ], - ], - 'numericEnums' => true, -]; diff --git a/owl-bot-staging/Dialogflow/v2/src/V2/resources/documents_client_config.json b/owl-bot-staging/Dialogflow/v2/src/V2/resources/documents_client_config.json 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 ddeba0eff1ea..000000000000 --- a/owl-bot-staging/Dialogflow/v2/src/V2/resources/documents_descriptor_config.php +++ /dev/null @@ -1,217 +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 22061213478a..000000000000 --- a/owl-bot-staging/Dialogflow/v2/src/V2/resources/documents_rest_client_config.php +++ /dev/null @@ -1,280 +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/encryption_spec_service_client_config.json b/owl-bot-staging/Dialogflow/v2/src/V2/resources/encryption_spec_service_client_config.json deleted file mode 100644 index ad9d113f458b..000000000000 --- a/owl-bot-staging/Dialogflow/v2/src/V2/resources/encryption_spec_service_client_config.json +++ /dev/null @@ -1,54 +0,0 @@ -{ - "interfaces": { - "google.cloud.dialogflow.v2.EncryptionSpecService": { - "retry_codes": { - "no_retry_codes": [], - "retry_policy_1_codes": [ - "UNAVAILABLE" - ] - }, - "retry_params": { - "no_retry_params": { - "initial_retry_delay_millis": 0, - "retry_delay_multiplier": 0.0, - "max_retry_delay_millis": 0, - "initial_rpc_timeout_millis": 0, - "rpc_timeout_multiplier": 1.0, - "max_rpc_timeout_millis": 0, - "total_timeout_millis": 0 - }, - "retry_policy_1_params": { - "initial_retry_delay_millis": 100, - "retry_delay_multiplier": 1.3, - "max_retry_delay_millis": 60000, - "initial_rpc_timeout_millis": 60000, - "rpc_timeout_multiplier": 1.0, - "max_rpc_timeout_millis": 60000, - "total_timeout_millis": 60000 - } - }, - "methods": { - "GetEncryptionSpec": { - "timeout_millis": 60000, - "retry_codes_name": "retry_policy_1_codes", - "retry_params_name": "retry_policy_1_params" - }, - "InitializeEncryptionSpec": { - "timeout_millis": 60000, - "retry_codes_name": "retry_policy_1_codes", - "retry_params_name": "retry_policy_1_params" - }, - "GetLocation": { - "timeout_millis": 60000, - "retry_codes_name": "retry_policy_1_codes", - "retry_params_name": "retry_policy_1_params" - }, - "ListLocations": { - "timeout_millis": 60000, - "retry_codes_name": "retry_policy_1_codes", - "retry_params_name": "retry_policy_1_params" - } - } - } - } -} diff --git a/owl-bot-staging/Dialogflow/v2/src/V2/resources/encryption_spec_service_descriptor_config.php b/owl-bot-staging/Dialogflow/v2/src/V2/resources/encryption_spec_service_descriptor_config.php deleted file mode 100644 index 64e32d6895fe..000000000000 --- a/owl-bot-staging/Dialogflow/v2/src/V2/resources/encryption_spec_service_descriptor_config.php +++ /dev/null @@ -1,97 +0,0 @@ - [ - 'google.cloud.dialogflow.v2.EncryptionSpecService' => [ - 'InitializeEncryptionSpec' => [ - 'longRunning' => [ - 'operationReturnType' => '\Google\Cloud\Dialogflow\V2\InitializeEncryptionSpecResponse', - 'metadataReturnType' => '\Google\Cloud\Dialogflow\V2\InitializeEncryptionSpecMetadata', - 'initialPollDelayMillis' => '500', - 'pollDelayMultiplier' => '1.5', - 'maxPollDelayMillis' => '5000', - 'totalPollTimeoutMillis' => '300000', - ], - 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, - 'headerParams' => [ - [ - 'keyName' => 'encryption_spec.name', - 'fieldAccessors' => [ - 'getEncryptionSpec', - 'getName', - ], - ], - ], - ], - 'GetEncryptionSpec' => [ - 'callType' => \Google\ApiCore\Call::UNARY_CALL, - 'responseType' => 'Google\Cloud\Dialogflow\V2\EncryptionSpec', - 'headerParams' => [ - [ - 'keyName' => 'name', - 'fieldAccessors' => [ - 'getName', - ], - ], - ], - ], - 'GetLocation' => [ - 'callType' => \Google\ApiCore\Call::UNARY_CALL, - 'responseType' => 'Google\Cloud\Location\Location', - 'headerParams' => [ - [ - 'keyName' => 'name', - 'fieldAccessors' => [ - 'getName', - ], - ], - ], - 'interfaceOverride' => 'google.cloud.location.Locations', - ], - 'ListLocations' => [ - 'pageStreaming' => [ - 'requestPageTokenGetMethod' => 'getPageToken', - 'requestPageTokenSetMethod' => 'setPageToken', - 'requestPageSizeGetMethod' => 'getPageSize', - 'requestPageSizeSetMethod' => 'setPageSize', - 'responsePageTokenGetMethod' => 'getNextPageToken', - 'resourcesGetMethod' => 'getLocations', - ], - 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, - 'responseType' => 'Google\Cloud\Location\ListLocationsResponse', - 'headerParams' => [ - [ - 'keyName' => 'name', - 'fieldAccessors' => [ - 'getName', - ], - ], - ], - 'interfaceOverride' => 'google.cloud.location.Locations', - ], - 'templateMap' => [ - 'encryptionSpec' => 'projects/{project}/locations/{location}/encryptionSpec', - ], - ], - ], -]; diff --git a/owl-bot-staging/Dialogflow/v2/src/V2/resources/encryption_spec_service_rest_client_config.php b/owl-bot-staging/Dialogflow/v2/src/V2/resources/encryption_spec_service_rest_client_config.php deleted file mode 100644 index ecf32803adf1..000000000000 --- a/owl-bot-staging/Dialogflow/v2/src/V2/resources/encryption_spec_service_rest_client_config.php +++ /dev/null @@ -1,130 +0,0 @@ - [ - 'google.cloud.dialogflow.v2.EncryptionSpecService' => [ - 'GetEncryptionSpec' => [ - 'method' => 'get', - 'uriTemplate' => '/v2/{name=projects/*/locations/*/encryptionSpec}', - 'placeholders' => [ - 'name' => [ - 'getters' => [ - 'getName', - ], - ], - ], - ], - 'InitializeEncryptionSpec' => [ - 'method' => 'post', - 'uriTemplate' => '/v2/{encryption_spec.name=projects/*/locations/*/encryptionSpec}:initialize', - 'body' => '*', - 'placeholders' => [ - 'encryption_spec.name' => [ - 'getters' => [ - 'getEncryptionSpec', - 'getName', - ], - ], - ], - ], - ], - 'google.cloud.location.Locations' => [ - 'GetLocation' => [ - 'method' => 'get', - 'uriTemplate' => '/v2/{name=projects/*/locations/*}', - 'placeholders' => [ - 'name' => [ - 'getters' => [ - 'getName', - ], - ], - ], - ], - 'ListLocations' => [ - 'method' => 'get', - 'uriTemplate' => '/v2/{name=projects/*}/locations', - 'placeholders' => [ - 'name' => [ - 'getters' => [ - 'getName', - ], - ], - ], - ], - ], - 'google.longrunning.Operations' => [ - 'CancelOperation' => [ - 'method' => 'post', - 'uriTemplate' => '/v2/{name=projects/*/operations/*}:cancel', - 'additionalBindings' => [ - [ - 'method' => 'post', - 'uriTemplate' => '/v2/{name=projects/*/locations/*/operations/*}:cancel', - ], - ], - 'placeholders' => [ - 'name' => [ - 'getters' => [ - 'getName', - ], - ], - ], - ], - 'GetOperation' => [ - 'method' => 'get', - 'uriTemplate' => '/v2/{name=projects/*/operations/*}', - 'additionalBindings' => [ - [ - 'method' => 'get', - 'uriTemplate' => '/v2/{name=projects/*/locations/*/operations/*}', - ], - ], - 'placeholders' => [ - 'name' => [ - 'getters' => [ - 'getName', - ], - ], - ], - ], - 'ListOperations' => [ - 'method' => 'get', - 'uriTemplate' => '/v2/{name=projects/*}/operations', - 'additionalBindings' => [ - [ - 'method' => 'get', - 'uriTemplate' => '/v2/{name=projects/*/locations/*}/operations', - ], - ], - 'placeholders' => [ - 'name' => [ - 'getters' => [ - 'getName', - ], - ], - ], - ], - ], - ], - 'numericEnums' => true, -]; diff --git a/owl-bot-staging/Dialogflow/v2/src/V2/resources/entity_types_client_config.json b/owl-bot-staging/Dialogflow/v2/src/V2/resources/entity_types_client_config.json 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 d9bd29f20e61..000000000000 --- a/owl-bot-staging/Dialogflow/v2/src/V2/resources/entity_types_descriptor_config.php +++ /dev/null @@ -1,234 +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 1742fe996aa5..000000000000 --- a/owl-bot-staging/Dialogflow/v2/src/V2/resources/entity_types_rest_client_config.php +++ /dev/null @@ -1,291 +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 18a5fd82ab95..000000000000 --- a/owl-bot-staging/Dialogflow/v2/src/V2/resources/environments_descriptor_config.php +++ /dev/null @@ -1,165 +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 2b1284121a19..000000000000 --- a/owl-bot-staging/Dialogflow/v2/src/V2/resources/environments_rest_client_config.php +++ /dev/null @@ -1,225 +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 934288f83f2a..000000000000 --- a/owl-bot-staging/Dialogflow/v2/src/V2/resources/fulfillments_descriptor_config.php +++ /dev/null @@ -1,92 +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 3ea8dacb34df..000000000000 --- a/owl-bot-staging/Dialogflow/v2/src/V2/resources/fulfillments_rest_client_config.php +++ /dev/null @@ -1,149 +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/generators_client_config.json b/owl-bot-staging/Dialogflow/v2/src/V2/resources/generators_client_config.json deleted file mode 100644 index d4ccea7d4677..000000000000 --- a/owl-bot-staging/Dialogflow/v2/src/V2/resources/generators_client_config.json +++ /dev/null @@ -1,69 +0,0 @@ -{ - "interfaces": { - "google.cloud.dialogflow.v2.Generators": { - "retry_codes": { - "no_retry_codes": [], - "retry_policy_1_codes": [ - "UNAVAILABLE" - ] - }, - "retry_params": { - "no_retry_params": { - "initial_retry_delay_millis": 0, - "retry_delay_multiplier": 0.0, - "max_retry_delay_millis": 0, - "initial_rpc_timeout_millis": 0, - "rpc_timeout_multiplier": 1.0, - "max_rpc_timeout_millis": 0, - "total_timeout_millis": 0 - }, - "retry_policy_1_params": { - "initial_retry_delay_millis": 100, - "retry_delay_multiplier": 1.3, - "max_retry_delay_millis": 60000, - "initial_rpc_timeout_millis": 60000, - "rpc_timeout_multiplier": 1.0, - "max_rpc_timeout_millis": 60000, - "total_timeout_millis": 60000 - } - }, - "methods": { - "CreateGenerator": { - "timeout_millis": 60000, - "retry_codes_name": "retry_policy_1_codes", - "retry_params_name": "retry_policy_1_params" - }, - "DeleteGenerator": { - "timeout_millis": 60000, - "retry_codes_name": "retry_policy_1_codes", - "retry_params_name": "retry_policy_1_params" - }, - "GetGenerator": { - "timeout_millis": 60000, - "retry_codes_name": "retry_policy_1_codes", - "retry_params_name": "retry_policy_1_params" - }, - "ListGenerators": { - "timeout_millis": 60000, - "retry_codes_name": "retry_policy_1_codes", - "retry_params_name": "retry_policy_1_params" - }, - "UpdateGenerator": { - "timeout_millis": 60000, - "retry_codes_name": "retry_policy_1_codes", - "retry_params_name": "retry_policy_1_params" - }, - "GetLocation": { - "timeout_millis": 60000, - "retry_codes_name": "retry_policy_1_codes", - "retry_params_name": "retry_policy_1_params" - }, - "ListLocations": { - "timeout_millis": 60000, - "retry_codes_name": "retry_policy_1_codes", - "retry_params_name": "retry_policy_1_params" - } - } - } - } -} diff --git a/owl-bot-staging/Dialogflow/v2/src/V2/resources/generators_descriptor_config.php b/owl-bot-staging/Dialogflow/v2/src/V2/resources/generators_descriptor_config.php deleted file mode 100644 index 5ef029130280..000000000000 --- a/owl-bot-staging/Dialogflow/v2/src/V2/resources/generators_descriptor_config.php +++ /dev/null @@ -1,135 +0,0 @@ - [ - 'google.cloud.dialogflow.v2.Generators' => [ - 'CreateGenerator' => [ - 'callType' => \Google\ApiCore\Call::UNARY_CALL, - 'responseType' => 'Google\Cloud\Dialogflow\V2\Generator', - 'headerParams' => [ - [ - 'keyName' => 'parent', - 'fieldAccessors' => [ - 'getParent', - ], - ], - ], - ], - 'DeleteGenerator' => [ - 'callType' => \Google\ApiCore\Call::UNARY_CALL, - 'responseType' => 'Google\Protobuf\GPBEmpty', - 'headerParams' => [ - [ - 'keyName' => 'name', - 'fieldAccessors' => [ - 'getName', - ], - ], - ], - ], - 'GetGenerator' => [ - 'callType' => \Google\ApiCore\Call::UNARY_CALL, - 'responseType' => 'Google\Cloud\Dialogflow\V2\Generator', - 'headerParams' => [ - [ - 'keyName' => 'name', - 'fieldAccessors' => [ - 'getName', - ], - ], - ], - ], - 'ListGenerators' => [ - 'pageStreaming' => [ - 'requestPageTokenGetMethod' => 'getPageToken', - 'requestPageTokenSetMethod' => 'setPageToken', - 'requestPageSizeGetMethod' => 'getPageSize', - 'requestPageSizeSetMethod' => 'setPageSize', - 'responsePageTokenGetMethod' => 'getNextPageToken', - 'resourcesGetMethod' => 'getGenerators', - ], - 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, - 'responseType' => 'Google\Cloud\Dialogflow\V2\ListGeneratorsResponse', - 'headerParams' => [ - [ - 'keyName' => 'parent', - 'fieldAccessors' => [ - 'getParent', - ], - ], - ], - ], - 'UpdateGenerator' => [ - 'callType' => \Google\ApiCore\Call::UNARY_CALL, - 'responseType' => 'Google\Cloud\Dialogflow\V2\Generator', - 'headerParams' => [ - [ - 'keyName' => 'generator.name', - 'fieldAccessors' => [ - 'getGenerator', - 'getName', - ], - ], - ], - ], - 'GetLocation' => [ - 'callType' => \Google\ApiCore\Call::UNARY_CALL, - 'responseType' => 'Google\Cloud\Location\Location', - 'headerParams' => [ - [ - 'keyName' => 'name', - 'fieldAccessors' => [ - 'getName', - ], - ], - ], - 'interfaceOverride' => 'google.cloud.location.Locations', - ], - 'ListLocations' => [ - 'pageStreaming' => [ - 'requestPageTokenGetMethod' => 'getPageToken', - 'requestPageTokenSetMethod' => 'setPageToken', - 'requestPageSizeGetMethod' => 'getPageSize', - 'requestPageSizeSetMethod' => 'setPageSize', - 'responsePageTokenGetMethod' => 'getNextPageToken', - 'resourcesGetMethod' => 'getLocations', - ], - 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, - 'responseType' => 'Google\Cloud\Location\ListLocationsResponse', - 'headerParams' => [ - [ - 'keyName' => 'name', - 'fieldAccessors' => [ - 'getName', - ], - ], - ], - 'interfaceOverride' => 'google.cloud.location.Locations', - ], - 'templateMap' => [ - 'generator' => 'projects/{project}/locations/{location}/generators/{generator}', - 'project' => 'projects/{project}', - ], - ], - ], -]; diff --git a/owl-bot-staging/Dialogflow/v2/src/V2/resources/generators_rest_client_config.php b/owl-bot-staging/Dialogflow/v2/src/V2/resources/generators_rest_client_config.php deleted file mode 100644 index f6ffa3f376c6..000000000000 --- a/owl-bot-staging/Dialogflow/v2/src/V2/resources/generators_rest_client_config.php +++ /dev/null @@ -1,177 +0,0 @@ - [ - 'google.cloud.dialogflow.v2.Generators' => [ - 'CreateGenerator' => [ - 'method' => 'post', - 'uriTemplate' => '/v2/{parent=projects/*/locations/*}/generators', - 'body' => 'generator', - 'additionalBindings' => [ - [ - 'method' => 'post', - 'uriTemplate' => '/v2/{parent=projects/*}/generators', - 'body' => 'generator', - ], - ], - 'placeholders' => [ - 'parent' => [ - 'getters' => [ - 'getParent', - ], - ], - ], - ], - 'DeleteGenerator' => [ - 'method' => 'delete', - 'uriTemplate' => '/v2/{name=projects/*/locations/*/generators/*}', - 'placeholders' => [ - 'name' => [ - 'getters' => [ - 'getName', - ], - ], - ], - ], - 'GetGenerator' => [ - 'method' => 'get', - 'uriTemplate' => '/v2/{name=projects/*/locations/*/generators/*}', - 'placeholders' => [ - 'name' => [ - 'getters' => [ - 'getName', - ], - ], - ], - ], - 'ListGenerators' => [ - 'method' => 'get', - 'uriTemplate' => '/v2/{parent=projects/*/locations/*}/generators', - 'additionalBindings' => [ - [ - 'method' => 'get', - 'uriTemplate' => '/v2/{parent=projects/*}/generators', - ], - ], - 'placeholders' => [ - 'parent' => [ - 'getters' => [ - 'getParent', - ], - ], - ], - ], - 'UpdateGenerator' => [ - 'method' => 'patch', - 'uriTemplate' => '/v2/{generator.name=projects/*/locations/*/generators/*}', - 'body' => 'generator', - 'placeholders' => [ - 'generator.name' => [ - 'getters' => [ - 'getGenerator', - 'getName', - ], - ], - ], - ], - ], - 'google.cloud.location.Locations' => [ - 'GetLocation' => [ - 'method' => 'get', - 'uriTemplate' => '/v2/{name=projects/*/locations/*}', - 'placeholders' => [ - 'name' => [ - 'getters' => [ - 'getName', - ], - ], - ], - ], - 'ListLocations' => [ - 'method' => 'get', - 'uriTemplate' => '/v2/{name=projects/*}/locations', - 'placeholders' => [ - 'name' => [ - 'getters' => [ - 'getName', - ], - ], - ], - ], - ], - 'google.longrunning.Operations' => [ - 'CancelOperation' => [ - 'method' => 'post', - 'uriTemplate' => '/v2/{name=projects/*/operations/*}:cancel', - 'additionalBindings' => [ - [ - 'method' => 'post', - 'uriTemplate' => '/v2/{name=projects/*/locations/*/operations/*}:cancel', - ], - ], - 'placeholders' => [ - 'name' => [ - 'getters' => [ - 'getName', - ], - ], - ], - ], - 'GetOperation' => [ - 'method' => 'get', - 'uriTemplate' => '/v2/{name=projects/*/operations/*}', - 'additionalBindings' => [ - [ - 'method' => 'get', - 'uriTemplate' => '/v2/{name=projects/*/locations/*/operations/*}', - ], - ], - 'placeholders' => [ - 'name' => [ - 'getters' => [ - 'getName', - ], - ], - ], - ], - 'ListOperations' => [ - 'method' => 'get', - 'uriTemplate' => '/v2/{name=projects/*}/operations', - 'additionalBindings' => [ - [ - 'method' => 'get', - 'uriTemplate' => '/v2/{name=projects/*/locations/*}/operations', - ], - ], - 'placeholders' => [ - 'name' => [ - 'getters' => [ - 'getName', - ], - ], - ], - ], - ], - ], - 'numericEnums' => true, -]; diff --git a/owl-bot-staging/Dialogflow/v2/src/V2/resources/intents_client_config.json b/owl-bot-staging/Dialogflow/v2/src/V2/resources/intents_client_config.json 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 d43f5884a84a..000000000000 --- a/owl-bot-staging/Dialogflow/v2/src/V2/resources/intents_descriptor_config.php +++ /dev/null @@ -1,187 +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 c6f9537e7696..000000000000 --- a/owl-bot-staging/Dialogflow/v2/src/V2/resources/intents_rest_client_config.php +++ /dev/null @@ -1,242 +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 9844957becbc..000000000000 --- a/owl-bot-staging/Dialogflow/v2/src/V2/resources/knowledge_bases_descriptor_config.php +++ /dev/null @@ -1,138 +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 0c7772592b29..000000000000 --- a/owl-bot-staging/Dialogflow/v2/src/V2/resources/knowledge_bases_rest_client_config.php +++ /dev/null @@ -1,218 +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 a96ad60c9a82..000000000000 --- a/owl-bot-staging/Dialogflow/v2/src/V2/resources/participants_client_config.json +++ /dev/null @@ -1,114 +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" - }, - "SuggestKnowledgeAssist": { - "timeout_millis": 60000, - "retry_codes_name": "retry_policy_1_codes", - "retry_params_name": "retry_policy_1_params" - }, - "SuggestSmartReplies": { - "timeout_millis": 60000, - "retry_codes_name": "retry_policy_1_codes", - "retry_params_name": "retry_policy_1_params" - }, - "UpdateParticipant": { - "timeout_millis": 60000, - "retry_codes_name": "retry_policy_1_codes", - "retry_params_name": "retry_policy_1_params" - }, - "GetLocation": { - "timeout_millis": 60000, - "retry_codes_name": "retry_policy_1_codes", - "retry_params_name": "retry_policy_1_params" - }, - "ListLocations": { - "timeout_millis": 60000, - "retry_codes_name": "retry_policy_1_codes", - "retry_params_name": "retry_policy_1_params" - } - } - } - } -} diff --git a/owl-bot-staging/Dialogflow/v2/src/V2/resources/participants_descriptor_config.php b/owl-bot-staging/Dialogflow/v2/src/V2/resources/participants_descriptor_config.php deleted file mode 100644 index 5a2033395861..000000000000 --- a/owl-bot-staging/Dialogflow/v2/src/V2/resources/participants_descriptor_config.php +++ /dev/null @@ -1,212 +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', - ], - ], - ], - ], - 'SuggestKnowledgeAssist' => [ - 'callType' => \Google\ApiCore\Call::UNARY_CALL, - 'responseType' => 'Google\Cloud\Dialogflow\V2\SuggestKnowledgeAssistResponse', - 'headerParams' => [ - [ - 'keyName' => 'parent', - 'fieldAccessors' => [ - 'getParent', - ], - ], - ], - ], - 'SuggestSmartReplies' => [ - 'callType' => \Google\ApiCore\Call::UNARY_CALL, - 'responseType' => 'Google\Cloud\Dialogflow\V2\SuggestSmartRepliesResponse', - 'headerParams' => [ - [ - 'keyName' => 'parent', - 'fieldAccessors' => [ - 'getParent', - ], - ], - ], - ], - 'UpdateParticipant' => [ - 'callType' => \Google\ApiCore\Call::UNARY_CALL, - 'responseType' => 'Google\Cloud\Dialogflow\V2\Participant', - 'headerParams' => [ - [ - 'keyName' => 'participant.name', - 'fieldAccessors' => [ - 'getParticipant', - 'getName', - ], - ], - ], - ], - 'GetLocation' => [ - 'callType' => \Google\ApiCore\Call::UNARY_CALL, - 'responseType' => 'Google\Cloud\Location\Location', - 'headerParams' => [ - [ - 'keyName' => 'name', - 'fieldAccessors' => [ - 'getName', - ], - ], - ], - 'interfaceOverride' => 'google.cloud.location.Locations', - ], - 'ListLocations' => [ - 'pageStreaming' => [ - 'requestPageTokenGetMethod' => 'getPageToken', - 'requestPageTokenSetMethod' => 'setPageToken', - 'requestPageSizeGetMethod' => 'getPageSize', - 'requestPageSizeSetMethod' => 'setPageSize', - 'responsePageTokenGetMethod' => 'getNextPageToken', - 'resourcesGetMethod' => 'getLocations', - ], - 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, - 'responseType' => 'Google\Cloud\Location\ListLocationsResponse', - 'headerParams' => [ - [ - 'keyName' => 'name', - 'fieldAccessors' => [ - 'getName', - ], - ], - ], - 'interfaceOverride' => 'google.cloud.location.Locations', - ], - 'templateMap' => [ - 'context' => 'projects/{project}/agent/sessions/{session}/contexts/{context}', - 'conversation' => 'projects/{project}/conversations/{conversation}', - 'message' => 'projects/{project}/conversations/{conversation}/messages/{message}', - 'participant' => 'projects/{project}/conversations/{conversation}/participants/{participant}', - '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 05c4a24dffe5..000000000000 --- a/owl-bot-staging/Dialogflow/v2/src/V2/resources/participants_rest_client_config.php +++ /dev/null @@ -1,280 +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', - ], - ], - ], - ], - 'SuggestKnowledgeAssist' => [ - 'method' => 'post', - 'uriTemplate' => '/v2/{parent=projects/*/conversations/*/participants/*}/suggestions:suggestKnowledgeAssist', - 'body' => '*', - 'additionalBindings' => [ - [ - 'method' => 'post', - 'uriTemplate' => '/v2/{parent=projects/*/locations/*/conversations/*/participants/*}/suggestions:suggestKnowledgeAssist', - 'body' => '*', - ], - ], - 'placeholders' => [ - 'parent' => [ - 'getters' => [ - 'getParent', - ], - ], - ], - ], - 'SuggestSmartReplies' => [ - 'method' => 'post', - 'uriTemplate' => '/v2/{parent=projects/*/conversations/*/participants/*}/suggestions:suggestSmartReplies', - 'body' => '*', - 'additionalBindings' => [ - [ - 'method' => 'post', - 'uriTemplate' => '/v2/{parent=projects/*/locations/*/conversations/*/participants/*}/suggestions:suggestSmartReplies', - 'body' => '*', - ], - ], - 'placeholders' => [ - 'parent' => [ - 'getters' => [ - 'getParent', - ], - ], - ], - ], - 'UpdateParticipant' => [ - 'method' => 'patch', - 'uriTemplate' => '/v2/{participant.name=projects/*/conversations/*/participants/*}', - 'body' => 'participant', - 'additionalBindings' => [ - [ - 'method' => 'patch', - 'uriTemplate' => '/v2/{participant.name=projects/*/locations/*/conversations/*/participants/*}', - 'body' => 'participant', - 'queryParams' => [ - 'update_mask', - ], - ], - ], - 'placeholders' => [ - 'participant.name' => [ - 'getters' => [ - 'getParticipant', - 'getName', - ], - ], - ], - 'queryParams' => [ - 'update_mask', - ], - ], - ], - 'google.cloud.location.Locations' => [ - 'GetLocation' => [ - 'method' => 'get', - 'uriTemplate' => '/v2/{name=projects/*/locations/*}', - 'placeholders' => [ - 'name' => [ - 'getters' => [ - 'getName', - ], - ], - ], - ], - 'ListLocations' => [ - 'method' => 'get', - 'uriTemplate' => '/v2/{name=projects/*}/locations', - 'placeholders' => [ - 'name' => [ - 'getters' => [ - 'getName', - ], - ], - ], - ], - ], - 'google.longrunning.Operations' => [ - 'CancelOperation' => [ - 'method' => 'post', - 'uriTemplate' => '/v2/{name=projects/*/operations/*}:cancel', - 'additionalBindings' => [ - [ - 'method' => 'post', - 'uriTemplate' => '/v2/{name=projects/*/locations/*/operations/*}:cancel', - ], - ], - 'placeholders' => [ - 'name' => [ - 'getters' => [ - 'getName', - ], - ], - ], - ], - 'GetOperation' => [ - 'method' => 'get', - 'uriTemplate' => '/v2/{name=projects/*/operations/*}', - 'additionalBindings' => [ - [ - 'method' => 'get', - 'uriTemplate' => '/v2/{name=projects/*/locations/*/operations/*}', - ], - ], - 'placeholders' => [ - 'name' => [ - 'getters' => [ - 'getName', - ], - ], - ], - ], - 'ListOperations' => [ - 'method' => 'get', - 'uriTemplate' => '/v2/{name=projects/*}/operations', - 'additionalBindings' => [ - [ - 'method' => 'get', - 'uriTemplate' => '/v2/{name=projects/*/locations/*}/operations', - ], - ], - 'placeholders' => [ - 'name' => [ - 'getters' => [ - 'getName', - ], - ], - ], - ], - ], - ], - 'numericEnums' => true, -]; diff --git a/owl-bot-staging/Dialogflow/v2/src/V2/resources/session_entity_types_client_config.json b/owl-bot-staging/Dialogflow/v2/src/V2/resources/session_entity_types_client_config.json 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 4a3ab70206be..000000000000 --- a/owl-bot-staging/Dialogflow/v2/src/V2/resources/session_entity_types_descriptor_config.php +++ /dev/null @@ -1,143 +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 ab800d609729..000000000000 --- a/owl-bot-staging/Dialogflow/v2/src/V2/resources/session_entity_types_rest_client_config.php +++ /dev/null @@ -1,240 +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 9841d3d32655..000000000000 --- a/owl-bot-staging/Dialogflow/v2/src/V2/resources/sessions_descriptor_config.php +++ /dev/null @@ -1,98 +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 cb68ff256c1b..000000000000 --- a/owl-bot-staging/Dialogflow/v2/src/V2/resources/sessions_rest_client_config.php +++ /dev/null @@ -1,135 +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 9d7753d6ddbf..000000000000 --- a/owl-bot-staging/Dialogflow/v2/src/V2/resources/versions_descriptor_config.php +++ /dev/null @@ -1,139 +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 d10527947441..000000000000 --- a/owl-bot-staging/Dialogflow/v2/src/V2/resources/versions_rest_client_config.php +++ /dev/null @@ -1,202 +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 0e50edb9b689..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 e150a76137bd..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 e1deb6232bdb..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 afe99defe2a5..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 26450e1422cf..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 ad973c022732..000000000000 --- a/owl-bot-staging/Dialogflow/v2/tests/Unit/V2/Client/ConversationDatasetsClientTest.php +++ /dev/null @@ -1,825 +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; - $satisfiesPzi = false; - $satisfiesPzs = false; - $expectedResponse = new ConversationDataset(); - $expectedResponse->setName($name); - $expectedResponse->setDisplayName($displayName); - $expectedResponse->setDescription($description); - $expectedResponse->setConversationCount($conversationCount); - $expectedResponse->setSatisfiesPzi($satisfiesPzi); - $expectedResponse->setSatisfiesPzs($satisfiesPzs); - $anyResponse = new Any(); - $anyResponse->setValue($expectedResponse->serializeToString()); - $completeOperation = new Operation(); - $completeOperation->setName('operations/createConversationDatasetTest'); - $completeOperation->setDone(true); - $completeOperation->setResponse($anyResponse); - $operationsTransport->addResponse($completeOperation); - // Mock request - $parent = 'parent-995424086'; - $conversationDataset = new ConversationDataset(); - $conversationDatasetDisplayName = 'conversationDatasetDisplayName-925930312'; - $conversationDataset->setDisplayName($conversationDatasetDisplayName); - $request = (new CreateConversationDatasetRequest()) - ->setParent($parent) - ->setConversationDataset($conversationDataset); - $response = $gapicClient->createConversationDataset($request); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $apiRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($apiRequests)); - $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); - $this->assertSame(0, count($operationsRequestsEmpty)); - $actualApiFuncCall = $apiRequests[0]->getFuncCall(); - $actualApiRequestObject = $apiRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.dialogflow.v2.ConversationDatasets/CreateConversationDataset', $actualApiFuncCall); - $actualValue = $actualApiRequestObject->getParent(); - $this->assertProtobufEquals($parent, $actualValue); - $actualValue = $actualApiRequestObject->getConversationDataset(); - $this->assertProtobufEquals($conversationDataset, $actualValue); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/createConversationDatasetTest'); - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - $this->assertTrue($response->isDone()); - $this->assertEquals($expectedResponse, $response->getResult()); - $apiRequestsEmpty = $transport->popReceivedCalls(); - $this->assertSame(0, count($apiRequestsEmpty)); - $operationsRequests = $operationsTransport->popReceivedCalls(); - $this->assertSame(1, count($operationsRequests)); - $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); - $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); - $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); - $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function createConversationDatasetExceptionTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/createConversationDatasetTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $operationsTransport->addResponse(null, $status); - // Mock request - $parent = 'parent-995424086'; - $conversationDataset = new ConversationDataset(); - $conversationDatasetDisplayName = 'conversationDatasetDisplayName-925930312'; - $conversationDataset->setDisplayName($conversationDatasetDisplayName); - $request = (new CreateConversationDatasetRequest()) - ->setParent($parent) - ->setConversationDataset($conversationDataset); - $response = $gapicClient->createConversationDataset($request); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/createConversationDatasetTest'); - try { - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - // If the pollUntilComplete() method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stubs are exhausted - $transport->popReceivedCalls(); - $operationsTransport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function deleteConversationDatasetTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/deleteConversationDatasetTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $expectedResponse = new GPBEmpty(); - $anyResponse = new Any(); - $anyResponse->setValue($expectedResponse->serializeToString()); - $completeOperation = new Operation(); - $completeOperation->setName('operations/deleteConversationDatasetTest'); - $completeOperation->setDone(true); - $completeOperation->setResponse($anyResponse); - $operationsTransport->addResponse($completeOperation); - // Mock request - $formattedName = $gapicClient->conversationDatasetName('[PROJECT]', '[LOCATION]', '[CONVERSATION_DATASET]'); - $request = (new DeleteConversationDatasetRequest()) - ->setName($formattedName); - $response = $gapicClient->deleteConversationDataset($request); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $apiRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($apiRequests)); - $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); - $this->assertSame(0, count($operationsRequestsEmpty)); - $actualApiFuncCall = $apiRequests[0]->getFuncCall(); - $actualApiRequestObject = $apiRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.dialogflow.v2.ConversationDatasets/DeleteConversationDataset', $actualApiFuncCall); - $actualValue = $actualApiRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/deleteConversationDatasetTest'); - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - $this->assertTrue($response->isDone()); - $this->assertEquals($expectedResponse, $response->getResult()); - $apiRequestsEmpty = $transport->popReceivedCalls(); - $this->assertSame(0, count($apiRequestsEmpty)); - $operationsRequests = $operationsTransport->popReceivedCalls(); - $this->assertSame(1, count($operationsRequests)); - $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); - $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); - $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); - $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function deleteConversationDatasetExceptionTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/deleteConversationDatasetTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $operationsTransport->addResponse(null, $status); - // Mock request - $formattedName = $gapicClient->conversationDatasetName('[PROJECT]', '[LOCATION]', '[CONVERSATION_DATASET]'); - $request = (new DeleteConversationDatasetRequest()) - ->setName($formattedName); - $response = $gapicClient->deleteConversationDataset($request); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/deleteConversationDatasetTest'); - try { - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - // If the pollUntilComplete() method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stubs are exhausted - $transport->popReceivedCalls(); - $operationsTransport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function getConversationDatasetTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name2 = 'name2-1052831874'; - $displayName = 'displayName1615086568'; - $description = 'description-1724546052'; - $conversationCount = 1994187347; - $satisfiesPzi = false; - $satisfiesPzs = false; - $expectedResponse = new ConversationDataset(); - $expectedResponse->setName($name2); - $expectedResponse->setDisplayName($displayName); - $expectedResponse->setDescription($description); - $expectedResponse->setConversationCount($conversationCount); - $expectedResponse->setSatisfiesPzi($satisfiesPzi); - $expectedResponse->setSatisfiesPzs($satisfiesPzs); - $transport->addResponse($expectedResponse); - // Mock request - $formattedName = $gapicClient->conversationDatasetName('[PROJECT]', '[LOCATION]', '[CONVERSATION_DATASET]'); - $request = (new GetConversationDatasetRequest()) - ->setName($formattedName); - $response = $gapicClient->getConversationDataset($request); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.dialogflow.v2.ConversationDatasets/GetConversationDataset', $actualFuncCall); - $actualValue = $actualRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function getConversationDatasetExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $formattedName = $gapicClient->conversationDatasetName('[PROJECT]', '[LOCATION]', '[CONVERSATION_DATASET]'); - $request = (new GetConversationDatasetRequest()) - ->setName($formattedName); - try { - $gapicClient->getConversationDataset($request); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function importConversationDataTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/importConversationDataTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $conversationDataset = 'conversationDataset1344013500'; - $importCount = 1721296907; - $expectedResponse = new ImportConversationDataOperationResponse(); - $expectedResponse->setConversationDataset($conversationDataset); - $expectedResponse->setImportCount($importCount); - $anyResponse = new Any(); - $anyResponse->setValue($expectedResponse->serializeToString()); - $completeOperation = new Operation(); - $completeOperation->setName('operations/importConversationDataTest'); - $completeOperation->setDone(true); - $completeOperation->setResponse($anyResponse); - $operationsTransport->addResponse($completeOperation); - // Mock request - $formattedName = $gapicClient->conversationDatasetName('[PROJECT]', '[LOCATION]', '[CONVERSATION_DATASET]'); - $inputConfig = new InputConfig(); - $request = (new ImportConversationDataRequest()) - ->setName($formattedName) - ->setInputConfig($inputConfig); - $response = $gapicClient->importConversationData($request); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $apiRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($apiRequests)); - $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); - $this->assertSame(0, count($operationsRequestsEmpty)); - $actualApiFuncCall = $apiRequests[0]->getFuncCall(); - $actualApiRequestObject = $apiRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.dialogflow.v2.ConversationDatasets/ImportConversationData', $actualApiFuncCall); - $actualValue = $actualApiRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $actualValue = $actualApiRequestObject->getInputConfig(); - $this->assertProtobufEquals($inputConfig, $actualValue); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/importConversationDataTest'); - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - $this->assertTrue($response->isDone()); - $this->assertEquals($expectedResponse, $response->getResult()); - $apiRequestsEmpty = $transport->popReceivedCalls(); - $this->assertSame(0, count($apiRequestsEmpty)); - $operationsRequests = $operationsTransport->popReceivedCalls(); - $this->assertSame(1, count($operationsRequests)); - $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); - $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); - $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); - $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function importConversationDataExceptionTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/importConversationDataTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $operationsTransport->addResponse(null, $status); - // Mock request - $formattedName = $gapicClient->conversationDatasetName('[PROJECT]', '[LOCATION]', '[CONVERSATION_DATASET]'); - $inputConfig = new InputConfig(); - $request = (new ImportConversationDataRequest()) - ->setName($formattedName) - ->setInputConfig($inputConfig); - $response = $gapicClient->importConversationData($request); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/importConversationDataTest'); - try { - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - // If the pollUntilComplete() method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stubs are exhausted - $transport->popReceivedCalls(); - $operationsTransport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function listConversationDatasetsTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $nextPageToken = ''; - $conversationDatasetsElement = new ConversationDataset(); - $conversationDatasets = [ - $conversationDatasetsElement, - ]; - $expectedResponse = new ListConversationDatasetsResponse(); - $expectedResponse->setNextPageToken($nextPageToken); - $expectedResponse->setConversationDatasets($conversationDatasets); - $transport->addResponse($expectedResponse); - // Mock request - $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); - $request = (new ListConversationDatasetsRequest()) - ->setParent($formattedParent); - $response = $gapicClient->listConversationDatasets($request); - $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); - $resources = iterator_to_array($response->iterateAllElements()); - $this->assertSame(1, count($resources)); - $this->assertEquals($expectedResponse->getConversationDatasets()[0], $resources[0]); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.dialogflow.v2.ConversationDatasets/ListConversationDatasets', $actualFuncCall); - $actualValue = $actualRequestObject->getParent(); - $this->assertProtobufEquals($formattedParent, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function listConversationDatasetsExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); - $request = (new ListConversationDatasetsRequest()) - ->setParent($formattedParent); - try { - $gapicClient->listConversationDatasets($request); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function getLocationTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name2 = 'name2-1052831874'; - $locationId = 'locationId552319461'; - $displayName = 'displayName1615086568'; - $expectedResponse = new Location(); - $expectedResponse->setName($name2); - $expectedResponse->setLocationId($locationId); - $expectedResponse->setDisplayName($displayName); - $transport->addResponse($expectedResponse); - $request = new GetLocationRequest(); - $response = $gapicClient->getLocation($request); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.location.Locations/GetLocation', $actualFuncCall); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function getLocationExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - $request = new GetLocationRequest(); - try { - $gapicClient->getLocation($request); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function listLocationsTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $nextPageToken = ''; - $locationsElement = new Location(); - $locations = [ - $locationsElement, - ]; - $expectedResponse = new ListLocationsResponse(); - $expectedResponse->setNextPageToken($nextPageToken); - $expectedResponse->setLocations($locations); - $transport->addResponse($expectedResponse); - $request = new ListLocationsRequest(); - $response = $gapicClient->listLocations($request); - $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); - $resources = iterator_to_array($response->iterateAllElements()); - $this->assertSame(1, count($resources)); - $this->assertEquals($expectedResponse->getLocations()[0], $resources[0]); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.location.Locations/ListLocations', $actualFuncCall); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function listLocationsExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - $request = new ListLocationsRequest(); - try { - $gapicClient->listLocations($request); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function createConversationDatasetAsyncTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/createConversationDatasetTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $name = 'name3373707'; - $displayName = 'displayName1615086568'; - $description = 'description-1724546052'; - $conversationCount = 1994187347; - $satisfiesPzi = false; - $satisfiesPzs = false; - $expectedResponse = new ConversationDataset(); - $expectedResponse->setName($name); - $expectedResponse->setDisplayName($displayName); - $expectedResponse->setDescription($description); - $expectedResponse->setConversationCount($conversationCount); - $expectedResponse->setSatisfiesPzi($satisfiesPzi); - $expectedResponse->setSatisfiesPzs($satisfiesPzs); - $anyResponse = new Any(); - $anyResponse->setValue($expectedResponse->serializeToString()); - $completeOperation = new Operation(); - $completeOperation->setName('operations/createConversationDatasetTest'); - $completeOperation->setDone(true); - $completeOperation->setResponse($anyResponse); - $operationsTransport->addResponse($completeOperation); - // Mock request - $parent = 'parent-995424086'; - $conversationDataset = new ConversationDataset(); - $conversationDatasetDisplayName = 'conversationDatasetDisplayName-925930312'; - $conversationDataset->setDisplayName($conversationDatasetDisplayName); - $request = (new CreateConversationDatasetRequest()) - ->setParent($parent) - ->setConversationDataset($conversationDataset); - $response = $gapicClient->createConversationDatasetAsync($request)->wait(); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $apiRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($apiRequests)); - $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); - $this->assertSame(0, count($operationsRequestsEmpty)); - $actualApiFuncCall = $apiRequests[0]->getFuncCall(); - $actualApiRequestObject = $apiRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.dialogflow.v2.ConversationDatasets/CreateConversationDataset', $actualApiFuncCall); - $actualValue = $actualApiRequestObject->getParent(); - $this->assertProtobufEquals($parent, $actualValue); - $actualValue = $actualApiRequestObject->getConversationDataset(); - $this->assertProtobufEquals($conversationDataset, $actualValue); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/createConversationDatasetTest'); - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - $this->assertTrue($response->isDone()); - $this->assertEquals($expectedResponse, $response->getResult()); - $apiRequestsEmpty = $transport->popReceivedCalls(); - $this->assertSame(0, count($apiRequestsEmpty)); - $operationsRequests = $operationsTransport->popReceivedCalls(); - $this->assertSame(1, count($operationsRequests)); - $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); - $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); - $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); - $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } -} diff --git a/owl-bot-staging/Dialogflow/v2/tests/Unit/V2/Client/ConversationModelsClientTest.php b/owl-bot-staging/Dialogflow/v2/tests/Unit/V2/Client/ConversationModelsClientTest.php deleted file mode 100644 index 7ac5c6a4d083..000000000000 --- a/owl-bot-staging/Dialogflow/v2/tests/Unit/V2/Client/ConversationModelsClientTest.php +++ /dev/null @@ -1,1203 +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'; - $satisfiesPzs = false; - $satisfiesPzi = false; - $expectedResponse = new ConversationModel(); - $expectedResponse->setName($name); - $expectedResponse->setDisplayName($displayName); - $expectedResponse->setLanguageCode($languageCode); - $expectedResponse->setSatisfiesPzs($satisfiesPzs); - $expectedResponse->setSatisfiesPzi($satisfiesPzi); - $anyResponse = new Any(); - $anyResponse->setValue($expectedResponse->serializeToString()); - $completeOperation = new Operation(); - $completeOperation->setName('operations/createConversationModelTest'); - $completeOperation->setDone(true); - $completeOperation->setResponse($anyResponse); - $operationsTransport->addResponse($completeOperation); - // Mock request - $conversationModel = new ConversationModel(); - $conversationModelDisplayName = 'conversationModelDisplayName-1078928857'; - $conversationModel->setDisplayName($conversationModelDisplayName); - $conversationModelDatasets = []; - $conversationModel->setDatasets($conversationModelDatasets); - $request = (new CreateConversationModelRequest()) - ->setConversationModel($conversationModel); - $response = $gapicClient->createConversationModel($request); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $apiRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($apiRequests)); - $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); - $this->assertSame(0, count($operationsRequestsEmpty)); - $actualApiFuncCall = $apiRequests[0]->getFuncCall(); - $actualApiRequestObject = $apiRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.dialogflow.v2.ConversationModels/CreateConversationModel', $actualApiFuncCall); - $actualValue = $actualApiRequestObject->getConversationModel(); - $this->assertProtobufEquals($conversationModel, $actualValue); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/createConversationModelTest'); - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - $this->assertTrue($response->isDone()); - $this->assertEquals($expectedResponse, $response->getResult()); - $apiRequestsEmpty = $transport->popReceivedCalls(); - $this->assertSame(0, count($apiRequestsEmpty)); - $operationsRequests = $operationsTransport->popReceivedCalls(); - $this->assertSame(1, count($operationsRequests)); - $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); - $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); - $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); - $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function createConversationModelExceptionTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/createConversationModelTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $operationsTransport->addResponse(null, $status); - // Mock request - $conversationModel = new ConversationModel(); - $conversationModelDisplayName = 'conversationModelDisplayName-1078928857'; - $conversationModel->setDisplayName($conversationModelDisplayName); - $conversationModelDatasets = []; - $conversationModel->setDatasets($conversationModelDatasets); - $request = (new CreateConversationModelRequest()) - ->setConversationModel($conversationModel); - $response = $gapicClient->createConversationModel($request); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/createConversationModelTest'); - try { - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - // If the pollUntilComplete() method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stubs are exhausted - $transport->popReceivedCalls(); - $operationsTransport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function createConversationModelEvaluationTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/createConversationModelEvaluationTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $name = 'name3373707'; - $displayName = 'displayName1615086568'; - $rawHumanEvalTemplateCsv = 'rawHumanEvalTemplateCsv-1393080869'; - $expectedResponse = new ConversationModelEvaluation(); - $expectedResponse->setName($name); - $expectedResponse->setDisplayName($displayName); - $expectedResponse->setRawHumanEvalTemplateCsv($rawHumanEvalTemplateCsv); - $anyResponse = new Any(); - $anyResponse->setValue($expectedResponse->serializeToString()); - $completeOperation = new Operation(); - $completeOperation->setName('operations/createConversationModelEvaluationTest'); - $completeOperation->setDone(true); - $completeOperation->setResponse($anyResponse); - $operationsTransport->addResponse($completeOperation); - // Mock request - $formattedParent = $gapicClient->conversationModelName('[PROJECT]', '[LOCATION]', '[CONVERSATION_MODEL]'); - $conversationModelEvaluation = new ConversationModelEvaluation(); - $request = (new CreateConversationModelEvaluationRequest()) - ->setParent($formattedParent) - ->setConversationModelEvaluation($conversationModelEvaluation); - $response = $gapicClient->createConversationModelEvaluation($request); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $apiRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($apiRequests)); - $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); - $this->assertSame(0, count($operationsRequestsEmpty)); - $actualApiFuncCall = $apiRequests[0]->getFuncCall(); - $actualApiRequestObject = $apiRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.dialogflow.v2.ConversationModels/CreateConversationModelEvaluation', $actualApiFuncCall); - $actualValue = $actualApiRequestObject->getParent(); - $this->assertProtobufEquals($formattedParent, $actualValue); - $actualValue = $actualApiRequestObject->getConversationModelEvaluation(); - $this->assertProtobufEquals($conversationModelEvaluation, $actualValue); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/createConversationModelEvaluationTest'); - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - $this->assertTrue($response->isDone()); - $this->assertEquals($expectedResponse, $response->getResult()); - $apiRequestsEmpty = $transport->popReceivedCalls(); - $this->assertSame(0, count($apiRequestsEmpty)); - $operationsRequests = $operationsTransport->popReceivedCalls(); - $this->assertSame(1, count($operationsRequests)); - $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); - $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); - $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); - $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function createConversationModelEvaluationExceptionTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/createConversationModelEvaluationTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $operationsTransport->addResponse(null, $status); - // Mock request - $formattedParent = $gapicClient->conversationModelName('[PROJECT]', '[LOCATION]', '[CONVERSATION_MODEL]'); - $conversationModelEvaluation = new ConversationModelEvaluation(); - $request = (new CreateConversationModelEvaluationRequest()) - ->setParent($formattedParent) - ->setConversationModelEvaluation($conversationModelEvaluation); - $response = $gapicClient->createConversationModelEvaluation($request); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/createConversationModelEvaluationTest'); - try { - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - // If the pollUntilComplete() method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stubs are exhausted - $transport->popReceivedCalls(); - $operationsTransport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function deleteConversationModelTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/deleteConversationModelTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $expectedResponse = new GPBEmpty(); - $anyResponse = new Any(); - $anyResponse->setValue($expectedResponse->serializeToString()); - $completeOperation = new Operation(); - $completeOperation->setName('operations/deleteConversationModelTest'); - $completeOperation->setDone(true); - $completeOperation->setResponse($anyResponse); - $operationsTransport->addResponse($completeOperation); - // Mock request - $name = 'name3373707'; - $request = (new DeleteConversationModelRequest()) - ->setName($name); - $response = $gapicClient->deleteConversationModel($request); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $apiRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($apiRequests)); - $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); - $this->assertSame(0, count($operationsRequestsEmpty)); - $actualApiFuncCall = $apiRequests[0]->getFuncCall(); - $actualApiRequestObject = $apiRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.dialogflow.v2.ConversationModels/DeleteConversationModel', $actualApiFuncCall); - $actualValue = $actualApiRequestObject->getName(); - $this->assertProtobufEquals($name, $actualValue); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/deleteConversationModelTest'); - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - $this->assertTrue($response->isDone()); - $this->assertEquals($expectedResponse, $response->getResult()); - $apiRequestsEmpty = $transport->popReceivedCalls(); - $this->assertSame(0, count($apiRequestsEmpty)); - $operationsRequests = $operationsTransport->popReceivedCalls(); - $this->assertSame(1, count($operationsRequests)); - $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); - $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); - $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); - $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function deleteConversationModelExceptionTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/deleteConversationModelTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $operationsTransport->addResponse(null, $status); - // Mock request - $name = 'name3373707'; - $request = (new DeleteConversationModelRequest()) - ->setName($name); - $response = $gapicClient->deleteConversationModel($request); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/deleteConversationModelTest'); - try { - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - // If the pollUntilComplete() method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stubs are exhausted - $transport->popReceivedCalls(); - $operationsTransport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function deployConversationModelTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/deployConversationModelTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $expectedResponse = new GPBEmpty(); - $anyResponse = new Any(); - $anyResponse->setValue($expectedResponse->serializeToString()); - $completeOperation = new Operation(); - $completeOperation->setName('operations/deployConversationModelTest'); - $completeOperation->setDone(true); - $completeOperation->setResponse($anyResponse); - $operationsTransport->addResponse($completeOperation); - // Mock request - $name = 'name3373707'; - $request = (new DeployConversationModelRequest()) - ->setName($name); - $response = $gapicClient->deployConversationModel($request); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $apiRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($apiRequests)); - $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); - $this->assertSame(0, count($operationsRequestsEmpty)); - $actualApiFuncCall = $apiRequests[0]->getFuncCall(); - $actualApiRequestObject = $apiRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.dialogflow.v2.ConversationModels/DeployConversationModel', $actualApiFuncCall); - $actualValue = $actualApiRequestObject->getName(); - $this->assertProtobufEquals($name, $actualValue); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/deployConversationModelTest'); - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - $this->assertTrue($response->isDone()); - $this->assertEquals($expectedResponse, $response->getResult()); - $apiRequestsEmpty = $transport->popReceivedCalls(); - $this->assertSame(0, count($apiRequestsEmpty)); - $operationsRequests = $operationsTransport->popReceivedCalls(); - $this->assertSame(1, count($operationsRequests)); - $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); - $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); - $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); - $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function deployConversationModelExceptionTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/deployConversationModelTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $operationsTransport->addResponse(null, $status); - // Mock request - $name = 'name3373707'; - $request = (new DeployConversationModelRequest()) - ->setName($name); - $response = $gapicClient->deployConversationModel($request); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/deployConversationModelTest'); - try { - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - // If the pollUntilComplete() method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stubs are exhausted - $transport->popReceivedCalls(); - $operationsTransport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function getConversationModelTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name2 = 'name2-1052831874'; - $displayName = 'displayName1615086568'; - $languageCode = 'languageCode-412800396'; - $satisfiesPzs = false; - $satisfiesPzi = false; - $expectedResponse = new ConversationModel(); - $expectedResponse->setName($name2); - $expectedResponse->setDisplayName($displayName); - $expectedResponse->setLanguageCode($languageCode); - $expectedResponse->setSatisfiesPzs($satisfiesPzs); - $expectedResponse->setSatisfiesPzi($satisfiesPzi); - $transport->addResponse($expectedResponse); - // Mock request - $name = 'name3373707'; - $request = (new GetConversationModelRequest()) - ->setName($name); - $response = $gapicClient->getConversationModel($request); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.dialogflow.v2.ConversationModels/GetConversationModel', $actualFuncCall); - $actualValue = $actualRequestObject->getName(); - $this->assertProtobufEquals($name, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function getConversationModelExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $name = 'name3373707'; - $request = (new GetConversationModelRequest()) - ->setName($name); - try { - $gapicClient->getConversationModel($request); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function getConversationModelEvaluationTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name2 = 'name2-1052831874'; - $displayName = 'displayName1615086568'; - $rawHumanEvalTemplateCsv = 'rawHumanEvalTemplateCsv-1393080869'; - $expectedResponse = new ConversationModelEvaluation(); - $expectedResponse->setName($name2); - $expectedResponse->setDisplayName($displayName); - $expectedResponse->setRawHumanEvalTemplateCsv($rawHumanEvalTemplateCsv); - $transport->addResponse($expectedResponse); - // Mock request - $name = 'name3373707'; - $request = (new GetConversationModelEvaluationRequest()) - ->setName($name); - $response = $gapicClient->getConversationModelEvaluation($request); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.dialogflow.v2.ConversationModels/GetConversationModelEvaluation', $actualFuncCall); - $actualValue = $actualRequestObject->getName(); - $this->assertProtobufEquals($name, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function getConversationModelEvaluationExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $name = 'name3373707'; - $request = (new GetConversationModelEvaluationRequest()) - ->setName($name); - try { - $gapicClient->getConversationModelEvaluation($request); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function listConversationModelEvaluationsTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $nextPageToken = ''; - $conversationModelEvaluationsElement = new ConversationModelEvaluation(); - $conversationModelEvaluations = [ - $conversationModelEvaluationsElement, - ]; - $expectedResponse = new ListConversationModelEvaluationsResponse(); - $expectedResponse->setNextPageToken($nextPageToken); - $expectedResponse->setConversationModelEvaluations($conversationModelEvaluations); - $transport->addResponse($expectedResponse); - // Mock request - $parent = 'parent-995424086'; - $request = (new ListConversationModelEvaluationsRequest()) - ->setParent($parent); - $response = $gapicClient->listConversationModelEvaluations($request); - $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); - $resources = iterator_to_array($response->iterateAllElements()); - $this->assertSame(1, count($resources)); - $this->assertEquals($expectedResponse->getConversationModelEvaluations()[0], $resources[0]); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.dialogflow.v2.ConversationModels/ListConversationModelEvaluations', $actualFuncCall); - $actualValue = $actualRequestObject->getParent(); - $this->assertProtobufEquals($parent, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function listConversationModelEvaluationsExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $parent = 'parent-995424086'; - $request = (new ListConversationModelEvaluationsRequest()) - ->setParent($parent); - try { - $gapicClient->listConversationModelEvaluations($request); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function listConversationModelsTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $nextPageToken = ''; - $conversationModelsElement = new ConversationModel(); - $conversationModels = [ - $conversationModelsElement, - ]; - $expectedResponse = new ListConversationModelsResponse(); - $expectedResponse->setNextPageToken($nextPageToken); - $expectedResponse->setConversationModels($conversationModels); - $transport->addResponse($expectedResponse); - // Mock request - $parent = 'parent-995424086'; - $request = (new ListConversationModelsRequest()) - ->setParent($parent); - $response = $gapicClient->listConversationModels($request); - $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); - $resources = iterator_to_array($response->iterateAllElements()); - $this->assertSame(1, count($resources)); - $this->assertEquals($expectedResponse->getConversationModels()[0], $resources[0]); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.dialogflow.v2.ConversationModels/ListConversationModels', $actualFuncCall); - $actualValue = $actualRequestObject->getParent(); - $this->assertProtobufEquals($parent, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function listConversationModelsExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $parent = 'parent-995424086'; - $request = (new ListConversationModelsRequest()) - ->setParent($parent); - try { - $gapicClient->listConversationModels($request); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function undeployConversationModelTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/undeployConversationModelTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $expectedResponse = new GPBEmpty(); - $anyResponse = new Any(); - $anyResponse->setValue($expectedResponse->serializeToString()); - $completeOperation = new Operation(); - $completeOperation->setName('operations/undeployConversationModelTest'); - $completeOperation->setDone(true); - $completeOperation->setResponse($anyResponse); - $operationsTransport->addResponse($completeOperation); - // Mock request - $name = 'name3373707'; - $request = (new UndeployConversationModelRequest()) - ->setName($name); - $response = $gapicClient->undeployConversationModel($request); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $apiRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($apiRequests)); - $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); - $this->assertSame(0, count($operationsRequestsEmpty)); - $actualApiFuncCall = $apiRequests[0]->getFuncCall(); - $actualApiRequestObject = $apiRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.dialogflow.v2.ConversationModels/UndeployConversationModel', $actualApiFuncCall); - $actualValue = $actualApiRequestObject->getName(); - $this->assertProtobufEquals($name, $actualValue); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/undeployConversationModelTest'); - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - $this->assertTrue($response->isDone()); - $this->assertEquals($expectedResponse, $response->getResult()); - $apiRequestsEmpty = $transport->popReceivedCalls(); - $this->assertSame(0, count($apiRequestsEmpty)); - $operationsRequests = $operationsTransport->popReceivedCalls(); - $this->assertSame(1, count($operationsRequests)); - $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); - $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); - $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); - $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function undeployConversationModelExceptionTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/undeployConversationModelTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $operationsTransport->addResponse(null, $status); - // Mock request - $name = 'name3373707'; - $request = (new UndeployConversationModelRequest()) - ->setName($name); - $response = $gapicClient->undeployConversationModel($request); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/undeployConversationModelTest'); - try { - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - // If the pollUntilComplete() method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stubs are exhausted - $transport->popReceivedCalls(); - $operationsTransport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function getLocationTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name2 = 'name2-1052831874'; - $locationId = 'locationId552319461'; - $displayName = 'displayName1615086568'; - $expectedResponse = new Location(); - $expectedResponse->setName($name2); - $expectedResponse->setLocationId($locationId); - $expectedResponse->setDisplayName($displayName); - $transport->addResponse($expectedResponse); - $request = new GetLocationRequest(); - $response = $gapicClient->getLocation($request); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.location.Locations/GetLocation', $actualFuncCall); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function getLocationExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - $request = new GetLocationRequest(); - try { - $gapicClient->getLocation($request); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function listLocationsTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $nextPageToken = ''; - $locationsElement = new Location(); - $locations = [ - $locationsElement, - ]; - $expectedResponse = new ListLocationsResponse(); - $expectedResponse->setNextPageToken($nextPageToken); - $expectedResponse->setLocations($locations); - $transport->addResponse($expectedResponse); - $request = new ListLocationsRequest(); - $response = $gapicClient->listLocations($request); - $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); - $resources = iterator_to_array($response->iterateAllElements()); - $this->assertSame(1, count($resources)); - $this->assertEquals($expectedResponse->getLocations()[0], $resources[0]); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.location.Locations/ListLocations', $actualFuncCall); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function listLocationsExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - $request = new ListLocationsRequest(); - try { - $gapicClient->listLocations($request); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function createConversationModelAsyncTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/createConversationModelTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $name = 'name3373707'; - $displayName = 'displayName1615086568'; - $languageCode = 'languageCode-412800396'; - $satisfiesPzs = false; - $satisfiesPzi = false; - $expectedResponse = new ConversationModel(); - $expectedResponse->setName($name); - $expectedResponse->setDisplayName($displayName); - $expectedResponse->setLanguageCode($languageCode); - $expectedResponse->setSatisfiesPzs($satisfiesPzs); - $expectedResponse->setSatisfiesPzi($satisfiesPzi); - $anyResponse = new Any(); - $anyResponse->setValue($expectedResponse->serializeToString()); - $completeOperation = new Operation(); - $completeOperation->setName('operations/createConversationModelTest'); - $completeOperation->setDone(true); - $completeOperation->setResponse($anyResponse); - $operationsTransport->addResponse($completeOperation); - // Mock request - $conversationModel = new ConversationModel(); - $conversationModelDisplayName = 'conversationModelDisplayName-1078928857'; - $conversationModel->setDisplayName($conversationModelDisplayName); - $conversationModelDatasets = []; - $conversationModel->setDatasets($conversationModelDatasets); - $request = (new CreateConversationModelRequest()) - ->setConversationModel($conversationModel); - $response = $gapicClient->createConversationModelAsync($request)->wait(); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $apiRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($apiRequests)); - $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); - $this->assertSame(0, count($operationsRequestsEmpty)); - $actualApiFuncCall = $apiRequests[0]->getFuncCall(); - $actualApiRequestObject = $apiRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.dialogflow.v2.ConversationModels/CreateConversationModel', $actualApiFuncCall); - $actualValue = $actualApiRequestObject->getConversationModel(); - $this->assertProtobufEquals($conversationModel, $actualValue); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/createConversationModelTest'); - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - $this->assertTrue($response->isDone()); - $this->assertEquals($expectedResponse, $response->getResult()); - $apiRequestsEmpty = $transport->popReceivedCalls(); - $this->assertSame(0, count($apiRequestsEmpty)); - $operationsRequests = $operationsTransport->popReceivedCalls(); - $this->assertSame(1, count($operationsRequests)); - $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); - $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); - $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); - $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } -} diff --git a/owl-bot-staging/Dialogflow/v2/tests/Unit/V2/Client/ConversationProfilesClientTest.php b/owl-bot-staging/Dialogflow/v2/tests/Unit/V2/Client/ConversationProfilesClientTest.php deleted file mode 100644 index 5df2196def3a..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 732aadc5d072..000000000000 --- a/owl-bot-staging/Dialogflow/v2/tests/Unit/V2/Client/ConversationsClientTest.php +++ /dev/null @@ -1,881 +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 generateStatelessSuggestionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $expectedResponse = new GenerateStatelessSuggestionResponse(); - $transport->addResponse($expectedResponse); - // Mock request - $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); - $request = (new GenerateStatelessSuggestionRequest()) - ->setParent($formattedParent); - $response = $gapicClient->generateStatelessSuggestion($request); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.dialogflow.v2.Conversations/GenerateStatelessSuggestion', $actualFuncCall); - $actualValue = $actualRequestObject->getParent(); - $this->assertProtobufEquals($formattedParent, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function generateStatelessSuggestionExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); - $request = (new GenerateStatelessSuggestionRequest()) - ->setParent($formattedParent); - try { - $gapicClient->generateStatelessSuggestion($request); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function generateStatelessSummaryTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $latestMessage2 = 'latestMessage2-440913086'; - $contextSize = 1116903569; - $expectedResponse = new GenerateStatelessSummaryResponse(); - $expectedResponse->setLatestMessage($latestMessage2); - $expectedResponse->setContextSize($contextSize); - $transport->addResponse($expectedResponse); - // Mock request - $statelessConversation = new MinimalConversation(); - $statelessConversationMessages = []; - $statelessConversation->setMessages($statelessConversationMessages); - $statelessConversationParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); - $statelessConversation->setParent($statelessConversationParent); - $conversationProfile = new ConversationProfile(); - $conversationProfileDisplayName = 'conversationProfileDisplayName-203415833'; - $conversationProfile->setDisplayName($conversationProfileDisplayName); - $request = (new GenerateStatelessSummaryRequest()) - ->setStatelessConversation($statelessConversation) - ->setConversationProfile($conversationProfile); - $response = $gapicClient->generateStatelessSummary($request); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.dialogflow.v2.Conversations/GenerateStatelessSummary', $actualFuncCall); - $actualValue = $actualRequestObject->getStatelessConversation(); - $this->assertProtobufEquals($statelessConversation, $actualValue); - $actualValue = $actualRequestObject->getConversationProfile(); - $this->assertProtobufEquals($conversationProfile, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function generateStatelessSummaryExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $statelessConversation = new MinimalConversation(); - $statelessConversationMessages = []; - $statelessConversation->setMessages($statelessConversationMessages); - $statelessConversationParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); - $statelessConversation->setParent($statelessConversationParent); - $conversationProfile = new ConversationProfile(); - $conversationProfileDisplayName = 'conversationProfileDisplayName-203415833'; - $conversationProfile->setDisplayName($conversationProfileDisplayName); - $request = (new GenerateStatelessSummaryRequest()) - ->setStatelessConversation($statelessConversation) - ->setConversationProfile($conversationProfile); - try { - $gapicClient->generateStatelessSummary($request); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function 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 searchKnowledgeTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $rewrittenQuery = 'rewrittenQuery-1113584563'; - $expectedResponse = new SearchKnowledgeResponse(); - $expectedResponse->setRewrittenQuery($rewrittenQuery); - $transport->addResponse($expectedResponse); - // Mock request - $query = new TextInput(); - $queryText = 'queryText-1806881259'; - $query->setText($queryText); - $queryLanguageCode = 'queryLanguageCode66898509'; - $query->setLanguageCode($queryLanguageCode); - $formattedConversationProfile = $gapicClient->conversationProfileName('[PROJECT]', '[CONVERSATION_PROFILE]'); - $request = (new SearchKnowledgeRequest()) - ->setQuery($query) - ->setConversationProfile($formattedConversationProfile); - $response = $gapicClient->searchKnowledge($request); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.dialogflow.v2.Conversations/SearchKnowledge', $actualFuncCall); - $actualValue = $actualRequestObject->getQuery(); - $this->assertProtobufEquals($query, $actualValue); - $actualValue = $actualRequestObject->getConversationProfile(); - $this->assertProtobufEquals($formattedConversationProfile, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function searchKnowledgeExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $query = new TextInput(); - $queryText = 'queryText-1806881259'; - $query->setText($queryText); - $queryLanguageCode = 'queryLanguageCode66898509'; - $query->setLanguageCode($queryLanguageCode); - $formattedConversationProfile = $gapicClient->conversationProfileName('[PROJECT]', '[CONVERSATION_PROFILE]'); - $request = (new SearchKnowledgeRequest()) - ->setQuery($query) - ->setConversationProfile($formattedConversationProfile); - try { - $gapicClient->searchKnowledge($request); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function suggestConversationSummaryTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $latestMessage2 = 'latestMessage2-440913086'; - $contextSize2 = 397491196; - $expectedResponse = new SuggestConversationSummaryResponse(); - $expectedResponse->setLatestMessage($latestMessage2); - $expectedResponse->setContextSize($contextSize2); - $transport->addResponse($expectedResponse); - // Mock request - $formattedConversation = $gapicClient->conversationName('[PROJECT]', '[CONVERSATION]'); - $request = (new SuggestConversationSummaryRequest()) - ->setConversation($formattedConversation); - $response = $gapicClient->suggestConversationSummary($request); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.dialogflow.v2.Conversations/SuggestConversationSummary', $actualFuncCall); - $actualValue = $actualRequestObject->getConversation(); - $this->assertProtobufEquals($formattedConversation, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function suggestConversationSummaryExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $formattedConversation = $gapicClient->conversationName('[PROJECT]', '[CONVERSATION]'); - $request = (new SuggestConversationSummaryRequest()) - ->setConversation($formattedConversation); - try { - $gapicClient->suggestConversationSummary($request); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function getLocationTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name2 = 'name2-1052831874'; - $locationId = 'locationId552319461'; - $displayName = 'displayName1615086568'; - $expectedResponse = new Location(); - $expectedResponse->setName($name2); - $expectedResponse->setLocationId($locationId); - $expectedResponse->setDisplayName($displayName); - $transport->addResponse($expectedResponse); - $request = new GetLocationRequest(); - $response = $gapicClient->getLocation($request); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.location.Locations/GetLocation', $actualFuncCall); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function getLocationExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - $request = new GetLocationRequest(); - try { - $gapicClient->getLocation($request); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function listLocationsTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $nextPageToken = ''; - $locationsElement = new Location(); - $locations = [ - $locationsElement, - ]; - $expectedResponse = new ListLocationsResponse(); - $expectedResponse->setNextPageToken($nextPageToken); - $expectedResponse->setLocations($locations); - $transport->addResponse($expectedResponse); - $request = new ListLocationsRequest(); - $response = $gapicClient->listLocations($request); - $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); - $resources = iterator_to_array($response->iterateAllElements()); - $this->assertSame(1, count($resources)); - $this->assertEquals($expectedResponse->getLocations()[0], $resources[0]); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.location.Locations/ListLocations', $actualFuncCall); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function listLocationsExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - $request = new ListLocationsRequest(); - try { - $gapicClient->listLocations($request); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function completeConversationAsyncTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name2 = 'name2-1052831874'; - $conversationProfile = 'conversationProfile-408626707'; - $expectedResponse = new Conversation(); - $expectedResponse->setName($name2); - $expectedResponse->setConversationProfile($conversationProfile); - $transport->addResponse($expectedResponse); - // Mock request - $formattedName = $gapicClient->conversationName('[PROJECT]', '[CONVERSATION]'); - $request = (new CompleteConversationRequest()) - ->setName($formattedName); - $response = $gapicClient->completeConversationAsync($request)->wait(); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.dialogflow.v2.Conversations/CompleteConversation', $actualFuncCall); - $actualValue = $actualRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $this->assertTrue($transport->isExhausted()); - } -} diff --git a/owl-bot-staging/Dialogflow/v2/tests/Unit/V2/Client/DocumentsClientTest.php b/owl-bot-staging/Dialogflow/v2/tests/Unit/V2/Client/DocumentsClientTest.php deleted file mode 100644 index adee77d94af1..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/EncryptionSpecServiceClientTest.php b/owl-bot-staging/Dialogflow/v2/tests/Unit/V2/Client/EncryptionSpecServiceClientTest.php deleted file mode 100644 index f114bab199fa..000000000000 --- a/owl-bot-staging/Dialogflow/v2/tests/Unit/V2/Client/EncryptionSpecServiceClientTest.php +++ /dev/null @@ -1,418 +0,0 @@ -getMockBuilder(CredentialsWrapper::class)->disableOriginalConstructor()->getMock(); - } - - /** @return EncryptionSpecServiceClient */ - private function createClient(array $options = []) - { - $options += [ - 'credentials' => $this->createCredentials(), - ]; - return new EncryptionSpecServiceClient($options); - } - - /** @test */ - public function getEncryptionSpecTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name2 = 'name2-1052831874'; - $kmsKey = 'kmsKey-591635343'; - $expectedResponse = new EncryptionSpec(); - $expectedResponse->setName($name2); - $expectedResponse->setKmsKey($kmsKey); - $transport->addResponse($expectedResponse); - // Mock request - $formattedName = $gapicClient->encryptionSpecName('[PROJECT]', '[LOCATION]'); - $request = (new GetEncryptionSpecRequest()) - ->setName($formattedName); - $response = $gapicClient->getEncryptionSpec($request); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.dialogflow.v2.EncryptionSpecService/GetEncryptionSpec', $actualFuncCall); - $actualValue = $actualRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function getEncryptionSpecExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $formattedName = $gapicClient->encryptionSpecName('[PROJECT]', '[LOCATION]'); - $request = (new GetEncryptionSpecRequest()) - ->setName($formattedName); - try { - $gapicClient->getEncryptionSpec($request); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function initializeEncryptionSpecTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/initializeEncryptionSpecTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $expectedResponse = new InitializeEncryptionSpecResponse(); - $anyResponse = new Any(); - $anyResponse->setValue($expectedResponse->serializeToString()); - $completeOperation = new Operation(); - $completeOperation->setName('operations/initializeEncryptionSpecTest'); - $completeOperation->setDone(true); - $completeOperation->setResponse($anyResponse); - $operationsTransport->addResponse($completeOperation); - // Mock request - $encryptionSpec = new EncryptionSpec(); - $encryptionSpecKmsKey = 'encryptionSpecKmsKey627607756'; - $encryptionSpec->setKmsKey($encryptionSpecKmsKey); - $request = (new InitializeEncryptionSpecRequest()) - ->setEncryptionSpec($encryptionSpec); - $response = $gapicClient->initializeEncryptionSpec($request); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $apiRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($apiRequests)); - $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); - $this->assertSame(0, count($operationsRequestsEmpty)); - $actualApiFuncCall = $apiRequests[0]->getFuncCall(); - $actualApiRequestObject = $apiRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.dialogflow.v2.EncryptionSpecService/InitializeEncryptionSpec', $actualApiFuncCall); - $actualValue = $actualApiRequestObject->getEncryptionSpec(); - $this->assertProtobufEquals($encryptionSpec, $actualValue); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/initializeEncryptionSpecTest'); - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - $this->assertTrue($response->isDone()); - $this->assertEquals($expectedResponse, $response->getResult()); - $apiRequestsEmpty = $transport->popReceivedCalls(); - $this->assertSame(0, count($apiRequestsEmpty)); - $operationsRequests = $operationsTransport->popReceivedCalls(); - $this->assertSame(1, count($operationsRequests)); - $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); - $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); - $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); - $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function initializeEncryptionSpecExceptionTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/initializeEncryptionSpecTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $operationsTransport->addResponse(null, $status); - // Mock request - $encryptionSpec = new EncryptionSpec(); - $encryptionSpecKmsKey = 'encryptionSpecKmsKey627607756'; - $encryptionSpec->setKmsKey($encryptionSpecKmsKey); - $request = (new InitializeEncryptionSpecRequest()) - ->setEncryptionSpec($encryptionSpec); - $response = $gapicClient->initializeEncryptionSpec($request); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/initializeEncryptionSpecTest'); - try { - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - // If the pollUntilComplete() method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stubs are exhausted - $transport->popReceivedCalls(); - $operationsTransport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function getLocationTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name2 = 'name2-1052831874'; - $locationId = 'locationId552319461'; - $displayName = 'displayName1615086568'; - $expectedResponse = new Location(); - $expectedResponse->setName($name2); - $expectedResponse->setLocationId($locationId); - $expectedResponse->setDisplayName($displayName); - $transport->addResponse($expectedResponse); - $request = new GetLocationRequest(); - $response = $gapicClient->getLocation($request); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.location.Locations/GetLocation', $actualFuncCall); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function getLocationExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - $request = new GetLocationRequest(); - try { - $gapicClient->getLocation($request); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function listLocationsTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $nextPageToken = ''; - $locationsElement = new Location(); - $locations = [ - $locationsElement, - ]; - $expectedResponse = new ListLocationsResponse(); - $expectedResponse->setNextPageToken($nextPageToken); - $expectedResponse->setLocations($locations); - $transport->addResponse($expectedResponse); - $request = new ListLocationsRequest(); - $response = $gapicClient->listLocations($request); - $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); - $resources = iterator_to_array($response->iterateAllElements()); - $this->assertSame(1, count($resources)); - $this->assertEquals($expectedResponse->getLocations()[0], $resources[0]); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.location.Locations/ListLocations', $actualFuncCall); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function listLocationsExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - $request = new ListLocationsRequest(); - try { - $gapicClient->listLocations($request); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function getEncryptionSpecAsyncTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name2 = 'name2-1052831874'; - $kmsKey = 'kmsKey-591635343'; - $expectedResponse = new EncryptionSpec(); - $expectedResponse->setName($name2); - $expectedResponse->setKmsKey($kmsKey); - $transport->addResponse($expectedResponse); - // Mock request - $formattedName = $gapicClient->encryptionSpecName('[PROJECT]', '[LOCATION]'); - $request = (new GetEncryptionSpecRequest()) - ->setName($formattedName); - $response = $gapicClient->getEncryptionSpecAsync($request)->wait(); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.dialogflow.v2.EncryptionSpecService/GetEncryptionSpec', $actualFuncCall); - $actualValue = $actualRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $this->assertTrue($transport->isExhausted()); - } -} diff --git a/owl-bot-staging/Dialogflow/v2/tests/Unit/V2/Client/EntityTypesClientTest.php b/owl-bot-staging/Dialogflow/v2/tests/Unit/V2/Client/EntityTypesClientTest.php deleted file mode 100644 index 39c6839204a7..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 44caad5a6589..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 b07d23c50e32..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/GeneratorsClientTest.php b/owl-bot-staging/Dialogflow/v2/tests/Unit/V2/Client/GeneratorsClientTest.php deleted file mode 100644 index 4e08b32cbebd..000000000000 --- a/owl-bot-staging/Dialogflow/v2/tests/Unit/V2/Client/GeneratorsClientTest.php +++ /dev/null @@ -1,568 +0,0 @@ -getMockBuilder(CredentialsWrapper::class)->disableOriginalConstructor()->getMock(); - } - - /** @return GeneratorsClient */ - private function createClient(array $options = []) - { - $options += [ - 'credentials' => $this->createCredentials(), - ]; - return new GeneratorsClient($options); - } - - /** @test */ - public function createGeneratorTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name = 'name3373707'; - $description = 'description-1724546052'; - $expectedResponse = new Generator(); - $expectedResponse->setName($name); - $expectedResponse->setDescription($description); - $transport->addResponse($expectedResponse); - // Mock request - $formattedParent = $gapicClient->projectName('[PROJECT]'); - $generator = new Generator(); - $request = (new CreateGeneratorRequest()) - ->setParent($formattedParent) - ->setGenerator($generator); - $response = $gapicClient->createGenerator($request); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.dialogflow.v2.Generators/CreateGenerator', $actualFuncCall); - $actualValue = $actualRequestObject->getParent(); - $this->assertProtobufEquals($formattedParent, $actualValue); - $actualValue = $actualRequestObject->getGenerator(); - $this->assertProtobufEquals($generator, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function createGeneratorExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $formattedParent = $gapicClient->projectName('[PROJECT]'); - $generator = new Generator(); - $request = (new CreateGeneratorRequest()) - ->setParent($formattedParent) - ->setGenerator($generator); - try { - $gapicClient->createGenerator($request); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function deleteGeneratorTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $expectedResponse = new GPBEmpty(); - $transport->addResponse($expectedResponse); - // Mock request - $formattedName = $gapicClient->generatorName('[PROJECT]', '[LOCATION]', '[GENERATOR]'); - $request = (new DeleteGeneratorRequest()) - ->setName($formattedName); - $gapicClient->deleteGenerator($request); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.dialogflow.v2.Generators/DeleteGenerator', $actualFuncCall); - $actualValue = $actualRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function deleteGeneratorExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $formattedName = $gapicClient->generatorName('[PROJECT]', '[LOCATION]', '[GENERATOR]'); - $request = (new DeleteGeneratorRequest()) - ->setName($formattedName); - try { - $gapicClient->deleteGenerator($request); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function getGeneratorTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name2 = 'name2-1052831874'; - $description = 'description-1724546052'; - $expectedResponse = new Generator(); - $expectedResponse->setName($name2); - $expectedResponse->setDescription($description); - $transport->addResponse($expectedResponse); - // Mock request - $formattedName = $gapicClient->generatorName('[PROJECT]', '[LOCATION]', '[GENERATOR]'); - $request = (new GetGeneratorRequest()) - ->setName($formattedName); - $response = $gapicClient->getGenerator($request); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.dialogflow.v2.Generators/GetGenerator', $actualFuncCall); - $actualValue = $actualRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function getGeneratorExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $formattedName = $gapicClient->generatorName('[PROJECT]', '[LOCATION]', '[GENERATOR]'); - $request = (new GetGeneratorRequest()) - ->setName($formattedName); - try { - $gapicClient->getGenerator($request); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function listGeneratorsTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $nextPageToken = ''; - $generatorsElement = new Generator(); - $generators = [ - $generatorsElement, - ]; - $expectedResponse = new ListGeneratorsResponse(); - $expectedResponse->setNextPageToken($nextPageToken); - $expectedResponse->setGenerators($generators); - $transport->addResponse($expectedResponse); - // Mock request - $formattedParent = $gapicClient->projectName('[PROJECT]'); - $request = (new ListGeneratorsRequest()) - ->setParent($formattedParent); - $response = $gapicClient->listGenerators($request); - $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); - $resources = iterator_to_array($response->iterateAllElements()); - $this->assertSame(1, count($resources)); - $this->assertEquals($expectedResponse->getGenerators()[0], $resources[0]); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.dialogflow.v2.Generators/ListGenerators', $actualFuncCall); - $actualValue = $actualRequestObject->getParent(); - $this->assertProtobufEquals($formattedParent, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function listGeneratorsExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $formattedParent = $gapicClient->projectName('[PROJECT]'); - $request = (new ListGeneratorsRequest()) - ->setParent($formattedParent); - try { - $gapicClient->listGenerators($request); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function updateGeneratorTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name = 'name3373707'; - $description = 'description-1724546052'; - $expectedResponse = new Generator(); - $expectedResponse->setName($name); - $expectedResponse->setDescription($description); - $transport->addResponse($expectedResponse); - // Mock request - $generator = new Generator(); - $request = (new UpdateGeneratorRequest()) - ->setGenerator($generator); - $response = $gapicClient->updateGenerator($request); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.dialogflow.v2.Generators/UpdateGenerator', $actualFuncCall); - $actualValue = $actualRequestObject->getGenerator(); - $this->assertProtobufEquals($generator, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function updateGeneratorExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $generator = new Generator(); - $request = (new UpdateGeneratorRequest()) - ->setGenerator($generator); - try { - $gapicClient->updateGenerator($request); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function getLocationTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name2 = 'name2-1052831874'; - $locationId = 'locationId552319461'; - $displayName = 'displayName1615086568'; - $expectedResponse = new Location(); - $expectedResponse->setName($name2); - $expectedResponse->setLocationId($locationId); - $expectedResponse->setDisplayName($displayName); - $transport->addResponse($expectedResponse); - $request = new GetLocationRequest(); - $response = $gapicClient->getLocation($request); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.location.Locations/GetLocation', $actualFuncCall); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function getLocationExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - $request = new GetLocationRequest(); - try { - $gapicClient->getLocation($request); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function listLocationsTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $nextPageToken = ''; - $locationsElement = new Location(); - $locations = [ - $locationsElement, - ]; - $expectedResponse = new ListLocationsResponse(); - $expectedResponse->setNextPageToken($nextPageToken); - $expectedResponse->setLocations($locations); - $transport->addResponse($expectedResponse); - $request = new ListLocationsRequest(); - $response = $gapicClient->listLocations($request); - $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); - $resources = iterator_to_array($response->iterateAllElements()); - $this->assertSame(1, count($resources)); - $this->assertEquals($expectedResponse->getLocations()[0], $resources[0]); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.location.Locations/ListLocations', $actualFuncCall); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function listLocationsExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - $request = new ListLocationsRequest(); - try { - $gapicClient->listLocations($request); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function createGeneratorAsyncTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name = 'name3373707'; - $description = 'description-1724546052'; - $expectedResponse = new Generator(); - $expectedResponse->setName($name); - $expectedResponse->setDescription($description); - $transport->addResponse($expectedResponse); - // Mock request - $formattedParent = $gapicClient->projectName('[PROJECT]'); - $generator = new Generator(); - $request = (new CreateGeneratorRequest()) - ->setParent($formattedParent) - ->setGenerator($generator); - $response = $gapicClient->createGeneratorAsync($request)->wait(); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.dialogflow.v2.Generators/CreateGenerator', $actualFuncCall); - $actualValue = $actualRequestObject->getParent(); - $this->assertProtobufEquals($formattedParent, $actualValue); - $actualValue = $actualRequestObject->getGenerator(); - $this->assertProtobufEquals($generator, $actualValue); - $this->assertTrue($transport->isExhausted()); - } -} diff --git a/owl-bot-staging/Dialogflow/v2/tests/Unit/V2/Client/IntentsClientTest.php b/owl-bot-staging/Dialogflow/v2/tests/Unit/V2/Client/IntentsClientTest.php deleted file mode 100644 index c3aa8aa588d8..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 5eafe51a8c4f..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 9ec47f786ad8..000000000000 --- a/owl-bot-staging/Dialogflow/v2/tests/Unit/V2/Client/ParticipantsClientTest.php +++ /dev/null @@ -1,953 +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 suggestKnowledgeAssistTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $latestMessage2 = 'latestMessage2-440913086'; - $contextSize2 = 397491196; - $expectedResponse = new SuggestKnowledgeAssistResponse(); - $expectedResponse->setLatestMessage($latestMessage2); - $expectedResponse->setContextSize($contextSize2); - $transport->addResponse($expectedResponse); - // Mock request - $formattedParent = $gapicClient->participantName('[PROJECT]', '[CONVERSATION]', '[PARTICIPANT]'); - $request = (new SuggestKnowledgeAssistRequest()) - ->setParent($formattedParent); - $response = $gapicClient->suggestKnowledgeAssist($request); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.dialogflow.v2.Participants/SuggestKnowledgeAssist', $actualFuncCall); - $actualValue = $actualRequestObject->getParent(); - $this->assertProtobufEquals($formattedParent, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function suggestKnowledgeAssistExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $formattedParent = $gapicClient->participantName('[PROJECT]', '[CONVERSATION]', '[PARTICIPANT]'); - $request = (new SuggestKnowledgeAssistRequest()) - ->setParent($formattedParent); - try { - $gapicClient->suggestKnowledgeAssist($request); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function suggestSmartRepliesTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $latestMessage2 = 'latestMessage2-440913086'; - $contextSize2 = 397491196; - $expectedResponse = new SuggestSmartRepliesResponse(); - $expectedResponse->setLatestMessage($latestMessage2); - $expectedResponse->setContextSize($contextSize2); - $transport->addResponse($expectedResponse); - // Mock request - $formattedParent = $gapicClient->participantName('[PROJECT]', '[CONVERSATION]', '[PARTICIPANT]'); - $request = (new SuggestSmartRepliesRequest()) - ->setParent($formattedParent); - $response = $gapicClient->suggestSmartReplies($request); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.dialogflow.v2.Participants/SuggestSmartReplies', $actualFuncCall); - $actualValue = $actualRequestObject->getParent(); - $this->assertProtobufEquals($formattedParent, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function suggestSmartRepliesExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $formattedParent = $gapicClient->participantName('[PROJECT]', '[CONVERSATION]', '[PARTICIPANT]'); - $request = (new SuggestSmartRepliesRequest()) - ->setParent($formattedParent); - try { - $gapicClient->suggestSmartReplies($request); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function updateParticipantTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name = 'name3373707'; - $sipRecordingMediaLabel = 'sipRecordingMediaLabel-1522741274'; - $obfuscatedExternalUserId = 'obfuscatedExternalUserId-263618122'; - $expectedResponse = new Participant(); - $expectedResponse->setName($name); - $expectedResponse->setSipRecordingMediaLabel($sipRecordingMediaLabel); - $expectedResponse->setObfuscatedExternalUserId($obfuscatedExternalUserId); - $transport->addResponse($expectedResponse); - // Mock request - $participant = new Participant(); - $updateMask = new FieldMask(); - $request = (new UpdateParticipantRequest()) - ->setParticipant($participant) - ->setUpdateMask($updateMask); - $response = $gapicClient->updateParticipant($request); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.dialogflow.v2.Participants/UpdateParticipant', $actualFuncCall); - $actualValue = $actualRequestObject->getParticipant(); - $this->assertProtobufEquals($participant, $actualValue); - $actualValue = $actualRequestObject->getUpdateMask(); - $this->assertProtobufEquals($updateMask, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function updateParticipantExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $participant = new Participant(); - $updateMask = new FieldMask(); - $request = (new UpdateParticipantRequest()) - ->setParticipant($participant) - ->setUpdateMask($updateMask); - try { - $gapicClient->updateParticipant($request); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function getLocationTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name2 = 'name2-1052831874'; - $locationId = 'locationId552319461'; - $displayName = 'displayName1615086568'; - $expectedResponse = new Location(); - $expectedResponse->setName($name2); - $expectedResponse->setLocationId($locationId); - $expectedResponse->setDisplayName($displayName); - $transport->addResponse($expectedResponse); - $request = new GetLocationRequest(); - $response = $gapicClient->getLocation($request); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.location.Locations/GetLocation', $actualFuncCall); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function getLocationExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - $request = new GetLocationRequest(); - try { - $gapicClient->getLocation($request); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function listLocationsTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $nextPageToken = ''; - $locationsElement = new Location(); - $locations = [ - $locationsElement, - ]; - $expectedResponse = new ListLocationsResponse(); - $expectedResponse->setNextPageToken($nextPageToken); - $expectedResponse->setLocations($locations); - $transport->addResponse($expectedResponse); - $request = new ListLocationsRequest(); - $response = $gapicClient->listLocations($request); - $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); - $resources = iterator_to_array($response->iterateAllElements()); - $this->assertSame(1, count($resources)); - $this->assertEquals($expectedResponse->getLocations()[0], $resources[0]); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.location.Locations/ListLocations', $actualFuncCall); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function listLocationsExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - $request = new ListLocationsRequest(); - try { - $gapicClient->listLocations($request); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function analyzeContentAsyncTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $replyText = 'replyText-549180062'; - $expectedResponse = new AnalyzeContentResponse(); - $expectedResponse->setReplyText($replyText); - $transport->addResponse($expectedResponse); - // Mock request - $formattedParticipant = $gapicClient->participantName('[PROJECT]', '[CONVERSATION]', '[PARTICIPANT]'); - $request = (new AnalyzeContentRequest()) - ->setParticipant($formattedParticipant); - $response = $gapicClient->analyzeContentAsync($request)->wait(); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.dialogflow.v2.Participants/AnalyzeContent', $actualFuncCall); - $actualValue = $actualRequestObject->getParticipant(); - $this->assertProtobufEquals($formattedParticipant, $actualValue); - $this->assertTrue($transport->isExhausted()); - } -} diff --git a/owl-bot-staging/Dialogflow/v2/tests/Unit/V2/Client/SessionEntityTypesClientTest.php b/owl-bot-staging/Dialogflow/v2/tests/Unit/V2/Client/SessionEntityTypesClientTest.php deleted file mode 100644 index 1b65b70e6be7..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 124fc46599e3..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 060994e96bde..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 f29bd75ef538..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 154c4bf93341..000000000000 --- a/owl-bot-staging/Dialogflow/v2/tests/Unit/V2/ConversationDatasetsClientTest.php +++ /dev/null @@ -1,708 +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; - $satisfiesPzi = false; - $satisfiesPzs = false; - $expectedResponse = new ConversationDataset(); - $expectedResponse->setName($name); - $expectedResponse->setDisplayName($displayName); - $expectedResponse->setDescription($description); - $expectedResponse->setConversationCount($conversationCount); - $expectedResponse->setSatisfiesPzi($satisfiesPzi); - $expectedResponse->setSatisfiesPzs($satisfiesPzs); - $anyResponse = new Any(); - $anyResponse->setValue($expectedResponse->serializeToString()); - $completeOperation = new Operation(); - $completeOperation->setName('operations/createConversationDatasetTest'); - $completeOperation->setDone(true); - $completeOperation->setResponse($anyResponse); - $operationsTransport->addResponse($completeOperation); - // Mock request - $parent = 'parent-995424086'; - $conversationDataset = new ConversationDataset(); - $conversationDatasetDisplayName = 'conversationDatasetDisplayName-925930312'; - $conversationDataset->setDisplayName($conversationDatasetDisplayName); - $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; - $satisfiesPzi = false; - $satisfiesPzs = false; - $expectedResponse = new ConversationDataset(); - $expectedResponse->setName($name2); - $expectedResponse->setDisplayName($displayName); - $expectedResponse->setDescription($description); - $expectedResponse->setConversationCount($conversationCount); - $expectedResponse->setSatisfiesPzi($satisfiesPzi); - $expectedResponse->setSatisfiesPzs($satisfiesPzs); - $transport->addResponse($expectedResponse); - // Mock request - $formattedName = $gapicClient->conversationDatasetName('[PROJECT]', '[LOCATION]', '[CONVERSATION_DATASET]'); - $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 a6137c3f8b87..000000000000 --- a/owl-bot-staging/Dialogflow/v2/tests/Unit/V2/ConversationModelsClientTest.php +++ /dev/null @@ -1,1072 +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'; - $satisfiesPzs = false; - $satisfiesPzi = false; - $expectedResponse = new ConversationModel(); - $expectedResponse->setName($name); - $expectedResponse->setDisplayName($displayName); - $expectedResponse->setLanguageCode($languageCode); - $expectedResponse->setSatisfiesPzs($satisfiesPzs); - $expectedResponse->setSatisfiesPzi($satisfiesPzi); - $anyResponse = new Any(); - $anyResponse->setValue($expectedResponse->serializeToString()); - $completeOperation = new Operation(); - $completeOperation->setName('operations/createConversationModelTest'); - $completeOperation->setDone(true); - $completeOperation->setResponse($anyResponse); - $operationsTransport->addResponse($completeOperation); - // Mock request - $conversationModel = new ConversationModel(); - $conversationModelDisplayName = 'conversationModelDisplayName-1078928857'; - $conversationModel->setDisplayName($conversationModelDisplayName); - $conversationModelDatasets = []; - $conversationModel->setDatasets($conversationModelDatasets); - $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'; - $satisfiesPzs = false; - $satisfiesPzi = false; - $expectedResponse = new ConversationModel(); - $expectedResponse->setName($name2); - $expectedResponse->setDisplayName($displayName); - $expectedResponse->setLanguageCode($languageCode); - $expectedResponse->setSatisfiesPzs($satisfiesPzs); - $expectedResponse->setSatisfiesPzi($satisfiesPzi); - $transport->addResponse($expectedResponse); - // Mock request - $name = 'name3373707'; - $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 5310fb3e408e..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 2d77ced38b89..000000000000 --- a/owl-bot-staging/Dialogflow/v2/tests/Unit/V2/ConversationsClientTest.php +++ /dev/null @@ -1,793 +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 generateStatelessSuggestionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $expectedResponse = new GenerateStatelessSuggestionResponse(); - $transport->addResponse($expectedResponse); - // Mock request - $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); - $response = $gapicClient->generateStatelessSuggestion($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.Conversations/GenerateStatelessSuggestion', $actualFuncCall); - $actualValue = $actualRequestObject->getParent(); - $this->assertProtobufEquals($formattedParent, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function generateStatelessSuggestionExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); - try { - $gapicClient->generateStatelessSuggestion($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 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 searchKnowledgeTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $rewrittenQuery = 'rewrittenQuery-1113584563'; - $expectedResponse = new SearchKnowledgeResponse(); - $expectedResponse->setRewrittenQuery($rewrittenQuery); - $transport->addResponse($expectedResponse); - // Mock request - $query = new TextInput(); - $queryText = 'queryText-1806881259'; - $query->setText($queryText); - $queryLanguageCode = 'queryLanguageCode66898509'; - $query->setLanguageCode($queryLanguageCode); - $formattedConversationProfile = $gapicClient->conversationProfileName('[PROJECT]', '[CONVERSATION_PROFILE]'); - $response = $gapicClient->searchKnowledge($query, $formattedConversationProfile); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.dialogflow.v2.Conversations/SearchKnowledge', $actualFuncCall); - $actualValue = $actualRequestObject->getQuery(); - $this->assertProtobufEquals($query, $actualValue); - $actualValue = $actualRequestObject->getConversationProfile(); - $this->assertProtobufEquals($formattedConversationProfile, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function searchKnowledgeExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $query = new TextInput(); - $queryText = 'queryText-1806881259'; - $query->setText($queryText); - $queryLanguageCode = 'queryLanguageCode66898509'; - $query->setLanguageCode($queryLanguageCode); - $formattedConversationProfile = $gapicClient->conversationProfileName('[PROJECT]', '[CONVERSATION_PROFILE]'); - try { - $gapicClient->searchKnowledge($query, $formattedConversationProfile); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $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 405650dfbecc..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/EncryptionSpecServiceClientTest.php b/owl-bot-staging/Dialogflow/v2/tests/Unit/V2/EncryptionSpecServiceClientTest.php deleted file mode 100644 index 8d1849ab0231..000000000000 --- a/owl-bot-staging/Dialogflow/v2/tests/Unit/V2/EncryptionSpecServiceClientTest.php +++ /dev/null @@ -1,371 +0,0 @@ -getMockBuilder(CredentialsWrapper::class)->disableOriginalConstructor()->getMock(); - } - - /** @return EncryptionSpecServiceClient */ - private function createClient(array $options = []) - { - $options += [ - 'credentials' => $this->createCredentials(), - ]; - return new EncryptionSpecServiceClient($options); - } - - /** @test */ - public function getEncryptionSpecTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name2 = 'name2-1052831874'; - $kmsKey = 'kmsKey-591635343'; - $expectedResponse = new EncryptionSpec(); - $expectedResponse->setName($name2); - $expectedResponse->setKmsKey($kmsKey); - $transport->addResponse($expectedResponse); - // Mock request - $formattedName = $gapicClient->encryptionSpecName('[PROJECT]', '[LOCATION]'); - $response = $gapicClient->getEncryptionSpec($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.EncryptionSpecService/GetEncryptionSpec', $actualFuncCall); - $actualValue = $actualRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function getEncryptionSpecExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $formattedName = $gapicClient->encryptionSpecName('[PROJECT]', '[LOCATION]'); - try { - $gapicClient->getEncryptionSpec($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 initializeEncryptionSpecTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/initializeEncryptionSpecTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $expectedResponse = new InitializeEncryptionSpecResponse(); - $anyResponse = new Any(); - $anyResponse->setValue($expectedResponse->serializeToString()); - $completeOperation = new Operation(); - $completeOperation->setName('operations/initializeEncryptionSpecTest'); - $completeOperation->setDone(true); - $completeOperation->setResponse($anyResponse); - $operationsTransport->addResponse($completeOperation); - // Mock request - $encryptionSpec = new EncryptionSpec(); - $encryptionSpecKmsKey = 'encryptionSpecKmsKey627607756'; - $encryptionSpec->setKmsKey($encryptionSpecKmsKey); - $response = $gapicClient->initializeEncryptionSpec($encryptionSpec); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $apiRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($apiRequests)); - $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); - $this->assertSame(0, count($operationsRequestsEmpty)); - $actualApiFuncCall = $apiRequests[0]->getFuncCall(); - $actualApiRequestObject = $apiRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.dialogflow.v2.EncryptionSpecService/InitializeEncryptionSpec', $actualApiFuncCall); - $actualValue = $actualApiRequestObject->getEncryptionSpec(); - $this->assertProtobufEquals($encryptionSpec, $actualValue); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/initializeEncryptionSpecTest'); - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - $this->assertTrue($response->isDone()); - $this->assertEquals($expectedResponse, $response->getResult()); - $apiRequestsEmpty = $transport->popReceivedCalls(); - $this->assertSame(0, count($apiRequestsEmpty)); - $operationsRequests = $operationsTransport->popReceivedCalls(); - $this->assertSame(1, count($operationsRequests)); - $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); - $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); - $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); - $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function initializeEncryptionSpecExceptionTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/initializeEncryptionSpecTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $operationsTransport->addResponse(null, $status); - // Mock request - $encryptionSpec = new EncryptionSpec(); - $encryptionSpecKmsKey = 'encryptionSpecKmsKey627607756'; - $encryptionSpec->setKmsKey($encryptionSpecKmsKey); - $response = $gapicClient->initializeEncryptionSpec($encryptionSpec); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/initializeEncryptionSpecTest'); - try { - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - // If the pollUntilComplete() method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stubs are exhausted - $transport->popReceivedCalls(); - $operationsTransport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function getLocationTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name2 = 'name2-1052831874'; - $locationId = 'locationId552319461'; - $displayName = 'displayName1615086568'; - $expectedResponse = new Location(); - $expectedResponse->setName($name2); - $expectedResponse->setLocationId($locationId); - $expectedResponse->setDisplayName($displayName); - $transport->addResponse($expectedResponse); - $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 0bba9dc857d5..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 eb6575d0d997..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 e92d68b15866..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/GeneratorsClientTest.php b/owl-bot-staging/Dialogflow/v2/tests/Unit/V2/GeneratorsClientTest.php deleted file mode 100644 index e2fb8335acd0..000000000000 --- a/owl-bot-staging/Dialogflow/v2/tests/Unit/V2/GeneratorsClientTest.php +++ /dev/null @@ -1,500 +0,0 @@ -getMockBuilder(CredentialsWrapper::class)->disableOriginalConstructor()->getMock(); - } - - /** @return GeneratorsClient */ - private function createClient(array $options = []) - { - $options += [ - 'credentials' => $this->createCredentials(), - ]; - return new GeneratorsClient($options); - } - - /** @test */ - public function createGeneratorTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name = 'name3373707'; - $description = 'description-1724546052'; - $expectedResponse = new Generator(); - $expectedResponse->setName($name); - $expectedResponse->setDescription($description); - $transport->addResponse($expectedResponse); - // Mock request - $formattedParent = $gapicClient->projectName('[PROJECT]'); - $generator = new Generator(); - $response = $gapicClient->createGenerator($formattedParent, $generator); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.dialogflow.v2.Generators/CreateGenerator', $actualFuncCall); - $actualValue = $actualRequestObject->getParent(); - $this->assertProtobufEquals($formattedParent, $actualValue); - $actualValue = $actualRequestObject->getGenerator(); - $this->assertProtobufEquals($generator, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function createGeneratorExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $formattedParent = $gapicClient->projectName('[PROJECT]'); - $generator = new Generator(); - try { - $gapicClient->createGenerator($formattedParent, $generator); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function deleteGeneratorTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $expectedResponse = new GPBEmpty(); - $transport->addResponse($expectedResponse); - // Mock request - $formattedName = $gapicClient->generatorName('[PROJECT]', '[LOCATION]', '[GENERATOR]'); - $gapicClient->deleteGenerator($formattedName); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.dialogflow.v2.Generators/DeleteGenerator', $actualFuncCall); - $actualValue = $actualRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function deleteGeneratorExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $formattedName = $gapicClient->generatorName('[PROJECT]', '[LOCATION]', '[GENERATOR]'); - try { - $gapicClient->deleteGenerator($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 getGeneratorTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name2 = 'name2-1052831874'; - $description = 'description-1724546052'; - $expectedResponse = new Generator(); - $expectedResponse->setName($name2); - $expectedResponse->setDescription($description); - $transport->addResponse($expectedResponse); - // Mock request - $formattedName = $gapicClient->generatorName('[PROJECT]', '[LOCATION]', '[GENERATOR]'); - $response = $gapicClient->getGenerator($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.Generators/GetGenerator', $actualFuncCall); - $actualValue = $actualRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function getGeneratorExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $formattedName = $gapicClient->generatorName('[PROJECT]', '[LOCATION]', '[GENERATOR]'); - try { - $gapicClient->getGenerator($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 listGeneratorsTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $nextPageToken = ''; - $generatorsElement = new Generator(); - $generators = [ - $generatorsElement, - ]; - $expectedResponse = new ListGeneratorsResponse(); - $expectedResponse->setNextPageToken($nextPageToken); - $expectedResponse->setGenerators($generators); - $transport->addResponse($expectedResponse); - // Mock request - $formattedParent = $gapicClient->projectName('[PROJECT]'); - $response = $gapicClient->listGenerators($formattedParent); - $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); - $resources = iterator_to_array($response->iterateAllElements()); - $this->assertSame(1, count($resources)); - $this->assertEquals($expectedResponse->getGenerators()[0], $resources[0]); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.dialogflow.v2.Generators/ListGenerators', $actualFuncCall); - $actualValue = $actualRequestObject->getParent(); - $this->assertProtobufEquals($formattedParent, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function listGeneratorsExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $formattedParent = $gapicClient->projectName('[PROJECT]'); - try { - $gapicClient->listGenerators($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 updateGeneratorTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name = 'name3373707'; - $description = 'description-1724546052'; - $expectedResponse = new Generator(); - $expectedResponse->setName($name); - $expectedResponse->setDescription($description); - $transport->addResponse($expectedResponse); - // Mock request - $generator = new Generator(); - $response = $gapicClient->updateGenerator($generator); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.dialogflow.v2.Generators/UpdateGenerator', $actualFuncCall); - $actualValue = $actualRequestObject->getGenerator(); - $this->assertProtobufEquals($generator, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function updateGeneratorExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $generator = new Generator(); - try { - $gapicClient->updateGenerator($generator); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $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 1e34c1edc994..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 37bd4468424b..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 0d6385ee7512..000000000000 --- a/owl-bot-staging/Dialogflow/v2/tests/Unit/V2/ParticipantsClientTest.php +++ /dev/null @@ -1,869 +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 suggestKnowledgeAssistTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $latestMessage2 = 'latestMessage2-440913086'; - $contextSize2 = 397491196; - $expectedResponse = new SuggestKnowledgeAssistResponse(); - $expectedResponse->setLatestMessage($latestMessage2); - $expectedResponse->setContextSize($contextSize2); - $transport->addResponse($expectedResponse); - // Mock request - $formattedParent = $gapicClient->participantName('[PROJECT]', '[CONVERSATION]', '[PARTICIPANT]'); - $response = $gapicClient->suggestKnowledgeAssist($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/SuggestKnowledgeAssist', $actualFuncCall); - $actualValue = $actualRequestObject->getParent(); - $this->assertProtobufEquals($formattedParent, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function suggestKnowledgeAssistExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $formattedParent = $gapicClient->participantName('[PROJECT]', '[CONVERSATION]', '[PARTICIPANT]'); - try { - $gapicClient->suggestKnowledgeAssist($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 fc6b9e1423a9..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 f325f10f819e..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 3f455f70882d..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()); - } -}