gcp.diagflow.Fulfillment
Explore with Pulumi AI
By default, your agent responds to a matched intent with a static response. If you’re using one of the integration options, you can provide a more dynamic response by using fulfillment. When you enable fulfillment for an intent, Dialogflow responds to that intent by calling a service that you define. For example, if an end-user wants to schedule a haircut on Friday, your service can check your database and respond to the end-user with availability information for Friday.
To get more information about Fulfillment, see:
- API documentation
- How-to Guides
Example Usage
Dialogflow Fulfillment Basic
import * as pulumi from "@pulumi/pulumi";
import * as gcp from "@pulumi/gcp";
const basicAgent = new gcp.diagflow.Agent("basic_agent", {
displayName: "example_agent",
defaultLanguageCode: "en",
timeZone: "America/New_York",
});
const basicFulfillment = new gcp.diagflow.Fulfillment("basic_fulfillment", {
displayName: "basic-fulfillment",
enabled: true,
genericWebService: {
uri: "https://google.com",
username: "admin",
password: "password",
requestHeaders: {
name: "wrench",
},
},
}, {
dependsOn: [basicAgent],
});
import pulumi
import pulumi_gcp as gcp
basic_agent = gcp.diagflow.Agent("basic_agent",
display_name="example_agent",
default_language_code="en",
time_zone="America/New_York")
basic_fulfillment = gcp.diagflow.Fulfillment("basic_fulfillment",
display_name="basic-fulfillment",
enabled=True,
generic_web_service={
"uri": "https://google.com",
"username": "admin",
"password": "password",
"request_headers": {
"name": "wrench",
},
},
opts = pulumi.ResourceOptions(depends_on=[basic_agent]))
package main
import (
"github.com/pulumi/pulumi-gcp/sdk/v8/go/gcp/diagflow"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
basicAgent, err := diagflow.NewAgent(ctx, "basic_agent", &diagflow.AgentArgs{
DisplayName: pulumi.String("example_agent"),
DefaultLanguageCode: pulumi.String("en"),
TimeZone: pulumi.String("America/New_York"),
})
if err != nil {
return err
}
_, err = diagflow.NewFulfillment(ctx, "basic_fulfillment", &diagflow.FulfillmentArgs{
DisplayName: pulumi.String("basic-fulfillment"),
Enabled: pulumi.Bool(true),
GenericWebService: &diagflow.FulfillmentGenericWebServiceArgs{
Uri: pulumi.String("https://google.com"),
Username: pulumi.String("admin"),
Password: pulumi.String("password"),
RequestHeaders: pulumi.StringMap{
"name": pulumi.String("wrench"),
},
},
}, pulumi.DependsOn([]pulumi.Resource{
basicAgent,
}))
if err != nil {
return err
}
return nil
})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Gcp = Pulumi.Gcp;
return await Deployment.RunAsync(() =>
{
var basicAgent = new Gcp.Diagflow.Agent("basic_agent", new()
{
DisplayName = "example_agent",
DefaultLanguageCode = "en",
TimeZone = "America/New_York",
});
var basicFulfillment = new Gcp.Diagflow.Fulfillment("basic_fulfillment", new()
{
DisplayName = "basic-fulfillment",
Enabled = true,
GenericWebService = new Gcp.Diagflow.Inputs.FulfillmentGenericWebServiceArgs
{
Uri = "https://google.com",
Username = "admin",
Password = "password",
RequestHeaders =
{
{ "name", "wrench" },
},
},
}, new CustomResourceOptions
{
DependsOn =
{
basicAgent,
},
});
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.gcp.diagflow.Agent;
import com.pulumi.gcp.diagflow.AgentArgs;
import com.pulumi.gcp.diagflow.Fulfillment;
import com.pulumi.gcp.diagflow.FulfillmentArgs;
import com.pulumi.gcp.diagflow.inputs.FulfillmentGenericWebServiceArgs;
import com.pulumi.resources.CustomResourceOptions;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;
public class App {
public static void main(String[] args) {
Pulumi.run(App::stack);
}
public static void stack(Context ctx) {
var basicAgent = new Agent("basicAgent", AgentArgs.builder()
.displayName("example_agent")
.defaultLanguageCode("en")
.timeZone("America/New_York")
.build());
var basicFulfillment = new Fulfillment("basicFulfillment", FulfillmentArgs.builder()
.displayName("basic-fulfillment")
.enabled(true)
.genericWebService(FulfillmentGenericWebServiceArgs.builder()
.uri("https://google.com")
.username("admin")
.password("password")
.requestHeaders(Map.of("name", "wrench"))
.build())
.build(), CustomResourceOptions.builder()
.dependsOn(basicAgent)
.build());
}
}
resources:
basicAgent:
type: gcp:diagflow:Agent
name: basic_agent
properties:
displayName: example_agent
defaultLanguageCode: en
timeZone: America/New_York
basicFulfillment:
type: gcp:diagflow:Fulfillment
name: basic_fulfillment
properties:
displayName: basic-fulfillment
enabled: true
genericWebService:
uri: https://google.com
username: admin
password: password
requestHeaders:
name: wrench
options:
dependson:
- ${basicAgent}
Create Fulfillment Resource
Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.
Constructor syntax
new Fulfillment(name: string, args: FulfillmentArgs, opts?: CustomResourceOptions);
@overload
def Fulfillment(resource_name: str,
args: FulfillmentArgs,
opts: Optional[ResourceOptions] = None)
@overload
def Fulfillment(resource_name: str,
opts: Optional[ResourceOptions] = None,
display_name: Optional[str] = None,
enabled: Optional[bool] = None,
features: Optional[Sequence[FulfillmentFeatureArgs]] = None,
generic_web_service: Optional[FulfillmentGenericWebServiceArgs] = None,
project: Optional[str] = None)
func NewFulfillment(ctx *Context, name string, args FulfillmentArgs, opts ...ResourceOption) (*Fulfillment, error)
public Fulfillment(string name, FulfillmentArgs args, CustomResourceOptions? opts = null)
public Fulfillment(String name, FulfillmentArgs args)
public Fulfillment(String name, FulfillmentArgs args, CustomResourceOptions options)
type: gcp:diagflow:Fulfillment
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.
Parameters
- name string
- The unique name of the resource.
- args FulfillmentArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- resource_name str
- The unique name of the resource.
- args FulfillmentArgs
- The arguments to resource properties.
- opts ResourceOptions
- Bag of options to control resource's behavior.
- ctx Context
- Context object for the current deployment.
- name string
- The unique name of the resource.
- args FulfillmentArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args FulfillmentArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args FulfillmentArgs
- The arguments to resource properties.
- options CustomResourceOptions
- Bag of options to control resource's behavior.
Constructor example
The following reference example uses placeholder values for all input properties.
var fulfillmentResource = new Gcp.Diagflow.Fulfillment("fulfillmentResource", new()
{
DisplayName = "string",
Enabled = false,
Features = new[]
{
new Gcp.Diagflow.Inputs.FulfillmentFeatureArgs
{
Type = "string",
},
},
GenericWebService = new Gcp.Diagflow.Inputs.FulfillmentGenericWebServiceArgs
{
Uri = "string",
Password = "string",
RequestHeaders =
{
{ "string", "string" },
},
Username = "string",
},
Project = "string",
});
example, err := diagflow.NewFulfillment(ctx, "fulfillmentResource", &diagflow.FulfillmentArgs{
DisplayName: pulumi.String("string"),
Enabled: pulumi.Bool(false),
Features: diagflow.FulfillmentFeatureArray{
&diagflow.FulfillmentFeatureArgs{
Type: pulumi.String("string"),
},
},
GenericWebService: &diagflow.FulfillmentGenericWebServiceArgs{
Uri: pulumi.String("string"),
Password: pulumi.String("string"),
RequestHeaders: pulumi.StringMap{
"string": pulumi.String("string"),
},
Username: pulumi.String("string"),
},
Project: pulumi.String("string"),
})
var fulfillmentResource = new Fulfillment("fulfillmentResource", FulfillmentArgs.builder()
.displayName("string")
.enabled(false)
.features(FulfillmentFeatureArgs.builder()
.type("string")
.build())
.genericWebService(FulfillmentGenericWebServiceArgs.builder()
.uri("string")
.password("string")
.requestHeaders(Map.of("string", "string"))
.username("string")
.build())
.project("string")
.build());
fulfillment_resource = gcp.diagflow.Fulfillment("fulfillmentResource",
display_name="string",
enabled=False,
features=[{
"type": "string",
}],
generic_web_service={
"uri": "string",
"password": "string",
"requestHeaders": {
"string": "string",
},
"username": "string",
},
project="string")
const fulfillmentResource = new gcp.diagflow.Fulfillment("fulfillmentResource", {
displayName: "string",
enabled: false,
features: [{
type: "string",
}],
genericWebService: {
uri: "string",
password: "string",
requestHeaders: {
string: "string",
},
username: "string",
},
project: "string",
});
type: gcp:diagflow:Fulfillment
properties:
displayName: string
enabled: false
features:
- type: string
genericWebService:
password: string
requestHeaders:
string: string
uri: string
username: string
project: string
Fulfillment Resource Properties
To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.
Inputs
The Fulfillment resource accepts the following input properties:
- Display
Name string - The human-readable name of the fulfillment, unique within the agent.
- Enabled bool
- Whether fulfillment is enabled.
- Features
List<Fulfillment
Feature> - The field defines whether the fulfillment is enabled for certain features. Structure is documented below.
- Generic
Web FulfillmentService Generic Web Service - Represents configuration for a generic web service. Dialogflow supports two mechanisms for authentications: - Basic authentication with username and password. - Authentication with additional authentication headers. Structure is documented below.
- Project string
- The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
- Display
Name string - The human-readable name of the fulfillment, unique within the agent.
- Enabled bool
- Whether fulfillment is enabled.
- Features
[]Fulfillment
Feature Args - The field defines whether the fulfillment is enabled for certain features. Structure is documented below.
- Generic
Web FulfillmentService Generic Web Service Args - Represents configuration for a generic web service. Dialogflow supports two mechanisms for authentications: - Basic authentication with username and password. - Authentication with additional authentication headers. Structure is documented below.
- Project string
- The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
- display
Name String - The human-readable name of the fulfillment, unique within the agent.
- enabled Boolean
- Whether fulfillment is enabled.
- features
List<Fulfillment
Feature> - The field defines whether the fulfillment is enabled for certain features. Structure is documented below.
- generic
Web FulfillmentService Generic Web Service - Represents configuration for a generic web service. Dialogflow supports two mechanisms for authentications: - Basic authentication with username and password. - Authentication with additional authentication headers. Structure is documented below.
- project String
- The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
- display
Name string - The human-readable name of the fulfillment, unique within the agent.
- enabled boolean
- Whether fulfillment is enabled.
- features
Fulfillment
Feature[] - The field defines whether the fulfillment is enabled for certain features. Structure is documented below.
- generic
Web FulfillmentService Generic Web Service - Represents configuration for a generic web service. Dialogflow supports two mechanisms for authentications: - Basic authentication with username and password. - Authentication with additional authentication headers. Structure is documented below.
- project string
- The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
- display_
name str - The human-readable name of the fulfillment, unique within the agent.
- enabled bool
- Whether fulfillment is enabled.
- features
Sequence[Fulfillment
Feature Args] - The field defines whether the fulfillment is enabled for certain features. Structure is documented below.
- generic_
web_ Fulfillmentservice Generic Web Service Args - Represents configuration for a generic web service. Dialogflow supports two mechanisms for authentications: - Basic authentication with username and password. - Authentication with additional authentication headers. Structure is documented below.
- project str
- The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
- display
Name String - The human-readable name of the fulfillment, unique within the agent.
- enabled Boolean
- Whether fulfillment is enabled.
- features List<Property Map>
- The field defines whether the fulfillment is enabled for certain features. Structure is documented below.
- generic
Web Property MapService - Represents configuration for a generic web service. Dialogflow supports two mechanisms for authentications: - Basic authentication with username and password. - Authentication with additional authentication headers. Structure is documented below.
- project String
- The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
Outputs
All input properties are implicitly available as output properties. Additionally, the Fulfillment resource produces the following output properties:
Look up Existing Fulfillment Resource
Get an existing Fulfillment resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.
public static get(name: string, id: Input<ID>, state?: FulfillmentState, opts?: CustomResourceOptions): Fulfillment
@staticmethod
def get(resource_name: str,
id: str,
opts: Optional[ResourceOptions] = None,
display_name: Optional[str] = None,
enabled: Optional[bool] = None,
features: Optional[Sequence[FulfillmentFeatureArgs]] = None,
generic_web_service: Optional[FulfillmentGenericWebServiceArgs] = None,
name: Optional[str] = None,
project: Optional[str] = None) -> Fulfillment
func GetFulfillment(ctx *Context, name string, id IDInput, state *FulfillmentState, opts ...ResourceOption) (*Fulfillment, error)
public static Fulfillment Get(string name, Input<string> id, FulfillmentState? state, CustomResourceOptions? opts = null)
public static Fulfillment get(String name, Output<String> id, FulfillmentState state, CustomResourceOptions options)
Resource lookup is not supported in YAML
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- resource_name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- Display
Name string - The human-readable name of the fulfillment, unique within the agent.
- Enabled bool
- Whether fulfillment is enabled.
- Features
List<Fulfillment
Feature> - The field defines whether the fulfillment is enabled for certain features. Structure is documented below.
- Generic
Web FulfillmentService Generic Web Service - Represents configuration for a generic web service. Dialogflow supports two mechanisms for authentications: - Basic authentication with username and password. - Authentication with additional authentication headers. Structure is documented below.
- Name string
- The unique identifier of the fulfillment. Format: projects//agent/fulfillment - projects//locations//agent/fulfillment
- Project string
- The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
- Display
Name string - The human-readable name of the fulfillment, unique within the agent.
- Enabled bool
- Whether fulfillment is enabled.
- Features
[]Fulfillment
Feature Args - The field defines whether the fulfillment is enabled for certain features. Structure is documented below.
- Generic
Web FulfillmentService Generic Web Service Args - Represents configuration for a generic web service. Dialogflow supports two mechanisms for authentications: - Basic authentication with username and password. - Authentication with additional authentication headers. Structure is documented below.
- Name string
- The unique identifier of the fulfillment. Format: projects//agent/fulfillment - projects//locations//agent/fulfillment
- Project string
- The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
- display
Name String - The human-readable name of the fulfillment, unique within the agent.
- enabled Boolean
- Whether fulfillment is enabled.
- features
List<Fulfillment
Feature> - The field defines whether the fulfillment is enabled for certain features. Structure is documented below.
- generic
Web FulfillmentService Generic Web Service - Represents configuration for a generic web service. Dialogflow supports two mechanisms for authentications: - Basic authentication with username and password. - Authentication with additional authentication headers. Structure is documented below.
- name String
- The unique identifier of the fulfillment. Format: projects//agent/fulfillment - projects//locations//agent/fulfillment
- project String
- The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
- display
Name string - The human-readable name of the fulfillment, unique within the agent.
- enabled boolean
- Whether fulfillment is enabled.
- features
Fulfillment
Feature[] - The field defines whether the fulfillment is enabled for certain features. Structure is documented below.
- generic
Web FulfillmentService Generic Web Service - Represents configuration for a generic web service. Dialogflow supports two mechanisms for authentications: - Basic authentication with username and password. - Authentication with additional authentication headers. Structure is documented below.
- name string
- The unique identifier of the fulfillment. Format: projects//agent/fulfillment - projects//locations//agent/fulfillment
- project string
- The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
- display_
name str - The human-readable name of the fulfillment, unique within the agent.
- enabled bool
- Whether fulfillment is enabled.
- features
Sequence[Fulfillment
Feature Args] - The field defines whether the fulfillment is enabled for certain features. Structure is documented below.
- generic_
web_ Fulfillmentservice Generic Web Service Args - Represents configuration for a generic web service. Dialogflow supports two mechanisms for authentications: - Basic authentication with username and password. - Authentication with additional authentication headers. Structure is documented below.
- name str
- The unique identifier of the fulfillment. Format: projects//agent/fulfillment - projects//locations//agent/fulfillment
- project str
- The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
- display
Name String - The human-readable name of the fulfillment, unique within the agent.
- enabled Boolean
- Whether fulfillment is enabled.
- features List<Property Map>
- The field defines whether the fulfillment is enabled for certain features. Structure is documented below.
- generic
Web Property MapService - Represents configuration for a generic web service. Dialogflow supports two mechanisms for authentications: - Basic authentication with username and password. - Authentication with additional authentication headers. Structure is documented below.
- name String
- The unique identifier of the fulfillment. Format: projects//agent/fulfillment - projects//locations//agent/fulfillment
- project String
- The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
Supporting Types
FulfillmentFeature, FulfillmentFeatureArgs
- Type string
- The type of the feature that enabled for fulfillment.
- SMALLTALK: Fulfillment is enabled for SmallTalk.
Possible values are:
SMALLTALK
.
- SMALLTALK: Fulfillment is enabled for SmallTalk.
Possible values are:
- Type string
- The type of the feature that enabled for fulfillment.
- SMALLTALK: Fulfillment is enabled for SmallTalk.
Possible values are:
SMALLTALK
.
- SMALLTALK: Fulfillment is enabled for SmallTalk.
Possible values are:
- type String
- The type of the feature that enabled for fulfillment.
- SMALLTALK: Fulfillment is enabled for SmallTalk.
Possible values are:
SMALLTALK
.
- SMALLTALK: Fulfillment is enabled for SmallTalk.
Possible values are:
- type string
- The type of the feature that enabled for fulfillment.
- SMALLTALK: Fulfillment is enabled for SmallTalk.
Possible values are:
SMALLTALK
.
- SMALLTALK: Fulfillment is enabled for SmallTalk.
Possible values are:
- type str
- The type of the feature that enabled for fulfillment.
- SMALLTALK: Fulfillment is enabled for SmallTalk.
Possible values are:
SMALLTALK
.
- SMALLTALK: Fulfillment is enabled for SmallTalk.
Possible values are:
- type String
- The type of the feature that enabled for fulfillment.
- SMALLTALK: Fulfillment is enabled for SmallTalk.
Possible values are:
SMALLTALK
.
- SMALLTALK: Fulfillment is enabled for SmallTalk.
Possible values are:
FulfillmentGenericWebService, FulfillmentGenericWebServiceArgs
- Uri string
- The fulfillment URI for receiving POST requests. It must use https protocol.
- Password string
- The password for HTTP Basic authentication.
- Request
Headers Dictionary<string, string> - The HTTP request headers to send together with fulfillment requests.
- Username string
- The user name for HTTP Basic authentication.
- Uri string
- The fulfillment URI for receiving POST requests. It must use https protocol.
- Password string
- The password for HTTP Basic authentication.
- Request
Headers map[string]string - The HTTP request headers to send together with fulfillment requests.
- Username string
- The user name for HTTP Basic authentication.
- uri String
- The fulfillment URI for receiving POST requests. It must use https protocol.
- password String
- The password for HTTP Basic authentication.
- request
Headers Map<String,String> - The HTTP request headers to send together with fulfillment requests.
- username String
- The user name for HTTP Basic authentication.
- uri string
- The fulfillment URI for receiving POST requests. It must use https protocol.
- password string
- The password for HTTP Basic authentication.
- request
Headers {[key: string]: string} - The HTTP request headers to send together with fulfillment requests.
- username string
- The user name for HTTP Basic authentication.
- uri str
- The fulfillment URI for receiving POST requests. It must use https protocol.
- password str
- The password for HTTP Basic authentication.
- request_
headers Mapping[str, str] - The HTTP request headers to send together with fulfillment requests.
- username str
- The user name for HTTP Basic authentication.
- uri String
- The fulfillment URI for receiving POST requests. It must use https protocol.
- password String
- The password for HTTP Basic authentication.
- request
Headers Map<String> - The HTTP request headers to send together with fulfillment requests.
- username String
- The user name for HTTP Basic authentication.
Import
Fulfillment can be imported using any of these accepted formats:
{{name}}
When using the pulumi import
command, Fulfillment can be imported using one of the formats above. For example:
$ pulumi import gcp:diagflow/fulfillment:Fulfillment default {{name}}
To learn more about importing existing cloud resources, see Importing resources.
Package Details
- Repository
- Google Cloud (GCP) Classic pulumi/pulumi-gcp
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the
google-beta
Terraform Provider.