blob: 5f0e574d21dbcb4d5b1f4d62f58aee294f5bebcd [file] [log] [blame]
// Copyright 2019 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// https://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
// Code generated by gapic-generator. DO NOT EDIT.
package cloudbuild_test
import (
"context"
cloudbuild "cloud.google.com/go/cloudbuild/apiv1"
"google.golang.org/api/iterator"
cloudbuildpb "google.golang.org/genproto/googleapis/devtools/cloudbuild/v1"
)
func ExampleNewClient() {
ctx := context.Background()
c, err := cloudbuild.NewClient(ctx)
if err != nil {
// TODO: Handle error.
}
// TODO: Use client.
_ = c
}
func ExampleClient_CreateBuild() {
ctx := context.Background()
c, err := cloudbuild.NewClient(ctx)
if err != nil {
// TODO: Handle error.
}
req := &cloudbuildpb.CreateBuildRequest{
// TODO: Fill request struct fields.
}
resp, err := c.CreateBuild(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func ExampleClient_GetBuild() {
ctx := context.Background()
c, err := cloudbuild.NewClient(ctx)
if err != nil {
// TODO: Handle error.
}
req := &cloudbuildpb.GetBuildRequest{
// TODO: Fill request struct fields.
}
resp, err := c.GetBuild(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func ExampleClient_ListBuilds() {
ctx := context.Background()
c, err := cloudbuild.NewClient(ctx)
if err != nil {
// TODO: Handle error.
}
req := &cloudbuildpb.ListBuildsRequest{
// TODO: Fill request struct fields.
}
it := c.ListBuilds(ctx, req)
for {
resp, err := it.Next()
if err == iterator.Done {
break
}
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
}
func ExampleClient_CancelBuild() {
ctx := context.Background()
c, err := cloudbuild.NewClient(ctx)
if err != nil {
// TODO: Handle error.
}
req := &cloudbuildpb.CancelBuildRequest{
// TODO: Fill request struct fields.
}
resp, err := c.CancelBuild(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func ExampleClient_CreateBuildTrigger() {
ctx := context.Background()
c, err := cloudbuild.NewClient(ctx)
if err != nil {
// TODO: Handle error.
}
req := &cloudbuildpb.CreateBuildTriggerRequest{
// TODO: Fill request struct fields.
}
resp, err := c.CreateBuildTrigger(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func ExampleClient_GetBuildTrigger() {
ctx := context.Background()
c, err := cloudbuild.NewClient(ctx)
if err != nil {
// TODO: Handle error.
}
req := &cloudbuildpb.GetBuildTriggerRequest{
// TODO: Fill request struct fields.
}
resp, err := c.GetBuildTrigger(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func ExampleClient_ListBuildTriggers() {
ctx := context.Background()
c, err := cloudbuild.NewClient(ctx)
if err != nil {
// TODO: Handle error.
}
req := &cloudbuildpb.ListBuildTriggersRequest{
// TODO: Fill request struct fields.
}
resp, err := c.ListBuildTriggers(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func ExampleClient_DeleteBuildTrigger() {
ctx := context.Background()
c, err := cloudbuild.NewClient(ctx)
if err != nil {
// TODO: Handle error.
}
req := &cloudbuildpb.DeleteBuildTriggerRequest{
// TODO: Fill request struct fields.
}
err = c.DeleteBuildTrigger(ctx, req)
if err != nil {
// TODO: Handle error.
}
}
func ExampleClient_UpdateBuildTrigger() {
ctx := context.Background()
c, err := cloudbuild.NewClient(ctx)
if err != nil {
// TODO: Handle error.
}
req := &cloudbuildpb.UpdateBuildTriggerRequest{
// TODO: Fill request struct fields.
}
resp, err := c.UpdateBuildTrigger(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func ExampleClient_RunBuildTrigger() {
ctx := context.Background()
c, err := cloudbuild.NewClient(ctx)
if err != nil {
// TODO: Handle error.
}
req := &cloudbuildpb.RunBuildTriggerRequest{
// TODO: Fill request struct fields.
}
resp, err := c.RunBuildTrigger(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func ExampleClient_RetryBuild() {
ctx := context.Background()
c, err := cloudbuild.NewClient(ctx)
if err != nil {
// TODO: Handle error.
}
req := &cloudbuildpb.RetryBuildRequest{
// TODO: Fill request struct fields.
}
resp, err := c.RetryBuild(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func ExampleClient_CreateWorkerPool() {
ctx := context.Background()
c, err := cloudbuild.NewClient(ctx)
if err != nil {
// TODO: Handle error.
}
req := &cloudbuildpb.CreateWorkerPoolRequest{
// TODO: Fill request struct fields.
}
resp, err := c.CreateWorkerPool(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func ExampleClient_GetWorkerPool() {
ctx := context.Background()
c, err := cloudbuild.NewClient(ctx)
if err != nil {
// TODO: Handle error.
}
req := &cloudbuildpb.GetWorkerPoolRequest{
// TODO: Fill request struct fields.
}
resp, err := c.GetWorkerPool(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func ExampleClient_DeleteWorkerPool() {
ctx := context.Background()
c, err := cloudbuild.NewClient(ctx)
if err != nil {
// TODO: Handle error.
}
req := &cloudbuildpb.DeleteWorkerPoolRequest{
// TODO: Fill request struct fields.
}
err = c.DeleteWorkerPool(ctx, req)
if err != nil {
// TODO: Handle error.
}
}
func ExampleClient_UpdateWorkerPool() {
ctx := context.Background()
c, err := cloudbuild.NewClient(ctx)
if err != nil {
// TODO: Handle error.
}
req := &cloudbuildpb.UpdateWorkerPoolRequest{
// TODO: Fill request struct fields.
}
resp, err := c.UpdateWorkerPool(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func ExampleClient_ListWorkerPools() {
ctx := context.Background()
c, err := cloudbuild.NewClient(ctx)
if err != nil {
// TODO: Handle error.
}
req := &cloudbuildpb.ListWorkerPoolsRequest{
// TODO: Fill request struct fields.
}
resp, err := c.ListWorkerPools(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}