blob: 2adce5e9634737a0763f953199ea72d879bad94d [file] [log] [blame]
// Copyright 2024 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 protoc-gen-go_gapic. DO NOT EDIT.
package cloudcontrolspartner_test
import (
"context"
cloudcontrolspartner "cloud.google.com/go/cloudcontrolspartner/apiv1beta"
cloudcontrolspartnerpb "cloud.google.com/go/cloudcontrolspartner/apiv1beta/cloudcontrolspartnerpb"
"google.golang.org/api/iterator"
)
func ExampleNewCloudControlsPartnerCoreClient() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := cloudcontrolspartner.NewCloudControlsPartnerCoreClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
// TODO: Use client.
_ = c
}
func ExampleNewCloudControlsPartnerCoreRESTClient() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := cloudcontrolspartner.NewCloudControlsPartnerCoreRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
// TODO: Use client.
_ = c
}
func ExampleCloudControlsPartnerCoreClient_GetCustomer() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := cloudcontrolspartner.NewCloudControlsPartnerCoreClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &cloudcontrolspartnerpb.GetCustomerRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/cloudcontrolspartner/apiv1beta/cloudcontrolspartnerpb#GetCustomerRequest.
}
resp, err := c.GetCustomer(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func ExampleCloudControlsPartnerCoreClient_GetEkmConnections() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := cloudcontrolspartner.NewCloudControlsPartnerCoreClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &cloudcontrolspartnerpb.GetEkmConnectionsRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/cloudcontrolspartner/apiv1beta/cloudcontrolspartnerpb#GetEkmConnectionsRequest.
}
resp, err := c.GetEkmConnections(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func ExampleCloudControlsPartnerCoreClient_GetPartner() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := cloudcontrolspartner.NewCloudControlsPartnerCoreClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &cloudcontrolspartnerpb.GetPartnerRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/cloudcontrolspartner/apiv1beta/cloudcontrolspartnerpb#GetPartnerRequest.
}
resp, err := c.GetPartner(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func ExampleCloudControlsPartnerCoreClient_GetPartnerPermissions() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := cloudcontrolspartner.NewCloudControlsPartnerCoreClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &cloudcontrolspartnerpb.GetPartnerPermissionsRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/cloudcontrolspartner/apiv1beta/cloudcontrolspartnerpb#GetPartnerPermissionsRequest.
}
resp, err := c.GetPartnerPermissions(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func ExampleCloudControlsPartnerCoreClient_GetWorkload() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := cloudcontrolspartner.NewCloudControlsPartnerCoreClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &cloudcontrolspartnerpb.GetWorkloadRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/cloudcontrolspartner/apiv1beta/cloudcontrolspartnerpb#GetWorkloadRequest.
}
resp, err := c.GetWorkload(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func ExampleCloudControlsPartnerCoreClient_ListAccessApprovalRequests() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := cloudcontrolspartner.NewCloudControlsPartnerCoreClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &cloudcontrolspartnerpb.ListAccessApprovalRequestsRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/cloudcontrolspartner/apiv1beta/cloudcontrolspartnerpb#ListAccessApprovalRequestsRequest.
}
it := c.ListAccessApprovalRequests(ctx, req)
for {
resp, err := it.Next()
if err == iterator.Done {
break
}
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
// If you need to access the underlying RPC response,
// you can do so by casting the `Response` as below.
// Otherwise, remove this line. Only populated after
// first call to Next(). Not safe for concurrent access.
_ = it.Response.(*cloudcontrolspartnerpb.ListAccessApprovalRequestsResponse)
}
}
func ExampleCloudControlsPartnerCoreClient_ListCustomers() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := cloudcontrolspartner.NewCloudControlsPartnerCoreClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &cloudcontrolspartnerpb.ListCustomersRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/cloudcontrolspartner/apiv1beta/cloudcontrolspartnerpb#ListCustomersRequest.
}
it := c.ListCustomers(ctx, req)
for {
resp, err := it.Next()
if err == iterator.Done {
break
}
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
// If you need to access the underlying RPC response,
// you can do so by casting the `Response` as below.
// Otherwise, remove this line. Only populated after
// first call to Next(). Not safe for concurrent access.
_ = it.Response.(*cloudcontrolspartnerpb.ListCustomersResponse)
}
}
func ExampleCloudControlsPartnerCoreClient_ListWorkloads() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := cloudcontrolspartner.NewCloudControlsPartnerCoreClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &cloudcontrolspartnerpb.ListWorkloadsRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/cloudcontrolspartner/apiv1beta/cloudcontrolspartnerpb#ListWorkloadsRequest.
}
it := c.ListWorkloads(ctx, req)
for {
resp, err := it.Next()
if err == iterator.Done {
break
}
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
// If you need to access the underlying RPC response,
// you can do so by casting the `Response` as below.
// Otherwise, remove this line. Only populated after
// first call to Next(). Not safe for concurrent access.
_ = it.Response.(*cloudcontrolspartnerpb.ListWorkloadsResponse)
}
}