class_docstr: A class for handling connections and interactions with the Google Content API for Shopping.
class_docstr_tok: ["A","class","for","handling","connections","and","interactions","with","the","Google","Content","API","for","Shopping","."]
docstr: Get products
  Args:
      params (dict): query parameters
  Returns:
      DataFrame
docstr_tok: ["Get","products","Args",":","params","(","dict",")",":","query","parameters","Returns",":","DataFrame"]
code: def get_products(self, params: dict = None) -> DataFrame:
      """
      Get products
      Args:
          params (dict): query parameters
      Returns:
          DataFrame
      """
      service = self.connect()
      page_token = None
      products = pd.DataFrame(columns=self.products.get_columns())
      if params["product_id"]:
          result = (
              service.products()
              .get(
                  merchantId=self.merchant_id,
                  productId=params["product_id"],
              )
              .execute()
          )
          products = pd.DataFrame(
              result, columns=self.products.get_columns()
          )
          return products
      while True:
          result = (
              service.products()
              .list(merchantId=self.merchant_id, page_token=page_token)
              .execute()
          )
          products = pd.concat(
              [
                  products,
                  pd.DataFrame(
                      result["resources"],
                      columns=self.products.get_columns(),
                  ),
              ],
              ignore_index=True,
          )
          page_token = result.get("nextPageToken")
          if not page_token:
              break
  
      if params["startId"] and params["endId"]:
          start_id = int(params["startId"])
          end_id = int(params["endId"])
      elif params["startId"]:
          start_id = int(params["startId"])
          end_id = start_id + 10
      elif params["endId"]:
          end_id = int(params["endId"])
          start_id = end_id - 10
      else:
          raise Exception("startId or endId must be specified")
  
      products = products.drop(
          products[
              (products["id"] < start_id) | (products["id"] > end_id)
          ].index
      )
  
      return products
  
imports: import json
  from collections import OrderedDict
  from mindsdb.integrations.libs.const import HANDLER_CONNECTION_ARG_TYPE
  import pandas
  from pandas import DataFrame
  from google.auth.transport.requests import Request
  from google.oauth2 import service_account
  from google.oauth2.credentials import Credentials
  from googleapiclient.discovery import build
  from mindsdb.api.executor.data_types.response_type import RESPONSE_TYPE
  from .google_content_shopping_tables import AccountsTable, OrdersTable, ProductsTable
  from mindsdb.integrations.libs.api_handler import APIHandler, FuncParser
  from mindsdb.integrations.libs.response import HandlerStatusResponse, HandlerResponse
  from mindsdb.utilities import log
label_desc: Use image node_id 9 for calling the GoogleContentShoppingHandler obj's underlying member method code with example usage: obj.get_products(params) and returns: products, products