Skip to content
This repository was archived by the owner on Sep 9, 2023. It is now read-only.

Commit c15a776

Browse files
fix: 'requests' field of CreateUserLink, UpdateUserLink, DeleteUserLink methods is now required (#96)
docs: minor documentation updates PiperOrigin-RevId: 340922897 Source-Author: Google APIs <noreply@google.com> Source-Date: Thu Nov 5 13:56:13 2020 -0800 Source-Repo: googleapis/googleapis Source-Sha: b365fff50d84fbe03ea16d02cc73d72fa1fc864d Source-Link: googleapis/googleapis@b365fff
1 parent 740be68 commit c15a776

19 files changed

Lines changed: 1105 additions & 796 deletions

google-analytics-admin/src/main/java/com/google/analytics/admin/v1alpha/AnalyticsAdminServiceClient.java

Lines changed: 26 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1657,9 +1657,11 @@ public final UnaryCallable<CreateUserLinkRequest, UserLink> createUserLinkCallab
16571657
*
16581658
* <pre><code>
16591659
* try (AnalyticsAdminServiceClient analyticsAdminServiceClient = AnalyticsAdminServiceClient.create()) {
1660-
* String parent = "";
1660+
* AccountName parent = AccountName.of("[ACCOUNT]");
1661+
* List&lt;CreateUserLinkRequest&gt; requests = new ArrayList&lt;&gt;();
16611662
* BatchCreateUserLinksRequest request = BatchCreateUserLinksRequest.newBuilder()
1662-
* .setParent(parent)
1663+
* .setParent(parent.toString())
1664+
* .addAllRequests(requests)
16631665
* .build();
16641666
* BatchCreateUserLinksResponse response = analyticsAdminServiceClient.batchCreateUserLinks(request);
16651667
* }
@@ -1684,9 +1686,11 @@ public final BatchCreateUserLinksResponse batchCreateUserLinks(
16841686
*
16851687
* <pre><code>
16861688
* try (AnalyticsAdminServiceClient analyticsAdminServiceClient = AnalyticsAdminServiceClient.create()) {
1687-
* String parent = "";
1689+
* AccountName parent = AccountName.of("[ACCOUNT]");
1690+
* List&lt;CreateUserLinkRequest&gt; requests = new ArrayList&lt;&gt;();
16881691
* BatchCreateUserLinksRequest request = BatchCreateUserLinksRequest.newBuilder()
1689-
* .setParent(parent)
1692+
* .setParent(parent.toString())
1693+
* .addAllRequests(requests)
16901694
* .build();
16911695
* ApiFuture&lt;BatchCreateUserLinksResponse&gt; future = analyticsAdminServiceClient.batchCreateUserLinksCallable().futureCall(request);
16921696
* // Do something
@@ -1774,9 +1778,11 @@ public final UnaryCallable<UpdateUserLinkRequest, UserLink> updateUserLinkCallab
17741778
*
17751779
* <pre><code>
17761780
* try (AnalyticsAdminServiceClient analyticsAdminServiceClient = AnalyticsAdminServiceClient.create()) {
1777-
* String parent = "";
1781+
* AccountName parent = AccountName.of("[ACCOUNT]");
1782+
* List&lt;UpdateUserLinkRequest&gt; requests = new ArrayList&lt;&gt;();
17781783
* BatchUpdateUserLinksRequest request = BatchUpdateUserLinksRequest.newBuilder()
1779-
* .setParent(parent)
1784+
* .setParent(parent.toString())
1785+
* .addAllRequests(requests)
17801786
* .build();
17811787
* BatchUpdateUserLinksResponse response = analyticsAdminServiceClient.batchUpdateUserLinks(request);
17821788
* }
@@ -1798,9 +1804,11 @@ public final BatchUpdateUserLinksResponse batchUpdateUserLinks(
17981804
*
17991805
* <pre><code>
18001806
* try (AnalyticsAdminServiceClient analyticsAdminServiceClient = AnalyticsAdminServiceClient.create()) {
1801-
* String parent = "";
1807+
* AccountName parent = AccountName.of("[ACCOUNT]");
1808+
* List&lt;UpdateUserLinkRequest&gt; requests = new ArrayList&lt;&gt;();
18021809
* BatchUpdateUserLinksRequest request = BatchUpdateUserLinksRequest.newBuilder()
1803-
* .setParent(parent)
1810+
* .setParent(parent.toString())
1811+
* .addAllRequests(requests)
18041812
* .build();
18051813
* ApiFuture&lt;BatchUpdateUserLinksResponse&gt; future = analyticsAdminServiceClient.batchUpdateUserLinksCallable().futureCall(request);
18061814
* // Do something
@@ -1909,9 +1917,11 @@ public final UnaryCallable<DeleteUserLinkRequest, Empty> deleteUserLinkCallable(
19091917
*
19101918
* <pre><code>
19111919
* try (AnalyticsAdminServiceClient analyticsAdminServiceClient = AnalyticsAdminServiceClient.create()) {
1912-
* String parent = "";
1920+
* AccountName parent = AccountName.of("[ACCOUNT]");
1921+
* List&lt;DeleteUserLinkRequest&gt; requests = new ArrayList&lt;&gt;();
19131922
* BatchDeleteUserLinksRequest request = BatchDeleteUserLinksRequest.newBuilder()
1914-
* .setParent(parent)
1923+
* .setParent(parent.toString())
1924+
* .addAllRequests(requests)
19151925
* .build();
19161926
* analyticsAdminServiceClient.batchDeleteUserLinks(request);
19171927
* }
@@ -1932,9 +1942,11 @@ public final void batchDeleteUserLinks(BatchDeleteUserLinksRequest request) {
19321942
*
19331943
* <pre><code>
19341944
* try (AnalyticsAdminServiceClient analyticsAdminServiceClient = AnalyticsAdminServiceClient.create()) {
1935-
* String parent = "";
1945+
* AccountName parent = AccountName.of("[ACCOUNT]");
1946+
* List&lt;DeleteUserLinkRequest&gt; requests = new ArrayList&lt;&gt;();
19361947
* BatchDeleteUserLinksRequest request = BatchDeleteUserLinksRequest.newBuilder()
1937-
* .setParent(parent)
1948+
* .setParent(parent.toString())
1949+
* .addAllRequests(requests)
19381950
* .build();
19391951
* ApiFuture&lt;Void&gt; future = analyticsAdminServiceClient.batchDeleteUserLinksCallable().futureCall(request);
19401952
* // Do something
@@ -3570,7 +3582,7 @@ public final ListAndroidAppDataStreamsPagedResponse listAndroidAppDataStreams(
35703582
* </code></pre>
35713583
*
35723584
* @param name Required. The name of the settings to lookup. Format:
3573-
* properties/{property_id}/webDataStreams/{stream_id}/enhancedMeasurementSettings Example:
3585+
* <p>properties/{property_id}/webDataStreams/{stream_id}/enhancedMeasurementSettings Example:
35743586
* "properties/1000/webDataStreams/2000/enhancedMeasurementSettings"
35753587
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
35763588
*/
@@ -3598,7 +3610,7 @@ public final EnhancedMeasurementSettings getEnhancedMeasurementSettings(
35983610
* </code></pre>
35993611
*
36003612
* @param name Required. The name of the settings to lookup. Format:
3601-
* properties/{property_id}/webDataStreams/{stream_id}/enhancedMeasurementSettings Example:
3613+
* <p>properties/{property_id}/webDataStreams/{stream_id}/enhancedMeasurementSettings Example:
36023614
* "properties/1000/webDataStreams/2000/enhancedMeasurementSettings"
36033615
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
36043616
*/

google-analytics-admin/src/test/java/com/google/analytics/admin/v1alpha/AnalyticsAdminServiceClientTest.java

Lines changed: 42 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -848,9 +848,13 @@ public void batchCreateUserLinksTest() {
848848
BatchCreateUserLinksResponse.newBuilder().build();
849849
mockAnalyticsAdminService.addResponse(expectedResponse);
850850

851-
String parent = "parent-995424086";
851+
AccountName parent = AccountName.of("[ACCOUNT]");
852+
List<CreateUserLinkRequest> requests = new ArrayList<>();
852853
BatchCreateUserLinksRequest request =
853-
BatchCreateUserLinksRequest.newBuilder().setParent(parent).build();
854+
BatchCreateUserLinksRequest.newBuilder()
855+
.setParent(parent.toString())
856+
.addAllRequests(requests)
857+
.build();
854858

855859
BatchCreateUserLinksResponse actualResponse = client.batchCreateUserLinks(request);
856860
Assert.assertEquals(expectedResponse, actualResponse);
@@ -859,7 +863,8 @@ public void batchCreateUserLinksTest() {
859863
Assert.assertEquals(1, actualRequests.size());
860864
BatchCreateUserLinksRequest actualRequest = (BatchCreateUserLinksRequest) actualRequests.get(0);
861865

862-
Assert.assertEquals(parent, actualRequest.getParent());
866+
Assert.assertEquals(parent, AccountName.parse(actualRequest.getParent()));
867+
Assert.assertEquals(requests, actualRequest.getRequestsList());
863868
Assert.assertTrue(
864869
channelProvider.isHeaderSent(
865870
ApiClientHeaderProvider.getDefaultApiClientHeaderKey(),
@@ -873,9 +878,13 @@ public void batchCreateUserLinksExceptionTest() throws Exception {
873878
mockAnalyticsAdminService.addException(exception);
874879

875880
try {
876-
String parent = "parent-995424086";
881+
AccountName parent = AccountName.of("[ACCOUNT]");
882+
List<CreateUserLinkRequest> requests = new ArrayList<>();
877883
BatchCreateUserLinksRequest request =
878-
BatchCreateUserLinksRequest.newBuilder().setParent(parent).build();
884+
BatchCreateUserLinksRequest.newBuilder()
885+
.setParent(parent.toString())
886+
.addAllRequests(requests)
887+
.build();
879888

880889
client.batchCreateUserLinks(request);
881890
Assert.fail("No exception raised");
@@ -932,9 +941,13 @@ public void batchUpdateUserLinksTest() {
932941
BatchUpdateUserLinksResponse.newBuilder().build();
933942
mockAnalyticsAdminService.addResponse(expectedResponse);
934943

935-
String parent = "parent-995424086";
944+
AccountName parent = AccountName.of("[ACCOUNT]");
945+
List<UpdateUserLinkRequest> requests = new ArrayList<>();
936946
BatchUpdateUserLinksRequest request =
937-
BatchUpdateUserLinksRequest.newBuilder().setParent(parent).build();
947+
BatchUpdateUserLinksRequest.newBuilder()
948+
.setParent(parent.toString())
949+
.addAllRequests(requests)
950+
.build();
938951

939952
BatchUpdateUserLinksResponse actualResponse = client.batchUpdateUserLinks(request);
940953
Assert.assertEquals(expectedResponse, actualResponse);
@@ -943,7 +956,8 @@ public void batchUpdateUserLinksTest() {
943956
Assert.assertEquals(1, actualRequests.size());
944957
BatchUpdateUserLinksRequest actualRequest = (BatchUpdateUserLinksRequest) actualRequests.get(0);
945958

946-
Assert.assertEquals(parent, actualRequest.getParent());
959+
Assert.assertEquals(parent, AccountName.parse(actualRequest.getParent()));
960+
Assert.assertEquals(requests, actualRequest.getRequestsList());
947961
Assert.assertTrue(
948962
channelProvider.isHeaderSent(
949963
ApiClientHeaderProvider.getDefaultApiClientHeaderKey(),
@@ -957,9 +971,13 @@ public void batchUpdateUserLinksExceptionTest() throws Exception {
957971
mockAnalyticsAdminService.addException(exception);
958972

959973
try {
960-
String parent = "parent-995424086";
974+
AccountName parent = AccountName.of("[ACCOUNT]");
975+
List<UpdateUserLinkRequest> requests = new ArrayList<>();
961976
BatchUpdateUserLinksRequest request =
962-
BatchUpdateUserLinksRequest.newBuilder().setParent(parent).build();
977+
BatchUpdateUserLinksRequest.newBuilder()
978+
.setParent(parent.toString())
979+
.addAllRequests(requests)
980+
.build();
963981

964982
client.batchUpdateUserLinks(request);
965983
Assert.fail("No exception raised");
@@ -1011,17 +1029,22 @@ public void batchDeleteUserLinksTest() {
10111029
Empty expectedResponse = Empty.newBuilder().build();
10121030
mockAnalyticsAdminService.addResponse(expectedResponse);
10131031

1014-
String parent = "parent-995424086";
1032+
AccountName parent = AccountName.of("[ACCOUNT]");
1033+
List<DeleteUserLinkRequest> requests = new ArrayList<>();
10151034
BatchDeleteUserLinksRequest request =
1016-
BatchDeleteUserLinksRequest.newBuilder().setParent(parent).build();
1035+
BatchDeleteUserLinksRequest.newBuilder()
1036+
.setParent(parent.toString())
1037+
.addAllRequests(requests)
1038+
.build();
10171039

10181040
client.batchDeleteUserLinks(request);
10191041

10201042
List<AbstractMessage> actualRequests = mockAnalyticsAdminService.getRequests();
10211043
Assert.assertEquals(1, actualRequests.size());
10221044
BatchDeleteUserLinksRequest actualRequest = (BatchDeleteUserLinksRequest) actualRequests.get(0);
10231045

1024-
Assert.assertEquals(parent, actualRequest.getParent());
1046+
Assert.assertEquals(parent, AccountName.parse(actualRequest.getParent()));
1047+
Assert.assertEquals(requests, actualRequest.getRequestsList());
10251048
Assert.assertTrue(
10261049
channelProvider.isHeaderSent(
10271050
ApiClientHeaderProvider.getDefaultApiClientHeaderKey(),
@@ -1035,9 +1058,13 @@ public void batchDeleteUserLinksExceptionTest() throws Exception {
10351058
mockAnalyticsAdminService.addException(exception);
10361059

10371060
try {
1038-
String parent = "parent-995424086";
1061+
AccountName parent = AccountName.of("[ACCOUNT]");
1062+
List<DeleteUserLinkRequest> requests = new ArrayList<>();
10391063
BatchDeleteUserLinksRequest request =
1040-
BatchDeleteUserLinksRequest.newBuilder().setParent(parent).build();
1064+
BatchDeleteUserLinksRequest.newBuilder()
1065+
.setParent(parent.toString())
1066+
.addAllRequests(requests)
1067+
.build();
10411068

10421069
client.batchDeleteUserLinks(request);
10431070
Assert.fail("No exception raised");

proto-google-analytics-admin-v1alpha/src/main/java/com/google/analytics/admin/v1alpha/Account.java

Lines changed: 21 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -369,7 +369,9 @@ public com.google.protobuf.ByteString getDisplayNameBytes() {
369369
*
370370
* <pre>
371371
* Country of business. Must be a non-deprecated code for a UN M.49 region.
372-
* https://unicode.org/cldr/charts/latest/supplemental/territory_containment_un_m_49.html
372+
* https:
373+
* //unicode.org/cldr/charts/latest/supplem
374+
* // ental/territory_containment_un_m_49.html
373375
* </pre>
374376
*
375377
* <code>string country_code = 5;</code>
@@ -393,7 +395,9 @@ public java.lang.String getCountryCode() {
393395
*
394396
* <pre>
395397
* Country of business. Must be a non-deprecated code for a UN M.49 region.
396-
* https://unicode.org/cldr/charts/latest/supplemental/territory_containment_un_m_49.html
398+
* https:
399+
* //unicode.org/cldr/charts/latest/supplem
400+
* // ental/territory_containment_un_m_49.html
397401
* </pre>
398402
*
399403
* <code>string country_code = 5;</code>
@@ -1481,7 +1485,9 @@ public Builder setDisplayNameBytes(com.google.protobuf.ByteString value) {
14811485
*
14821486
* <pre>
14831487
* Country of business. Must be a non-deprecated code for a UN M.49 region.
1484-
* https://unicode.org/cldr/charts/latest/supplemental/territory_containment_un_m_49.html
1488+
* https:
1489+
* //unicode.org/cldr/charts/latest/supplem
1490+
* // ental/territory_containment_un_m_49.html
14851491
* </pre>
14861492
*
14871493
* <code>string country_code = 5;</code>
@@ -1504,7 +1510,9 @@ public java.lang.String getCountryCode() {
15041510
*
15051511
* <pre>
15061512
* Country of business. Must be a non-deprecated code for a UN M.49 region.
1507-
* https://unicode.org/cldr/charts/latest/supplemental/territory_containment_un_m_49.html
1513+
* https:
1514+
* //unicode.org/cldr/charts/latest/supplem
1515+
* // ental/territory_containment_un_m_49.html
15081516
* </pre>
15091517
*
15101518
* <code>string country_code = 5;</code>
@@ -1527,7 +1535,9 @@ public com.google.protobuf.ByteString getCountryCodeBytes() {
15271535
*
15281536
* <pre>
15291537
* Country of business. Must be a non-deprecated code for a UN M.49 region.
1530-
* https://unicode.org/cldr/charts/latest/supplemental/territory_containment_un_m_49.html
1538+
* https:
1539+
* //unicode.org/cldr/charts/latest/supplem
1540+
* // ental/territory_containment_un_m_49.html
15311541
* </pre>
15321542
*
15331543
* <code>string country_code = 5;</code>
@@ -1549,7 +1559,9 @@ public Builder setCountryCode(java.lang.String value) {
15491559
*
15501560
* <pre>
15511561
* Country of business. Must be a non-deprecated code for a UN M.49 region.
1552-
* https://unicode.org/cldr/charts/latest/supplemental/territory_containment_un_m_49.html
1562+
* https:
1563+
* //unicode.org/cldr/charts/latest/supplem
1564+
* // ental/territory_containment_un_m_49.html
15531565
* </pre>
15541566
*
15551567
* <code>string country_code = 5;</code>
@@ -1567,7 +1579,9 @@ public Builder clearCountryCode() {
15671579
*
15681580
* <pre>
15691581
* Country of business. Must be a non-deprecated code for a UN M.49 region.
1570-
* https://unicode.org/cldr/charts/latest/supplemental/territory_containment_un_m_49.html
1582+
* https:
1583+
* //unicode.org/cldr/charts/latest/supplem
1584+
* // ental/territory_containment_un_m_49.html
15711585
* </pre>
15721586
*
15731587
* <code>string country_code = 5;</code>

proto-google-analytics-admin-v1alpha/src/main/java/com/google/analytics/admin/v1alpha/AccountOrBuilder.java

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,9 @@ public interface AccountOrBuilder
158158
*
159159
* <pre>
160160
* Country of business. Must be a non-deprecated code for a UN M.49 region.
161-
* https://unicode.org/cldr/charts/latest/supplemental/territory_containment_un_m_49.html
161+
* https:
162+
* //unicode.org/cldr/charts/latest/supplem
163+
* // ental/territory_containment_un_m_49.html
162164
* </pre>
163165
*
164166
* <code>string country_code = 5;</code>
@@ -171,7 +173,9 @@ public interface AccountOrBuilder
171173
*
172174
* <pre>
173175
* Country of business. Must be a non-deprecated code for a UN M.49 region.
174-
* https://unicode.org/cldr/charts/latest/supplemental/territory_containment_un_m_49.html
176+
* https:
177+
* //unicode.org/cldr/charts/latest/supplem
178+
* // ental/territory_containment_un_m_49.html
175179
* </pre>
176180
*
177181
* <code>string country_code = 5;</code>

0 commit comments

Comments
 (0)