| // Copyright 2021 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" |
| "google.golang.org/api/iterator" |
| channelpb "google.golang.org/genproto/googleapis/cloud/channel/v1" |
| ) |
| |
| func ExampleNewCloudChannelClient() { |
| ctx := context.Background() |
| c, err := channel.NewCloudChannelClient(ctx) |
| if err != nil { |
| // TODO: Handle error. |
| } |
| // TODO: Use client. |
| _ = c |
| } |
| |
| func ExampleCloudChannelClient_ListCustomers() { |
| // import channelpb "google.golang.org/genproto/googleapis/cloud/channel/v1" |
| // import "google.golang.org/api/iterator" |
| |
| ctx := context.Background() |
| c, err := channel.NewCloudChannelClient(ctx) |
| if err != nil { |
| // TODO: Handle error. |
| } |
| |
| req := &channelpb.ListCustomersRequest{ |
| // TODO: Fill request struct fields. |
| } |
| 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 |
| } |
| } |
| |
| func ExampleCloudChannelClient_GetCustomer() { |
| // import channelpb "google.golang.org/genproto/googleapis/cloud/channel/v1" |
| |
| ctx := context.Background() |
| c, err := channel.NewCloudChannelClient(ctx) |
| if err != nil { |
| // TODO: Handle error. |
| } |
| |
| req := &channelpb.GetCustomerRequest{ |
| // TODO: Fill request struct fields. |
| } |
| resp, err := c.GetCustomer(ctx, req) |
| if err != nil { |
| // TODO: Handle error. |
| } |
| // TODO: Use resp. |
| _ = resp |
| } |
| |
| func ExampleCloudChannelClient_CheckCloudIdentityAccountsExist() { |
| // import channelpb "google.golang.org/genproto/googleapis/cloud/channel/v1" |
| |
| ctx := context.Background() |
| c, err := channel.NewCloudChannelClient(ctx) |
| if err != nil { |
| // TODO: Handle error. |
| } |
| |
| req := &channelpb.CheckCloudIdentityAccountsExistRequest{ |
| // TODO: Fill request struct fields. |
| } |
| resp, err := c.CheckCloudIdentityAccountsExist(ctx, req) |
| if err != nil { |
| // TODO: Handle error. |
| } |
| // TODO: Use resp. |
| _ = resp |
| } |
| |
| func ExampleCloudChannelClient_CreateCustomer() { |
| // import channelpb "google.golang.org/genproto/googleapis/cloud/channel/v1" |
| |
| ctx := context.Background() |
| c, err := channel.NewCloudChannelClient(ctx) |
| if err != nil { |
| // TODO: Handle error. |
| } |
| |
| req := &channelpb.CreateCustomerRequest{ |
| // TODO: Fill request struct fields. |
| } |
| resp, err := c.CreateCustomer(ctx, req) |
| if err != nil { |
| // TODO: Handle error. |
| } |
| // TODO: Use resp. |
| _ = resp |
| } |
| |
| func ExampleCloudChannelClient_UpdateCustomer() { |
| // import channelpb "google.golang.org/genproto/googleapis/cloud/channel/v1" |
| |
| ctx := context.Background() |
| c, err := channel.NewCloudChannelClient(ctx) |
| if err != nil { |
| // TODO: Handle error. |
| } |
| |
| req := &channelpb.UpdateCustomerRequest{ |
| // TODO: Fill request struct fields. |
| } |
| resp, err := c.UpdateCustomer(ctx, req) |
| if err != nil { |
| // TODO: Handle error. |
| } |
| // TODO: Use resp. |
| _ = resp |
| } |
| |
| func ExampleCloudChannelClient_DeleteCustomer() { |
| ctx := context.Background() |
| c, err := channel.NewCloudChannelClient(ctx) |
| if err != nil { |
| // TODO: Handle error. |
| } |
| |
| req := &channelpb.DeleteCustomerRequest{ |
| // TODO: Fill request struct fields. |
| } |
| err = c.DeleteCustomer(ctx, req) |
| if err != nil { |
| // TODO: Handle error. |
| } |
| } |
| |
| func ExampleCloudChannelClient_ProvisionCloudIdentity() { |
| // import channelpb "google.golang.org/genproto/googleapis/cloud/channel/v1" |
| |
| ctx := context.Background() |
| c, err := channel.NewCloudChannelClient(ctx) |
| if err != nil { |
| // TODO: Handle error. |
| } |
| |
| req := &channelpb.ProvisionCloudIdentityRequest{ |
| // TODO: Fill request struct fields. |
| } |
| 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_ListEntitlements() { |
| // import channelpb "google.golang.org/genproto/googleapis/cloud/channel/v1" |
| // import "google.golang.org/api/iterator" |
| |
| ctx := context.Background() |
| c, err := channel.NewCloudChannelClient(ctx) |
| if err != nil { |
| // TODO: Handle error. |
| } |
| |
| req := &channelpb.ListEntitlementsRequest{ |
| // TODO: Fill request struct fields. |
| } |
| 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 |
| } |
| } |
| |
| func ExampleCloudChannelClient_ListTransferableSkus() { |
| // import channelpb "google.golang.org/genproto/googleapis/cloud/channel/v1" |
| // import "google.golang.org/api/iterator" |
| |
| ctx := context.Background() |
| c, err := channel.NewCloudChannelClient(ctx) |
| if err != nil { |
| // TODO: Handle error. |
| } |
| |
| req := &channelpb.ListTransferableSkusRequest{ |
| // TODO: Fill request struct fields. |
| } |
| 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 |
| } |
| } |
| |
| func ExampleCloudChannelClient_ListTransferableOffers() { |
| // import channelpb "google.golang.org/genproto/googleapis/cloud/channel/v1" |
| // import "google.golang.org/api/iterator" |
| |
| ctx := context.Background() |
| c, err := channel.NewCloudChannelClient(ctx) |
| if err != nil { |
| // TODO: Handle error. |
| } |
| |
| req := &channelpb.ListTransferableOffersRequest{ |
| // TODO: Fill request struct fields. |
| } |
| 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 |
| } |
| } |
| |
| func ExampleCloudChannelClient_GetEntitlement() { |
| // import channelpb "google.golang.org/genproto/googleapis/cloud/channel/v1" |
| |
| ctx := context.Background() |
| c, err := channel.NewCloudChannelClient(ctx) |
| if err != nil { |
| // TODO: Handle error. |
| } |
| |
| req := &channelpb.GetEntitlementRequest{ |
| // TODO: Fill request struct fields. |
| } |
| resp, err := c.GetEntitlement(ctx, req) |
| if err != nil { |
| // TODO: Handle error. |
| } |
| // TODO: Use resp. |
| _ = resp |
| } |
| |
| func ExampleCloudChannelClient_CreateEntitlement() { |
| // import channelpb "google.golang.org/genproto/googleapis/cloud/channel/v1" |
| |
| ctx := context.Background() |
| c, err := channel.NewCloudChannelClient(ctx) |
| if err != nil { |
| // TODO: Handle error. |
| } |
| |
| req := &channelpb.CreateEntitlementRequest{ |
| // TODO: Fill request struct fields. |
| } |
| 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_ChangeParameters() { |
| // import channelpb "google.golang.org/genproto/googleapis/cloud/channel/v1" |
| |
| ctx := context.Background() |
| c, err := channel.NewCloudChannelClient(ctx) |
| if err != nil { |
| // TODO: Handle error. |
| } |
| |
| req := &channelpb.ChangeParametersRequest{ |
| // TODO: Fill request struct fields. |
| } |
| 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() { |
| // import channelpb "google.golang.org/genproto/googleapis/cloud/channel/v1" |
| |
| ctx := context.Background() |
| c, err := channel.NewCloudChannelClient(ctx) |
| if err != nil { |
| // TODO: Handle error. |
| } |
| |
| req := &channelpb.ChangeRenewalSettingsRequest{ |
| // TODO: Fill request struct fields. |
| } |
| 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_ChangeOffer() { |
| // import channelpb "google.golang.org/genproto/googleapis/cloud/channel/v1" |
| |
| ctx := context.Background() |
| c, err := channel.NewCloudChannelClient(ctx) |
| if err != nil { |
| // TODO: Handle error. |
| } |
| |
| req := &channelpb.ChangeOfferRequest{ |
| // TODO: Fill request struct fields. |
| } |
| 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_StartPaidService() { |
| // import channelpb "google.golang.org/genproto/googleapis/cloud/channel/v1" |
| |
| ctx := context.Background() |
| c, err := channel.NewCloudChannelClient(ctx) |
| if err != nil { |
| // TODO: Handle error. |
| } |
| |
| req := &channelpb.StartPaidServiceRequest{ |
| // TODO: Fill request struct fields. |
| } |
| 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() { |
| // import channelpb "google.golang.org/genproto/googleapis/cloud/channel/v1" |
| |
| ctx := context.Background() |
| c, err := channel.NewCloudChannelClient(ctx) |
| if err != nil { |
| // TODO: Handle error. |
| } |
| |
| req := &channelpb.SuspendEntitlementRequest{ |
| // TODO: Fill request struct fields. |
| } |
| 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_CancelEntitlement() { |
| // import channelpb "google.golang.org/genproto/googleapis/cloud/channel/v1" |
| |
| ctx := context.Background() |
| c, err := channel.NewCloudChannelClient(ctx) |
| if err != nil { |
| // TODO: Handle error. |
| } |
| |
| req := &channelpb.CancelEntitlementRequest{ |
| // TODO: Fill request struct fields. |
| } |
| op, err := c.CancelEntitlement(ctx, req) |
| if err != nil { |
| // TODO: Handle error. |
| } |
| |
| err = op.Wait(ctx) |
| if err != nil { |
| // TODO: Handle error. |
| } |
| } |
| |
| func ExampleCloudChannelClient_ActivateEntitlement() { |
| // import channelpb "google.golang.org/genproto/googleapis/cloud/channel/v1" |
| |
| ctx := context.Background() |
| c, err := channel.NewCloudChannelClient(ctx) |
| if err != nil { |
| // TODO: Handle error. |
| } |
| |
| req := &channelpb.ActivateEntitlementRequest{ |
| // TODO: Fill request struct fields. |
| } |
| 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_TransferEntitlements() { |
| // import channelpb "google.golang.org/genproto/googleapis/cloud/channel/v1" |
| |
| ctx := context.Background() |
| c, err := channel.NewCloudChannelClient(ctx) |
| if err != nil { |
| // TODO: Handle error. |
| } |
| |
| req := &channelpb.TransferEntitlementsRequest{ |
| // TODO: Fill request struct fields. |
| } |
| 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() { |
| // import channelpb "google.golang.org/genproto/googleapis/cloud/channel/v1" |
| |
| ctx := context.Background() |
| c, err := channel.NewCloudChannelClient(ctx) |
| if err != nil { |
| // TODO: Handle error. |
| } |
| |
| req := &channelpb.TransferEntitlementsToGoogleRequest{ |
| // TODO: Fill request struct fields. |
| } |
| op, err := c.TransferEntitlementsToGoogle(ctx, req) |
| if err != nil { |
| // TODO: Handle error. |
| } |
| |
| err = op.Wait(ctx) |
| if err != nil { |
| // TODO: Handle error. |
| } |
| } |
| |
| func ExampleCloudChannelClient_ListChannelPartnerLinks() { |
| // import channelpb "google.golang.org/genproto/googleapis/cloud/channel/v1" |
| // import "google.golang.org/api/iterator" |
| |
| ctx := context.Background() |
| c, err := channel.NewCloudChannelClient(ctx) |
| if err != nil { |
| // TODO: Handle error. |
| } |
| |
| req := &channelpb.ListChannelPartnerLinksRequest{ |
| // TODO: Fill request struct fields. |
| } |
| 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 |
| } |
| } |
| |
| func ExampleCloudChannelClient_GetChannelPartnerLink() { |
| // import channelpb "google.golang.org/genproto/googleapis/cloud/channel/v1" |
| |
| ctx := context.Background() |
| c, err := channel.NewCloudChannelClient(ctx) |
| if err != nil { |
| // TODO: Handle error. |
| } |
| |
| req := &channelpb.GetChannelPartnerLinkRequest{ |
| // TODO: Fill request struct fields. |
| } |
| resp, err := c.GetChannelPartnerLink(ctx, req) |
| if err != nil { |
| // TODO: Handle error. |
| } |
| // TODO: Use resp. |
| _ = resp |
| } |
| |
| func ExampleCloudChannelClient_CreateChannelPartnerLink() { |
| // import channelpb "google.golang.org/genproto/googleapis/cloud/channel/v1" |
| |
| ctx := context.Background() |
| c, err := channel.NewCloudChannelClient(ctx) |
| if err != nil { |
| // TODO: Handle error. |
| } |
| |
| req := &channelpb.CreateChannelPartnerLinkRequest{ |
| // TODO: Fill request struct fields. |
| } |
| resp, err := c.CreateChannelPartnerLink(ctx, req) |
| if err != nil { |
| // TODO: Handle error. |
| } |
| // TODO: Use resp. |
| _ = resp |
| } |
| |
| func ExampleCloudChannelClient_UpdateChannelPartnerLink() { |
| // import channelpb "google.golang.org/genproto/googleapis/cloud/channel/v1" |
| |
| ctx := context.Background() |
| c, err := channel.NewCloudChannelClient(ctx) |
| if err != nil { |
| // TODO: Handle error. |
| } |
| |
| req := &channelpb.UpdateChannelPartnerLinkRequest{ |
| // TODO: Fill request struct fields. |
| } |
| resp, err := c.UpdateChannelPartnerLink(ctx, req) |
| if err != nil { |
| // TODO: Handle error. |
| } |
| // TODO: Use resp. |
| _ = resp |
| } |
| |
| func ExampleCloudChannelClient_ListProducts() { |
| // import channelpb "google.golang.org/genproto/googleapis/cloud/channel/v1" |
| // import "google.golang.org/api/iterator" |
| |
| ctx := context.Background() |
| c, err := channel.NewCloudChannelClient(ctx) |
| if err != nil { |
| // TODO: Handle error. |
| } |
| |
| req := &channelpb.ListProductsRequest{ |
| // TODO: Fill request struct fields. |
| } |
| 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 |
| } |
| } |
| |
| func ExampleCloudChannelClient_ListSkus() { |
| // import channelpb "google.golang.org/genproto/googleapis/cloud/channel/v1" |
| // import "google.golang.org/api/iterator" |
| |
| ctx := context.Background() |
| c, err := channel.NewCloudChannelClient(ctx) |
| if err != nil { |
| // TODO: Handle error. |
| } |
| |
| req := &channelpb.ListSkusRequest{ |
| // TODO: Fill request struct fields. |
| } |
| 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 |
| } |
| } |
| |
| func ExampleCloudChannelClient_ListOffers() { |
| // import channelpb "google.golang.org/genproto/googleapis/cloud/channel/v1" |
| // import "google.golang.org/api/iterator" |
| |
| ctx := context.Background() |
| c, err := channel.NewCloudChannelClient(ctx) |
| if err != nil { |
| // TODO: Handle error. |
| } |
| |
| req := &channelpb.ListOffersRequest{ |
| // TODO: Fill request struct fields. |
| } |
| 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 |
| } |
| } |
| |
| func ExampleCloudChannelClient_ListPurchasableSkus() { |
| // import channelpb "google.golang.org/genproto/googleapis/cloud/channel/v1" |
| // import "google.golang.org/api/iterator" |
| |
| ctx := context.Background() |
| c, err := channel.NewCloudChannelClient(ctx) |
| if err != nil { |
| // TODO: Handle error. |
| } |
| |
| req := &channelpb.ListPurchasableSkusRequest{ |
| // TODO: Fill request struct fields. |
| } |
| 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 |
| } |
| } |
| |
| func ExampleCloudChannelClient_ListPurchasableOffers() { |
| // import channelpb "google.golang.org/genproto/googleapis/cloud/channel/v1" |
| // import "google.golang.org/api/iterator" |
| |
| ctx := context.Background() |
| c, err := channel.NewCloudChannelClient(ctx) |
| if err != nil { |
| // TODO: Handle error. |
| } |
| |
| req := &channelpb.ListPurchasableOffersRequest{ |
| // TODO: Fill request struct fields. |
| } |
| 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 |
| } |
| } |