#[non_exhaustive]pub struct GenericWebService {Show 14 fields
pub uri: String,
pub username: String,
pub password: String,
pub secret_version_for_username_password: String,
pub request_headers: HashMap<String, String>,
pub secret_versions_for_request_headers: HashMap<String, SecretVersionHeaderValue>,
pub allowed_ca_certs: Vec<Bytes>,
pub oauth_config: Option<OAuthConfig>,
pub service_agent_auth: ServiceAgentAuth,
pub service_account_auth_config: Option<ServiceAccountAuthConfig>,
pub webhook_type: WebhookType,
pub http_method: HttpMethod,
pub request_body: String,
pub parameter_mapping: HashMap<String, String>,
/* private fields */
}environments or webhooks only.Expand description
Represents configuration for a generic web service.
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 webhook URI for receiving POST requests. It must use https protocol.
username: StringThe user name for HTTP Basic authentication.
password: StringThe password for HTTP Basic authentication.
secret_version_for_username_password: StringOptional. The SecretManager secret version resource storing the
username:password pair for HTTP Basic authentication. Format:
projects/{project}/secrets/{secret}/versions/{version}
request_headers: HashMap<String, String>The HTTP request headers to send together with webhook requests.
secret_versions_for_request_headers: HashMap<String, SecretVersionHeaderValue>Optional. The HTTP request headers to send together with webhook requests. Header values are stored in SecretManager secret versions.
When the same header name is specified in both request_headers and
secret_versions_for_request_headers, the value in
secret_versions_for_request_headers will be used.
allowed_ca_certs: Vec<Bytes>Optional. Specifies a list of allowed custom CA certificates (in DER format) for HTTPS verification. This overrides the default SSL trust store. If this is empty or unspecified, Dialogflow will use Google’s default trust store to verify certificates. N.B. Make sure the HTTPS server certificates are signed with “subject alt name”. For instance a certificate can be self-signed using the following command,
openssl x509 -req -days 200 -in example.com.csr \
-signkey example.com.key \
-out example.com.crt \
-extfile <(printf "\nsubjectAltName='DNS:www.example.com'")oauth_config: Option<OAuthConfig>Optional. The OAuth configuration of the webhook. If specified, Dialogflow will initiate the OAuth client credential flow to exchange an access token from the 3rd party platform and put it in the auth header.
service_agent_auth: ServiceAgentAuthOptional. Indicate the auth token type generated from the Diglogflow service agent. The generated token is sent in the Authorization header.
service_account_auth_config: Option<ServiceAccountAuthConfig>Optional. Configuration for service account authentication.
webhook_type: WebhookTypeOptional. Type of the webhook.
http_method: HttpMethodOptional. HTTP method for the flexible webhook calls. Standard webhook always uses POST.
request_body: StringOptional. Defines a custom JSON object as request body to send to flexible webhook.
parameter_mapping: HashMap<String, String>Optional. Maps the values extracted from specific fields of the flexible webhook response into session parameters.
- Key: session parameter name
- Value: field path in the webhook response
Implementations§
Source§impl GenericWebService
impl GenericWebService
Sourcepub fn set_username<T: Into<String>>(self, v: T) -> Self
👎Deprecated
pub fn set_username<T: Into<String>>(self, v: T) -> Self
Sourcepub fn set_password<T: Into<String>>(self, v: T) -> Self
👎Deprecated
pub fn set_password<T: Into<String>>(self, v: T) -> Self
Sourcepub fn set_secret_version_for_username_password<T: Into<String>>(
self,
v: T,
) -> Self
pub fn set_secret_version_for_username_password<T: Into<String>>( self, v: T, ) -> Self
Sets the value of secret_version_for_username_password.
§Example
let x = GenericWebService::new().set_secret_version_for_username_password("example");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_secret_versions_for_request_headers<T, K, V>(self, v: T) -> Self
pub fn set_secret_versions_for_request_headers<T, K, V>(self, v: T) -> Self
Sets the value of secret_versions_for_request_headers.
§Example
use google_cloud_dialogflow_cx_v3::model::webhook::generic_web_service::SecretVersionHeaderValue;
let x = GenericWebService::new().set_secret_versions_for_request_headers([
("key0", SecretVersionHeaderValue::default()/* use setters */),
("key1", SecretVersionHeaderValue::default()/* use (different) setters */),
]);Sourcepub fn set_allowed_ca_certs<T, V>(self, v: T) -> Self
pub fn set_allowed_ca_certs<T, V>(self, v: T) -> Self
Sets the value of allowed_ca_certs.
§Example
let b1 = bytes::Bytes::from_static(b"abc");
let b2 = bytes::Bytes::from_static(b"xyz");
let x = GenericWebService::new().set_allowed_ca_certs([b1, b2]);Sourcepub fn set_oauth_config<T>(self, v: T) -> Selfwhere
T: Into<OAuthConfig>,
pub fn set_oauth_config<T>(self, v: T) -> Selfwhere
T: Into<OAuthConfig>,
Sets the value of oauth_config.
§Example
use google_cloud_dialogflow_cx_v3::model::webhook::generic_web_service::OAuthConfig;
let x = GenericWebService::new().set_oauth_config(OAuthConfig::default()/* use setters */);Sourcepub fn set_or_clear_oauth_config<T>(self, v: Option<T>) -> Selfwhere
T: Into<OAuthConfig>,
pub fn set_or_clear_oauth_config<T>(self, v: Option<T>) -> Selfwhere
T: Into<OAuthConfig>,
Sets or clears the value of oauth_config.
§Example
use google_cloud_dialogflow_cx_v3::model::webhook::generic_web_service::OAuthConfig;
let x = GenericWebService::new().set_or_clear_oauth_config(Some(OAuthConfig::default()/* use setters */));
let x = GenericWebService::new().set_or_clear_oauth_config(None::<OAuthConfig>);Sourcepub fn set_service_agent_auth<T: Into<ServiceAgentAuth>>(self, v: T) -> Self
pub fn set_service_agent_auth<T: Into<ServiceAgentAuth>>(self, v: T) -> Self
Sets the value of service_agent_auth.
§Example
use google_cloud_dialogflow_cx_v3::model::webhook::generic_web_service::ServiceAgentAuth;
let x0 = GenericWebService::new().set_service_agent_auth(ServiceAgentAuth::None);
let x1 = GenericWebService::new().set_service_agent_auth(ServiceAgentAuth::IdToken);
let x2 = GenericWebService::new().set_service_agent_auth(ServiceAgentAuth::AccessToken);Sourcepub fn set_service_account_auth_config<T>(self, v: T) -> Selfwhere
T: Into<ServiceAccountAuthConfig>,
pub fn set_service_account_auth_config<T>(self, v: T) -> Selfwhere
T: Into<ServiceAccountAuthConfig>,
Sets the value of service_account_auth_config.
§Example
use google_cloud_dialogflow_cx_v3::model::webhook::generic_web_service::ServiceAccountAuthConfig;
let x = GenericWebService::new().set_service_account_auth_config(ServiceAccountAuthConfig::default()/* use setters */);Sourcepub fn set_or_clear_service_account_auth_config<T>(self, v: Option<T>) -> Selfwhere
T: Into<ServiceAccountAuthConfig>,
pub fn set_or_clear_service_account_auth_config<T>(self, v: Option<T>) -> Selfwhere
T: Into<ServiceAccountAuthConfig>,
Sets or clears the value of service_account_auth_config.
§Example
use google_cloud_dialogflow_cx_v3::model::webhook::generic_web_service::ServiceAccountAuthConfig;
let x = GenericWebService::new().set_or_clear_service_account_auth_config(Some(ServiceAccountAuthConfig::default()/* use setters */));
let x = GenericWebService::new().set_or_clear_service_account_auth_config(None::<ServiceAccountAuthConfig>);Sourcepub fn set_webhook_type<T: Into<WebhookType>>(self, v: T) -> Self
pub fn set_webhook_type<T: Into<WebhookType>>(self, v: T) -> Self
Sets the value of webhook_type.
§Example
use google_cloud_dialogflow_cx_v3::model::webhook::generic_web_service::WebhookType;
let x0 = GenericWebService::new().set_webhook_type(WebhookType::Standard);
let x1 = GenericWebService::new().set_webhook_type(WebhookType::Flexible);Sourcepub fn set_http_method<T: Into<HttpMethod>>(self, v: T) -> Self
pub fn set_http_method<T: Into<HttpMethod>>(self, v: T) -> Self
Sets the value of http_method.
§Example
use google_cloud_dialogflow_cx_v3::model::webhook::generic_web_service::HttpMethod;
let x0 = GenericWebService::new().set_http_method(HttpMethod::Post);
let x1 = GenericWebService::new().set_http_method(HttpMethod::Get);
let x2 = GenericWebService::new().set_http_method(HttpMethod::Head);Sourcepub fn set_request_body<T: Into<String>>(self, v: T) -> Self
pub fn set_request_body<T: Into<String>>(self, v: T) -> Self
Sets the value of request_body.
§Example
let x = GenericWebService::new().set_request_body("example");Sourcepub fn set_parameter_mapping<T, K, V>(self, v: T) -> Self
pub fn set_parameter_mapping<T, K, V>(self, v: T) -> Self
Sets the value of parameter_mapping.
§Example
let x = GenericWebService::new().set_parameter_mapping([
("key0", "abc"),
("key1", "xyz"),
]);Trait Implementations§
Source§impl Clone for GenericWebService
impl Clone for GenericWebService
Source§fn clone(&self) -> GenericWebService
fn clone(&self) -> GenericWebService
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for GenericWebService
impl Debug for GenericWebService
Source§impl Default for GenericWebService
impl Default for GenericWebService
Source§fn default() -> GenericWebService
fn default() -> GenericWebService
Source§impl Message for GenericWebService
impl Message for GenericWebService
Source§impl PartialEq for GenericWebService
impl PartialEq for GenericWebService
Source§fn eq(&self, other: &GenericWebService) -> bool
fn eq(&self, other: &GenericWebService) -> bool
self and other values to be equal, and is used by ==.