TyrantLucifer commented on code in PR #3848: URL: https://github.com/apache/incubator-seatunnel/pull/3848#discussion_r1118850752
########## docs/en/connector-v2/sink/GoogleSheets.md: ########## @@ -0,0 +1,56 @@ +# GoogleSheets + +> GoogleSheets sink connector +> + ## Description Review Comment: remove blank ########## seatunnel-connectors-v2/connector-google-sheets/src/main/java/org/apache/seatunnel/connectors/seatunnel/google/sheets/exception/GoogleSheetsConnectorErrorCode.java: ########## @@ -0,0 +1,48 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You 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 + * + * http://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. + */ + +package org.apache.seatunnel.connectors.seatunnel.google.sheets.exception; + +import org.apache.seatunnel.common.exception.SeaTunnelErrorCode; + +public enum GoogleSheetsConnectorErrorCode implements SeaTunnelErrorCode { + BUILD_SHEETS_REQUEST_EXCEPTION("GOOGLESHEETS-01", "Build google sheets http request exception"); + + private final String code; + + private final String description; + + GoogleSheetsConnectorErrorCode(String code, String description) { + this.code = code; + this.description = description; + } + + @Override + public String getCode() { + return this.code; + } + + @Override + public String getDescription() { + return this.description; + } + + @Override + public String getErrorMessage() { Review Comment: Remove ########## seatunnel-connectors-v2/connector-google-sheets/src/main/java/org/apache/seatunnel/connectors/seatunnel/google/sheets/config/SheetsParameters.java: ########## @@ -42,4 +63,27 @@ public SheetsParameters buildWithConfig(Config config) { this.range = config.getString(SheetsConfig.RANGE.key()); return this; } + + public Sheets buildSheets() throws IOException { + byte[] keyBytes = Base64.getDecoder().decode(this.serviceAccountKey); + ServiceAccountCredentials sourceCredentials = + ServiceAccountCredentials.fromStream(new ByteArrayInputStream(keyBytes)); + sourceCredentials = + (ServiceAccountCredentials) + sourceCredentials.createScoped( + Collections.singletonList(SheetsScopes.SPREADSHEETS)); + HttpRequestInitializer requestInitializer = new HttpCredentialsAdapter(sourceCredentials); + NetHttpTransport httpTransport = null; Review Comment: ```suggestion NetHttpTransport httpTransport; ``` -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
