blob: c4ce47237e3ae8b7bf8766528f7231b834677bab [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 channel_test
import (
"context"
channel "cloud.google.com/go/channel/apiv1"
channelpb "cloud.google.com/go/channel/apiv1/channelpb"
longrunningpb "cloud.google.com/go/longrunning/autogen/longrunningpb"
"google.golang.org/api/iterator"
)
func ExampleNewCloudChannelClient() {
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 := channel.NewCloudChannelClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
// TODO: Use client.
_ = c
}
func ExampleNewCloudChannelRESTClient() {
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 := channel.NewCloudChannelRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
// TODO: Use client.
_ = c
}
func ExampleCloudChannelClient_ActivateEntitlement() {
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 := channel.NewCloudChannelClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &channelpb.ActivateEntitlementRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/channel/apiv1/channelpb#ActivateEntitlementRequest.
}
op, err := c.ActivateEntitlement(ctx, req)
if err != nil {
// TODO: Handle error.
}
resp, err := op.Wait(ctx)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func ExampleCloudChannelClient_CancelEntitlement() {
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 := channel.NewCloudChannelClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &channelpb.CancelEntitlementRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/channel/apiv1/channelpb#CancelEntitlementRequest.
}
op, err := c.CancelEntitlement(ctx, req)
if err != nil {
// TODO: Handle error.
}
err = op.Wait(ctx)
if err != nil {
// TODO: Handle error.
}
}
func ExampleCloudChannelClient_ChangeOffer() {
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 := channel.NewCloudChannelClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &channelpb.ChangeOfferRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/channel/apiv1/channelpb#ChangeOfferRequest.
}
op, err := c.ChangeOffer(ctx, req)
if err != nil {
// TODO: Handle error.
}
resp, err := op.Wait(ctx)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func ExampleCloudChannelClient_ChangeParameters() {
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 := channel.NewCloudChannelClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &channelpb.ChangeParametersRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/channel/apiv1/channelpb#ChangeParametersRequest.
}
op, err := c.ChangeParameters(ctx, req)
if err != nil {
// TODO: Handle error.
}
resp, err := op.Wait(ctx)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func ExampleCloudChannelClient_ChangeRenewalSettings() {
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 := channel.NewCloudChannelClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &channelpb.ChangeRenewalSettingsRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/channel/apiv1/channelpb#ChangeRenewalSettingsRequest.
}
op, err := c.ChangeRenewalSettings(ctx, req)
if err != nil {
// TODO: Handle error.
}
resp, err := op.Wait(ctx)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func ExampleCloudChannelClient_CheckCloudIdentityAccountsExist() {
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 := channel.NewCloudChannelClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &channelpb.CheckCloudIdentityAccountsExistRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/channel/apiv1/channelpb#CheckCloudIdentityAccountsExistRequest.
}
resp, err := c.CheckCloudIdentityAccountsExist(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func ExampleCloudChannelClient_CreateChannelPartnerLink() {
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 := channel.NewCloudChannelClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &channelpb.CreateChannelPartnerLinkRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/channel/apiv1/channelpb#CreateChannelPartnerLinkRequest.
}
resp, err := c.CreateChannelPartnerLink(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func ExampleCloudChannelClient_CreateChannelPartnerRepricingConfig() {
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 := channel.NewCloudChannelClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &channelpb.CreateChannelPartnerRepricingConfigRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/channel/apiv1/channelpb#CreateChannelPartnerRepricingConfigRequest.
}
resp, err := c.CreateChannelPartnerRepricingConfig(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func ExampleCloudChannelClient_CreateCustomer() {
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 := channel.NewCloudChannelClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &channelpb.CreateCustomerRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/channel/apiv1/channelpb#CreateCustomerRequest.
}
resp, err := c.CreateCustomer(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func ExampleCloudChannelClient_CreateCustomerRepricingConfig() {
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 := channel.NewCloudChannelClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &channelpb.CreateCustomerRepricingConfigRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/channel/apiv1/channelpb#CreateCustomerRepricingConfigRequest.
}
resp, err := c.CreateCustomerRepricingConfig(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func ExampleCloudChannelClient_CreateEntitlement() {
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 := channel.NewCloudChannelClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &channelpb.CreateEntitlementRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/channel/apiv1/channelpb#CreateEntitlementRequest.
}
op, err := c.CreateEntitlement(ctx, req)
if err != nil {
// TODO: Handle error.
}
resp, err := op.Wait(ctx)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func ExampleCloudChannelClient_DeleteChannelPartnerRepricingConfig() {
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 := channel.NewCloudChannelClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &channelpb.DeleteChannelPartnerRepricingConfigRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/channel/apiv1/channelpb#DeleteChannelPartnerRepricingConfigRequest.
}
err = c.DeleteChannelPartnerRepricingConfig(ctx, req)
if err != nil {
// TODO: Handle error.
}
}
func ExampleCloudChannelClient_DeleteCustomer() {
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 := channel.NewCloudChannelClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &channelpb.DeleteCustomerRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/channel/apiv1/channelpb#DeleteCustomerRequest.
}
err = c.DeleteCustomer(ctx, req)
if err != nil {
// TODO: Handle error.
}
}
func ExampleCloudChannelClient_DeleteCustomerRepricingConfig() {
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 := channel.NewCloudChannelClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &channelpb.DeleteCustomerRepricingConfigRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/channel/apiv1/channelpb#DeleteCustomerRepricingConfigRequest.
}
err = c.DeleteCustomerRepricingConfig(ctx, req)
if err != nil {
// TODO: Handle error.
}
}
func ExampleCloudChannelClient_GetChannelPartnerLink() {
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 := channel.NewCloudChannelClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &channelpb.GetChannelPartnerLinkRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/channel/apiv1/channelpb#GetChannelPartnerLinkRequest.
}
resp, err := c.GetChannelPartnerLink(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func ExampleCloudChannelClient_GetChannelPartnerRepricingConfig() {
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 := channel.NewCloudChannelClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &channelpb.GetChannelPartnerRepricingConfigRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/channel/apiv1/channelpb#GetChannelPartnerRepricingConfigRequest.
}
resp, err := c.GetChannelPartnerRepricingConfig(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func ExampleCloudChannelClient_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 := channel.NewCloudChannelClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &channelpb.GetCustomerRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/channel/apiv1/channelpb#GetCustomerRequest.
}
resp, err := c.GetCustomer(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func ExampleCloudChannelClient_GetCustomerRepricingConfig() {
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 := channel.NewCloudChannelClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &channelpb.GetCustomerRepricingConfigRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/channel/apiv1/channelpb#GetCustomerRepricingConfigRequest.
}
resp, err := c.GetCustomerRepricingConfig(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func ExampleCloudChannelClient_GetEntitlement() {
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 := channel.NewCloudChannelClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &channelpb.GetEntitlementRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/channel/apiv1/channelpb#GetEntitlementRequest.
}
resp, err := c.GetEntitlement(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func ExampleCloudChannelClient_ImportCustomer() {
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 := channel.NewCloudChannelClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &channelpb.ImportCustomerRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/channel/apiv1/channelpb#ImportCustomerRequest.
}
resp, err := c.ImportCustomer(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func ExampleCloudChannelClient_ListChannelPartnerLinks() {
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 := channel.NewCloudChannelClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &channelpb.ListChannelPartnerLinksRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/channel/apiv1/channelpb#ListChannelPartnerLinksRequest.
}
it := c.ListChannelPartnerLinks(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.(*channelpb.ListChannelPartnerLinksResponse)
}
}
func ExampleCloudChannelClient_ListChannelPartnerRepricingConfigs() {
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 := channel.NewCloudChannelClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &channelpb.ListChannelPartnerRepricingConfigsRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/channel/apiv1/channelpb#ListChannelPartnerRepricingConfigsRequest.
}
it := c.ListChannelPartnerRepricingConfigs(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.(*channelpb.ListChannelPartnerRepricingConfigsResponse)
}
}
func ExampleCloudChannelClient_ListCustomerRepricingConfigs() {
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 := channel.NewCloudChannelClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &channelpb.ListCustomerRepricingConfigsRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/channel/apiv1/channelpb#ListCustomerRepricingConfigsRequest.
}
it := c.ListCustomerRepricingConfigs(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.(*channelpb.ListCustomerRepricingConfigsResponse)
}
}
func ExampleCloudChannelClient_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 := channel.NewCloudChannelClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &channelpb.ListCustomersRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/channel/apiv1/channelpb#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.(*channelpb.ListCustomersResponse)
}
}
func ExampleCloudChannelClient_ListEntitlementChanges() {
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 := channel.NewCloudChannelClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &channelpb.ListEntitlementChangesRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/channel/apiv1/channelpb#ListEntitlementChangesRequest.
}
it := c.ListEntitlementChanges(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.(*channelpb.ListEntitlementChangesResponse)
}
}
func ExampleCloudChannelClient_ListEntitlements() {
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 := channel.NewCloudChannelClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &channelpb.ListEntitlementsRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/channel/apiv1/channelpb#ListEntitlementsRequest.
}
it := c.ListEntitlements(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.(*channelpb.ListEntitlementsResponse)
}
}
func ExampleCloudChannelClient_ListOffers() {
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 := channel.NewCloudChannelClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &channelpb.ListOffersRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/channel/apiv1/channelpb#ListOffersRequest.
}
it := c.ListOffers(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.(*channelpb.ListOffersResponse)
}
}
func ExampleCloudChannelClient_ListProducts() {
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 := channel.NewCloudChannelClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &channelpb.ListProductsRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/channel/apiv1/channelpb#ListProductsRequest.
}
it := c.ListProducts(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.(*channelpb.ListProductsResponse)
}
}
func ExampleCloudChannelClient_ListPurchasableOffers() {
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 := channel.NewCloudChannelClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &channelpb.ListPurchasableOffersRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/channel/apiv1/channelpb#ListPurchasableOffersRequest.
}
it := c.ListPurchasableOffers(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.(*channelpb.ListPurchasableOffersResponse)
}
}
func ExampleCloudChannelClient_ListPurchasableSkus() {
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 := channel.NewCloudChannelClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &channelpb.ListPurchasableSkusRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/channel/apiv1/channelpb#ListPurchasableSkusRequest.
}
it := c.ListPurchasableSkus(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.(*channelpb.ListPurchasableSkusResponse)
}
}
func ExampleCloudChannelClient_ListSkuGroupBillableSkus() {
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 := channel.NewCloudChannelClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &channelpb.ListSkuGroupBillableSkusRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/channel/apiv1/channelpb#ListSkuGroupBillableSkusRequest.
}
it := c.ListSkuGroupBillableSkus(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.(*channelpb.ListSkuGroupBillableSkusResponse)
}
}
func ExampleCloudChannelClient_ListSkuGroups() {
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 := channel.NewCloudChannelClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &channelpb.ListSkuGroupsRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/channel/apiv1/channelpb#ListSkuGroupsRequest.
}
it := c.ListSkuGroups(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.(*channelpb.ListSkuGroupsResponse)
}
}
func ExampleCloudChannelClient_ListSkus() {
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 := channel.NewCloudChannelClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &channelpb.ListSkusRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/channel/apiv1/channelpb#ListSkusRequest.
}
it := c.ListSkus(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.(*channelpb.ListSkusResponse)
}
}
func ExampleCloudChannelClient_ListSubscribers() {
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 := channel.NewCloudChannelClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &channelpb.ListSubscribersRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/channel/apiv1/channelpb#ListSubscribersRequest.
}
it := c.ListSubscribers(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.(*channelpb.ListSubscribersResponse)
}
}
func ExampleCloudChannelClient_ListTransferableOffers() {
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 := channel.NewCloudChannelClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &channelpb.ListTransferableOffersRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/channel/apiv1/channelpb#ListTransferableOffersRequest.
}
it := c.ListTransferableOffers(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.(*channelpb.ListTransferableOffersResponse)
}
}
func ExampleCloudChannelClient_ListTransferableSkus() {
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 := channel.NewCloudChannelClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &channelpb.ListTransferableSkusRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/channel/apiv1/channelpb#ListTransferableSkusRequest.
}
it := c.ListTransferableSkus(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.(*channelpb.ListTransferableSkusResponse)
}
}
func ExampleCloudChannelClient_LookupOffer() {
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 := channel.NewCloudChannelClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &channelpb.LookupOfferRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/channel/apiv1/channelpb#LookupOfferRequest.
}
resp, err := c.LookupOffer(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func ExampleCloudChannelClient_ProvisionCloudIdentity() {
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 := channel.NewCloudChannelClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &channelpb.ProvisionCloudIdentityRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/channel/apiv1/channelpb#ProvisionCloudIdentityRequest.
}
op, err := c.ProvisionCloudIdentity(ctx, req)
if err != nil {
// TODO: Handle error.
}
resp, err := op.Wait(ctx)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func ExampleCloudChannelClient_QueryEligibleBillingAccounts() {
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 := channel.NewCloudChannelClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &channelpb.QueryEligibleBillingAccountsRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/channel/apiv1/channelpb#QueryEligibleBillingAccountsRequest.
}
resp, err := c.QueryEligibleBillingAccounts(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func ExampleCloudChannelClient_RegisterSubscriber() {
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 := channel.NewCloudChannelClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &channelpb.RegisterSubscriberRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/channel/apiv1/channelpb#RegisterSubscriberRequest.
}
resp, err := c.RegisterSubscriber(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func ExampleCloudChannelClient_StartPaidService() {
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 := channel.NewCloudChannelClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &channelpb.StartPaidServiceRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/channel/apiv1/channelpb#StartPaidServiceRequest.
}
op, err := c.StartPaidService(ctx, req)
if err != nil {
// TODO: Handle error.
}
resp, err := op.Wait(ctx)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func ExampleCloudChannelClient_SuspendEntitlement() {
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 := channel.NewCloudChannelClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &channelpb.SuspendEntitlementRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/channel/apiv1/channelpb#SuspendEntitlementRequest.
}
op, err := c.SuspendEntitlement(ctx, req)
if err != nil {
// TODO: Handle error.
}
resp, err := op.Wait(ctx)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func ExampleCloudChannelClient_TransferEntitlements() {
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 := channel.NewCloudChannelClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &channelpb.TransferEntitlementsRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/channel/apiv1/channelpb#TransferEntitlementsRequest.
}
op, err := c.TransferEntitlements(ctx, req)
if err != nil {
// TODO: Handle error.
}
resp, err := op.Wait(ctx)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func ExampleCloudChannelClient_TransferEntitlementsToGoogle() {
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 := channel.NewCloudChannelClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &channelpb.TransferEntitlementsToGoogleRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/channel/apiv1/channelpb#TransferEntitlementsToGoogleRequest.
}
op, err := c.TransferEntitlementsToGoogle(ctx, req)
if err != nil {
// TODO: Handle error.
}
err = op.Wait(ctx)
if err != nil {
// TODO: Handle error.
}
}
func ExampleCloudChannelClient_UnregisterSubscriber() {
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 := channel.NewCloudChannelClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &channelpb.UnregisterSubscriberRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/channel/apiv1/channelpb#UnregisterSubscriberRequest.
}
resp, err := c.UnregisterSubscriber(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func ExampleCloudChannelClient_UpdateChannelPartnerLink() {
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 := channel.NewCloudChannelClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &channelpb.UpdateChannelPartnerLinkRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/channel/apiv1/channelpb#UpdateChannelPartnerLinkRequest.
}
resp, err := c.UpdateChannelPartnerLink(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func ExampleCloudChannelClient_UpdateChannelPartnerRepricingConfig() {
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 := channel.NewCloudChannelClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &channelpb.UpdateChannelPartnerRepricingConfigRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/channel/apiv1/channelpb#UpdateChannelPartnerRepricingConfigRequest.
}
resp, err := c.UpdateChannelPartnerRepricingConfig(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func ExampleCloudChannelClient_UpdateCustomer() {
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 := channel.NewCloudChannelClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &channelpb.UpdateCustomerRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/channel/apiv1/channelpb#UpdateCustomerRequest.
}
resp, err := c.UpdateCustomer(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func ExampleCloudChannelClient_UpdateCustomerRepricingConfig() {
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 := channel.NewCloudChannelClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &channelpb.UpdateCustomerRepricingConfigRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/channel/apiv1/channelpb#UpdateCustomerRepricingConfigRequest.
}
resp, err := c.UpdateCustomerRepricingConfig(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func ExampleCloudChannelClient_CancelOperation() {
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 := channel.NewCloudChannelClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &longrunningpb.CancelOperationRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/longrunning/autogen/longrunningpb#CancelOperationRequest.
}
err = c.CancelOperation(ctx, req)
if err != nil {
// TODO: Handle error.
}
}
func ExampleCloudChannelClient_DeleteOperation() {
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 := channel.NewCloudChannelClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &longrunningpb.DeleteOperationRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/longrunning/autogen/longrunningpb#DeleteOperationRequest.
}
err = c.DeleteOperation(ctx, req)
if err != nil {
// TODO: Handle error.
}
}
func ExampleCloudChannelClient_GetOperation() {
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 := channel.NewCloudChannelClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &longrunningpb.GetOperationRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/longrunning/autogen/longrunningpb#GetOperationRequest.
}
resp, err := c.GetOperation(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func ExampleCloudChannelClient_ListOperations() {
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 := channel.NewCloudChannelClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &longrunningpb.ListOperationsRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/longrunning/autogen/longrunningpb#ListOperationsRequest.
}
it := c.ListOperations(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.(*longrunningpb.ListOperationsResponse)
}
}