From ba10fac1f143650146f14202578b282204db7163 Mon Sep 17 00:00:00 2001 From: Shin Fan Date: Fri, 24 Feb 2017 16:22:59 -0800 Subject: [PATCH 1/2] Refresh gapic clients with latest toolkit (#1662) --- .../errorreporting/spi/v1beta1/ErrorGroupServiceClient.java | 2 +- .../spi/v1beta1/ErrorGroupServiceSettings.java | 6 +++++- .../errorreporting/spi/v1beta1/ErrorStatsServiceClient.java | 2 +- .../spi/v1beta1/ErrorStatsServiceSettings.java | 6 +++++- .../errorreporting/spi/v1beta1/PagedResponseWrappers.java | 2 +- .../spi/v1beta1/ReportErrorsServiceClient.java | 2 +- .../spi/v1beta1/ReportErrorsServiceSettings.java | 6 +++++- .../cloud/errorreporting/spi/v1beta1/package-info.java | 2 +- .../spi/v1beta1/ErrorGroupServiceClientTest.java | 2 +- .../spi/v1beta1/ErrorStatsServiceClientTest.java | 2 +- .../errorreporting/spi/v1beta1/MockErrorGroupService.java | 2 +- .../spi/v1beta1/MockErrorGroupServiceImpl.java | 2 +- .../errorreporting/spi/v1beta1/MockErrorStatsService.java | 2 +- .../spi/v1beta1/MockErrorStatsServiceImpl.java | 2 +- .../errorreporting/spi/v1beta1/MockReportErrorsService.java | 2 +- .../spi/v1beta1/MockReportErrorsServiceImpl.java | 2 +- .../spi/v1beta1/ReportErrorsServiceClientTest.java | 2 +- .../google/cloud/language/spi/v1/LanguageServiceClient.java | 2 +- .../cloud/language/spi/v1/LanguageServiceSettings.java | 6 +++++- .../java/com/google/cloud/language/spi/v1/package-info.java | 2 +- .../cloud/language/spi/v1/LanguageServiceClientTest.java | 2 +- .../google/cloud/language/spi/v1/MockLanguageService.java | 2 +- .../cloud/language/spi/v1/MockLanguageServiceImpl.java | 2 +- .../google/cloud/logging/spi/v2/ConfigServiceV2Client.java | 2 +- .../cloud/logging/spi/v2/ConfigServiceV2Settings.java | 6 +++++- .../google/cloud/logging/spi/v2/LoggingServiceV2Client.java | 2 +- .../cloud/logging/spi/v2/LoggingServiceV2Settings.java | 6 +++++- .../google/cloud/logging/spi/v2/MetricsServiceV2Client.java | 2 +- .../cloud/logging/spi/v2/MetricsServiceV2Settings.java | 6 +++++- .../google/cloud/logging/spi/v2/PagedResponseWrappers.java | 2 +- .../java/com/google/cloud/logging/spi/v2/package-info.java | 2 +- .../cloud/logging/spi/v2/ConfigServiceV2ClientTest.java | 2 +- .../cloud/logging/spi/v2/LoggingServiceV2ClientTest.java | 2 +- .../cloud/logging/spi/v2/MetricsServiceV2ClientTest.java | 2 +- .../google/cloud/logging/spi/v2/MockConfigServiceV2.java | 2 +- .../cloud/logging/spi/v2/MockConfigServiceV2Impl.java | 2 +- .../google/cloud/logging/spi/v2/MockLoggingServiceV2.java | 2 +- .../cloud/logging/spi/v2/MockLoggingServiceV2Impl.java | 2 +- .../google/cloud/logging/spi/v2/MockMetricsServiceV2.java | 2 +- .../cloud/logging/spi/v2/MockMetricsServiceV2Impl.java | 2 +- .../google/cloud/monitoring/spi/v3/GroupServiceClient.java | 2 +- .../cloud/monitoring/spi/v3/GroupServiceSettings.java | 6 +++++- .../google/cloud/monitoring/spi/v3/MetricServiceClient.java | 2 +- .../cloud/monitoring/spi/v3/MetricServiceSettings.java | 6 +++++- .../cloud/monitoring/spi/v3/PagedResponseWrappers.java | 2 +- .../com/google/cloud/monitoring/spi/v3/package-info.java | 2 +- .../cloud/monitoring/spi/v3/GroupServiceClientTest.java | 2 +- .../cloud/monitoring/spi/v3/MetricServiceClientTest.java | 2 +- .../google/cloud/monitoring/spi/v3/MockGroupService.java | 2 +- .../cloud/monitoring/spi/v3/MockGroupServiceImpl.java | 2 +- .../google/cloud/monitoring/spi/v3/MockMetricService.java | 2 +- .../cloud/monitoring/spi/v3/MockMetricServiceImpl.java | 2 +- .../google/cloud/pubsub/spi/v1/PagedResponseWrappers.java | 2 +- .../com/google/cloud/pubsub/spi/v1/PublisherClient.java | 2 +- .../com/google/cloud/pubsub/spi/v1/PublisherSettings.java | 6 +++++- .../com/google/cloud/pubsub/spi/v1/SubscriberClient.java | 2 +- .../com/google/cloud/pubsub/spi/v1/SubscriberSettings.java | 6 +++++- .../java/com/google/cloud/pubsub/spi/v1/package-info.java | 2 +- .../java/com/google/cloud/pubsub/spi/v1/MockIAMPolicy.java | 2 +- .../com/google/cloud/pubsub/spi/v1/MockIAMPolicyImpl.java | 2 +- .../java/com/google/cloud/pubsub/spi/v1/MockPublisher.java | 2 +- .../com/google/cloud/pubsub/spi/v1/MockPublisherImpl.java | 2 +- .../java/com/google/cloud/pubsub/spi/v1/MockSubscriber.java | 2 +- .../com/google/cloud/pubsub/spi/v1/MockSubscriberImpl.java | 2 +- .../com/google/cloud/pubsub/spi/v1/PublisherClientTest.java | 2 +- .../google/cloud/pubsub/spi/v1/SubscriberClientTest.java | 2 +- .../com/google/cloud/speech/spi/v1beta1/SpeechClient.java | 2 +- .../com/google/cloud/speech/spi/v1beta1/SpeechSettings.java | 6 +++++- .../com/google/cloud/speech/spi/v1beta1/package-info.java | 2 +- .../com/google/cloud/speech/spi/v1beta1/MockSpeech.java | 2 +- .../com/google/cloud/speech/spi/v1beta1/MockSpeechImpl.java | 2 +- .../google/cloud/speech/spi/v1beta1/SpeechClientTest.java | 2 +- .../google/cloud/trace/spi/v1/PagedResponseWrappers.java | 2 +- .../com/google/cloud/trace/spi/v1/TraceServiceClient.java | 2 +- .../com/google/cloud/trace/spi/v1/TraceServiceSettings.java | 6 +++++- .../java/com/google/cloud/trace/spi/v1/package-info.java | 2 +- .../com/google/cloud/trace/spi/v1/MockTraceService.java | 2 +- .../com/google/cloud/trace/spi/v1/MockTraceServiceImpl.java | 2 +- .../google/cloud/trace/spi/v1/TraceServiceClientTest.java | 2 +- .../google/cloud/vision/spi/v1/ImageAnnotatorClient.java | 2 +- .../google/cloud/vision/spi/v1/ImageAnnotatorSettings.java | 6 +++++- .../java/com/google/cloud/vision/spi/v1/package-info.java | 2 +- .../cloud/vision/spi/v1/ImageAnnotatorClientTest.java | 2 +- .../com/google/cloud/vision/spi/v1/MockImageAnnotator.java | 2 +- .../google/cloud/vision/spi/v1/MockImageAnnotatorImpl.java | 2 +- 85 files changed, 141 insertions(+), 85 deletions(-) diff --git a/google-cloud-errorreporting/src/main/java/com/google/cloud/errorreporting/spi/v1beta1/ErrorGroupServiceClient.java b/google-cloud-errorreporting/src/main/java/com/google/cloud/errorreporting/spi/v1beta1/ErrorGroupServiceClient.java index c745a1643fbf..b3cd09d3f082 100644 --- a/google-cloud-errorreporting/src/main/java/com/google/cloud/errorreporting/spi/v1beta1/ErrorGroupServiceClient.java +++ b/google-cloud-errorreporting/src/main/java/com/google/cloud/errorreporting/spi/v1beta1/ErrorGroupServiceClient.java @@ -1,5 +1,5 @@ /* - * Copyright 2016, Google Inc. All rights reserved. + * Copyright 2017, Google Inc. All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/google-cloud-errorreporting/src/main/java/com/google/cloud/errorreporting/spi/v1beta1/ErrorGroupServiceSettings.java b/google-cloud-errorreporting/src/main/java/com/google/cloud/errorreporting/spi/v1beta1/ErrorGroupServiceSettings.java index e73eea5db4c4..d25bc0257934 100644 --- a/google-cloud-errorreporting/src/main/java/com/google/cloud/errorreporting/spi/v1beta1/ErrorGroupServiceSettings.java +++ b/google-cloud-errorreporting/src/main/java/com/google/cloud/errorreporting/spi/v1beta1/ErrorGroupServiceSettings.java @@ -1,5 +1,5 @@ /* - * Copyright 2016, Google Inc. All rights reserved. + * Copyright 2017, Google Inc. All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -79,6 +79,9 @@ public class ErrorGroupServiceSettings extends ClientSettings { private static final ImmutableList DEFAULT_SERVICE_SCOPES = ImmutableList.builder().add("https://www.googleapis.com/auth/cloud-platform").build(); + private static final String DEFAULT_GENERATOR_NAME = "gapic"; + private static final String DEFAULT_GENERATOR_VERSION = "0.0.5"; + private final SimpleCallSettings getGroupSettings; private final SimpleCallSettings updateGroupSettings; @@ -122,6 +125,7 @@ public static InstantiatingChannelProvider.Builder defaultChannelProviderBuilder return InstantiatingChannelProvider.newBuilder() .setServiceAddress(DEFAULT_SERVICE_ADDRESS) .setPort(DEFAULT_SERVICE_PORT) + .setGeneratorHeader(DEFAULT_GENERATOR_NAME, DEFAULT_GENERATOR_VERSION) .setCredentialsProvider(defaultCredentialsProviderBuilder().build()); } diff --git a/google-cloud-errorreporting/src/main/java/com/google/cloud/errorreporting/spi/v1beta1/ErrorStatsServiceClient.java b/google-cloud-errorreporting/src/main/java/com/google/cloud/errorreporting/spi/v1beta1/ErrorStatsServiceClient.java index 71e545c4cb16..3e3f27a25e7d 100644 --- a/google-cloud-errorreporting/src/main/java/com/google/cloud/errorreporting/spi/v1beta1/ErrorStatsServiceClient.java +++ b/google-cloud-errorreporting/src/main/java/com/google/cloud/errorreporting/spi/v1beta1/ErrorStatsServiceClient.java @@ -1,5 +1,5 @@ /* - * Copyright 2016, Google Inc. All rights reserved. + * Copyright 2017, Google Inc. All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/google-cloud-errorreporting/src/main/java/com/google/cloud/errorreporting/spi/v1beta1/ErrorStatsServiceSettings.java b/google-cloud-errorreporting/src/main/java/com/google/cloud/errorreporting/spi/v1beta1/ErrorStatsServiceSettings.java index 4502f19ea910..f36711acebdf 100644 --- a/google-cloud-errorreporting/src/main/java/com/google/cloud/errorreporting/spi/v1beta1/ErrorStatsServiceSettings.java +++ b/google-cloud-errorreporting/src/main/java/com/google/cloud/errorreporting/spi/v1beta1/ErrorStatsServiceSettings.java @@ -1,5 +1,5 @@ /* - * Copyright 2016, Google Inc. All rights reserved. + * Copyright 2017, Google Inc. All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -92,6 +92,9 @@ public class ErrorStatsServiceSettings extends ClientSettings { private static final ImmutableList DEFAULT_SERVICE_SCOPES = ImmutableList.builder().add("https://www.googleapis.com/auth/cloud-platform").build(); + private static final String DEFAULT_GENERATOR_NAME = "gapic"; + private static final String DEFAULT_GENERATOR_VERSION = "0.0.5"; + private final PagedCallSettings< ListGroupStatsRequest, ListGroupStatsResponse, ListGroupStatsPagedResponse> listGroupStatsSettings; @@ -147,6 +150,7 @@ public static InstantiatingChannelProvider.Builder defaultChannelProviderBuilder return InstantiatingChannelProvider.newBuilder() .setServiceAddress(DEFAULT_SERVICE_ADDRESS) .setPort(DEFAULT_SERVICE_PORT) + .setGeneratorHeader(DEFAULT_GENERATOR_NAME, DEFAULT_GENERATOR_VERSION) .setCredentialsProvider(defaultCredentialsProviderBuilder().build()); } diff --git a/google-cloud-errorreporting/src/main/java/com/google/cloud/errorreporting/spi/v1beta1/PagedResponseWrappers.java b/google-cloud-errorreporting/src/main/java/com/google/cloud/errorreporting/spi/v1beta1/PagedResponseWrappers.java index 43627e1732bf..070fee864afe 100644 --- a/google-cloud-errorreporting/src/main/java/com/google/cloud/errorreporting/spi/v1beta1/PagedResponseWrappers.java +++ b/google-cloud-errorreporting/src/main/java/com/google/cloud/errorreporting/spi/v1beta1/PagedResponseWrappers.java @@ -1,5 +1,5 @@ /* - * Copyright 2016, Google Inc. All rights reserved. + * Copyright 2017, Google Inc. All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/google-cloud-errorreporting/src/main/java/com/google/cloud/errorreporting/spi/v1beta1/ReportErrorsServiceClient.java b/google-cloud-errorreporting/src/main/java/com/google/cloud/errorreporting/spi/v1beta1/ReportErrorsServiceClient.java index 9d7fafe286ef..a09feee03742 100644 --- a/google-cloud-errorreporting/src/main/java/com/google/cloud/errorreporting/spi/v1beta1/ReportErrorsServiceClient.java +++ b/google-cloud-errorreporting/src/main/java/com/google/cloud/errorreporting/spi/v1beta1/ReportErrorsServiceClient.java @@ -1,5 +1,5 @@ /* - * Copyright 2016, Google Inc. All rights reserved. + * Copyright 2017, Google Inc. All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/google-cloud-errorreporting/src/main/java/com/google/cloud/errorreporting/spi/v1beta1/ReportErrorsServiceSettings.java b/google-cloud-errorreporting/src/main/java/com/google/cloud/errorreporting/spi/v1beta1/ReportErrorsServiceSettings.java index c88c070fd316..e78646927da0 100644 --- a/google-cloud-errorreporting/src/main/java/com/google/cloud/errorreporting/spi/v1beta1/ReportErrorsServiceSettings.java +++ b/google-cloud-errorreporting/src/main/java/com/google/cloud/errorreporting/spi/v1beta1/ReportErrorsServiceSettings.java @@ -1,5 +1,5 @@ /* - * Copyright 2016, Google Inc. All rights reserved. + * Copyright 2017, Google Inc. All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -78,6 +78,9 @@ public class ReportErrorsServiceSettings extends ClientSettings { private static final ImmutableList DEFAULT_SERVICE_SCOPES = ImmutableList.builder().add("https://www.googleapis.com/auth/cloud-platform").build(); + private static final String DEFAULT_GENERATOR_NAME = "gapic"; + private static final String DEFAULT_GENERATOR_VERSION = "0.0.5"; + private final SimpleCallSettings reportErrorEventSettings; @@ -117,6 +120,7 @@ public static InstantiatingChannelProvider.Builder defaultChannelProviderBuilder return InstantiatingChannelProvider.newBuilder() .setServiceAddress(DEFAULT_SERVICE_ADDRESS) .setPort(DEFAULT_SERVICE_PORT) + .setGeneratorHeader(DEFAULT_GENERATOR_NAME, DEFAULT_GENERATOR_VERSION) .setCredentialsProvider(defaultCredentialsProviderBuilder().build()); } diff --git a/google-cloud-errorreporting/src/main/java/com/google/cloud/errorreporting/spi/v1beta1/package-info.java b/google-cloud-errorreporting/src/main/java/com/google/cloud/errorreporting/spi/v1beta1/package-info.java index f48abbe98e8d..b220ed188232 100644 --- a/google-cloud-errorreporting/src/main/java/com/google/cloud/errorreporting/spi/v1beta1/package-info.java +++ b/google-cloud-errorreporting/src/main/java/com/google/cloud/errorreporting/spi/v1beta1/package-info.java @@ -1,5 +1,5 @@ /* - * Copyright 2016, Google Inc. All rights reserved. + * Copyright 2017, Google Inc. All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/google-cloud-errorreporting/src/test/java/com/google/cloud/errorreporting/spi/v1beta1/ErrorGroupServiceClientTest.java b/google-cloud-errorreporting/src/test/java/com/google/cloud/errorreporting/spi/v1beta1/ErrorGroupServiceClientTest.java index 130c784e1bf6..f36aefdcb516 100644 --- a/google-cloud-errorreporting/src/test/java/com/google/cloud/errorreporting/spi/v1beta1/ErrorGroupServiceClientTest.java +++ b/google-cloud-errorreporting/src/test/java/com/google/cloud/errorreporting/spi/v1beta1/ErrorGroupServiceClientTest.java @@ -1,5 +1,5 @@ /* - * Copyright 2016, Google Inc. All rights reserved. + * Copyright 2017, Google Inc. All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/google-cloud-errorreporting/src/test/java/com/google/cloud/errorreporting/spi/v1beta1/ErrorStatsServiceClientTest.java b/google-cloud-errorreporting/src/test/java/com/google/cloud/errorreporting/spi/v1beta1/ErrorStatsServiceClientTest.java index 6e4223cf455d..5d99dedf092f 100644 --- a/google-cloud-errorreporting/src/test/java/com/google/cloud/errorreporting/spi/v1beta1/ErrorStatsServiceClientTest.java +++ b/google-cloud-errorreporting/src/test/java/com/google/cloud/errorreporting/spi/v1beta1/ErrorStatsServiceClientTest.java @@ -1,5 +1,5 @@ /* - * Copyright 2016, Google Inc. All rights reserved. + * Copyright 2017, Google Inc. All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/google-cloud-errorreporting/src/test/java/com/google/cloud/errorreporting/spi/v1beta1/MockErrorGroupService.java b/google-cloud-errorreporting/src/test/java/com/google/cloud/errorreporting/spi/v1beta1/MockErrorGroupService.java index eebc1db9642f..8f05cc80defb 100644 --- a/google-cloud-errorreporting/src/test/java/com/google/cloud/errorreporting/spi/v1beta1/MockErrorGroupService.java +++ b/google-cloud-errorreporting/src/test/java/com/google/cloud/errorreporting/spi/v1beta1/MockErrorGroupService.java @@ -1,5 +1,5 @@ /* - * Copyright 2016, Google Inc. All rights reserved. + * Copyright 2017, Google Inc. All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/google-cloud-errorreporting/src/test/java/com/google/cloud/errorreporting/spi/v1beta1/MockErrorGroupServiceImpl.java b/google-cloud-errorreporting/src/test/java/com/google/cloud/errorreporting/spi/v1beta1/MockErrorGroupServiceImpl.java index 7f1808bd952e..9f7617d889d0 100644 --- a/google-cloud-errorreporting/src/test/java/com/google/cloud/errorreporting/spi/v1beta1/MockErrorGroupServiceImpl.java +++ b/google-cloud-errorreporting/src/test/java/com/google/cloud/errorreporting/spi/v1beta1/MockErrorGroupServiceImpl.java @@ -1,5 +1,5 @@ /* - * Copyright 2016, Google Inc. All rights reserved. + * Copyright 2017, Google Inc. All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/google-cloud-errorreporting/src/test/java/com/google/cloud/errorreporting/spi/v1beta1/MockErrorStatsService.java b/google-cloud-errorreporting/src/test/java/com/google/cloud/errorreporting/spi/v1beta1/MockErrorStatsService.java index 2acc7112f214..3344517a7c40 100644 --- a/google-cloud-errorreporting/src/test/java/com/google/cloud/errorreporting/spi/v1beta1/MockErrorStatsService.java +++ b/google-cloud-errorreporting/src/test/java/com/google/cloud/errorreporting/spi/v1beta1/MockErrorStatsService.java @@ -1,5 +1,5 @@ /* - * Copyright 2016, Google Inc. All rights reserved. + * Copyright 2017, Google Inc. All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/google-cloud-errorreporting/src/test/java/com/google/cloud/errorreporting/spi/v1beta1/MockErrorStatsServiceImpl.java b/google-cloud-errorreporting/src/test/java/com/google/cloud/errorreporting/spi/v1beta1/MockErrorStatsServiceImpl.java index b4b95110ff51..023e4696de66 100644 --- a/google-cloud-errorreporting/src/test/java/com/google/cloud/errorreporting/spi/v1beta1/MockErrorStatsServiceImpl.java +++ b/google-cloud-errorreporting/src/test/java/com/google/cloud/errorreporting/spi/v1beta1/MockErrorStatsServiceImpl.java @@ -1,5 +1,5 @@ /* - * Copyright 2016, Google Inc. All rights reserved. + * Copyright 2017, Google Inc. All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/google-cloud-errorreporting/src/test/java/com/google/cloud/errorreporting/spi/v1beta1/MockReportErrorsService.java b/google-cloud-errorreporting/src/test/java/com/google/cloud/errorreporting/spi/v1beta1/MockReportErrorsService.java index ff4007c77f55..be20b6dec3c7 100644 --- a/google-cloud-errorreporting/src/test/java/com/google/cloud/errorreporting/spi/v1beta1/MockReportErrorsService.java +++ b/google-cloud-errorreporting/src/test/java/com/google/cloud/errorreporting/spi/v1beta1/MockReportErrorsService.java @@ -1,5 +1,5 @@ /* - * Copyright 2016, Google Inc. All rights reserved. + * Copyright 2017, Google Inc. All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/google-cloud-errorreporting/src/test/java/com/google/cloud/errorreporting/spi/v1beta1/MockReportErrorsServiceImpl.java b/google-cloud-errorreporting/src/test/java/com/google/cloud/errorreporting/spi/v1beta1/MockReportErrorsServiceImpl.java index cfa41bcbcd95..3388438a11af 100644 --- a/google-cloud-errorreporting/src/test/java/com/google/cloud/errorreporting/spi/v1beta1/MockReportErrorsServiceImpl.java +++ b/google-cloud-errorreporting/src/test/java/com/google/cloud/errorreporting/spi/v1beta1/MockReportErrorsServiceImpl.java @@ -1,5 +1,5 @@ /* - * Copyright 2016, Google Inc. All rights reserved. + * Copyright 2017, Google Inc. All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/google-cloud-errorreporting/src/test/java/com/google/cloud/errorreporting/spi/v1beta1/ReportErrorsServiceClientTest.java b/google-cloud-errorreporting/src/test/java/com/google/cloud/errorreporting/spi/v1beta1/ReportErrorsServiceClientTest.java index cfc633509bc3..edf2da22c398 100644 --- a/google-cloud-errorreporting/src/test/java/com/google/cloud/errorreporting/spi/v1beta1/ReportErrorsServiceClientTest.java +++ b/google-cloud-errorreporting/src/test/java/com/google/cloud/errorreporting/spi/v1beta1/ReportErrorsServiceClientTest.java @@ -1,5 +1,5 @@ /* - * Copyright 2016, Google Inc. All rights reserved. + * Copyright 2017, Google Inc. All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/google-cloud-language/src/main/java/com/google/cloud/language/spi/v1/LanguageServiceClient.java b/google-cloud-language/src/main/java/com/google/cloud/language/spi/v1/LanguageServiceClient.java index 3fc105ea507e..c2881e01239c 100644 --- a/google-cloud-language/src/main/java/com/google/cloud/language/spi/v1/LanguageServiceClient.java +++ b/google-cloud-language/src/main/java/com/google/cloud/language/spi/v1/LanguageServiceClient.java @@ -1,5 +1,5 @@ /* - * Copyright 2016, Google Inc. All rights reserved. + * Copyright 2017, Google Inc. All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/google-cloud-language/src/main/java/com/google/cloud/language/spi/v1/LanguageServiceSettings.java b/google-cloud-language/src/main/java/com/google/cloud/language/spi/v1/LanguageServiceSettings.java index d709a0f6e88d..ca016e586a33 100644 --- a/google-cloud-language/src/main/java/com/google/cloud/language/spi/v1/LanguageServiceSettings.java +++ b/google-cloud-language/src/main/java/com/google/cloud/language/spi/v1/LanguageServiceSettings.java @@ -1,5 +1,5 @@ /* - * Copyright 2016, Google Inc. All rights reserved. + * Copyright 2017, Google Inc. All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -83,6 +83,9 @@ public class LanguageServiceSettings extends ClientSettings { private static final ImmutableList DEFAULT_SERVICE_SCOPES = ImmutableList.builder().add("https://www.googleapis.com/auth/cloud-platform").build(); + private static final String DEFAULT_GENERATOR_NAME = "gapic"; + private static final String DEFAULT_GENERATOR_VERSION = "0.0.5"; + private final SimpleCallSettings analyzeSentimentSettings; private final SimpleCallSettings @@ -143,6 +146,7 @@ public static InstantiatingChannelProvider.Builder defaultChannelProviderBuilder return InstantiatingChannelProvider.newBuilder() .setServiceAddress(DEFAULT_SERVICE_ADDRESS) .setPort(DEFAULT_SERVICE_PORT) + .setGeneratorHeader(DEFAULT_GENERATOR_NAME, DEFAULT_GENERATOR_VERSION) .setCredentialsProvider(defaultCredentialsProviderBuilder().build()); } diff --git a/google-cloud-language/src/main/java/com/google/cloud/language/spi/v1/package-info.java b/google-cloud-language/src/main/java/com/google/cloud/language/spi/v1/package-info.java index 0c1bc9939384..8153b76e7b31 100644 --- a/google-cloud-language/src/main/java/com/google/cloud/language/spi/v1/package-info.java +++ b/google-cloud-language/src/main/java/com/google/cloud/language/spi/v1/package-info.java @@ -1,5 +1,5 @@ /* - * Copyright 2016, Google Inc. All rights reserved. + * Copyright 2017, Google Inc. All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/google-cloud-language/src/test/java/com/google/cloud/language/spi/v1/LanguageServiceClientTest.java b/google-cloud-language/src/test/java/com/google/cloud/language/spi/v1/LanguageServiceClientTest.java index e1b640f38537..8fadd45dc42f 100644 --- a/google-cloud-language/src/test/java/com/google/cloud/language/spi/v1/LanguageServiceClientTest.java +++ b/google-cloud-language/src/test/java/com/google/cloud/language/spi/v1/LanguageServiceClientTest.java @@ -1,5 +1,5 @@ /* - * Copyright 2016, Google Inc. All rights reserved. + * Copyright 2017, Google Inc. All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/google-cloud-language/src/test/java/com/google/cloud/language/spi/v1/MockLanguageService.java b/google-cloud-language/src/test/java/com/google/cloud/language/spi/v1/MockLanguageService.java index 35f102d8e94a..b0963f16bcce 100644 --- a/google-cloud-language/src/test/java/com/google/cloud/language/spi/v1/MockLanguageService.java +++ b/google-cloud-language/src/test/java/com/google/cloud/language/spi/v1/MockLanguageService.java @@ -1,5 +1,5 @@ /* - * Copyright 2016, Google Inc. All rights reserved. + * Copyright 2017, Google Inc. All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/google-cloud-language/src/test/java/com/google/cloud/language/spi/v1/MockLanguageServiceImpl.java b/google-cloud-language/src/test/java/com/google/cloud/language/spi/v1/MockLanguageServiceImpl.java index d3f075ca33c4..d1d4ed6f985f 100644 --- a/google-cloud-language/src/test/java/com/google/cloud/language/spi/v1/MockLanguageServiceImpl.java +++ b/google-cloud-language/src/test/java/com/google/cloud/language/spi/v1/MockLanguageServiceImpl.java @@ -1,5 +1,5 @@ /* - * Copyright 2016, Google Inc. All rights reserved. + * Copyright 2017, Google Inc. All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/google-cloud-logging/src/main/java/com/google/cloud/logging/spi/v2/ConfigServiceV2Client.java b/google-cloud-logging/src/main/java/com/google/cloud/logging/spi/v2/ConfigServiceV2Client.java index b8e74eb4f962..3dbf95c8192c 100644 --- a/google-cloud-logging/src/main/java/com/google/cloud/logging/spi/v2/ConfigServiceV2Client.java +++ b/google-cloud-logging/src/main/java/com/google/cloud/logging/spi/v2/ConfigServiceV2Client.java @@ -1,5 +1,5 @@ /* - * Copyright 2016, Google Inc. All rights reserved. + * Copyright 2017, Google Inc. All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/google-cloud-logging/src/main/java/com/google/cloud/logging/spi/v2/ConfigServiceV2Settings.java b/google-cloud-logging/src/main/java/com/google/cloud/logging/spi/v2/ConfigServiceV2Settings.java index 203ca822a94f..c04c08cd1fb8 100644 --- a/google-cloud-logging/src/main/java/com/google/cloud/logging/spi/v2/ConfigServiceV2Settings.java +++ b/google-cloud-logging/src/main/java/com/google/cloud/logging/spi/v2/ConfigServiceV2Settings.java @@ -1,5 +1,5 @@ /* - * Copyright 2016, Google Inc. All rights reserved. + * Copyright 2017, Google Inc. All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -96,6 +96,9 @@ public class ConfigServiceV2Settings extends ClientSettings { .add("https://www.googleapis.com/auth/logging.write") .build(); + private static final String DEFAULT_GENERATOR_NAME = "gapic"; + private static final String DEFAULT_GENERATOR_VERSION = "0.0.5"; + private final PagedCallSettings listSinksSettings; private final SimpleCallSettings getSinkSettings; @@ -159,6 +162,7 @@ public static InstantiatingChannelProvider.Builder defaultChannelProviderBuilder return InstantiatingChannelProvider.newBuilder() .setServiceAddress(DEFAULT_SERVICE_ADDRESS) .setPort(DEFAULT_SERVICE_PORT) + .setGeneratorHeader(DEFAULT_GENERATOR_NAME, DEFAULT_GENERATOR_VERSION) .setCredentialsProvider(defaultCredentialsProviderBuilder().build()); } diff --git a/google-cloud-logging/src/main/java/com/google/cloud/logging/spi/v2/LoggingServiceV2Client.java b/google-cloud-logging/src/main/java/com/google/cloud/logging/spi/v2/LoggingServiceV2Client.java index bcebf5b2ea2c..432996cfbfde 100644 --- a/google-cloud-logging/src/main/java/com/google/cloud/logging/spi/v2/LoggingServiceV2Client.java +++ b/google-cloud-logging/src/main/java/com/google/cloud/logging/spi/v2/LoggingServiceV2Client.java @@ -1,5 +1,5 @@ /* - * Copyright 2016, Google Inc. All rights reserved. + * Copyright 2017, Google Inc. All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/google-cloud-logging/src/main/java/com/google/cloud/logging/spi/v2/LoggingServiceV2Settings.java b/google-cloud-logging/src/main/java/com/google/cloud/logging/spi/v2/LoggingServiceV2Settings.java index 6abe4e5ad849..7467627cf106 100644 --- a/google-cloud-logging/src/main/java/com/google/cloud/logging/spi/v2/LoggingServiceV2Settings.java +++ b/google-cloud-logging/src/main/java/com/google/cloud/logging/spi/v2/LoggingServiceV2Settings.java @@ -1,5 +1,5 @@ /* - * Copyright 2016, Google Inc. All rights reserved. + * Copyright 2017, Google Inc. All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -109,6 +109,9 @@ public class LoggingServiceV2Settings extends ClientSettings { .add("https://www.googleapis.com/auth/logging.write") .build(); + private static final String DEFAULT_GENERATOR_NAME = "gapic"; + private static final String DEFAULT_GENERATOR_VERSION = "0.0.5"; + private final SimpleCallSettings deleteLogSettings; private final BundlingCallSettings writeLogEntriesSettings; @@ -184,6 +187,7 @@ public static InstantiatingChannelProvider.Builder defaultChannelProviderBuilder return InstantiatingChannelProvider.newBuilder() .setServiceAddress(DEFAULT_SERVICE_ADDRESS) .setPort(DEFAULT_SERVICE_PORT) + .setGeneratorHeader(DEFAULT_GENERATOR_NAME, DEFAULT_GENERATOR_VERSION) .setCredentialsProvider(defaultCredentialsProviderBuilder().build()); } diff --git a/google-cloud-logging/src/main/java/com/google/cloud/logging/spi/v2/MetricsServiceV2Client.java b/google-cloud-logging/src/main/java/com/google/cloud/logging/spi/v2/MetricsServiceV2Client.java index 85c13df7fa34..84936f18b7ad 100644 --- a/google-cloud-logging/src/main/java/com/google/cloud/logging/spi/v2/MetricsServiceV2Client.java +++ b/google-cloud-logging/src/main/java/com/google/cloud/logging/spi/v2/MetricsServiceV2Client.java @@ -1,5 +1,5 @@ /* - * Copyright 2016, Google Inc. All rights reserved. + * Copyright 2017, Google Inc. All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/google-cloud-logging/src/main/java/com/google/cloud/logging/spi/v2/MetricsServiceV2Settings.java b/google-cloud-logging/src/main/java/com/google/cloud/logging/spi/v2/MetricsServiceV2Settings.java index 6b63a16d21ea..a8e29d9ee90a 100644 --- a/google-cloud-logging/src/main/java/com/google/cloud/logging/spi/v2/MetricsServiceV2Settings.java +++ b/google-cloud-logging/src/main/java/com/google/cloud/logging/spi/v2/MetricsServiceV2Settings.java @@ -1,5 +1,5 @@ /* - * Copyright 2016, Google Inc. All rights reserved. + * Copyright 2017, Google Inc. All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -96,6 +96,9 @@ public class MetricsServiceV2Settings extends ClientSettings { .add("https://www.googleapis.com/auth/logging.write") .build(); + private static final String DEFAULT_GENERATOR_NAME = "gapic"; + private static final String DEFAULT_GENERATOR_VERSION = "0.0.5"; + private final PagedCallSettings< ListLogMetricsRequest, ListLogMetricsResponse, ListLogMetricsPagedResponse> listLogMetricsSettings; @@ -161,6 +164,7 @@ public static InstantiatingChannelProvider.Builder defaultChannelProviderBuilder return InstantiatingChannelProvider.newBuilder() .setServiceAddress(DEFAULT_SERVICE_ADDRESS) .setPort(DEFAULT_SERVICE_PORT) + .setGeneratorHeader(DEFAULT_GENERATOR_NAME, DEFAULT_GENERATOR_VERSION) .setCredentialsProvider(defaultCredentialsProviderBuilder().build()); } diff --git a/google-cloud-logging/src/main/java/com/google/cloud/logging/spi/v2/PagedResponseWrappers.java b/google-cloud-logging/src/main/java/com/google/cloud/logging/spi/v2/PagedResponseWrappers.java index 30ac77a1cd25..061da4e7b6fa 100644 --- a/google-cloud-logging/src/main/java/com/google/cloud/logging/spi/v2/PagedResponseWrappers.java +++ b/google-cloud-logging/src/main/java/com/google/cloud/logging/spi/v2/PagedResponseWrappers.java @@ -1,5 +1,5 @@ /* - * Copyright 2016, Google Inc. All rights reserved. + * Copyright 2017, Google Inc. All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/google-cloud-logging/src/main/java/com/google/cloud/logging/spi/v2/package-info.java b/google-cloud-logging/src/main/java/com/google/cloud/logging/spi/v2/package-info.java index c087e4089b63..bdded777062a 100644 --- a/google-cloud-logging/src/main/java/com/google/cloud/logging/spi/v2/package-info.java +++ b/google-cloud-logging/src/main/java/com/google/cloud/logging/spi/v2/package-info.java @@ -1,5 +1,5 @@ /* - * Copyright 2016, Google Inc. All rights reserved. + * Copyright 2017, Google Inc. All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/google-cloud-logging/src/test/java/com/google/cloud/logging/spi/v2/ConfigServiceV2ClientTest.java b/google-cloud-logging/src/test/java/com/google/cloud/logging/spi/v2/ConfigServiceV2ClientTest.java index 1519a443a482..040bc2a17af4 100644 --- a/google-cloud-logging/src/test/java/com/google/cloud/logging/spi/v2/ConfigServiceV2ClientTest.java +++ b/google-cloud-logging/src/test/java/com/google/cloud/logging/spi/v2/ConfigServiceV2ClientTest.java @@ -1,5 +1,5 @@ /* - * Copyright 2016, Google Inc. All rights reserved. + * Copyright 2017, Google Inc. All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/google-cloud-logging/src/test/java/com/google/cloud/logging/spi/v2/LoggingServiceV2ClientTest.java b/google-cloud-logging/src/test/java/com/google/cloud/logging/spi/v2/LoggingServiceV2ClientTest.java index e681044b321d..81f52d9c55ff 100644 --- a/google-cloud-logging/src/test/java/com/google/cloud/logging/spi/v2/LoggingServiceV2ClientTest.java +++ b/google-cloud-logging/src/test/java/com/google/cloud/logging/spi/v2/LoggingServiceV2ClientTest.java @@ -1,5 +1,5 @@ /* - * Copyright 2016, Google Inc. All rights reserved. + * Copyright 2017, Google Inc. All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/google-cloud-logging/src/test/java/com/google/cloud/logging/spi/v2/MetricsServiceV2ClientTest.java b/google-cloud-logging/src/test/java/com/google/cloud/logging/spi/v2/MetricsServiceV2ClientTest.java index ea1fa833b1f4..63c344e70f0a 100644 --- a/google-cloud-logging/src/test/java/com/google/cloud/logging/spi/v2/MetricsServiceV2ClientTest.java +++ b/google-cloud-logging/src/test/java/com/google/cloud/logging/spi/v2/MetricsServiceV2ClientTest.java @@ -1,5 +1,5 @@ /* - * Copyright 2016, Google Inc. All rights reserved. + * Copyright 2017, Google Inc. All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/google-cloud-logging/src/test/java/com/google/cloud/logging/spi/v2/MockConfigServiceV2.java b/google-cloud-logging/src/test/java/com/google/cloud/logging/spi/v2/MockConfigServiceV2.java index 020f0fff8fa6..3709896fe50f 100644 --- a/google-cloud-logging/src/test/java/com/google/cloud/logging/spi/v2/MockConfigServiceV2.java +++ b/google-cloud-logging/src/test/java/com/google/cloud/logging/spi/v2/MockConfigServiceV2.java @@ -1,5 +1,5 @@ /* - * Copyright 2016, Google Inc. All rights reserved. + * Copyright 2017, Google Inc. All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/google-cloud-logging/src/test/java/com/google/cloud/logging/spi/v2/MockConfigServiceV2Impl.java b/google-cloud-logging/src/test/java/com/google/cloud/logging/spi/v2/MockConfigServiceV2Impl.java index e7892a87bb52..3e74a4b949d0 100644 --- a/google-cloud-logging/src/test/java/com/google/cloud/logging/spi/v2/MockConfigServiceV2Impl.java +++ b/google-cloud-logging/src/test/java/com/google/cloud/logging/spi/v2/MockConfigServiceV2Impl.java @@ -1,5 +1,5 @@ /* - * Copyright 2016, Google Inc. All rights reserved. + * Copyright 2017, Google Inc. All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/google-cloud-logging/src/test/java/com/google/cloud/logging/spi/v2/MockLoggingServiceV2.java b/google-cloud-logging/src/test/java/com/google/cloud/logging/spi/v2/MockLoggingServiceV2.java index 9e3a6bd0ea99..b9723185ab1d 100644 --- a/google-cloud-logging/src/test/java/com/google/cloud/logging/spi/v2/MockLoggingServiceV2.java +++ b/google-cloud-logging/src/test/java/com/google/cloud/logging/spi/v2/MockLoggingServiceV2.java @@ -1,5 +1,5 @@ /* - * Copyright 2016, Google Inc. All rights reserved. + * Copyright 2017, Google Inc. All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/google-cloud-logging/src/test/java/com/google/cloud/logging/spi/v2/MockLoggingServiceV2Impl.java b/google-cloud-logging/src/test/java/com/google/cloud/logging/spi/v2/MockLoggingServiceV2Impl.java index 02090c9934d4..c63de1feecbf 100644 --- a/google-cloud-logging/src/test/java/com/google/cloud/logging/spi/v2/MockLoggingServiceV2Impl.java +++ b/google-cloud-logging/src/test/java/com/google/cloud/logging/spi/v2/MockLoggingServiceV2Impl.java @@ -1,5 +1,5 @@ /* - * Copyright 2016, Google Inc. All rights reserved. + * Copyright 2017, Google Inc. All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/google-cloud-logging/src/test/java/com/google/cloud/logging/spi/v2/MockMetricsServiceV2.java b/google-cloud-logging/src/test/java/com/google/cloud/logging/spi/v2/MockMetricsServiceV2.java index f3c82f61a7f7..9b7d28127631 100644 --- a/google-cloud-logging/src/test/java/com/google/cloud/logging/spi/v2/MockMetricsServiceV2.java +++ b/google-cloud-logging/src/test/java/com/google/cloud/logging/spi/v2/MockMetricsServiceV2.java @@ -1,5 +1,5 @@ /* - * Copyright 2016, Google Inc. All rights reserved. + * Copyright 2017, Google Inc. All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/google-cloud-logging/src/test/java/com/google/cloud/logging/spi/v2/MockMetricsServiceV2Impl.java b/google-cloud-logging/src/test/java/com/google/cloud/logging/spi/v2/MockMetricsServiceV2Impl.java index fe7db1934a6b..685bf0b97d8c 100644 --- a/google-cloud-logging/src/test/java/com/google/cloud/logging/spi/v2/MockMetricsServiceV2Impl.java +++ b/google-cloud-logging/src/test/java/com/google/cloud/logging/spi/v2/MockMetricsServiceV2Impl.java @@ -1,5 +1,5 @@ /* - * Copyright 2016, Google Inc. All rights reserved. + * Copyright 2017, Google Inc. All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/google-cloud-monitoring/src/main/java/com/google/cloud/monitoring/spi/v3/GroupServiceClient.java b/google-cloud-monitoring/src/main/java/com/google/cloud/monitoring/spi/v3/GroupServiceClient.java index 8f4a2750e503..0c1522424120 100644 --- a/google-cloud-monitoring/src/main/java/com/google/cloud/monitoring/spi/v3/GroupServiceClient.java +++ b/google-cloud-monitoring/src/main/java/com/google/cloud/monitoring/spi/v3/GroupServiceClient.java @@ -1,5 +1,5 @@ /* - * Copyright 2016, Google Inc. All rights reserved. + * Copyright 2017, Google Inc. All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/google-cloud-monitoring/src/main/java/com/google/cloud/monitoring/spi/v3/GroupServiceSettings.java b/google-cloud-monitoring/src/main/java/com/google/cloud/monitoring/spi/v3/GroupServiceSettings.java index 797cd87b40de..7f507a6f720f 100644 --- a/google-cloud-monitoring/src/main/java/com/google/cloud/monitoring/spi/v3/GroupServiceSettings.java +++ b/google-cloud-monitoring/src/main/java/com/google/cloud/monitoring/spi/v3/GroupServiceSettings.java @@ -1,5 +1,5 @@ /* - * Copyright 2016, Google Inc. All rights reserved. + * Copyright 2017, Google Inc. All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -99,6 +99,9 @@ public class GroupServiceSettings extends ClientSettings { .add("https://www.googleapis.com/auth/monitoring.write") .build(); + private static final String DEFAULT_GENERATOR_NAME = "gapic"; + private static final String DEFAULT_GENERATOR_VERSION = "0.0.5"; + private final PagedCallSettings listGroupsSettings; private final SimpleCallSettings getGroupSettings; @@ -172,6 +175,7 @@ public static InstantiatingChannelProvider.Builder defaultChannelProviderBuilder return InstantiatingChannelProvider.newBuilder() .setServiceAddress(DEFAULT_SERVICE_ADDRESS) .setPort(DEFAULT_SERVICE_PORT) + .setGeneratorHeader(DEFAULT_GENERATOR_NAME, DEFAULT_GENERATOR_VERSION) .setCredentialsProvider(defaultCredentialsProviderBuilder().build()); } diff --git a/google-cloud-monitoring/src/main/java/com/google/cloud/monitoring/spi/v3/MetricServiceClient.java b/google-cloud-monitoring/src/main/java/com/google/cloud/monitoring/spi/v3/MetricServiceClient.java index fdd725b5094b..8efd1fa6f671 100644 --- a/google-cloud-monitoring/src/main/java/com/google/cloud/monitoring/spi/v3/MetricServiceClient.java +++ b/google-cloud-monitoring/src/main/java/com/google/cloud/monitoring/spi/v3/MetricServiceClient.java @@ -1,5 +1,5 @@ /* - * Copyright 2016, Google Inc. All rights reserved. + * Copyright 2017, Google Inc. All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/google-cloud-monitoring/src/main/java/com/google/cloud/monitoring/spi/v3/MetricServiceSettings.java b/google-cloud-monitoring/src/main/java/com/google/cloud/monitoring/spi/v3/MetricServiceSettings.java index 162d1210204d..acdeddc3d13e 100644 --- a/google-cloud-monitoring/src/main/java/com/google/cloud/monitoring/spi/v3/MetricServiceSettings.java +++ b/google-cloud-monitoring/src/main/java/com/google/cloud/monitoring/spi/v3/MetricServiceSettings.java @@ -1,5 +1,5 @@ /* - * Copyright 2016, Google Inc. All rights reserved. + * Copyright 2017, Google Inc. All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -104,6 +104,9 @@ public class MetricServiceSettings extends ClientSettings { .add("https://www.googleapis.com/auth/monitoring.write") .build(); + private static final String DEFAULT_GENERATOR_NAME = "gapic"; + private static final String DEFAULT_GENERATOR_VERSION = "0.0.5"; + private final PagedCallSettings< ListMonitoredResourceDescriptorsRequest, ListMonitoredResourceDescriptorsResponse, ListMonitoredResourceDescriptorsPagedResponse> @@ -207,6 +210,7 @@ public static InstantiatingChannelProvider.Builder defaultChannelProviderBuilder return InstantiatingChannelProvider.newBuilder() .setServiceAddress(DEFAULT_SERVICE_ADDRESS) .setPort(DEFAULT_SERVICE_PORT) + .setGeneratorHeader(DEFAULT_GENERATOR_NAME, DEFAULT_GENERATOR_VERSION) .setCredentialsProvider(defaultCredentialsProviderBuilder().build()); } diff --git a/google-cloud-monitoring/src/main/java/com/google/cloud/monitoring/spi/v3/PagedResponseWrappers.java b/google-cloud-monitoring/src/main/java/com/google/cloud/monitoring/spi/v3/PagedResponseWrappers.java index b0da812a33e3..83ff4f730566 100644 --- a/google-cloud-monitoring/src/main/java/com/google/cloud/monitoring/spi/v3/PagedResponseWrappers.java +++ b/google-cloud-monitoring/src/main/java/com/google/cloud/monitoring/spi/v3/PagedResponseWrappers.java @@ -1,5 +1,5 @@ /* - * Copyright 2016, Google Inc. All rights reserved. + * Copyright 2017, Google Inc. All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/google-cloud-monitoring/src/main/java/com/google/cloud/monitoring/spi/v3/package-info.java b/google-cloud-monitoring/src/main/java/com/google/cloud/monitoring/spi/v3/package-info.java index 95db6ed368b8..39be7555fee6 100644 --- a/google-cloud-monitoring/src/main/java/com/google/cloud/monitoring/spi/v3/package-info.java +++ b/google-cloud-monitoring/src/main/java/com/google/cloud/monitoring/spi/v3/package-info.java @@ -1,5 +1,5 @@ /* - * Copyright 2016, Google Inc. All rights reserved. + * Copyright 2017, Google Inc. All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/google-cloud-monitoring/src/test/java/com/google/cloud/monitoring/spi/v3/GroupServiceClientTest.java b/google-cloud-monitoring/src/test/java/com/google/cloud/monitoring/spi/v3/GroupServiceClientTest.java index c7ae7cc9a29f..bcdffb6ec8de 100644 --- a/google-cloud-monitoring/src/test/java/com/google/cloud/monitoring/spi/v3/GroupServiceClientTest.java +++ b/google-cloud-monitoring/src/test/java/com/google/cloud/monitoring/spi/v3/GroupServiceClientTest.java @@ -1,5 +1,5 @@ /* - * Copyright 2016, Google Inc. All rights reserved. + * Copyright 2017, Google Inc. All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/google-cloud-monitoring/src/test/java/com/google/cloud/monitoring/spi/v3/MetricServiceClientTest.java b/google-cloud-monitoring/src/test/java/com/google/cloud/monitoring/spi/v3/MetricServiceClientTest.java index 7f03d16fc944..ae649f904be1 100644 --- a/google-cloud-monitoring/src/test/java/com/google/cloud/monitoring/spi/v3/MetricServiceClientTest.java +++ b/google-cloud-monitoring/src/test/java/com/google/cloud/monitoring/spi/v3/MetricServiceClientTest.java @@ -1,5 +1,5 @@ /* - * Copyright 2016, Google Inc. All rights reserved. + * Copyright 2017, Google Inc. All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/google-cloud-monitoring/src/test/java/com/google/cloud/monitoring/spi/v3/MockGroupService.java b/google-cloud-monitoring/src/test/java/com/google/cloud/monitoring/spi/v3/MockGroupService.java index 4b12fe3b5cda..2b3d2c4626b7 100644 --- a/google-cloud-monitoring/src/test/java/com/google/cloud/monitoring/spi/v3/MockGroupService.java +++ b/google-cloud-monitoring/src/test/java/com/google/cloud/monitoring/spi/v3/MockGroupService.java @@ -1,5 +1,5 @@ /* - * Copyright 2016, Google Inc. All rights reserved. + * Copyright 2017, Google Inc. All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/google-cloud-monitoring/src/test/java/com/google/cloud/monitoring/spi/v3/MockGroupServiceImpl.java b/google-cloud-monitoring/src/test/java/com/google/cloud/monitoring/spi/v3/MockGroupServiceImpl.java index f3e4f556df58..82487adc2e1d 100644 --- a/google-cloud-monitoring/src/test/java/com/google/cloud/monitoring/spi/v3/MockGroupServiceImpl.java +++ b/google-cloud-monitoring/src/test/java/com/google/cloud/monitoring/spi/v3/MockGroupServiceImpl.java @@ -1,5 +1,5 @@ /* - * Copyright 2016, Google Inc. All rights reserved. + * Copyright 2017, Google Inc. All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/google-cloud-monitoring/src/test/java/com/google/cloud/monitoring/spi/v3/MockMetricService.java b/google-cloud-monitoring/src/test/java/com/google/cloud/monitoring/spi/v3/MockMetricService.java index 268f78db56f4..0d5a98c9cc4f 100644 --- a/google-cloud-monitoring/src/test/java/com/google/cloud/monitoring/spi/v3/MockMetricService.java +++ b/google-cloud-monitoring/src/test/java/com/google/cloud/monitoring/spi/v3/MockMetricService.java @@ -1,5 +1,5 @@ /* - * Copyright 2016, Google Inc. All rights reserved. + * Copyright 2017, Google Inc. All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/google-cloud-monitoring/src/test/java/com/google/cloud/monitoring/spi/v3/MockMetricServiceImpl.java b/google-cloud-monitoring/src/test/java/com/google/cloud/monitoring/spi/v3/MockMetricServiceImpl.java index c6ff4dcfb476..e31c639eae74 100644 --- a/google-cloud-monitoring/src/test/java/com/google/cloud/monitoring/spi/v3/MockMetricServiceImpl.java +++ b/google-cloud-monitoring/src/test/java/com/google/cloud/monitoring/spi/v3/MockMetricServiceImpl.java @@ -1,5 +1,5 @@ /* - * Copyright 2016, Google Inc. All rights reserved. + * Copyright 2017, Google Inc. All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/google-cloud-pubsub/src/main/java/com/google/cloud/pubsub/spi/v1/PagedResponseWrappers.java b/google-cloud-pubsub/src/main/java/com/google/cloud/pubsub/spi/v1/PagedResponseWrappers.java index b1d57f8116cf..56c37d765e47 100644 --- a/google-cloud-pubsub/src/main/java/com/google/cloud/pubsub/spi/v1/PagedResponseWrappers.java +++ b/google-cloud-pubsub/src/main/java/com/google/cloud/pubsub/spi/v1/PagedResponseWrappers.java @@ -1,5 +1,5 @@ /* - * Copyright 2016, Google Inc. All rights reserved. + * Copyright 2017, Google Inc. All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/google-cloud-pubsub/src/main/java/com/google/cloud/pubsub/spi/v1/PublisherClient.java b/google-cloud-pubsub/src/main/java/com/google/cloud/pubsub/spi/v1/PublisherClient.java index b956c306eca6..0f1f2254b43e 100644 --- a/google-cloud-pubsub/src/main/java/com/google/cloud/pubsub/spi/v1/PublisherClient.java +++ b/google-cloud-pubsub/src/main/java/com/google/cloud/pubsub/spi/v1/PublisherClient.java @@ -1,5 +1,5 @@ /* - * Copyright 2016, Google Inc. All rights reserved. + * Copyright 2017, Google Inc. All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/google-cloud-pubsub/src/main/java/com/google/cloud/pubsub/spi/v1/PublisherSettings.java b/google-cloud-pubsub/src/main/java/com/google/cloud/pubsub/spi/v1/PublisherSettings.java index db1a202392ab..c9d87236448a 100644 --- a/google-cloud-pubsub/src/main/java/com/google/cloud/pubsub/spi/v1/PublisherSettings.java +++ b/google-cloud-pubsub/src/main/java/com/google/cloud/pubsub/spi/v1/PublisherSettings.java @@ -1,5 +1,5 @@ /* - * Copyright 2016, Google Inc. All rights reserved. + * Copyright 2017, Google Inc. All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -110,6 +110,9 @@ public class PublisherSettings extends ClientSettings { .add("https://www.googleapis.com/auth/pubsub") .build(); + private static final String DEFAULT_GENERATOR_NAME = "gapic"; + private static final String DEFAULT_GENERATOR_VERSION = "0.0.5"; + private final SimpleCallSettings createTopicSettings; private final BundlingCallSettings publishSettings; private final SimpleCallSettings getTopicSettings; @@ -205,6 +208,7 @@ public static InstantiatingChannelProvider.Builder defaultChannelProviderBuilder return InstantiatingChannelProvider.newBuilder() .setServiceAddress(DEFAULT_SERVICE_ADDRESS) .setPort(DEFAULT_SERVICE_PORT) + .setGeneratorHeader(DEFAULT_GENERATOR_NAME, DEFAULT_GENERATOR_VERSION) .setCredentialsProvider(defaultCredentialsProviderBuilder().build()); } diff --git a/google-cloud-pubsub/src/main/java/com/google/cloud/pubsub/spi/v1/SubscriberClient.java b/google-cloud-pubsub/src/main/java/com/google/cloud/pubsub/spi/v1/SubscriberClient.java index 5706fa7f9f83..27e889e9ca0d 100644 --- a/google-cloud-pubsub/src/main/java/com/google/cloud/pubsub/spi/v1/SubscriberClient.java +++ b/google-cloud-pubsub/src/main/java/com/google/cloud/pubsub/spi/v1/SubscriberClient.java @@ -1,5 +1,5 @@ /* - * Copyright 2016, Google Inc. All rights reserved. + * Copyright 2017, Google Inc. All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/google-cloud-pubsub/src/main/java/com/google/cloud/pubsub/spi/v1/SubscriberSettings.java b/google-cloud-pubsub/src/main/java/com/google/cloud/pubsub/spi/v1/SubscriberSettings.java index 1366d8e10e90..5d7e0f1d647e 100644 --- a/google-cloud-pubsub/src/main/java/com/google/cloud/pubsub/spi/v1/SubscriberSettings.java +++ b/google-cloud-pubsub/src/main/java/com/google/cloud/pubsub/spi/v1/SubscriberSettings.java @@ -1,5 +1,5 @@ /* - * Copyright 2016, Google Inc. All rights reserved. + * Copyright 2017, Google Inc. All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -105,6 +105,9 @@ public class SubscriberSettings extends ClientSettings { .add("https://www.googleapis.com/auth/pubsub") .build(); + private static final String DEFAULT_GENERATOR_NAME = "gapic"; + private static final String DEFAULT_GENERATOR_VERSION = "0.0.5"; + private final SimpleCallSettings createSubscriptionSettings; private final SimpleCallSettings getSubscriptionSettings; private final PagedCallSettings< @@ -216,6 +219,7 @@ public static InstantiatingChannelProvider.Builder defaultChannelProviderBuilder return InstantiatingChannelProvider.newBuilder() .setServiceAddress(DEFAULT_SERVICE_ADDRESS) .setPort(DEFAULT_SERVICE_PORT) + .setGeneratorHeader(DEFAULT_GENERATOR_NAME, DEFAULT_GENERATOR_VERSION) .setCredentialsProvider(defaultCredentialsProviderBuilder().build()); } diff --git a/google-cloud-pubsub/src/main/java/com/google/cloud/pubsub/spi/v1/package-info.java b/google-cloud-pubsub/src/main/java/com/google/cloud/pubsub/spi/v1/package-info.java index 057a948b8683..e7beb741eb31 100644 --- a/google-cloud-pubsub/src/main/java/com/google/cloud/pubsub/spi/v1/package-info.java +++ b/google-cloud-pubsub/src/main/java/com/google/cloud/pubsub/spi/v1/package-info.java @@ -1,5 +1,5 @@ /* - * Copyright 2016, Google Inc. All rights reserved. + * Copyright 2017, Google Inc. All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/google-cloud-pubsub/src/test/java/com/google/cloud/pubsub/spi/v1/MockIAMPolicy.java b/google-cloud-pubsub/src/test/java/com/google/cloud/pubsub/spi/v1/MockIAMPolicy.java index 729859244c4f..1e5d899738b8 100644 --- a/google-cloud-pubsub/src/test/java/com/google/cloud/pubsub/spi/v1/MockIAMPolicy.java +++ b/google-cloud-pubsub/src/test/java/com/google/cloud/pubsub/spi/v1/MockIAMPolicy.java @@ -1,5 +1,5 @@ /* - * Copyright 2016, Google Inc. All rights reserved. + * Copyright 2017, Google Inc. All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/google-cloud-pubsub/src/test/java/com/google/cloud/pubsub/spi/v1/MockIAMPolicyImpl.java b/google-cloud-pubsub/src/test/java/com/google/cloud/pubsub/spi/v1/MockIAMPolicyImpl.java index c5ee265c371a..d2986b9e3a84 100644 --- a/google-cloud-pubsub/src/test/java/com/google/cloud/pubsub/spi/v1/MockIAMPolicyImpl.java +++ b/google-cloud-pubsub/src/test/java/com/google/cloud/pubsub/spi/v1/MockIAMPolicyImpl.java @@ -1,5 +1,5 @@ /* - * Copyright 2016, Google Inc. All rights reserved. + * Copyright 2017, Google Inc. All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/google-cloud-pubsub/src/test/java/com/google/cloud/pubsub/spi/v1/MockPublisher.java b/google-cloud-pubsub/src/test/java/com/google/cloud/pubsub/spi/v1/MockPublisher.java index 5ddbea20e909..e551321168bf 100644 --- a/google-cloud-pubsub/src/test/java/com/google/cloud/pubsub/spi/v1/MockPublisher.java +++ b/google-cloud-pubsub/src/test/java/com/google/cloud/pubsub/spi/v1/MockPublisher.java @@ -1,5 +1,5 @@ /* - * Copyright 2016, Google Inc. All rights reserved. + * Copyright 2017, Google Inc. All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/google-cloud-pubsub/src/test/java/com/google/cloud/pubsub/spi/v1/MockPublisherImpl.java b/google-cloud-pubsub/src/test/java/com/google/cloud/pubsub/spi/v1/MockPublisherImpl.java index 947dd09f8c90..63317aba0656 100644 --- a/google-cloud-pubsub/src/test/java/com/google/cloud/pubsub/spi/v1/MockPublisherImpl.java +++ b/google-cloud-pubsub/src/test/java/com/google/cloud/pubsub/spi/v1/MockPublisherImpl.java @@ -1,5 +1,5 @@ /* - * Copyright 2016, Google Inc. All rights reserved. + * Copyright 2017, Google Inc. All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/google-cloud-pubsub/src/test/java/com/google/cloud/pubsub/spi/v1/MockSubscriber.java b/google-cloud-pubsub/src/test/java/com/google/cloud/pubsub/spi/v1/MockSubscriber.java index 25b5463fbf7c..4516cb757fd6 100644 --- a/google-cloud-pubsub/src/test/java/com/google/cloud/pubsub/spi/v1/MockSubscriber.java +++ b/google-cloud-pubsub/src/test/java/com/google/cloud/pubsub/spi/v1/MockSubscriber.java @@ -1,5 +1,5 @@ /* - * Copyright 2016, Google Inc. All rights reserved. + * Copyright 2017, Google Inc. All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/google-cloud-pubsub/src/test/java/com/google/cloud/pubsub/spi/v1/MockSubscriberImpl.java b/google-cloud-pubsub/src/test/java/com/google/cloud/pubsub/spi/v1/MockSubscriberImpl.java index cb589e8e0028..a7b0077a6bee 100644 --- a/google-cloud-pubsub/src/test/java/com/google/cloud/pubsub/spi/v1/MockSubscriberImpl.java +++ b/google-cloud-pubsub/src/test/java/com/google/cloud/pubsub/spi/v1/MockSubscriberImpl.java @@ -1,5 +1,5 @@ /* - * Copyright 2016, Google Inc. All rights reserved. + * Copyright 2017, Google Inc. All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/google-cloud-pubsub/src/test/java/com/google/cloud/pubsub/spi/v1/PublisherClientTest.java b/google-cloud-pubsub/src/test/java/com/google/cloud/pubsub/spi/v1/PublisherClientTest.java index 4e429f9e459e..39e39a817224 100644 --- a/google-cloud-pubsub/src/test/java/com/google/cloud/pubsub/spi/v1/PublisherClientTest.java +++ b/google-cloud-pubsub/src/test/java/com/google/cloud/pubsub/spi/v1/PublisherClientTest.java @@ -1,5 +1,5 @@ /* - * Copyright 2016, Google Inc. All rights reserved. + * Copyright 2017, Google Inc. All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/google-cloud-pubsub/src/test/java/com/google/cloud/pubsub/spi/v1/SubscriberClientTest.java b/google-cloud-pubsub/src/test/java/com/google/cloud/pubsub/spi/v1/SubscriberClientTest.java index c9a2420e2bdf..265168dabb65 100644 --- a/google-cloud-pubsub/src/test/java/com/google/cloud/pubsub/spi/v1/SubscriberClientTest.java +++ b/google-cloud-pubsub/src/test/java/com/google/cloud/pubsub/spi/v1/SubscriberClientTest.java @@ -1,5 +1,5 @@ /* - * Copyright 2016, Google Inc. All rights reserved. + * Copyright 2017, Google Inc. All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/google-cloud-speech/src/main/java/com/google/cloud/speech/spi/v1beta1/SpeechClient.java b/google-cloud-speech/src/main/java/com/google/cloud/speech/spi/v1beta1/SpeechClient.java index 7e277a5da3ba..4cc2e21a9583 100644 --- a/google-cloud-speech/src/main/java/com/google/cloud/speech/spi/v1beta1/SpeechClient.java +++ b/google-cloud-speech/src/main/java/com/google/cloud/speech/spi/v1beta1/SpeechClient.java @@ -1,5 +1,5 @@ /* - * Copyright 2016, Google Inc. All rights reserved. + * Copyright 2017, Google Inc. All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/google-cloud-speech/src/main/java/com/google/cloud/speech/spi/v1beta1/SpeechSettings.java b/google-cloud-speech/src/main/java/com/google/cloud/speech/spi/v1beta1/SpeechSettings.java index f1e38b260328..e67b7fbdb108 100644 --- a/google-cloud-speech/src/main/java/com/google/cloud/speech/spi/v1beta1/SpeechSettings.java +++ b/google-cloud-speech/src/main/java/com/google/cloud/speech/spi/v1beta1/SpeechSettings.java @@ -1,5 +1,5 @@ /* - * Copyright 2016, Google Inc. All rights reserved. + * Copyright 2017, Google Inc. All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -83,6 +83,9 @@ public class SpeechSettings extends ClientSettings { private static final ImmutableList DEFAULT_SERVICE_SCOPES = ImmutableList.builder().add("https://www.googleapis.com/auth/cloud-platform").build(); + private static final String DEFAULT_GENERATOR_NAME = "gapic"; + private static final String DEFAULT_GENERATOR_VERSION = "0.0.5"; + private final SimpleCallSettings syncRecognizeSettings; private final OperationCallSettings @@ -137,6 +140,7 @@ public static InstantiatingChannelProvider.Builder defaultChannelProviderBuilder return InstantiatingChannelProvider.newBuilder() .setServiceAddress(DEFAULT_SERVICE_ADDRESS) .setPort(DEFAULT_SERVICE_PORT) + .setGeneratorHeader(DEFAULT_GENERATOR_NAME, DEFAULT_GENERATOR_VERSION) .setCredentialsProvider(defaultCredentialsProviderBuilder().build()); } diff --git a/google-cloud-speech/src/main/java/com/google/cloud/speech/spi/v1beta1/package-info.java b/google-cloud-speech/src/main/java/com/google/cloud/speech/spi/v1beta1/package-info.java index 7851dcd3a143..aba4be4d6b7a 100644 --- a/google-cloud-speech/src/main/java/com/google/cloud/speech/spi/v1beta1/package-info.java +++ b/google-cloud-speech/src/main/java/com/google/cloud/speech/spi/v1beta1/package-info.java @@ -1,5 +1,5 @@ /* - * Copyright 2016, Google Inc. All rights reserved. + * Copyright 2017, Google Inc. All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/google-cloud-speech/src/test/java/com/google/cloud/speech/spi/v1beta1/MockSpeech.java b/google-cloud-speech/src/test/java/com/google/cloud/speech/spi/v1beta1/MockSpeech.java index 7f9e1dd4c7a1..510ff151c941 100644 --- a/google-cloud-speech/src/test/java/com/google/cloud/speech/spi/v1beta1/MockSpeech.java +++ b/google-cloud-speech/src/test/java/com/google/cloud/speech/spi/v1beta1/MockSpeech.java @@ -1,5 +1,5 @@ /* - * Copyright 2016, Google Inc. All rights reserved. + * Copyright 2017, Google Inc. All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/google-cloud-speech/src/test/java/com/google/cloud/speech/spi/v1beta1/MockSpeechImpl.java b/google-cloud-speech/src/test/java/com/google/cloud/speech/spi/v1beta1/MockSpeechImpl.java index 850279b2ffff..91872165fbb9 100644 --- a/google-cloud-speech/src/test/java/com/google/cloud/speech/spi/v1beta1/MockSpeechImpl.java +++ b/google-cloud-speech/src/test/java/com/google/cloud/speech/spi/v1beta1/MockSpeechImpl.java @@ -1,5 +1,5 @@ /* - * Copyright 2016, Google Inc. All rights reserved. + * Copyright 2017, Google Inc. All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/google-cloud-speech/src/test/java/com/google/cloud/speech/spi/v1beta1/SpeechClientTest.java b/google-cloud-speech/src/test/java/com/google/cloud/speech/spi/v1beta1/SpeechClientTest.java index e6f3a0296381..f455c4db6aff 100644 --- a/google-cloud-speech/src/test/java/com/google/cloud/speech/spi/v1beta1/SpeechClientTest.java +++ b/google-cloud-speech/src/test/java/com/google/cloud/speech/spi/v1beta1/SpeechClientTest.java @@ -1,5 +1,5 @@ /* - * Copyright 2016, Google Inc. All rights reserved. + * Copyright 2017, Google Inc. All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/google-cloud-trace/src/main/java/com/google/cloud/trace/spi/v1/PagedResponseWrappers.java b/google-cloud-trace/src/main/java/com/google/cloud/trace/spi/v1/PagedResponseWrappers.java index 3d53bbe3acbb..0b51f402e6fc 100644 --- a/google-cloud-trace/src/main/java/com/google/cloud/trace/spi/v1/PagedResponseWrappers.java +++ b/google-cloud-trace/src/main/java/com/google/cloud/trace/spi/v1/PagedResponseWrappers.java @@ -1,5 +1,5 @@ /* - * Copyright 2016, Google Inc. All rights reserved. + * Copyright 2017, Google Inc. All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/google-cloud-trace/src/main/java/com/google/cloud/trace/spi/v1/TraceServiceClient.java b/google-cloud-trace/src/main/java/com/google/cloud/trace/spi/v1/TraceServiceClient.java index 2a18efdd56df..bee9e8f4e2ef 100644 --- a/google-cloud-trace/src/main/java/com/google/cloud/trace/spi/v1/TraceServiceClient.java +++ b/google-cloud-trace/src/main/java/com/google/cloud/trace/spi/v1/TraceServiceClient.java @@ -1,5 +1,5 @@ /* - * Copyright 2016, Google Inc. All rights reserved. + * Copyright 2017, Google Inc. All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/google-cloud-trace/src/main/java/com/google/cloud/trace/spi/v1/TraceServiceSettings.java b/google-cloud-trace/src/main/java/com/google/cloud/trace/spi/v1/TraceServiceSettings.java index 6a91556bf670..b793669c66e6 100644 --- a/google-cloud-trace/src/main/java/com/google/cloud/trace/spi/v1/TraceServiceSettings.java +++ b/google-cloud-trace/src/main/java/com/google/cloud/trace/spi/v1/TraceServiceSettings.java @@ -1,5 +1,5 @@ /* - * Copyright 2016, Google Inc. All rights reserved. + * Copyright 2017, Google Inc. All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -92,6 +92,9 @@ public class TraceServiceSettings extends ClientSettings { .add("https://www.googleapis.com/auth/trace.readonly") .build(); + private static final String DEFAULT_GENERATOR_NAME = "gapic"; + private static final String DEFAULT_GENERATOR_VERSION = "0.0.5"; + private final SimpleCallSettings patchTracesSettings; private final SimpleCallSettings getTraceSettings; private final PagedCallSettings @@ -143,6 +146,7 @@ public static InstantiatingChannelProvider.Builder defaultChannelProviderBuilder return InstantiatingChannelProvider.newBuilder() .setServiceAddress(DEFAULT_SERVICE_ADDRESS) .setPort(DEFAULT_SERVICE_PORT) + .setGeneratorHeader(DEFAULT_GENERATOR_NAME, DEFAULT_GENERATOR_VERSION) .setCredentialsProvider(defaultCredentialsProviderBuilder().build()); } diff --git a/google-cloud-trace/src/main/java/com/google/cloud/trace/spi/v1/package-info.java b/google-cloud-trace/src/main/java/com/google/cloud/trace/spi/v1/package-info.java index f0d36d650afe..162962740bce 100644 --- a/google-cloud-trace/src/main/java/com/google/cloud/trace/spi/v1/package-info.java +++ b/google-cloud-trace/src/main/java/com/google/cloud/trace/spi/v1/package-info.java @@ -1,5 +1,5 @@ /* - * Copyright 2016, Google Inc. All rights reserved. + * Copyright 2017, Google Inc. All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/google-cloud-trace/src/test/java/com/google/cloud/trace/spi/v1/MockTraceService.java b/google-cloud-trace/src/test/java/com/google/cloud/trace/spi/v1/MockTraceService.java index c480df752b3c..c95b79b16af0 100644 --- a/google-cloud-trace/src/test/java/com/google/cloud/trace/spi/v1/MockTraceService.java +++ b/google-cloud-trace/src/test/java/com/google/cloud/trace/spi/v1/MockTraceService.java @@ -1,5 +1,5 @@ /* - * Copyright 2016, Google Inc. All rights reserved. + * Copyright 2017, Google Inc. All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/google-cloud-trace/src/test/java/com/google/cloud/trace/spi/v1/MockTraceServiceImpl.java b/google-cloud-trace/src/test/java/com/google/cloud/trace/spi/v1/MockTraceServiceImpl.java index ba84b2e652ed..1871f21a1db8 100644 --- a/google-cloud-trace/src/test/java/com/google/cloud/trace/spi/v1/MockTraceServiceImpl.java +++ b/google-cloud-trace/src/test/java/com/google/cloud/trace/spi/v1/MockTraceServiceImpl.java @@ -1,5 +1,5 @@ /* - * Copyright 2016, Google Inc. All rights reserved. + * Copyright 2017, Google Inc. All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/google-cloud-trace/src/test/java/com/google/cloud/trace/spi/v1/TraceServiceClientTest.java b/google-cloud-trace/src/test/java/com/google/cloud/trace/spi/v1/TraceServiceClientTest.java index c09ed2b486ce..0874976eab4a 100644 --- a/google-cloud-trace/src/test/java/com/google/cloud/trace/spi/v1/TraceServiceClientTest.java +++ b/google-cloud-trace/src/test/java/com/google/cloud/trace/spi/v1/TraceServiceClientTest.java @@ -1,5 +1,5 @@ /* - * Copyright 2016, Google Inc. All rights reserved. + * Copyright 2017, Google Inc. All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/google-cloud-vision/src/main/java/com/google/cloud/vision/spi/v1/ImageAnnotatorClient.java b/google-cloud-vision/src/main/java/com/google/cloud/vision/spi/v1/ImageAnnotatorClient.java index 7ebe53e6ba62..f6fbd37e2785 100644 --- a/google-cloud-vision/src/main/java/com/google/cloud/vision/spi/v1/ImageAnnotatorClient.java +++ b/google-cloud-vision/src/main/java/com/google/cloud/vision/spi/v1/ImageAnnotatorClient.java @@ -1,5 +1,5 @@ /* - * Copyright 2016, Google Inc. All rights reserved. + * Copyright 2017, Google Inc. All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/google-cloud-vision/src/main/java/com/google/cloud/vision/spi/v1/ImageAnnotatorSettings.java b/google-cloud-vision/src/main/java/com/google/cloud/vision/spi/v1/ImageAnnotatorSettings.java index 9b1a8370d7c9..a1492e40da5d 100644 --- a/google-cloud-vision/src/main/java/com/google/cloud/vision/spi/v1/ImageAnnotatorSettings.java +++ b/google-cloud-vision/src/main/java/com/google/cloud/vision/spi/v1/ImageAnnotatorSettings.java @@ -1,5 +1,5 @@ /* - * Copyright 2016, Google Inc. All rights reserved. + * Copyright 2017, Google Inc. All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -77,6 +77,9 @@ public class ImageAnnotatorSettings extends ClientSettings { private static final ImmutableList DEFAULT_SERVICE_SCOPES = ImmutableList.builder().add("https://www.googleapis.com/auth/cloud-platform").build(); + private static final String DEFAULT_GENERATOR_NAME = "gapic"; + private static final String DEFAULT_GENERATOR_VERSION = "0.0.5"; + private final SimpleCallSettings batchAnnotateImagesSettings; @@ -116,6 +119,7 @@ public static InstantiatingChannelProvider.Builder defaultChannelProviderBuilder return InstantiatingChannelProvider.newBuilder() .setServiceAddress(DEFAULT_SERVICE_ADDRESS) .setPort(DEFAULT_SERVICE_PORT) + .setGeneratorHeader(DEFAULT_GENERATOR_NAME, DEFAULT_GENERATOR_VERSION) .setCredentialsProvider(defaultCredentialsProviderBuilder().build()); } diff --git a/google-cloud-vision/src/main/java/com/google/cloud/vision/spi/v1/package-info.java b/google-cloud-vision/src/main/java/com/google/cloud/vision/spi/v1/package-info.java index 1f5e67e60bbe..c866929a9e6f 100644 --- a/google-cloud-vision/src/main/java/com/google/cloud/vision/spi/v1/package-info.java +++ b/google-cloud-vision/src/main/java/com/google/cloud/vision/spi/v1/package-info.java @@ -1,5 +1,5 @@ /* - * Copyright 2016, Google Inc. All rights reserved. + * Copyright 2017, Google Inc. All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/google-cloud-vision/src/test/java/com/google/cloud/vision/spi/v1/ImageAnnotatorClientTest.java b/google-cloud-vision/src/test/java/com/google/cloud/vision/spi/v1/ImageAnnotatorClientTest.java index ac57ccc3abc0..f1129b74f967 100644 --- a/google-cloud-vision/src/test/java/com/google/cloud/vision/spi/v1/ImageAnnotatorClientTest.java +++ b/google-cloud-vision/src/test/java/com/google/cloud/vision/spi/v1/ImageAnnotatorClientTest.java @@ -1,5 +1,5 @@ /* - * Copyright 2016, Google Inc. All rights reserved. + * Copyright 2017, Google Inc. All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/google-cloud-vision/src/test/java/com/google/cloud/vision/spi/v1/MockImageAnnotator.java b/google-cloud-vision/src/test/java/com/google/cloud/vision/spi/v1/MockImageAnnotator.java index 3aae35e55ae9..2a2b59d54fc0 100644 --- a/google-cloud-vision/src/test/java/com/google/cloud/vision/spi/v1/MockImageAnnotator.java +++ b/google-cloud-vision/src/test/java/com/google/cloud/vision/spi/v1/MockImageAnnotator.java @@ -1,5 +1,5 @@ /* - * Copyright 2016, Google Inc. All rights reserved. + * Copyright 2017, Google Inc. All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/google-cloud-vision/src/test/java/com/google/cloud/vision/spi/v1/MockImageAnnotatorImpl.java b/google-cloud-vision/src/test/java/com/google/cloud/vision/spi/v1/MockImageAnnotatorImpl.java index 82428ce9ca86..2170d56f0cd7 100644 --- a/google-cloud-vision/src/test/java/com/google/cloud/vision/spi/v1/MockImageAnnotatorImpl.java +++ b/google-cloud-vision/src/test/java/com/google/cloud/vision/spi/v1/MockImageAnnotatorImpl.java @@ -1,5 +1,5 @@ /* - * Copyright 2016, Google Inc. All rights reserved. + * Copyright 2017, Google Inc. All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. From 365a0f7d295d89a162ee1ebda9b092c2255ad4fc Mon Sep 17 00:00:00 2001 From: Michael Darakananda Date: Tue, 28 Feb 2017 11:34:33 +1100 Subject: [PATCH 2/2] add test for Publisher and Subscriber snippets (#1658) --- .../pubsub/snippets/PublisherSnippets.java | 5 +- .../pubsub/snippets/SubscriberSnippets.java | 2 +- .../pubsub/snippets/ITPubSubSnippets.java | 88 +++++++++++++++++++ 3 files changed, 92 insertions(+), 3 deletions(-) diff --git a/google-cloud-examples/src/main/java/com/google/cloud/examples/pubsub/snippets/PublisherSnippets.java b/google-cloud-examples/src/main/java/com/google/cloud/examples/pubsub/snippets/PublisherSnippets.java index 7b8d5acf8fc8..28cb71f615ea 100644 --- a/google-cloud-examples/src/main/java/com/google/cloud/examples/pubsub/snippets/PublisherSnippets.java +++ b/google-cloud-examples/src/main/java/com/google/cloud/examples/pubsub/snippets/PublisherSnippets.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package com.google.cloud.examples.pubsub; +package com.google.cloud.examples.pubsub.snippets; import com.google.api.gax.core.RpcFuture; import com.google.api.gax.core.RpcFutureCallback; @@ -35,7 +35,7 @@ public PublisherSnippets(Publisher publisher) { */ // [TARGET publish(PubsubMessage)] // [VARIABLE "my_message"] - public void publish(String message) { + public RpcFuture publish(String message) { // [START publish] ByteString data = ByteString.copyFromUtf8(message); PubsubMessage pubsubMessage = PubsubMessage.newBuilder().setData(data).build(); @@ -50,6 +50,7 @@ public void onFailure(Throwable t) { } }); // [END publish] + return messageIdFuture; } /** diff --git a/google-cloud-examples/src/main/java/com/google/cloud/examples/pubsub/snippets/SubscriberSnippets.java b/google-cloud-examples/src/main/java/com/google/cloud/examples/pubsub/snippets/SubscriberSnippets.java index 13bc5a6c6cdd..8ca753fc266e 100644 --- a/google-cloud-examples/src/main/java/com/google/cloud/examples/pubsub/snippets/SubscriberSnippets.java +++ b/google-cloud-examples/src/main/java/com/google/cloud/examples/pubsub/snippets/SubscriberSnippets.java @@ -50,7 +50,7 @@ public SubscriberSnippets( * Example of receiving a specific number of messages. */ // [TARGET startAsync()] - public void startAsync() throws Exception { + public void startAndWait() throws Exception { // [START startAsync] Subscriber subscriber = Subscriber.newBuilder(subscription, receiver).build(); subscriber.addListener(new Subscriber.SubscriberListener() { diff --git a/google-cloud-examples/src/test/java/com/google/cloud/examples/pubsub/snippets/ITPubSubSnippets.java b/google-cloud-examples/src/test/java/com/google/cloud/examples/pubsub/snippets/ITPubSubSnippets.java index 1d69d94aaa18..1bf5a2bed2f9 100644 --- a/google-cloud-examples/src/test/java/com/google/cloud/examples/pubsub/snippets/ITPubSubSnippets.java +++ b/google-cloud-examples/src/test/java/com/google/cloud/examples/pubsub/snippets/ITPubSubSnippets.java @@ -21,6 +21,8 @@ import static org.junit.Assert.assertNull; import static org.junit.Assert.assertTrue; +import com.google.api.gax.core.RpcFutureCallback; +import com.google.api.gax.core.SettableRpcFuture; import com.google.cloud.Identity; import com.google.cloud.Page; import com.google.cloud.Policy; @@ -33,14 +35,25 @@ import com.google.cloud.pubsub.deprecated.SubscriptionInfo; import com.google.cloud.pubsub.deprecated.Topic; import com.google.cloud.pubsub.deprecated.TopicInfo; +import com.google.cloud.pubsub.spi.v1.Publisher; +import com.google.cloud.pubsub.spi.v1.PublisherClient; +import com.google.cloud.pubsub.spi.v1.SubscriberClient; import com.google.common.collect.Iterators; import com.google.common.collect.Sets; +import com.google.common.util.concurrent.MoreExecutors; +import com.google.pubsub.v1.PubsubMessage; +import com.google.pubsub.v1.PushConfig; +import com.google.pubsub.v1.SubscriptionName; +import com.google.pubsub.v1.TopicName; import java.util.HashSet; import java.util.Iterator; import java.util.List; import java.util.Set; import java.util.UUID; +import java.util.concurrent.ArrayBlockingQueue; +import java.util.concurrent.BlockingQueue; import java.util.concurrent.ExecutionException; +import java.util.concurrent.TimeUnit; import org.junit.AfterClass; import org.junit.BeforeClass; import org.junit.Rule; @@ -264,4 +277,79 @@ public void testTopicPolicyAsync() throws ExecutionException, InterruptedExcepti topic.delete(); subscription.delete(); } + + @Test + public void testPublisherSubscriber() throws Exception { + TopicName topicName = + TopicName.create(pubsub.getOptions().getProjectId(), formatForTest("test-topic")); + SubscriptionName subscriptionName = + SubscriptionName.create( + pubsub.getOptions().getProjectId(), formatForTest("test-subscription")); + try (PublisherClient publisherClient = PublisherClient.create(); + SubscriberClient subscriberClient = SubscriberClient.create()) { + publisherClient.createTopic(topicName); + subscriberClient.createSubscription( + subscriptionName, topicName, PushConfig.getDefaultInstance(), 0); + + testPublisherSubscriberHelper(topicName, subscriptionName); + + subscriberClient.deleteSubscription(subscriptionName); + publisherClient.deleteTopic(topicName); + } + } + + private void testPublisherSubscriberHelper( + TopicName topicName, SubscriptionName subscriptionName) throws Exception { + String messageToPublish = "my-message"; + + Publisher publisher = null; + try { + publisher = Publisher.newBuilder(topicName).build(); + PublisherSnippets snippets = new PublisherSnippets(publisher); + final SettableRpcFuture done = new SettableRpcFuture<>(); + snippets + .publish(messageToPublish) + .addCallback( + new RpcFutureCallback() { + public void onSuccess(String messageId) { + done.set(null); + } + + public void onFailure(Throwable t) { + done.setException(t); + } + }); + done.get(); + } finally { + if (publisher != null) { + publisher.shutdown(); + } + } + + final BlockingQueue queue = new ArrayBlockingQueue<>(1); + final SettableRpcFuture done = new SettableRpcFuture<>(); + final SettableRpcFuture received = new SettableRpcFuture<>(); + SubscriberSnippets snippets = + new SubscriberSnippets( + subscriptionName, + new MessageReceiverSnippets(queue).messageReceiver(), + done, + MoreExecutors.directExecutor()); + new Thread(new Runnable() { + @Override + public void run() { + try { + received.set(queue.poll(10, TimeUnit.MINUTES)); + } catch (InterruptedException e) { + received.set(null); + } + done.set(null); // signal the subscriber to clean up + } + }).start(); + snippets.startAndWait(); // blocks until done is set + + PubsubMessage message = received.get(); + assertNotNull(message); + assertEquals(message.getData().toStringUtf8(), messageToPublish); + } }