#[non_exhaustive]pub struct GenericWebService {
pub uri: String,
pub username: String,
pub password: String,
pub request_headers: HashMap<String, String>,
pub is_cloud_function: bool,
/* private fields */
}environments or fulfillments only.Expand description
Represents configuration for a generic web service. Dialogflow supports two mechanisms for authentications:
- Basic authentication with username and password.
- Authentication with additional authentication headers.
More information could be found at: https://cloud.google.com/dialogflow/docs/fulfillment-configure.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.uri: StringRequired. The fulfillment URI for receiving POST requests. It must use https protocol.
username: StringOptional. The user name for HTTP Basic authentication.
password: StringOptional. The password for HTTP Basic authentication.
request_headers: HashMap<String, String>Optional. The HTTP request headers to send together with fulfillment requests.
is_cloud_function: boolOptional. 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.
Implementations§
Source§impl GenericWebService
impl GenericWebService
pub fn new() -> Self
Sourcepub fn set_username<T: Into<String>>(self, v: T) -> Self
pub fn set_username<T: Into<String>>(self, v: T) -> Self
Sourcepub fn set_password<T: Into<String>>(self, v: T) -> Self
pub fn set_password<T: Into<String>>(self, v: T) -> Self
Sourcepub fn set_request_headers<T, K, V>(self, v: T) -> Self
pub fn set_request_headers<T, K, V>(self, v: T) -> Self
Sets the value of request_headers.
§Example
let x = GenericWebService::new().set_request_headers([
("key0", "abc"),
("key1", "xyz"),
]);Sourcepub fn set_is_cloud_function<T: Into<bool>>(self, v: T) -> Self
👎Deprecated
pub fn set_is_cloud_function<T: Into<bool>>(self, v: T) -> Self
Sets the value of is_cloud_function.
§Example
let x = GenericWebService::new().set_is_cloud_function(true);Trait Implementations§
Source§impl Clone for GenericWebService
impl Clone for GenericWebService
Source§fn clone(&self) -> GenericWebService
fn clone(&self) -> GenericWebService
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more