1// Copyright 2018 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// AUTO-GENERATED CODE. DO NOT EDIT. 16 17package dialogflow_test 18 19import ( 20 "cloud.google.com/go/dialogflow/apiv2" 21 "golang.org/x/net/context" 22 "google.golang.org/api/iterator" 23 dialogflowpb "google.golang.org/genproto/googleapis/cloud/dialogflow/v2" 24) 25 26func ExampleNewSessionEntityTypesClient() { 27 ctx := context.Background() 28 c, err := dialogflow.NewSessionEntityTypesClient(ctx) 29 if err != nil { 30 // TODO: Handle error. 31 } 32 // TODO: Use client. 33 _ = c 34} 35 36func ExampleSessionEntityTypesClient_ListSessionEntityTypes() { 37 ctx := context.Background() 38 c, err := dialogflow.NewSessionEntityTypesClient(ctx) 39 if err != nil { 40 // TODO: Handle error. 41 } 42 43 req := &dialogflowpb.ListSessionEntityTypesRequest{ 44 // TODO: Fill request struct fields. 45 } 46 it := c.ListSessionEntityTypes(ctx, req) 47 for { 48 resp, err := it.Next() 49 if err == iterator.Done { 50 break 51 } 52 if err != nil { 53 // TODO: Handle error. 54 } 55 // TODO: Use resp. 56 _ = resp 57 } 58} 59 60func ExampleSessionEntityTypesClient_GetSessionEntityType() { 61 ctx := context.Background() 62 c, err := dialogflow.NewSessionEntityTypesClient(ctx) 63 if err != nil { 64 // TODO: Handle error. 65 } 66 67 req := &dialogflowpb.GetSessionEntityTypeRequest{ 68 // TODO: Fill request struct fields. 69 } 70 resp, err := c.GetSessionEntityType(ctx, req) 71 if err != nil { 72 // TODO: Handle error. 73 } 74 // TODO: Use resp. 75 _ = resp 76} 77 78func ExampleSessionEntityTypesClient_CreateSessionEntityType() { 79 ctx := context.Background() 80 c, err := dialogflow.NewSessionEntityTypesClient(ctx) 81 if err != nil { 82 // TODO: Handle error. 83 } 84 85 req := &dialogflowpb.CreateSessionEntityTypeRequest{ 86 // TODO: Fill request struct fields. 87 } 88 resp, err := c.CreateSessionEntityType(ctx, req) 89 if err != nil { 90 // TODO: Handle error. 91 } 92 // TODO: Use resp. 93 _ = resp 94} 95 96func ExampleSessionEntityTypesClient_UpdateSessionEntityType() { 97 ctx := context.Background() 98 c, err := dialogflow.NewSessionEntityTypesClient(ctx) 99 if err != nil { 100 // TODO: Handle error. 101 } 102 103 req := &dialogflowpb.UpdateSessionEntityTypeRequest{ 104 // TODO: Fill request struct fields. 105 } 106 resp, err := c.UpdateSessionEntityType(ctx, req) 107 if err != nil { 108 // TODO: Handle error. 109 } 110 // TODO: Use resp. 111 _ = resp 112} 113 114func ExampleSessionEntityTypesClient_DeleteSessionEntityType() { 115 ctx := context.Background() 116 c, err := dialogflow.NewSessionEntityTypesClient(ctx) 117 if err != nil { 118 // TODO: Handle error. 119 } 120 121 req := &dialogflowpb.DeleteSessionEntityTypeRequest{ 122 // TODO: Fill request struct fields. 123 } 124 err = c.DeleteSessionEntityType(ctx, req) 125 if err != nil { 126 // TODO: Handle error. 127 } 128} 129