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 gaming_test
18
19import (
20	"context"
21
22	gaming "cloud.google.com/go/gaming/apiv1beta"
23	"google.golang.org/api/iterator"
24	gamingpb "google.golang.org/genproto/googleapis/cloud/gaming/v1beta"
25)
26
27func ExampleNewGameServerClustersClient() {
28	ctx := context.Background()
29	c, err := gaming.NewGameServerClustersClient(ctx)
30	if err != nil {
31		// TODO: Handle error.
32	}
33	defer c.Close()
34
35	// TODO: Use client.
36	_ = c
37}
38
39func ExampleGameServerClustersClient_ListGameServerClusters() {
40	ctx := context.Background()
41	c, err := gaming.NewGameServerClustersClient(ctx)
42	if err != nil {
43		// TODO: Handle error.
44	}
45	defer c.Close()
46
47	req := &gamingpb.ListGameServerClustersRequest{
48		// TODO: Fill request struct fields.
49	}
50	it := c.ListGameServerClusters(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 ExampleGameServerClustersClient_GetGameServerCluster() {
65	ctx := context.Background()
66	c, err := gaming.NewGameServerClustersClient(ctx)
67	if err != nil {
68		// TODO: Handle error.
69	}
70	defer c.Close()
71
72	req := &gamingpb.GetGameServerClusterRequest{
73		// TODO: Fill request struct fields.
74	}
75	resp, err := c.GetGameServerCluster(ctx, req)
76	if err != nil {
77		// TODO: Handle error.
78	}
79	// TODO: Use resp.
80	_ = resp
81}
82
83func ExampleGameServerClustersClient_CreateGameServerCluster() {
84	ctx := context.Background()
85	c, err := gaming.NewGameServerClustersClient(ctx)
86	if err != nil {
87		// TODO: Handle error.
88	}
89	defer c.Close()
90
91	req := &gamingpb.CreateGameServerClusterRequest{
92		// TODO: Fill request struct fields.
93	}
94	op, err := c.CreateGameServerCluster(ctx, req)
95	if err != nil {
96		// TODO: Handle error.
97	}
98
99	resp, err := op.Wait(ctx)
100	if err != nil {
101		// TODO: Handle error.
102	}
103	// TODO: Use resp.
104	_ = resp
105}
106
107func ExampleGameServerClustersClient_PreviewCreateGameServerCluster() {
108	ctx := context.Background()
109	c, err := gaming.NewGameServerClustersClient(ctx)
110	if err != nil {
111		// TODO: Handle error.
112	}
113	defer c.Close()
114
115	req := &gamingpb.PreviewCreateGameServerClusterRequest{
116		// TODO: Fill request struct fields.
117	}
118	resp, err := c.PreviewCreateGameServerCluster(ctx, req)
119	if err != nil {
120		// TODO: Handle error.
121	}
122	// TODO: Use resp.
123	_ = resp
124}
125
126func ExampleGameServerClustersClient_DeleteGameServerCluster() {
127	ctx := context.Background()
128	c, err := gaming.NewGameServerClustersClient(ctx)
129	if err != nil {
130		// TODO: Handle error.
131	}
132	defer c.Close()
133
134	req := &gamingpb.DeleteGameServerClusterRequest{
135		// TODO: Fill request struct fields.
136	}
137	op, err := c.DeleteGameServerCluster(ctx, req)
138	if err != nil {
139		// TODO: Handle error.
140	}
141
142	err = op.Wait(ctx)
143	if err != nil {
144		// TODO: Handle error.
145	}
146}
147
148func ExampleGameServerClustersClient_PreviewDeleteGameServerCluster() {
149	ctx := context.Background()
150	c, err := gaming.NewGameServerClustersClient(ctx)
151	if err != nil {
152		// TODO: Handle error.
153	}
154	defer c.Close()
155
156	req := &gamingpb.PreviewDeleteGameServerClusterRequest{
157		// TODO: Fill request struct fields.
158	}
159	resp, err := c.PreviewDeleteGameServerCluster(ctx, req)
160	if err != nil {
161		// TODO: Handle error.
162	}
163	// TODO: Use resp.
164	_ = resp
165}
166
167func ExampleGameServerClustersClient_UpdateGameServerCluster() {
168	ctx := context.Background()
169	c, err := gaming.NewGameServerClustersClient(ctx)
170	if err != nil {
171		// TODO: Handle error.
172	}
173	defer c.Close()
174
175	req := &gamingpb.UpdateGameServerClusterRequest{
176		// TODO: Fill request struct fields.
177	}
178	op, err := c.UpdateGameServerCluster(ctx, req)
179	if err != nil {
180		// TODO: Handle error.
181	}
182
183	resp, err := op.Wait(ctx)
184	if err != nil {
185		// TODO: Handle error.
186	}
187	// TODO: Use resp.
188	_ = resp
189}
190
191func ExampleGameServerClustersClient_PreviewUpdateGameServerCluster() {
192	ctx := context.Background()
193	c, err := gaming.NewGameServerClustersClient(ctx)
194	if err != nil {
195		// TODO: Handle error.
196	}
197	defer c.Close()
198
199	req := &gamingpb.PreviewUpdateGameServerClusterRequest{
200		// TODO: Fill request struct fields.
201	}
202	resp, err := c.PreviewUpdateGameServerCluster(ctx, req)
203	if err != nil {
204		// TODO: Handle error.
205	}
206	// TODO: Use resp.
207	_ = resp
208}
209