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

fix: 'requests' field of CreateUserLink, UpdateUserLink, DeleteUserLink methods is now required docs: minor documentation updates #96

Merged
merged 1 commit into from
Nov 5, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -1657,9 +1657,11 @@ public final UnaryCallable<CreateUserLinkRequest, UserLink> createUserLinkCallab
*
* <pre><code>
* try (AnalyticsAdminServiceClient analyticsAdminServiceClient = AnalyticsAdminServiceClient.create()) {
* String parent = "";
* AccountName parent = AccountName.of("[ACCOUNT]");
* List&lt;CreateUserLinkRequest&gt; requests = new ArrayList&lt;&gt;();
* BatchCreateUserLinksRequest request = BatchCreateUserLinksRequest.newBuilder()
* .setParent(parent)
* .setParent(parent.toString())
* .addAllRequests(requests)
* .build();
* BatchCreateUserLinksResponse response = analyticsAdminServiceClient.batchCreateUserLinks(request);
* }
Expand All @@ -1684,9 +1686,11 @@ public final BatchCreateUserLinksResponse batchCreateUserLinks(
*
* <pre><code>
* try (AnalyticsAdminServiceClient analyticsAdminServiceClient = AnalyticsAdminServiceClient.create()) {
* String parent = "";
* AccountName parent = AccountName.of("[ACCOUNT]");
* List&lt;CreateUserLinkRequest&gt; requests = new ArrayList&lt;&gt;();
* BatchCreateUserLinksRequest request = BatchCreateUserLinksRequest.newBuilder()
* .setParent(parent)
* .setParent(parent.toString())
* .addAllRequests(requests)
* .build();
* ApiFuture&lt;BatchCreateUserLinksResponse&gt; future = analyticsAdminServiceClient.batchCreateUserLinksCallable().futureCall(request);
* // Do something
Expand Down Expand Up @@ -1774,9 +1778,11 @@ public final UnaryCallable<UpdateUserLinkRequest, UserLink> updateUserLinkCallab
*
* <pre><code>
* try (AnalyticsAdminServiceClient analyticsAdminServiceClient = AnalyticsAdminServiceClient.create()) {
* String parent = "";
* AccountName parent = AccountName.of("[ACCOUNT]");
* List&lt;UpdateUserLinkRequest&gt; requests = new ArrayList&lt;&gt;();
* BatchUpdateUserLinksRequest request = BatchUpdateUserLinksRequest.newBuilder()
* .setParent(parent)
* .setParent(parent.toString())
* .addAllRequests(requests)
* .build();
* BatchUpdateUserLinksResponse response = analyticsAdminServiceClient.batchUpdateUserLinks(request);
* }
Expand All @@ -1798,9 +1804,11 @@ public final BatchUpdateUserLinksResponse batchUpdateUserLinks(
*
* <pre><code>
* try (AnalyticsAdminServiceClient analyticsAdminServiceClient = AnalyticsAdminServiceClient.create()) {
* String parent = "";
* AccountName parent = AccountName.of("[ACCOUNT]");
* List&lt;UpdateUserLinkRequest&gt; requests = new ArrayList&lt;&gt;();
* BatchUpdateUserLinksRequest request = BatchUpdateUserLinksRequest.newBuilder()
* .setParent(parent)
* .setParent(parent.toString())
* .addAllRequests(requests)
* .build();
* ApiFuture&lt;BatchUpdateUserLinksResponse&gt; future = analyticsAdminServiceClient.batchUpdateUserLinksCallable().futureCall(request);
* // Do something
Expand Down Expand Up @@ -1909,9 +1917,11 @@ public final UnaryCallable<DeleteUserLinkRequest, Empty> deleteUserLinkCallable(
*
* <pre><code>
* try (AnalyticsAdminServiceClient analyticsAdminServiceClient = AnalyticsAdminServiceClient.create()) {
* String parent = "";
* AccountName parent = AccountName.of("[ACCOUNT]");
* List&lt;DeleteUserLinkRequest&gt; requests = new ArrayList&lt;&gt;();
* BatchDeleteUserLinksRequest request = BatchDeleteUserLinksRequest.newBuilder()
* .setParent(parent)
* .setParent(parent.toString())
* .addAllRequests(requests)
* .build();
* analyticsAdminServiceClient.batchDeleteUserLinks(request);
* }
Expand All @@ -1932,9 +1942,11 @@ public final void batchDeleteUserLinks(BatchDeleteUserLinksRequest request) {
*
* <pre><code>
* try (AnalyticsAdminServiceClient analyticsAdminServiceClient = AnalyticsAdminServiceClient.create()) {
* String parent = "";
* AccountName parent = AccountName.of("[ACCOUNT]");
* List&lt;DeleteUserLinkRequest&gt; requests = new ArrayList&lt;&gt;();
* BatchDeleteUserLinksRequest request = BatchDeleteUserLinksRequest.newBuilder()
* .setParent(parent)
* .setParent(parent.toString())
* .addAllRequests(requests)
* .build();
* ApiFuture&lt;Void&gt; future = analyticsAdminServiceClient.batchDeleteUserLinksCallable().futureCall(request);
* // Do something
Expand Down Expand Up @@ -3570,7 +3582,7 @@ public final ListAndroidAppDataStreamsPagedResponse listAndroidAppDataStreams(
* </code></pre>
*
* @param name Required. The name of the settings to lookup. Format:
* properties/{property_id}/webDataStreams/{stream_id}/enhancedMeasurementSettings Example:
* <p>properties/{property_id}/webDataStreams/{stream_id}/enhancedMeasurementSettings Example:
* "properties/1000/webDataStreams/2000/enhancedMeasurementSettings"
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
*/
Expand Down Expand Up @@ -3598,7 +3610,7 @@ public final EnhancedMeasurementSettings getEnhancedMeasurementSettings(
* </code></pre>
*
* @param name Required. The name of the settings to lookup. Format:
* properties/{property_id}/webDataStreams/{stream_id}/enhancedMeasurementSettings Example:
* <p>properties/{property_id}/webDataStreams/{stream_id}/enhancedMeasurementSettings Example:
* "properties/1000/webDataStreams/2000/enhancedMeasurementSettings"
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -848,9 +848,13 @@ public void batchCreateUserLinksTest() {
BatchCreateUserLinksResponse.newBuilder().build();
mockAnalyticsAdminService.addResponse(expectedResponse);

String parent = "parent-995424086";
AccountName parent = AccountName.of("[ACCOUNT]");
List<CreateUserLinkRequest> requests = new ArrayList<>();
BatchCreateUserLinksRequest request =
BatchCreateUserLinksRequest.newBuilder().setParent(parent).build();
BatchCreateUserLinksRequest.newBuilder()
.setParent(parent.toString())
.addAllRequests(requests)
.build();

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

Assert.assertEquals(parent, actualRequest.getParent());
Assert.assertEquals(parent, AccountName.parse(actualRequest.getParent()));
Assert.assertEquals(requests, actualRequest.getRequestsList());
Assert.assertTrue(
channelProvider.isHeaderSent(
ApiClientHeaderProvider.getDefaultApiClientHeaderKey(),
Expand All @@ -873,9 +878,13 @@ public void batchCreateUserLinksExceptionTest() throws Exception {
mockAnalyticsAdminService.addException(exception);

try {
String parent = "parent-995424086";
AccountName parent = AccountName.of("[ACCOUNT]");
List<CreateUserLinkRequest> requests = new ArrayList<>();
BatchCreateUserLinksRequest request =
BatchCreateUserLinksRequest.newBuilder().setParent(parent).build();
BatchCreateUserLinksRequest.newBuilder()
.setParent(parent.toString())
.addAllRequests(requests)
.build();

client.batchCreateUserLinks(request);
Assert.fail("No exception raised");
Expand Down Expand Up @@ -932,9 +941,13 @@ public void batchUpdateUserLinksTest() {
BatchUpdateUserLinksResponse.newBuilder().build();
mockAnalyticsAdminService.addResponse(expectedResponse);

String parent = "parent-995424086";
AccountName parent = AccountName.of("[ACCOUNT]");
List<UpdateUserLinkRequest> requests = new ArrayList<>();
BatchUpdateUserLinksRequest request =
BatchUpdateUserLinksRequest.newBuilder().setParent(parent).build();
BatchUpdateUserLinksRequest.newBuilder()
.setParent(parent.toString())
.addAllRequests(requests)
.build();

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

Assert.assertEquals(parent, actualRequest.getParent());
Assert.assertEquals(parent, AccountName.parse(actualRequest.getParent()));
Assert.assertEquals(requests, actualRequest.getRequestsList());
Assert.assertTrue(
channelProvider.isHeaderSent(
ApiClientHeaderProvider.getDefaultApiClientHeaderKey(),
Expand All @@ -957,9 +971,13 @@ public void batchUpdateUserLinksExceptionTest() throws Exception {
mockAnalyticsAdminService.addException(exception);

try {
String parent = "parent-995424086";
AccountName parent = AccountName.of("[ACCOUNT]");
List<UpdateUserLinkRequest> requests = new ArrayList<>();
BatchUpdateUserLinksRequest request =
BatchUpdateUserLinksRequest.newBuilder().setParent(parent).build();
BatchUpdateUserLinksRequest.newBuilder()
.setParent(parent.toString())
.addAllRequests(requests)
.build();

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

String parent = "parent-995424086";
AccountName parent = AccountName.of("[ACCOUNT]");
List<DeleteUserLinkRequest> requests = new ArrayList<>();
BatchDeleteUserLinksRequest request =
BatchDeleteUserLinksRequest.newBuilder().setParent(parent).build();
BatchDeleteUserLinksRequest.newBuilder()
.setParent(parent.toString())
.addAllRequests(requests)
.build();

client.batchDeleteUserLinks(request);

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

Assert.assertEquals(parent, actualRequest.getParent());
Assert.assertEquals(parent, AccountName.parse(actualRequest.getParent()));
Assert.assertEquals(requests, actualRequest.getRequestsList());
Assert.assertTrue(
channelProvider.isHeaderSent(
ApiClientHeaderProvider.getDefaultApiClientHeaderKey(),
Expand All @@ -1035,9 +1058,13 @@ public void batchDeleteUserLinksExceptionTest() throws Exception {
mockAnalyticsAdminService.addException(exception);

try {
String parent = "parent-995424086";
AccountName parent = AccountName.of("[ACCOUNT]");
List<DeleteUserLinkRequest> requests = new ArrayList<>();
BatchDeleteUserLinksRequest request =
BatchDeleteUserLinksRequest.newBuilder().setParent(parent).build();
BatchDeleteUserLinksRequest.newBuilder()
.setParent(parent.toString())
.addAllRequests(requests)
.build();

client.batchDeleteUserLinks(request);
Assert.fail("No exception raised");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -369,7 +369,9 @@ public com.google.protobuf.ByteString getDisplayNameBytes() {
*
* <pre>
* Country of business. Must be a non-deprecated code for a UN M.49 region.
* https://unicode.org/cldr/charts/latest/supplemental/territory_containment_un_m_49.html
* https:
* //unicode.org/cldr/charts/latest/supplem
* // ental/territory_containment_un_m_49.html
* </pre>
*
* <code>string country_code = 5;</code>
Expand All @@ -393,7 +395,9 @@ public java.lang.String getCountryCode() {
*
* <pre>
* Country of business. Must be a non-deprecated code for a UN M.49 region.
* https://unicode.org/cldr/charts/latest/supplemental/territory_containment_un_m_49.html
* https:
* //unicode.org/cldr/charts/latest/supplem
* // ental/territory_containment_un_m_49.html
* </pre>
*
* <code>string country_code = 5;</code>
Expand Down Expand Up @@ -1481,7 +1485,9 @@ public Builder setDisplayNameBytes(com.google.protobuf.ByteString value) {
*
* <pre>
* Country of business. Must be a non-deprecated code for a UN M.49 region.
* https://unicode.org/cldr/charts/latest/supplemental/territory_containment_un_m_49.html
* https:
* //unicode.org/cldr/charts/latest/supplem
* // ental/territory_containment_un_m_49.html
* </pre>
*
* <code>string country_code = 5;</code>
Expand All @@ -1504,7 +1510,9 @@ public java.lang.String getCountryCode() {
*
* <pre>
* Country of business. Must be a non-deprecated code for a UN M.49 region.
* https://unicode.org/cldr/charts/latest/supplemental/territory_containment_un_m_49.html
* https:
* //unicode.org/cldr/charts/latest/supplem
* // ental/territory_containment_un_m_49.html
* </pre>
*
* <code>string country_code = 5;</code>
Expand All @@ -1527,7 +1535,9 @@ public com.google.protobuf.ByteString getCountryCodeBytes() {
*
* <pre>
* Country of business. Must be a non-deprecated code for a UN M.49 region.
* https://unicode.org/cldr/charts/latest/supplemental/territory_containment_un_m_49.html
* https:
* //unicode.org/cldr/charts/latest/supplem
* // ental/territory_containment_un_m_49.html
* </pre>
*
* <code>string country_code = 5;</code>
Expand All @@ -1549,7 +1559,9 @@ public Builder setCountryCode(java.lang.String value) {
*
* <pre>
* Country of business. Must be a non-deprecated code for a UN M.49 region.
* https://unicode.org/cldr/charts/latest/supplemental/territory_containment_un_m_49.html
* https:
* //unicode.org/cldr/charts/latest/supplem
* // ental/territory_containment_un_m_49.html
* </pre>
*
* <code>string country_code = 5;</code>
Expand All @@ -1567,7 +1579,9 @@ public Builder clearCountryCode() {
*
* <pre>
* Country of business. Must be a non-deprecated code for a UN M.49 region.
* https://unicode.org/cldr/charts/latest/supplemental/territory_containment_un_m_49.html
* https:
* //unicode.org/cldr/charts/latest/supplem
* // ental/territory_containment_un_m_49.html
* </pre>
*
* <code>string country_code = 5;</code>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,9 @@ public interface AccountOrBuilder
*
* <pre>
* Country of business. Must be a non-deprecated code for a UN M.49 region.
* https://unicode.org/cldr/charts/latest/supplemental/territory_containment_un_m_49.html
* https:
* //unicode.org/cldr/charts/latest/supplem
* // ental/territory_containment_un_m_49.html
* </pre>
*
* <code>string country_code = 5;</code>
Expand All @@ -171,7 +173,9 @@ public interface AccountOrBuilder
*
* <pre>
* Country of business. Must be a non-deprecated code for a UN M.49 region.
* https://unicode.org/cldr/charts/latest/supplemental/territory_containment_un_m_49.html
* https:
* //unicode.org/cldr/charts/latest/supplem
* // ental/territory_containment_un_m_49.html
* </pre>
*
* <code>string country_code = 5;</code>
Expand Down
Loading