Package lfp is an auto-generated package for the Merchant API.
Programmatically manage your Merchant Center Accounts.
General documentation
For information that is relevant for all client libraries please reference https://pkg.go.dev/cloud.google.com/go#pkg-overview . Some information on this page includes:
- Authentication and Authorization
- Timeouts and Cancellation
- Testing against Client Libraries
- Debugging Client Libraries
- Inspecting errors
Example usage
To get started with this package, create a client.
// go get cloud.google.com/go/shopping/merchant/lfp/apiv1@latest 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 := lfp . NewLfpInventoryClient ( ctx ) if err != nil { // TODO: Handle error. } defer c . Close ()
The client will use your default application credentials. Clients should be reused instead of created as needed. The methods of Client are safe for concurrent use by multiple goroutines. The returned client must be Closed when it is done being used.
Using the Client
The following is an example of making an API call with the newly created client, mentioned above.
req := & lfppb . InsertLfpInventoryRequest { // TODO: Fill request struct fields. // See https://pkg.go.dev/cloud.google.com/go/shopping/merchant/lfp/apiv1/lfppb#InsertLfpInventoryRequest. } resp , err := c . InsertLfpInventory ( ctx , req ) if err != nil { // TODO: Handle error. } // TODO: Use resp. _ = resp
Use of Context
The ctx passed to NewLfpInventoryClient is used for authentication requests and for creating the underlying connection, but is not used for subsequent calls. Individual methods on the client use the ctx given to them.
To close the open connection, use the Close() method.
Functions
func DefaultAuthScopes
  func 
  
 DefaultAuthScopes 
 () 
  
 [] 
  string 
 
 
 
DefaultAuthScopes reports the default set of authentication scopes to use with this package.
LfpInventoryCallOptions
  type 
  
 LfpInventoryCallOptions 
  
 struct 
  
 { 
  
 InsertLfpInventory 
  
 [] 
  gax 
 
 . 
  CallOption 
 
 } 
 
 
LfpInventoryCallOptions contains the retry settings for each method of LfpInventoryClient.
LfpInventoryClient
  type 
  
 LfpInventoryClient 
  
 struct 
  
 { 
  
 // The call options for this service. 
  
 CallOptions 
  
 * 
  LfpInventoryCallOptions 
 
  
 // contains filtered or unexported fields 
 } 
 
 
LfpInventoryClient is a client for interacting with Merchant API. Methods, except Close, may be called concurrently. However, fields must not be modified concurrently with method calls.
Service for a LFP partner (at https://support.google.com/merchants/answer/7676652 ) to submit local inventories for a merchant.
func NewLfpInventoryClient
  func 
  
 NewLfpInventoryClient 
 ( 
 ctx 
  
  context 
 
 . 
  Context 
 
 , 
  
 opts 
  
 ... 
 option 
 . 
 ClientOption 
 ) 
  
 ( 
 * 
  LfpInventoryClient 
 
 , 
  
  error 
 
 ) 
 
 
NewLfpInventoryClient creates a new lfp inventory service client based on gRPC. The returned client must be Closed when it is done being used to clean up its underlying connections.
Service for a LFP partner (at https://support.google.com/merchants/answer/7676652 ) to submit local inventories for a merchant.
Example
  package 
  
 main 
 import 
  
 ( 
  
 "context" 
  
 lfp 
  
 "cloud.google.com/go/shopping/merchant/lfp/apiv1" 
 ) 
 func 
  
 main 
 () 
  
 { 
  
 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 
  
 := 
  
 lfp 
 . 
  NewLfpInventoryClient 
 
 ( 
 ctx 
 ) 
  
 if 
  
 err 
  
 != 
  
 nil 
  
 { 
  
 // TODO: Handle error. 
  
 } 
  
 defer 
  
 c 
 . 
 Close 
 () 
  
 // TODO: Use client. 
  
 _ 
  
 = 
  
 c 
 } 
 
 
func NewLfpInventoryRESTClient
  func 
  
 NewLfpInventoryRESTClient 
 ( 
 ctx 
  
  context 
 
 . 
  Context 
 
 , 
  
 opts 
  
 ... 
 option 
 . 
 ClientOption 
 ) 
  
 ( 
 * 
  LfpInventoryClient 
 
 , 
  
  error 
 
 ) 
 
 
NewLfpInventoryRESTClient creates a new lfp inventory service rest client.
Service for a LFP partner (at https://support.google.com/merchants/answer/7676652 ) to submit local inventories for a merchant.
Example
  package 
  
 main 
 import 
  
 ( 
  
 "context" 
  
 lfp 
  
 "cloud.google.com/go/shopping/merchant/lfp/apiv1" 
 ) 
 func 
  
 main 
 () 
  
 { 
  
 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 
  
 := 
  
 lfp 
 . 
  NewLfpInventoryRESTClient 
 
 ( 
 ctx 
 ) 
  
 if 
  
 err 
  
 != 
  
 nil 
  
 { 
  
 // TODO: Handle error. 
  
 } 
  
 defer 
  
 c 
 . 
 Close 
 () 
  
 // TODO: Use client. 
  
 _ 
  
 = 
  
 c 
 } 
 
 
func (*LfpInventoryClient) Close
  func 
  
 ( 
 c 
  
 * 
  LfpInventoryClient 
 
 ) 
  
 Close 
 () 
  
  error 
 
 
 
Close closes the connection to the API service. The user should invoke this when the client is no longer required.
func (*LfpInventoryClient) Connection (deprecated)
  func 
  
 ( 
 c 
  
 * 
  LfpInventoryClient 
 
 ) 
  
 Connection 
 () 
  
 * 
 grpc 
 . 
 ClientConn 
 
 
Connection returns a connection to the API service.
Deprecated: Connections are now pooled so this method does not always return the same resource.
func (*LfpInventoryClient) InsertLfpInventory
  func 
  
 ( 
 c 
  
 * 
  LfpInventoryClient 
 
 ) 
  
 InsertLfpInventory 
 ( 
 ctx 
  
  context 
 
 . 
  Context 
 
 , 
  
 req 
  
 * 
  lfppb 
 
 . 
  InsertLfpInventoryRequest 
 
 , 
  
 opts 
  
 ... 
  gax 
 
 . 
  CallOption 
 
 ) 
  
 ( 
 * 
  lfppb 
 
 . 
  LfpInventory 
 
 , 
  
  error 
 
 ) 
 
 
InsertLfpInventory inserts a LfpInventory resource for the given target merchant account. If the resource already exists, it will be replaced. The inventory automatically expires after 30 days.
Example
  package 
  
 main 
 import 
  
 ( 
  
 "context" 
  
 lfp 
  
 "cloud.google.com/go/shopping/merchant/lfp/apiv1" 
  
 lfppb 
  
 "cloud.google.com/go/shopping/merchant/lfp/apiv1/lfppb" 
 ) 
 func 
  
 main 
 () 
  
 { 
  
 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 
  
 := 
  
 lfp 
 . 
  NewLfpInventoryClient 
 
 ( 
 ctx 
 ) 
  
 if 
  
 err 
  
 != 
  
 nil 
  
 { 
  
 // TODO: Handle error. 
  
 } 
  
 defer 
  
 c 
 . 
 Close 
 () 
  
 req 
  
 := 
  
& lfppb 
 . 
 InsertLfpInventoryRequest 
 { 
  
 // TODO: Fill request struct fields. 
  
 // See https://pkg.go.dev/cloud.google.com/go/shopping/merchant/lfp/apiv1/lfppb#InsertLfpInventoryRequest. 
  
 } 
  
 resp 
 , 
  
 err 
  
 := 
  
 c 
 . 
 InsertLfpInventory 
 ( 
 ctx 
 , 
  
 req 
 ) 
  
 if 
  
 err 
  
 != 
  
 nil 
  
 { 
  
 // TODO: Handle error. 
  
 } 
  
 // TODO: Use resp. 
  
 _ 
  
 = 
  
 resp 
 } 
 
 
LfpMerchantStateCallOptions
  type 
  
 LfpMerchantStateCallOptions 
  
 struct 
  
 { 
  
 GetLfpMerchantState 
  
 [] 
  gax 
 
 . 
  CallOption 
 
 } 
 
 
LfpMerchantStateCallOptions contains the retry settings for each method of LfpMerchantStateClient.
LfpMerchantStateClient
  type 
  
 LfpMerchantStateClient 
  
 struct 
  
 { 
  
 // The call options for this service. 
  
 CallOptions 
  
 * 
  LfpMerchantStateCallOptions 
 
  
 // contains filtered or unexported fields 
 } 
 
 
LfpMerchantStateClient is a client for interacting with Merchant API. Methods, except Close, may be called concurrently. However, fields must not be modified concurrently with method calls.
Service for a LFP partner (at https://support.google.com/merchants/answer/7676652 ) to get the state of a merchant.
For information about onboarding a retailer, see How to onboard a retailer (at https://support.google.com/merchants/answer/15243706 ).
func NewLfpMerchantStateClient
  func 
  
 NewLfpMerchantStateClient 
 ( 
 ctx 
  
  context 
 
 . 
  Context 
 
 , 
  
 opts 
  
 ... 
 option 
 . 
 ClientOption 
 ) 
  
 ( 
 * 
  LfpMerchantStateClient 
 
 , 
  
  error 
 
 ) 
 
 
NewLfpMerchantStateClient creates a new lfp merchant state service client based on gRPC. The returned client must be Closed when it is done being used to clean up its underlying connections.
Service for a LFP partner (at https://support.google.com/merchants/answer/7676652 ) to get the state of a merchant.
For information about onboarding a retailer, see How to onboard a retailer (at https://support.google.com/merchants/answer/15243706 ).
Example
  package 
  
 main 
 import 
  
 ( 
  
 "context" 
  
 lfp 
  
 "cloud.google.com/go/shopping/merchant/lfp/apiv1" 
 ) 
 func 
  
 main 
 () 
  
 { 
  
 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 
  
 := 
  
 lfp 
 . 
  NewLfpMerchantStateClient 
 
 ( 
 ctx 
 ) 
  
 if 
  
 err 
  
 != 
  
 nil 
  
 { 
  
 // TODO: Handle error. 
  
 } 
  
 defer 
  
 c 
 . 
 Close 
 () 
  
 // TODO: Use client. 
  
 _ 
  
 = 
  
 c 
 } 
 
 
func NewLfpMerchantStateRESTClient
  func 
  
 NewLfpMerchantStateRESTClient 
 ( 
 ctx 
  
  context 
 
 . 
  Context 
 
 , 
  
 opts 
  
 ... 
 option 
 . 
 ClientOption 
 ) 
  
 ( 
 * 
  LfpMerchantStateClient 
 
 , 
  
  error 
 
 ) 
 
 
NewLfpMerchantStateRESTClient creates a new lfp merchant state service rest client.
Service for a LFP partner (at https://support.google.com/merchants/answer/7676652 ) to get the state of a merchant.
For information about onboarding a retailer, see How to onboard a retailer (at https://support.google.com/merchants/answer/15243706 ).
Example
  package 
  
 main 
 import 
  
 ( 
  
 "context" 
  
 lfp 
  
 "cloud.google.com/go/shopping/merchant/lfp/apiv1" 
 ) 
 func 
  
 main 
 () 
  
 { 
  
 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 
  
 := 
  
 lfp 
 . 
  NewLfpMerchantStateRESTClient 
 
 ( 
 ctx 
 ) 
  
 if 
  
 err 
  
 != 
  
 nil 
  
 { 
  
 // TODO: Handle error. 
  
 } 
  
 defer 
  
 c 
 . 
 Close 
 () 
  
 // TODO: Use client. 
  
 _ 
  
 = 
  
 c 
 } 
 
 
func (*LfpMerchantStateClient) Close
  func 
  
 ( 
 c 
  
 * 
  LfpMerchantStateClient 
 
 ) 
  
 Close 
 () 
  
  error 
 
 
 
Close closes the connection to the API service. The user should invoke this when the client is no longer required.
func (*LfpMerchantStateClient) Connection (deprecated)
  func 
  
 ( 
 c 
  
 * 
  LfpMerchantStateClient 
 
 ) 
  
 Connection 
 () 
  
 * 
 grpc 
 . 
 ClientConn 
 
 
Connection returns a connection to the API service.
Deprecated: Connections are now pooled so this method does not always return the same resource.
func (*LfpMerchantStateClient) GetLfpMerchantState
  func 
  
 ( 
 c 
  
 * 
  LfpMerchantStateClient 
 
 ) 
  
 GetLfpMerchantState 
 ( 
 ctx 
  
  context 
 
 . 
  Context 
 
 , 
  
 req 
  
 * 
  lfppb 
 
 . 
  GetLfpMerchantStateRequest 
 
 , 
  
 opts 
  
 ... 
  gax 
 
 . 
  CallOption 
 
 ) 
  
 ( 
 * 
  lfppb 
 
 . 
  LfpMerchantState 
 
 , 
  
  error 
 
 ) 
 
 
GetLfpMerchantState gets the LFP state of a merchant
Example
  package 
  
 main 
 import 
  
 ( 
  
 "context" 
  
 lfp 
  
 "cloud.google.com/go/shopping/merchant/lfp/apiv1" 
  
 lfppb 
  
 "cloud.google.com/go/shopping/merchant/lfp/apiv1/lfppb" 
 ) 
 func 
  
 main 
 () 
  
 { 
  
 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 
  
 := 
  
 lfp 
 . 
  NewLfpMerchantStateClient 
 
 ( 
 ctx 
 ) 
  
 if 
  
 err 
  
 != 
  
 nil 
  
 { 
  
 // TODO: Handle error. 
  
 } 
  
 defer 
  
 c 
 . 
 Close 
 () 
  
 req 
  
 := 
  
& lfppb 
 . 
 GetLfpMerchantStateRequest 
 { 
  
 // TODO: Fill request struct fields. 
  
 // See https://pkg.go.dev/cloud.google.com/go/shopping/merchant/lfp/apiv1/lfppb#GetLfpMerchantStateRequest. 
  
 } 
  
 resp 
 , 
  
 err 
  
 := 
  
 c 
 . 
 GetLfpMerchantState 
 ( 
 ctx 
 , 
  
 req 
 ) 
  
 if 
  
 err 
  
 != 
  
 nil 
  
 { 
  
 // TODO: Handle error. 
  
 } 
  
 // TODO: Use resp. 
  
 _ 
  
 = 
  
 resp 
 } 
 
 
LfpSaleCallOptions
  type 
  
 LfpSaleCallOptions 
  
 struct 
  
 { 
  
 InsertLfpSale 
  
 [] 
  gax 
 
 . 
  CallOption 
 
 } 
 
 
LfpSaleCallOptions contains the retry settings for each method of LfpSaleClient.
LfpSaleClient
  type 
  
 LfpSaleClient 
  
 struct 
  
 { 
  
 // The call options for this service. 
  
 CallOptions 
  
 * 
  LfpSaleCallOptions 
 
  
 // contains filtered or unexported fields 
 } 
 
 
LfpSaleClient is a client for interacting with Merchant API. Methods, except Close, may be called concurrently. However, fields must not be modified concurrently with method calls.
Service for a LFP partner (at https://support.google.com/merchants/answer/7676652 ) to submit sales data for a merchant.
func NewLfpSaleClient
  func 
  
 NewLfpSaleClient 
 ( 
 ctx 
  
  context 
 
 . 
  Context 
 
 , 
  
 opts 
  
 ... 
 option 
 . 
 ClientOption 
 ) 
  
 ( 
 * 
  LfpSaleClient 
 
 , 
  
  error 
 
 ) 
 
 
NewLfpSaleClient creates a new lfp sale service client based on gRPC. The returned client must be Closed when it is done being used to clean up its underlying connections.
Service for a LFP partner (at https://support.google.com/merchants/answer/7676652 ) to submit sales data for a merchant.
Example
  package 
  
 main 
 import 
  
 ( 
  
 "context" 
  
 lfp 
  
 "cloud.google.com/go/shopping/merchant/lfp/apiv1" 
 ) 
 func 
  
 main 
 () 
  
 { 
  
 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 
  
 := 
  
 lfp 
 . 
  NewLfpSaleClient 
 
 ( 
 ctx 
 ) 
  
 if 
  
 err 
  
 != 
  
 nil 
  
 { 
  
 // TODO: Handle error. 
  
 } 
  
 defer 
  
 c 
 . 
 Close 
 () 
  
 // TODO: Use client. 
  
 _ 
  
 = 
  
 c 
 } 
 
 
func NewLfpSaleRESTClient
  func 
  
 NewLfpSaleRESTClient 
 ( 
 ctx 
  
  context 
 
 . 
  Context 
 
 , 
  
 opts 
  
 ... 
 option 
 . 
 ClientOption 
 ) 
  
 ( 
 * 
  LfpSaleClient 
 
 , 
  
  error 
 
 ) 
 
 
NewLfpSaleRESTClient creates a new lfp sale service rest client.
Service for a LFP partner (at https://support.google.com/merchants/answer/7676652 ) to submit sales data for a merchant.
Example
  package 
  
 main 
 import 
  
 ( 
  
 "context" 
  
 lfp 
  
 "cloud.google.com/go/shopping/merchant/lfp/apiv1" 
 ) 
 func 
  
 main 
 () 
  
 { 
  
 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 
  
 := 
  
 lfp 
 . 
  NewLfpSaleRESTClient 
 
 ( 
 ctx 
 ) 
  
 if 
  
 err 
  
 != 
  
 nil 
  
 { 
  
 // TODO: Handle error. 
  
 } 
  
 defer 
  
 c 
 . 
 Close 
 () 
  
 // TODO: Use client. 
  
 _ 
  
 = 
  
 c 
 } 
 
 
func (*LfpSaleClient) Close
  func 
  
 ( 
 c 
  
 * 
  LfpSaleClient 
 
 ) 
  
 Close 
 () 
  
  error 
 
 
 
Close closes the connection to the API service. The user should invoke this when the client is no longer required.
func (*LfpSaleClient) Connection (deprecated)
  func 
  
 ( 
 c 
  
 * 
  LfpSaleClient 
 
 ) 
  
 Connection 
 () 
  
 * 
 grpc 
 . 
 ClientConn 
 
 
Connection returns a connection to the API service.
Deprecated: Connections are now pooled so this method does not always return the same resource.
func (*LfpSaleClient) InsertLfpSale
  func 
  
 ( 
 c 
  
 * 
  LfpSaleClient 
 
 ) 
  
 InsertLfpSale 
 ( 
 ctx 
  
  context 
 
 . 
  Context 
 
 , 
  
 req 
  
 * 
  lfppb 
 
 . 
  InsertLfpSaleRequest 
 
 , 
  
 opts 
  
 ... 
  gax 
 
 . 
  CallOption 
 
 ) 
  
 ( 
 * 
  lfppb 
 
 . 
  LfpSale 
 
 , 
  
  error 
 
 ) 
 
 
InsertLfpSale inserts a LfpSale for the given merchant.
Example
  package 
  
 main 
 import 
  
 ( 
  
 "context" 
  
 lfp 
  
 "cloud.google.com/go/shopping/merchant/lfp/apiv1" 
  
 lfppb 
  
 "cloud.google.com/go/shopping/merchant/lfp/apiv1/lfppb" 
 ) 
 func 
  
 main 
 () 
  
 { 
  
 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 
  
 := 
  
 lfp 
 . 
  NewLfpSaleClient 
 
 ( 
 ctx 
 ) 
  
 if 
  
 err 
  
 != 
  
 nil 
  
 { 
  
 // TODO: Handle error. 
  
 } 
  
 defer 
  
 c 
 . 
 Close 
 () 
  
 req 
  
 := 
  
& lfppb 
 . 
 InsertLfpSaleRequest 
 { 
  
 // TODO: Fill request struct fields. 
  
 // See https://pkg.go.dev/cloud.google.com/go/shopping/merchant/lfp/apiv1/lfppb#InsertLfpSaleRequest. 
  
 } 
  
 resp 
 , 
  
 err 
  
 := 
  
 c 
 . 
 InsertLfpSale 
 ( 
 ctx 
 , 
  
 req 
 ) 
  
 if 
  
 err 
  
 != 
  
 nil 
  
 { 
  
 // TODO: Handle error. 
  
 } 
  
 // TODO: Use resp. 
  
 _ 
  
 = 
  
 resp 
 } 
 
 
LfpStoreCallOptions
  type 
  
 LfpStoreCallOptions 
  
 struct 
  
 { 
  
 GetLfpStore 
  
 [] 
  gax 
 
 . 
  CallOption 
 
  
 InsertLfpStore 
  
 [] 
  gax 
 
 . 
  CallOption 
 
  
 DeleteLfpStore 
  
 [] 
  gax 
 
 . 
  CallOption 
 
  
 ListLfpStores 
  
 [] 
  gax 
 
 . 
  CallOption 
 
 } 
 
 
LfpStoreCallOptions contains the retry settings for each method of LfpStoreClient.
LfpStoreClient
  type 
  
 LfpStoreClient 
  
 struct 
  
 { 
  
 // The call options for this service. 
  
 CallOptions 
  
 * 
  LfpStoreCallOptions 
 
  
 // contains filtered or unexported fields 
 } 
 
 
LfpStoreClient is a client for interacting with Merchant API. Methods, except Close, may be called concurrently. However, fields must not be modified concurrently with method calls.
Service for a LFP partner (at https://support.google.com/merchants/answer/7676652 ) to submit local stores for a merchant.
func NewLfpStoreClient
  func 
  
 NewLfpStoreClient 
 ( 
 ctx 
  
  context 
 
 . 
  Context 
 
 , 
  
 opts 
  
 ... 
 option 
 . 
 ClientOption 
 ) 
  
 ( 
 * 
  LfpStoreClient 
 
 , 
  
  error 
 
 ) 
 
 
NewLfpStoreClient creates a new lfp store service client based on gRPC. The returned client must be Closed when it is done being used to clean up its underlying connections.
Service for a LFP partner (at https://support.google.com/merchants/answer/7676652 ) to submit local stores for a merchant.
Example
  package 
  
 main 
 import 
  
 ( 
  
 "context" 
  
 lfp 
  
 "cloud.google.com/go/shopping/merchant/lfp/apiv1" 
 ) 
 func 
  
 main 
 () 
  
 { 
  
 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 
  
 := 
  
 lfp 
 . 
  NewLfpStoreClient 
 
 ( 
 ctx 
 ) 
  
 if 
  
 err 
  
 != 
  
 nil 
  
 { 
  
 // TODO: Handle error. 
  
 } 
  
 defer 
  
 c 
 . 
 Close 
 () 
  
 // TODO: Use client. 
  
 _ 
  
 = 
  
 c 
 } 
 
 
func NewLfpStoreRESTClient
  func 
  
 NewLfpStoreRESTClient 
 ( 
 ctx 
  
  context 
 
 . 
  Context 
 
 , 
  
 opts 
  
 ... 
 option 
 . 
 ClientOption 
 ) 
  
 ( 
 * 
  LfpStoreClient 
 
 , 
  
  error 
 
 ) 
 
 
NewLfpStoreRESTClient creates a new lfp store service rest client.
Service for a LFP partner (at https://support.google.com/merchants/answer/7676652 ) to submit local stores for a merchant.
Example
  package 
  
 main 
 import 
  
 ( 
  
 "context" 
  
 lfp 
  
 "cloud.google.com/go/shopping/merchant/lfp/apiv1" 
 ) 
 func 
  
 main 
 () 
  
 { 
  
 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 
  
 := 
  
 lfp 
 . 
  NewLfpStoreRESTClient 
 
 ( 
 ctx 
 ) 
  
 if 
  
 err 
  
 != 
  
 nil 
  
 { 
  
 // TODO: Handle error. 
  
 } 
  
 defer 
  
 c 
 . 
 Close 
 () 
  
 // TODO: Use client. 
  
 _ 
  
 = 
  
 c 
 } 
 
 
func (*LfpStoreClient) Close
  func 
  
 ( 
 c 
  
 * 
  LfpStoreClient 
 
 ) 
  
 Close 
 () 
  
  error 
 
 
 
Close closes the connection to the API service. The user should invoke this when the client is no longer required.
func (*LfpStoreClient) Connection (deprecated)
  func 
  
 ( 
 c 
  
 * 
  LfpStoreClient 
 
 ) 
  
 Connection 
 () 
  
 * 
 grpc 
 . 
 ClientConn 
 
 
Connection returns a connection to the API service.
Deprecated: Connections are now pooled so this method does not always return the same resource.
func (*LfpStoreClient) DeleteLfpStore
  func 
  
 ( 
 c 
  
 * 
  LfpStoreClient 
 
 ) 
  
 DeleteLfpStore 
 ( 
 ctx 
  
  context 
 
 . 
  Context 
 
 , 
  
 req 
  
 * 
  lfppb 
 
 . 
  DeleteLfpStoreRequest 
 
 , 
  
 opts 
  
 ... 
  gax 
 
 . 
  CallOption 
 
 ) 
  
  error 
 
 
 
DeleteLfpStore deletes a store for a target merchant.
Example
  package 
  
 main 
 import 
  
 ( 
  
 "context" 
  
 lfp 
  
 "cloud.google.com/go/shopping/merchant/lfp/apiv1" 
  
 lfppb 
  
 "cloud.google.com/go/shopping/merchant/lfp/apiv1/lfppb" 
 ) 
 func 
  
 main 
 () 
  
 { 
  
 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 
  
 := 
  
 lfp 
 . 
  NewLfpStoreClient 
 
 ( 
 ctx 
 ) 
  
 if 
  
 err 
  
 != 
  
 nil 
  
 { 
  
 // TODO: Handle error. 
  
 } 
  
 defer 
  
 c 
 . 
 Close 
 () 
  
 req 
  
 := 
  
& lfppb 
 . 
 DeleteLfpStoreRequest 
 { 
  
 // TODO: Fill request struct fields. 
  
 // See https://pkg.go.dev/cloud.google.com/go/shopping/merchant/lfp/apiv1/lfppb#DeleteLfpStoreRequest. 
  
 } 
  
 err 
  
 = 
  
 c 
 . 
 DeleteLfpStore 
 ( 
 ctx 
 , 
  
 req 
 ) 
  
 if 
  
 err 
  
 != 
  
 nil 
  
 { 
  
 // TODO: Handle error. 
  
 } 
 } 
 
 
func (*LfpStoreClient) GetLfpStore
  func 
  
 ( 
 c 
  
 * 
  LfpStoreClient 
 
 ) 
  
 GetLfpStore 
 ( 
 ctx 
  
  context 
 
 . 
  Context 
 
 , 
  
 req 
  
 * 
  lfppb 
 
 . 
  GetLfpStoreRequest 
 
 , 
  
 opts 
  
 ... 
  gax 
 
 . 
  CallOption 
 
 ) 
  
 ( 
 * 
  lfppb 
 
 . 
  LfpStore 
 
 , 
  
  error 
 
 ) 
 
 
GetLfpStore retrieves information about a store.
Example
  package 
  
 main 
 import 
  
 ( 
  
 "context" 
  
 lfp 
  
 "cloud.google.com/go/shopping/merchant/lfp/apiv1" 
  
 lfppb 
  
 "cloud.google.com/go/shopping/merchant/lfp/apiv1/lfppb" 
 ) 
 func 
  
 main 
 () 
  
 { 
  
 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 
  
 := 
  
 lfp 
 . 
  NewLfpStoreClient 
 
 ( 
 ctx 
 ) 
  
 if 
  
 err 
  
 != 
  
 nil 
  
 { 
  
 // TODO: Handle error. 
  
 } 
  
 defer 
  
 c 
 . 
 Close 
 () 
  
 req 
  
 := 
  
& lfppb 
 . 
 GetLfpStoreRequest 
 { 
  
 // TODO: Fill request struct fields. 
  
 // See https://pkg.go.dev/cloud.google.com/go/shopping/merchant/lfp/apiv1/lfppb#GetLfpStoreRequest. 
  
 } 
  
 resp 
 , 
  
 err 
  
 := 
  
 c 
 . 
 GetLfpStore 
 ( 
 ctx 
 , 
  
 req 
 ) 
  
 if 
  
 err 
  
 != 
  
 nil 
  
 { 
  
 // TODO: Handle error. 
  
 } 
  
 // TODO: Use resp. 
  
 _ 
  
 = 
  
 resp 
 } 
 
 
func (*LfpStoreClient) InsertLfpStore
  func 
  
 ( 
 c 
  
 * 
  LfpStoreClient 
 
 ) 
  
 InsertLfpStore 
 ( 
 ctx 
  
  context 
 
 . 
  Context 
 
 , 
  
 req 
  
 * 
  lfppb 
 
 . 
  InsertLfpStoreRequest 
 
 , 
  
 opts 
  
 ... 
  gax 
 
 . 
  CallOption 
 
 ) 
  
 ( 
 * 
  lfppb 
 
 . 
  LfpStore 
 
 , 
  
  error 
 
 ) 
 
 
InsertLfpStore inserts a store for the target merchant. If the store with the same store code already exists, it will be replaced.
Example
  package 
  
 main 
 import 
  
 ( 
  
 "context" 
  
 lfp 
  
 "cloud.google.com/go/shopping/merchant/lfp/apiv1" 
  
 lfppb 
  
 "cloud.google.com/go/shopping/merchant/lfp/apiv1/lfppb" 
 ) 
 func 
  
 main 
 () 
  
 { 
  
 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 
  
 := 
  
 lfp 
 . 
  NewLfpStoreClient 
 
 ( 
 ctx 
 ) 
  
 if 
  
 err 
  
 != 
  
 nil 
  
 { 
  
 // TODO: Handle error. 
  
 } 
  
 defer 
  
 c 
 . 
 Close 
 () 
  
 req 
  
 := 
  
& lfppb 
 . 
 InsertLfpStoreRequest 
 { 
  
 // TODO: Fill request struct fields. 
  
 // See https://pkg.go.dev/cloud.google.com/go/shopping/merchant/lfp/apiv1/lfppb#InsertLfpStoreRequest. 
  
 } 
  
 resp 
 , 
  
 err 
  
 := 
  
 c 
 . 
 InsertLfpStore 
 ( 
 ctx 
 , 
  
 req 
 ) 
  
 if 
  
 err 
  
 != 
  
 nil 
  
 { 
  
 // TODO: Handle error. 
  
 } 
  
 // TODO: Use resp. 
  
 _ 
  
 = 
  
 resp 
 } 
 
 
func (*LfpStoreClient) ListLfpStores
  func 
  
 ( 
 c 
  
 * 
  LfpStoreClient 
 
 ) 
  
 ListLfpStores 
 ( 
 ctx 
  
  context 
 
 . 
  Context 
 
 , 
  
 req 
  
 * 
  lfppb 
 
 . 
  ListLfpStoresRequest 
 
 , 
  
 opts 
  
 ... 
  gax 
 
 . 
  CallOption 
 
 ) 
  
 * 
  LfpStoreIterator 
 
 
 
ListLfpStores lists the stores of the target merchant, specified by the filter in ListLfpStoresRequest.
Examples
  package 
  
 main 
 import 
  
 ( 
  
 "context" 
  
 lfp 
  
 "cloud.google.com/go/shopping/merchant/lfp/apiv1" 
  
 lfppb 
  
 "cloud.google.com/go/shopping/merchant/lfp/apiv1/lfppb" 
  
 "google.golang.org/api/iterator" 
 ) 
 func 
  
 main 
 () 
  
 { 
  
 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 
  
 := 
  
 lfp 
 . 
  NewLfpStoreClient 
 
 ( 
 ctx 
 ) 
  
 if 
  
 err 
  
 != 
  
 nil 
  
 { 
  
 // TODO: Handle error. 
  
 } 
  
 defer 
  
 c 
 . 
 Close 
 () 
  
 req 
  
 := 
  
& lfppb 
 . 
 ListLfpStoresRequest 
 { 
  
 // TODO: Fill request struct fields. 
  
 // See https://pkg.go.dev/cloud.google.com/go/shopping/merchant/lfp/apiv1/lfppb#ListLfpStoresRequest. 
  
 } 
  
 it 
  
 := 
  
 c 
 . 
 ListLfpStores 
 ( 
 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 
 .( 
 * 
 lfppb 
 . 
 ListLfpStoresResponse 
 ) 
  
 } 
 } 
 
 
all
  package 
  
 main 
 import 
  
 ( 
  
 "context" 
  
 lfp 
  
 "cloud.google.com/go/shopping/merchant/lfp/apiv1" 
  
 lfppb 
  
 "cloud.google.com/go/shopping/merchant/lfp/apiv1/lfppb" 
 ) 
 func 
  
 main 
 () 
  
 { 
  
 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 
  
 := 
  
 lfp 
 . 
  NewLfpStoreClient 
 
 ( 
 ctx 
 ) 
  
 if 
  
 err 
  
 != 
  
 nil 
  
 { 
  
 // TODO: Handle error. 
  
 } 
  
 defer 
  
 c 
 . 
 Close 
 () 
  
 req 
  
 := 
  
& lfppb 
 . 
 ListLfpStoresRequest 
 { 
  
 // TODO: Fill request struct fields. 
  
 // See https://pkg.go.dev/cloud.google.com/go/shopping/merchant/lfp/apiv1/lfppb#ListLfpStoresRequest. 
  
 } 
  
 for 
  
 resp 
 , 
  
 err 
  
 := 
  
 range 
  
 c 
 . 
 ListLfpStores 
 ( 
 ctx 
 , 
  
 req 
 ). 
  All 
 
 () 
  
 { 
  
 if 
  
 err 
  
 != 
  
 nil 
  
 { 
  
 // TODO: Handle error and break/return/continue. Iteration will stop after any error. 
  
 } 
  
 // TODO: Use resp. 
  
 _ 
  
 = 
  
 resp 
  
 } 
 } 
 
 
LfpStoreIterator
  type 
  
 LfpStoreIterator 
  
 struct 
  
 { 
  
 // Response is the raw response for the current page. 
  
 // It must be cast to the RPC response type. 
  
 // Calling Next() or InternalFetch() updates this value. 
  
 Response 
  
 interface 
 {} 
  
 // InternalFetch is for use by the Google Cloud Libraries only. 
  
 // It is not part of the stable interface of this package. 
  
 // 
  
 // InternalFetch returns results from a single call to the underlying RPC. 
  
 // The number of results is no greater than pageSize. 
  
 // If there are no more results, nextPageToken is empty and err is nil. 
  
 InternalFetch 
  
 func 
 ( 
 pageSize 
  
  int 
 
 , 
  
 pageToken 
  
  string 
 
 ) 
  
 ( 
 results 
  
 [] 
 * 
  lfppb 
 
 . 
  LfpStore 
 
 , 
  
 nextPageToken 
  
  string 
 
 , 
  
 err 
  
  error 
 
 ) 
  
 // contains filtered or unexported fields 
 } 
 
 
LfpStoreIterator manages a stream of *lfppb.LfpStore.
func (*LfpStoreIterator) All
  func 
  
 ( 
 it 
  
 * 
  LfpStoreIterator 
 
 ) 
  
 All 
 () 
  
 iter 
 . 
 Seq2 
 [ 
 * 
 lfppb 
 . 
 LfpStore 
 , 
  
 error 
 ] 
 
 
All returns an iterator. If an error is returned by the iterator, the iterator will stop after that iteration.
func (*LfpStoreIterator) Next
  func 
  
 ( 
 it 
  
 * 
  LfpStoreIterator 
 
 ) 
  
 Next 
 () 
  
 ( 
 * 
  lfppb 
 
 . 
  LfpStore 
 
 , 
  
  error 
 
 ) 
 
 
Next returns the next result. Its second return value is iterator.Done if there are no more results. Once Next returns Done, all subsequent calls will return Done.
func (*LfpStoreIterator) PageInfo
  func 
  
 ( 
 it 
  
 * 
  LfpStoreIterator 
 
 ) 
  
 PageInfo 
 () 
  
 * 
 iterator 
 . 
 PageInfo 
 
 
PageInfo supports pagination. See the [google.golang.org/api/iterator] package for details.

