use of com.google.cloud.secretmanager.v1.ProjectName in project java-bigquerydatatransfer by googleapis.
the class CreateYoutubeChannelTransfer method createYoutubeChannelTransfer.
public static void createYoutubeChannelTransfer(String projectId, TransferConfig transferConfig) throws IOException {
try (DataTransferServiceClient client = DataTransferServiceClient.create()) {
ProjectName parent = ProjectName.of(projectId);
CreateTransferConfigRequest request = CreateTransferConfigRequest.newBuilder().setParent(parent.toString()).setTransferConfig(transferConfig).build();
TransferConfig config = client.createTransferConfig(request);
System.out.println("Youtube channel transfer created successfully :" + config.getName());
} catch (ApiException ex) {
System.out.print("Youtube channel transfer was not created." + ex.toString());
}
}
use of com.google.cloud.secretmanager.v1.ProjectName in project java-bigquerydatatransfer by googleapis.
the class CreateYoutubeContentOwnerTransfer method createYoutubeContentOwnerTransfer.
public static void createYoutubeContentOwnerTransfer(String projectId, TransferConfig transferConfig) throws IOException {
try (DataTransferServiceClient client = DataTransferServiceClient.create()) {
ProjectName parent = ProjectName.of(projectId);
CreateTransferConfigRequest request = CreateTransferConfigRequest.newBuilder().setParent(parent.toString()).setTransferConfig(transferConfig).build();
TransferConfig config = client.createTransferConfig(request);
System.out.println("Youtube content owner channel transfer created successfully :" + config.getName());
} catch (ApiException ex) {
System.out.print("Youtube content owner channel transfer was not created." + ex.toString());
}
}
use of com.google.cloud.secretmanager.v1.ProjectName in project java-bigquerydatatransfer by googleapis.
the class ListTransferConfigs method listTransferConfigs.
public static void listTransferConfigs(String projectId) throws IOException {
try (DataTransferServiceClient dataTransferServiceClient = DataTransferServiceClient.create()) {
ProjectName parent = ProjectName.of(projectId);
ListTransferConfigsRequest request = ListTransferConfigsRequest.newBuilder().setParent(parent.toString()).build();
dataTransferServiceClient.listTransferConfigs(request).iterateAll().forEach(config -> System.out.print("Success! Config ID :" + config.getName() + "\n"));
} catch (ApiException ex) {
System.out.println("Config list not found due to error." + ex.toString());
}
}
use of com.google.cloud.secretmanager.v1.ProjectName in project java-bigquerydatatransfer by googleapis.
the class CreateAdManagerTransfer method createAdManagerTransfer.
public static void createAdManagerTransfer(String projectId, TransferConfig transferConfig) throws IOException {
try (DataTransferServiceClient client = DataTransferServiceClient.create()) {
ProjectName parent = ProjectName.of(projectId);
CreateTransferConfigRequest request = CreateTransferConfigRequest.newBuilder().setParent(parent.toString()).setTransferConfig(transferConfig).build();
TransferConfig config = client.createTransferConfig(request);
System.out.println("Ad manager transfer created successfully :" + config.getName());
} catch (ApiException ex) {
System.out.print("Ad manager transfer was not created." + ex.toString());
}
}
use of com.google.cloud.secretmanager.v1.ProjectName in project java-bigquerydatatransfer by googleapis.
the class CreateAmazonS3Transfer method createAmazonS3Transfer.
public static void createAmazonS3Transfer(String projectId, TransferConfig transferConfig) throws IOException {
try (DataTransferServiceClient client = DataTransferServiceClient.create()) {
ProjectName parent = ProjectName.of(projectId);
CreateTransferConfigRequest request = CreateTransferConfigRequest.newBuilder().setParent(parent.toString()).setTransferConfig(transferConfig).build();
TransferConfig config = client.createTransferConfig(request);
System.out.println("Amazon s3 transfer created successfully :" + config.getName());
} catch (ApiException ex) {
System.out.print("Amazon s3 transfer was not created." + ex.toString());
}
}
Aggregations