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: Set up any connections required by the handler
  Should return output of check_connection() method after attempting
  connection. Should switch self.is_connected.
  Returns:
      HandlerStatusResponse
docstr_tok: ["Set","up","any","connections","required","by","the","handler","Should","return","output","of","check_connection","(",")","method","after","attempting","connection",".","Should","switch","self.is_connected",".","Returns",":","HandlerStatusResponse"]
code: def connect(self):
      """
      Set up any connections required by the handler
      Should return output of check_connection() method after attempting
      connection. Should switch self.is_connected.
      Returns:
          HandlerStatusResponse
      """
      if self.is_connected is True:
          return self.service
      if self.credentials_file:
          try:
              json_str_bytes = self.fs_storage.file_get(
                  "token_content.json"
              )
              json_str = json_str_bytes.decode()
              self.credentials = Credentials.from_authorized_user_info(
                  info=json.loads(json_str), scopes=self.scopes
              )
          except Exception:
              self.credentials = None
          if not self.credentials or not self.credentials.valid:
              if (
                  self.credentials
                  and self.credentials.expired
                  and self.credentials.refresh_token
              ):
                  self.credentials.refresh(Request())
              else:
                  self.credentials = service_account.Credentials.from_service_account_file(
                      self.credentials_file, scopes=self.scopes
                  )
          # Save the credentials for the next run
          json_str = self.credentials.to_json()
          self.fs_storage.file_set(
              "token_content.json", json_str.encode()
          )
          self.service = build(
              "content", "v2.1", credentials=self.credentials
          )
      return self.service
  
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 2 for calling the GoogleContentShoppingHandler obj's underlying member method code with example usage: obj.connect() and returns: self, self