CustomerManagerLinkServiceClient implements BackgroundResource { public final CustomerManagerLink getCustomerManagerLink(CustomerManagerLinkName resourceName) { GetCustomerManagerLinkRequest request = GetCustomerManagerLinkRequest.newBuilder() .setResourceName(resourceName == null ? null : resourceName.toString()) .build(); return getCustomerManagerLink(request); } protected  CustomerManagerLinkServiceClient(CustomerManagerLinkServiceSettings settings); @BetaApi("A restructuring of stub classes is planned, so this may break in the future") protected  CustomerManagerLinkServiceClient(CustomerManagerLinkServiceStub stub); static final CustomerManagerLinkServiceClient create(); static final CustomerManagerLinkServiceClient create(
      CustomerManagerLinkServiceSettings settings); @BetaApi("A restructuring of stub classes is planned, so this may break in the future") static final CustomerManagerLinkServiceClient create(CustomerManagerLinkServiceStub stub); final CustomerManagerLinkServiceSettings getSettings(); @BetaApi("A restructuring of stub classes is planned, so this may break in the future") CustomerManagerLinkServiceStub getStub(); final CustomerManagerLink getCustomerManagerLink(CustomerManagerLinkName resourceName); final CustomerManagerLink getCustomerManagerLink(String resourceName); final CustomerManagerLink getCustomerManagerLink(GetCustomerManagerLinkRequest request); final UnaryCallable<GetCustomerManagerLinkRequest, CustomerManagerLink> getCustomerManagerLinkCallable(); final MutateCustomerManagerLinkResponse mutateCustomerManagerLink(
      String customerId, List<CustomerManagerLinkOperation> operations); final MutateCustomerManagerLinkResponse mutateCustomerManagerLink(
      MutateCustomerManagerLinkRequest request); final UnaryCallable<MutateCustomerManagerLinkRequest, MutateCustomerManagerLinkResponse> mutateCustomerManagerLinkCallable(); final MoveManagerLinkResponse moveManagerLink(
      String customerId, String previousCustomerManagerLink, String newManager); final MoveManagerLinkResponse moveManagerLink(MoveManagerLinkRequest request); final UnaryCallable<MoveManagerLinkRequest, MoveManagerLinkResponse> moveManagerLinkCallable(); @Override final void close(); @Override void shutdown(); @Override boolean isShutdown(); @Override boolean isTerminated(); @Override void shutdownNow(); @Override boolean awaitTermination(long duration, TimeUnit unit);  }
@Test @SuppressWarnings("all") public void getCustomerManagerLinkTest() { com.google.ads.googleads.v5.services.CustomerManagerLinkName resourceName2 = com.google.ads.googleads.v5.services.CustomerManagerLinkName.of( "[CUSTOMER]", "[CUSTOMER_MANAGER_LINK]"); CustomerManagerLink expectedResponse = CustomerManagerLink.newBuilder().setResourceName(resourceName2.toString()).build(); mockCustomerManagerLinkService.addResponse(expectedResponse); CustomerManagerLinkName resourceName = CustomerManagerLinkName.of("[CUSTOMER]", "[CUSTOMER_MANAGER_LINK]"); CustomerManagerLink actualResponse = client.getCustomerManagerLink(resourceName); Assert.assertEquals(expectedResponse, actualResponse); List<AbstractMessage> actualRequests = mockCustomerManagerLinkService.getRequests(); Assert.assertEquals(1, actualRequests.size()); GetCustomerManagerLinkRequest actualRequest = (GetCustomerManagerLinkRequest) actualRequests.get(0); Assert.assertEquals( resourceName, CustomerManagerLinkName.parse(actualRequest.getResourceName())); Assert.assertTrue( channelProvider.isHeaderSent( ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), GaxGrpcProperties.getDefaultApiClientHeaderPattern())); }
@Test @SuppressWarnings("all") public void getCustomerManagerLinkExceptionTest() throws Exception { StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); mockCustomerManagerLinkService.addException(exception); try { CustomerManagerLinkName resourceName = CustomerManagerLinkName.of("[CUSTOMER]", "[CUSTOMER_MANAGER_LINK]"); client.getCustomerManagerLink(resourceName); Assert.fail("No exception raised"); } catch (InvalidArgumentException e) { } }