main

in abap-sdk/ZGOOG_SDK_UTILITIES/zgoog_bq_read_odata/zcl_bq_table_read_odata_gen.clas.abap [0:0]


  METHOD main.
**********************************************************************
*  Copyright 2024 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.                                *
**********************************************************************

    mo_environment = xco_cp_generation=>environment->dev_system( p_tr ).
    mo_put_operation = mo_environment->create_put_operation( ).

    DATA(lo_bq) = NEW /goog/cl_bigquery_v2( iv_key_name = p_key ).

    lo_bq->get_tables(
      EXPORTING
        iv_p_datasets_id     = p_dset
        iv_p_projects_id     = CONV #( p_prj )
        iv_p_tables_id       = p_table
      IMPORTING
        es_output           = DATA(ls_table_get) ).

    REPLACE ALL OCCURRENCES OF ':' IN ls_table_get-id WITH '.'.

    put_ddls( p_devc = p_devc
              p_view = p_view
              p_qpcls = p_qpcls
              p_keys = p_keys
              p_strg = p_strg
              is_bq_table = ls_table_get ).

    put_clas( p_devc = p_devc
              is_bq_table = ls_table_get
              p_key = p_key
              p_dset = p_dset
              p_qpcls = p_qpcls ).

    put_srvd( p_devc = p_devc
              p_view = p_view
              p_srvd = p_srvd ).

    APPEND mo_put_operation->execute( ) TO rt_result .

    mo_environment = xco_cp_generation=>environment->dev_system( p_tr ).
    mo_put_operation = mo_environment->create_put_operation( ).

    add_srvb( p_btyp = p_btyp
              p_devc = p_devc
              p_srvd = p_srvd
              p_srvb = p_srvb ).

    APPEND mo_put_operation->execute( ) TO rt_result .