use of com.google.cloud.bigquery.datatransfer.v1.UpdateTransferConfigRequest in project java-bigquerydatatransfer by googleapis.
the class ReEnableTransferConfig method reEnableTransferConfig.
public static void reEnableTransferConfig(TransferConfig transferConfig, FieldMask updateMask) throws IOException {
try (DataTransferServiceClient dataTransferServiceClient = DataTransferServiceClient.create()) {
UpdateTransferConfigRequest request = UpdateTransferConfigRequest.newBuilder().setTransferConfig(transferConfig).setUpdateMask(updateMask).build();
TransferConfig updateConfig = dataTransferServiceClient.updateTransferConfig(request);
System.out.println("Transfer config reenable successfully :" + updateConfig.getDisplayName());
} catch (ApiException ex) {
System.out.print("Transfer config was not reenable." + ex.toString());
}
}
use of com.google.cloud.bigquery.datatransfer.v1.UpdateTransferConfigRequest in project java-bigquerydatatransfer by googleapis.
the class UpdateTransferConfig method updateTransferConfig.
public static void updateTransferConfig(TransferConfig transferConfig, FieldMask updateMask) throws IOException {
try (DataTransferServiceClient dataTransferServiceClient = DataTransferServiceClient.create()) {
UpdateTransferConfigRequest request = UpdateTransferConfigRequest.newBuilder().setTransferConfig(transferConfig).setUpdateMask(updateMask).build();
TransferConfig updateConfig = dataTransferServiceClient.updateTransferConfig(request);
System.out.println("Transfer config updated successfully :" + updateConfig.getDisplayName());
} catch (ApiException ex) {
System.out.print("Transfer config was not updated." + ex.toString());
}
}
use of com.google.cloud.bigquery.datatransfer.v1.UpdateTransferConfigRequest in project java-bigquerydatatransfer by googleapis.
the class UpdateCredentials method updateCredentials.
public static void updateCredentials(TransferConfig transferConfig, String serviceAccount, FieldMask updateMask) throws IOException {
try (DataTransferServiceClient dataTransferServiceClient = DataTransferServiceClient.create()) {
UpdateTransferConfigRequest request = UpdateTransferConfigRequest.newBuilder().setTransferConfig(transferConfig).setUpdateMask(updateMask).setServiceAccountName(serviceAccount).build();
dataTransferServiceClient.updateTransferConfig(request);
System.out.println("Credentials updated successfully");
} catch (ApiException ex) {
System.out.print("Credentials was not updated." + ex.toString());
}
}
use of com.google.cloud.bigquery.datatransfer.v1.UpdateTransferConfigRequest in project java-bigquerydatatransfer by googleapis.
the class DisableTransferConfig method disableTransferConfig.
public static void disableTransferConfig(TransferConfig transferConfig, FieldMask updateMask) throws IOException {
try (DataTransferServiceClient dataTransferServiceClient = DataTransferServiceClient.create()) {
UpdateTransferConfigRequest request = UpdateTransferConfigRequest.newBuilder().setTransferConfig(transferConfig).setUpdateMask(updateMask).build();
TransferConfig updateConfig = dataTransferServiceClient.updateTransferConfig(request);
System.out.println("Transfer config disabled successfully :" + updateConfig.getDisplayName());
} catch (ApiException ex) {
System.out.print("Transfer config was not disabled." + ex.toString());
}
}
Aggregations