AdGroupAdLabelServiceClient implements BackgroundResource { public final AdGroupAdLabel getAdGroupAdLabel(AdGroupAdLabelName resourceName) { GetAdGroupAdLabelRequest request = GetAdGroupAdLabelRequest.newBuilder() .setResourceName(resourceName == null ? null : resourceName.toString()) .build(); return getAdGroupAdLabel(request); } protected  AdGroupAdLabelServiceClient(AdGroupAdLabelServiceSettings settings); @BetaApi("A restructuring of stub classes is planned, so this may break in the future") protected  AdGroupAdLabelServiceClient(AdGroupAdLabelServiceStub stub); static final AdGroupAdLabelServiceClient create(); static final AdGroupAdLabelServiceClient create(AdGroupAdLabelServiceSettings settings); @BetaApi("A restructuring of stub classes is planned, so this may break in the future") static final AdGroupAdLabelServiceClient create(AdGroupAdLabelServiceStub stub); final AdGroupAdLabelServiceSettings getSettings(); @BetaApi("A restructuring of stub classes is planned, so this may break in the future") AdGroupAdLabelServiceStub getStub(); final AdGroupAdLabel getAdGroupAdLabel(AdGroupAdLabelName resourceName); final AdGroupAdLabel getAdGroupAdLabel(String resourceName); final AdGroupAdLabel getAdGroupAdLabel(GetAdGroupAdLabelRequest request); final UnaryCallable<GetAdGroupAdLabelRequest, AdGroupAdLabel> getAdGroupAdLabelCallable(); final MutateAdGroupAdLabelsResponse mutateAdGroupAdLabels(
      String customerId, List<AdGroupAdLabelOperation> operations); final MutateAdGroupAdLabelsResponse mutateAdGroupAdLabels(
      MutateAdGroupAdLabelsRequest request); final UnaryCallable<MutateAdGroupAdLabelsRequest, MutateAdGroupAdLabelsResponse> mutateAdGroupAdLabelsCallable(); @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 getAdGroupAdLabelTest() { com.google.ads.googleads.v5.services.AdGroupAdLabelName resourceName2 = com.google.ads.googleads.v5.services.AdGroupAdLabelName.of( "[CUSTOMER]", "[AD_GROUP_AD_LABEL]"); AdGroupAdLabel expectedResponse = AdGroupAdLabel.newBuilder().setResourceName(resourceName2.toString()).build(); mockAdGroupAdLabelService.addResponse(expectedResponse); AdGroupAdLabelName resourceName = AdGroupAdLabelName.of("[CUSTOMER]", "[AD_GROUP_AD_LABEL]"); AdGroupAdLabel actualResponse = client.getAdGroupAdLabel(resourceName); Assert.assertEquals(expectedResponse, actualResponse); List<AbstractMessage> actualRequests = mockAdGroupAdLabelService.getRequests(); Assert.assertEquals(1, actualRequests.size()); GetAdGroupAdLabelRequest actualRequest = (GetAdGroupAdLabelRequest) actualRequests.get(0); Assert.assertEquals(resourceName, AdGroupAdLabelName.parse(actualRequest.getResourceName())); Assert.assertTrue( channelProvider.isHeaderSent( ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), GaxGrpcProperties.getDefaultApiClientHeaderPattern())); }
@Test @SuppressWarnings("all") public void getAdGroupAdLabelExceptionTest() throws Exception { StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); mockAdGroupAdLabelService.addException(exception); try { AdGroupAdLabelName resourceName = AdGroupAdLabelName.of("[CUSTOMER]", "[AD_GROUP_AD_LABEL]"); client.getAdGroupAdLabel(resourceName); Assert.fail("No exception raised"); } catch (InvalidArgumentException e) { } }