lib/google/cloud/dialogflow/v2/conversations/paths.rb in google-cloud-dialogflow-v2-1.3.0 vs lib/google/cloud/dialogflow/v2/conversations/paths.rb in google-cloud-dialogflow-v2-1.4.0

- old
+ new

@@ -201,9 +201,54 @@ raise ::ArgumentError, "no resource found for values #{args.keys}" if resource.nil? resource.call(**args) end ## + # Create a fully-qualified DataStore resource string. + # + # @overload data_store_path(project:, location:, collection:, data_store:) + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}` + # + # @param project [String] + # @param location [String] + # @param collection [String] + # @param data_store [String] + # + # @overload data_store_path(project:, location:, data_store:) + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/dataStores/{data_store}` + # + # @param project [String] + # @param location [String] + # @param data_store [String] + # + # @return [::String] + def data_store_path **args + resources = { + "collection:data_store:location:project" => (proc do |project:, location:, collection:, data_store:| + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + raise ::ArgumentError, "collection cannot contain /" if collection.to_s.include? "/" + + "projects/#{project}/locations/#{location}/collections/#{collection}/dataStores/#{data_store}" + end), + "data_store:location:project" => (proc do |project:, location:, data_store:| + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + + "projects/#{project}/locations/#{location}/dataStores/#{data_store}" + end) + } + + resource = resources[args.keys.sort.join(":")] + raise ::ArgumentError, "no resource found for values #{args.keys}" if resource.nil? + resource.call(**args) + end + + ## # Create a fully-qualified Document resource string. # # @overload document_path(project:, knowledge_base:, document:) # The resource will be in the following format: #