Class: Google::Apis::DialogflowV2::GoogleCloudDialogflowV2Document

Inherits:
Object
  • Object
show all
Includes:
Core::Hashable, Core::JsonObjectSupport
Defined in:
lib/google/apis/dialogflow_v2/classes.rb,
lib/google/apis/dialogflow_v2/representations.rb,
lib/google/apis/dialogflow_v2/representations.rb

Overview

A knowledge document to be used by a KnowledgeBase. For more information, see the knowledge base guide. Note: The projects.agent.knowledgeBases.documents resource is deprecated; only use projects.knowledgeBases.documents.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(**args) ⇒ GoogleCloudDialogflowV2Document

Returns a new instance of GoogleCloudDialogflowV2Document.



8086
8087
8088
# File 'lib/google/apis/dialogflow_v2/classes.rb', line 8086

def initialize(**args)
   update!(**args)
end

Instance Attribute Details

#content_uriString

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. Corresponds to the JSON property contentUri

Returns:

  • (String)


8021
8022
8023
# File 'lib/google/apis/dialogflow_v2/classes.rb', line 8021

def content_uri
  @content_uri
end

#display_nameString

Required. The display name of the document. The name must be 1024 bytes or less; otherwise, the creation request fails. Corresponds to the JSON property displayName

Returns:

  • (String)


8027
8028
8029
# File 'lib/google/apis/dialogflow_v2/classes.rb', line 8027

def display_name
  @display_name
end

#enable_auto_reloadBoolean Also known as: 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. Corresponds to the JSON property enableAutoReload

Returns:

  • (Boolean)


8042
8043
8044
# File 'lib/google/apis/dialogflow_v2/classes.rb', line 8042

def enable_auto_reload
  @enable_auto_reload
end

#knowledge_typesArray<String>

Required. The knowledge type of document content. Corresponds to the JSON property knowledgeTypes

Returns:

  • (Array<String>)


8048
8049
8050
# File 'lib/google/apis/dialogflow_v2/classes.rb', line 8048

def knowledge_types
  @knowledge_types
end

#latest_reload_statusGoogle::Apis::DialogflowV2::GoogleCloudDialogflowV2DocumentReloadStatus

The status of a reload attempt. Corresponds to the JSON property latestReloadStatus



8053
8054
8055
# File 'lib/google/apis/dialogflow_v2/classes.rb', line 8053

def latest_reload_status
  @latest_reload_status
end

#metadataHash<String,String>

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. Corresponds to the JSON property metadata

Returns:

  • (Hash<String,String>)


8061
8062
8063
# File 'lib/google/apis/dialogflow_v2/classes.rb', line 8061

def 
  @metadata
end

#mime_typeString

Required. The MIME type of this document. Corresponds to the JSON property mimeType

Returns:

  • (String)


8066
8067
8068
# File 'lib/google/apis/dialogflow_v2/classes.rb', line 8066

def mime_type
  @mime_type
end

#nameString

Optional. The document resource name. The name must be empty when creating a document. Format: projects//locations//knowledgeBases//documents/. Corresponds to the JSON property name

Returns:

  • (String)


8072
8073
8074
# File 'lib/google/apis/dialogflow_v2/classes.rb', line 8072

def name
  @name
end

#raw_contentString

The raw content of the document. This field is only permitted for EXTRACTIVE_QA and FAQ knowledge types. Corresponds to the JSON property rawContent NOTE: Values are automatically base64 encoded/decoded in the client library.

Returns:

  • (String)


8079
8080
8081
# File 'lib/google/apis/dialogflow_v2/classes.rb', line 8079

def raw_content
  @raw_content
end

#stateString

Output only. The current state of the document. Corresponds to the JSON property state

Returns:

  • (String)


8084
8085
8086
# File 'lib/google/apis/dialogflow_v2/classes.rb', line 8084

def state
  @state
end

Instance Method Details

#update!(**args) ⇒ Object

Update properties of this object



8091
8092
8093
8094
8095
8096
8097
8098
8099
8100
8101
8102
# File 'lib/google/apis/dialogflow_v2/classes.rb', line 8091

def update!(**args)
  @content_uri = args[:content_uri] if args.key?(:content_uri)
  @display_name = args[:display_name] if args.key?(:display_name)
  @enable_auto_reload = args[:enable_auto_reload] if args.key?(:enable_auto_reload)
  @knowledge_types = args[:knowledge_types] if args.key?(:knowledge_types)
  @latest_reload_status = args[:latest_reload_status] if args.key?(:latest_reload_status)
  @metadata = args[:metadata] if args.key?(:metadata)
  @mime_type = args[:mime_type] if args.key?(:mime_type)
  @name = args[:name] if args.key?(:name)
  @raw_content = args[:raw_content] if args.key?(:raw_content)
  @state = args[:state] if args.key?(:state)
end