1// Copyright 2020 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 gapic-generator. DO NOT EDIT.
16
17package monitoring_test
18
19import (
20	"context"
21
22	monitoring "cloud.google.com/go/monitoring/apiv3"
23	"google.golang.org/api/iterator"
24	monitoringpb "google.golang.org/genproto/googleapis/monitoring/v3"
25)
26
27func ExampleNewUptimeCheckClient() {
28	ctx := context.Background()
29	c, err := monitoring.NewUptimeCheckClient(ctx)
30	if err != nil {
31		// TODO: Handle error.
32	}
33	// TODO: Use client.
34	_ = c
35}
36
37func ExampleUptimeCheckClient_ListUptimeCheckConfigs() {
38	ctx := context.Background()
39	c, err := monitoring.NewUptimeCheckClient(ctx)
40	if err != nil {
41		// TODO: Handle error.
42	}
43
44	req := &monitoringpb.ListUptimeCheckConfigsRequest{
45		// TODO: Fill request struct fields.
46	}
47	it := c.ListUptimeCheckConfigs(ctx, req)
48	for {
49		resp, err := it.Next()
50		if err == iterator.Done {
51			break
52		}
53		if err != nil {
54			// TODO: Handle error.
55		}
56		// TODO: Use resp.
57		_ = resp
58	}
59}
60
61func ExampleUptimeCheckClient_GetUptimeCheckConfig() {
62	ctx := context.Background()
63	c, err := monitoring.NewUptimeCheckClient(ctx)
64	if err != nil {
65		// TODO: Handle error.
66	}
67
68	req := &monitoringpb.GetUptimeCheckConfigRequest{
69		// TODO: Fill request struct fields.
70	}
71	resp, err := c.GetUptimeCheckConfig(ctx, req)
72	if err != nil {
73		// TODO: Handle error.
74	}
75	// TODO: Use resp.
76	_ = resp
77}
78
79func ExampleUptimeCheckClient_CreateUptimeCheckConfig() {
80	ctx := context.Background()
81	c, err := monitoring.NewUptimeCheckClient(ctx)
82	if err != nil {
83		// TODO: Handle error.
84	}
85
86	req := &monitoringpb.CreateUptimeCheckConfigRequest{
87		// TODO: Fill request struct fields.
88	}
89	resp, err := c.CreateUptimeCheckConfig(ctx, req)
90	if err != nil {
91		// TODO: Handle error.
92	}
93	// TODO: Use resp.
94	_ = resp
95}
96
97func ExampleUptimeCheckClient_UpdateUptimeCheckConfig() {
98	ctx := context.Background()
99	c, err := monitoring.NewUptimeCheckClient(ctx)
100	if err != nil {
101		// TODO: Handle error.
102	}
103
104	req := &monitoringpb.UpdateUptimeCheckConfigRequest{
105		// TODO: Fill request struct fields.
106	}
107	resp, err := c.UpdateUptimeCheckConfig(ctx, req)
108	if err != nil {
109		// TODO: Handle error.
110	}
111	// TODO: Use resp.
112	_ = resp
113}
114
115func ExampleUptimeCheckClient_DeleteUptimeCheckConfig() {
116	ctx := context.Background()
117	c, err := monitoring.NewUptimeCheckClient(ctx)
118	if err != nil {
119		// TODO: Handle error.
120	}
121
122	req := &monitoringpb.DeleteUptimeCheckConfigRequest{
123		// TODO: Fill request struct fields.
124	}
125	err = c.DeleteUptimeCheckConfig(ctx, req)
126	if err != nil {
127		// TODO: Handle error.
128	}
129}
130
131func ExampleUptimeCheckClient_ListUptimeCheckIps() {
132	ctx := context.Background()
133	c, err := monitoring.NewUptimeCheckClient(ctx)
134	if err != nil {
135		// TODO: Handle error.
136	}
137
138	req := &monitoringpb.ListUptimeCheckIpsRequest{
139		// TODO: Fill request struct fields.
140	}
141	it := c.ListUptimeCheckIps(ctx, req)
142	for {
143		resp, err := it.Next()
144		if err == iterator.Done {
145			break
146		}
147		if err != nil {
148			// TODO: Handle error.
149		}
150		// TODO: Use resp.
151		_ = resp
152	}
153}
154