1// Copyright 2021 Google LLC
2//
3// Licensed under the Apache License, Version 2.0 (the "License");
4// you may not use this file except in compliance with the License.
5// You may obtain a copy of the License at
6//
7//     https://www.apache.org/licenses/LICENSE-2.0
8//
9// Unless required by applicable law or agreed to in writing, software
10// distributed under the License is distributed on an "AS IS" BASIS,
11// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12// See the License for the specific language governing permissions and
13// limitations under the License.
14
15// Code generated by protoc-gen-go_gapic. DO NOT EDIT.
16
17package dialogflow_test
18
19import (
20	"context"
21
22	dialogflow "cloud.google.com/go/dialogflow/apiv2"
23	"google.golang.org/api/iterator"
24	dialogflowpb "google.golang.org/genproto/googleapis/cloud/dialogflow/v2"
25)
26
27func ExampleNewSessionEntityTypesClient() {
28	ctx := context.Background()
29	c, err := dialogflow.NewSessionEntityTypesClient(ctx)
30	if err != nil {
31		// TODO: Handle error.
32	}
33	defer c.Close()
34
35	// TODO: Use client.
36	_ = c
37}
38
39func ExampleSessionEntityTypesClient_ListSessionEntityTypes() {
40	ctx := context.Background()
41	c, err := dialogflow.NewSessionEntityTypesClient(ctx)
42	if err != nil {
43		// TODO: Handle error.
44	}
45	defer c.Close()
46
47	req := &dialogflowpb.ListSessionEntityTypesRequest{
48		// TODO: Fill request struct fields.
49	}
50	it := c.ListSessionEntityTypes(ctx, req)
51	for {
52		resp, err := it.Next()
53		if err == iterator.Done {
54			break
55		}
56		if err != nil {
57			// TODO: Handle error.
58		}
59		// TODO: Use resp.
60		_ = resp
61	}
62}
63
64func ExampleSessionEntityTypesClient_GetSessionEntityType() {
65	ctx := context.Background()
66	c, err := dialogflow.NewSessionEntityTypesClient(ctx)
67	if err != nil {
68		// TODO: Handle error.
69	}
70	defer c.Close()
71
72	req := &dialogflowpb.GetSessionEntityTypeRequest{
73		// TODO: Fill request struct fields.
74	}
75	resp, err := c.GetSessionEntityType(ctx, req)
76	if err != nil {
77		// TODO: Handle error.
78	}
79	// TODO: Use resp.
80	_ = resp
81}
82
83func ExampleSessionEntityTypesClient_CreateSessionEntityType() {
84	ctx := context.Background()
85	c, err := dialogflow.NewSessionEntityTypesClient(ctx)
86	if err != nil {
87		// TODO: Handle error.
88	}
89	defer c.Close()
90
91	req := &dialogflowpb.CreateSessionEntityTypeRequest{
92		// TODO: Fill request struct fields.
93	}
94	resp, err := c.CreateSessionEntityType(ctx, req)
95	if err != nil {
96		// TODO: Handle error.
97	}
98	// TODO: Use resp.
99	_ = resp
100}
101
102func ExampleSessionEntityTypesClient_UpdateSessionEntityType() {
103	ctx := context.Background()
104	c, err := dialogflow.NewSessionEntityTypesClient(ctx)
105	if err != nil {
106		// TODO: Handle error.
107	}
108	defer c.Close()
109
110	req := &dialogflowpb.UpdateSessionEntityTypeRequest{
111		// TODO: Fill request struct fields.
112	}
113	resp, err := c.UpdateSessionEntityType(ctx, req)
114	if err != nil {
115		// TODO: Handle error.
116	}
117	// TODO: Use resp.
118	_ = resp
119}
120
121func ExampleSessionEntityTypesClient_DeleteSessionEntityType() {
122	ctx := context.Background()
123	c, err := dialogflow.NewSessionEntityTypesClient(ctx)
124	if err != nil {
125		// TODO: Handle error.
126	}
127	defer c.Close()
128
129	req := &dialogflowpb.DeleteSessionEntityTypeRequest{
130		// TODO: Fill request struct fields.
131	}
132	err = c.DeleteSessionEntityType(ctx, req)
133	if err != nil {
134		// TODO: Handle error.
135	}
136}
137