// GetBrowseNodes gets browse nodes (categories) by id list
GetBrowseNodes gets browse nodes (categories) by id list
// GetBrowseNodes gets browse nodes ( categories ) by id list
func (c *Client) GetBrowseNodes(ctx context.Context, browseNodeIDs []string) ([]api.BrowseNode, error) {
	if c.tpdExhausted() {
		return nil, TransactionPerDayExhausted
	}
	if c.tpdExhausted() {
		return nil, TransactionPerDayExhausted
	}
	if err := c.rateLimiter.Wait(ctx); err != nil {
		return nil, fmt.Errorf("failed to wait :%w", err)
	}
	c.apiCallNum++
	resp, err := c.apiClient.GetBrowseNodes(ctx, &api.GetBrowseNodesParams{
		BrowseNodeIds: browseNodeIDs,
		Resources: []api.Resource{
			api.BrowseNodesAncestor,
			api.BrowseNodesChildren,
		},
		LanguagesOfPreference: []api.Language{api.JapaneseJapan},
	})
	if err != nil {
		return nil, err
	}
	var errs []error
	if len(resp.Errors) > 0 {
		for _, e := range resp.Errors {
			errs = append(errs, fmt.Errorf("type: %v, code: %v, message: %v", e.Type, e.Code, e.Message))
		}
		return nil, multierr.Combine(errs...)
	}
	return resp.BrowseNodesResult.BrowseNodes, err
}
func ( c * Client ) GetBrowseNodes ( ctx context . Context , browseNodeIDs [ ] string ) ( [ ] api . BrowseNode , error ) { if c . tpdExhausted ( ) { return nil , TransactionPerDayExhausted } if c . tpdExhausted ( ) { return nil , TransactionPerDayExhausted } if err := c . rateLimiter . Wait ( ctx ) ; err != nil { return nil , fmt . Errorf ( " " , err ) } c . apiCallNum ++ resp , err := c . apiClient . GetBrowseNodes ( ctx , & api . GetBrowseNodesParams { BrowseNodeIds : browseNodeIDs , Resources : [ ] api . Resource { api . BrowseNodesAncestor , api . BrowseNodesChildren , } , LanguagesOfPreference : [ ] api . Language { api . JapaneseJapan } , } ) if err != nil { return nil , err } var errs [ ] error if len ( resp . Errors ) > 0 { for _ , e := range resp . Errors { errs = append ( errs , fmt . Errorf ( " " , e . Type , e . Code , e . Message ) ) } return nil , multierr . Combine ( errs ... ) } return resp . BrowseNodesResult . BrowseNodes , err }
GetBrowseNodes gets browse nodes (categories) by id list
GetBrowseNodes gets browse nodes ( categories ) by id list