@Test @SuppressWarnings("all") public void getCampaignDraftTest() { com.google.ads.googleads.v5.services.CampaignDraftName resourceName2 = com.google.ads.googleads.v5.services.CampaignDraftName.of( "[CUSTOMER]", "[CAMPAIGN_DRAFT]"); CampaignDraft expectedResponse = CampaignDraft.newBuilder().setResourceName(resourceName2.toString()).build(); mockCampaignDraftService.addResponse(expectedResponse); CampaignDraftName resourceName = CampaignDraftName.of("[CUSTOMER]", "[CAMPAIGN_DRAFT]"); CampaignDraft actualResponse = client.getCampaignDraft(resourceName); Assert.assertEquals(expectedResponse, actualResponse); List<AbstractMessage> actualRequests = mockCampaignDraftService.getRequests(); Assert.assertEquals(1, actualRequests.size()); GetCampaignDraftRequest actualRequest = (GetCampaignDraftRequest) actualRequests.get(0); Assert.assertEquals(resourceName, CampaignDraftName.parse(actualRequest.getResourceName())); Assert.assertTrue( channelProvider.isHeaderSent( ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), GaxGrpcProperties.getDefaultApiClientHeaderPattern())); }
public final CampaignDraft getCampaignDraft(CampaignDraftName resourceName) { GetCampaignDraftRequest request = GetCampaignDraftRequest.newBuilder() .setResourceName(resourceName == null ? null : resourceName.toString()) .build(); return getCampaignDraft(request); }
CampaignDraftServiceClient implements BackgroundResource { public final CampaignDraft getCampaignDraft(CampaignDraftName resourceName) { GetCampaignDraftRequest request = GetCampaignDraftRequest.newBuilder() .setResourceName(resourceName == null ? null : resourceName.toString()) .build(); return getCampaignDraft(request); } }
CampaignDraftServiceClient implements BackgroundResource { public final CampaignDraft getCampaignDraft(CampaignDraftName resourceName) { GetCampaignDraftRequest request = GetCampaignDraftRequest.newBuilder() .setResourceName(resourceName == null ? null : resourceName.toString()) .build(); return getCampaignDraft(request); } protected  CampaignDraftServiceClient(CampaignDraftServiceSettings settings); @BetaApi("A restructuring of stub classes is planned, so this may break in the future") protected  CampaignDraftServiceClient(CampaignDraftServiceStub stub); }
CampaignDraftServiceClient implements BackgroundResource { public final CampaignDraft getCampaignDraft(CampaignDraftName resourceName) { GetCampaignDraftRequest request = GetCampaignDraftRequest.newBuilder() .setResourceName(resourceName == null ? null : resourceName.toString()) .build(); return getCampaignDraft(request); } protected  CampaignDraftServiceClient(CampaignDraftServiceSettings settings); @BetaApi("A restructuring of stub classes is planned, so this may break in the future") protected  CampaignDraftServiceClient(CampaignDraftServiceStub stub); static final CampaignDraftServiceClient create(); static final CampaignDraftServiceClient create(CampaignDraftServiceSettings settings); @BetaApi("A restructuring of stub classes is planned, so this may break in the future") static final CampaignDraftServiceClient create(CampaignDraftServiceStub stub); final CampaignDraftServiceSettings getSettings(); @BetaApi("A restructuring of stub classes is planned, so this may break in the future") CampaignDraftServiceStub getStub(); @BetaApi( "The surface for long-running operations is not stable yet and may change in the future.") final OperationsClient getOperationsClient(); final CampaignDraft getCampaignDraft(CampaignDraftName resourceName); final CampaignDraft getCampaignDraft(String resourceName); final CampaignDraft getCampaignDraft(GetCampaignDraftRequest request); final UnaryCallable<GetCampaignDraftRequest, CampaignDraft> getCampaignDraftCallable(); final MutateCampaignDraftsResponse mutateCampaignDrafts(
      String customerId, List<CampaignDraftOperation> operations); final MutateCampaignDraftsResponse mutateCampaignDrafts(
      MutateCampaignDraftsRequest request); final UnaryCallable<MutateCampaignDraftsRequest, MutateCampaignDraftsResponse> mutateCampaignDraftsCallable(); @BetaApi( "The surface for long-running operations is not stable yet and may change in the future.") final OperationFuture<Empty, Empty> promoteCampaignDraftAsync(String campaignDraft); @BetaApi( "The surface for long-running operations is not stable yet and may change in the future.") final OperationFuture<Empty, Empty> promoteCampaignDraftAsync(
      PromoteCampaignDraftRequest request); @BetaApi("The surface for use by generated code is not stable yet and may change in the future.") final OperationCallable<PromoteCampaignDraftRequest, Empty, Empty> promoteCampaignDraftOperationCallable(); final UnaryCallable<PromoteCampaignDraftRequest, Operation> promoteCampaignDraftCallable(); final ListCampaignDraftAsyncErrorsPagedResponse listCampaignDraftAsyncErrors(
      CampaignDraftName resourceName); final ListCampaignDraftAsyncErrorsPagedResponse listCampaignDraftAsyncErrors(
      String resourceName); final ListCampaignDraftAsyncErrorsPagedResponse listCampaignDraftAsyncErrors(
      ListCampaignDraftAsyncErrorsRequest request); final UnaryCallable<
          ListCampaignDraftAsyncErrorsRequest, ListCampaignDraftAsyncErrorsPagedResponse> listCampaignDraftAsyncErrorsPagedCallable(); final UnaryCallable<
          ListCampaignDraftAsyncErrorsRequest, ListCampaignDraftAsyncErrorsResponse> listCampaignDraftAsyncErrorsCallable(); @Override final void close(); @Override void shutdown(); @Override boolean isShutdown(); @Override boolean isTerminated(); @Override void shutdownNow(); @Override boolean awaitTermination(long duration, TimeUnit unit); }
CampaignDraftServiceClient implements BackgroundResource { public final CampaignDraft getCampaignDraft(CampaignDraftName resourceName) { GetCampaignDraftRequest request = GetCampaignDraftRequest.newBuilder() .setResourceName(resourceName == null ? null : resourceName.toString()) .build(); return getCampaignDraft(request); } protected  CampaignDraftServiceClient(CampaignDraftServiceSettings settings); @BetaApi("A restructuring of stub classes is planned, so this may break in the future") protected  CampaignDraftServiceClient(CampaignDraftServiceStub stub); static final CampaignDraftServiceClient create(); static final CampaignDraftServiceClient create(CampaignDraftServiceSettings settings); @BetaApi("A restructuring of stub classes is planned, so this may break in the future") static final CampaignDraftServiceClient create(CampaignDraftServiceStub stub); final CampaignDraftServiceSettings getSettings(); @BetaApi("A restructuring of stub classes is planned, so this may break in the future") CampaignDraftServiceStub getStub(); @BetaApi( "The surface for long-running operations is not stable yet and may change in the future.") final OperationsClient getOperationsClient(); final CampaignDraft getCampaignDraft(CampaignDraftName resourceName); final CampaignDraft getCampaignDraft(String resourceName); final CampaignDraft getCampaignDraft(GetCampaignDraftRequest request); final UnaryCallable<GetCampaignDraftRequest, CampaignDraft> getCampaignDraftCallable(); final MutateCampaignDraftsResponse mutateCampaignDrafts(
      String customerId, List<CampaignDraftOperation> operations); final MutateCampaignDraftsResponse mutateCampaignDrafts(
      MutateCampaignDraftsRequest request); final UnaryCallable<MutateCampaignDraftsRequest, MutateCampaignDraftsResponse> mutateCampaignDraftsCallable(); @BetaApi( "The surface for long-running operations is not stable yet and may change in the future.") final OperationFuture<Empty, Empty> promoteCampaignDraftAsync(String campaignDraft); @BetaApi( "The surface for long-running operations is not stable yet and may change in the future.") final OperationFuture<Empty, Empty> promoteCampaignDraftAsync(
      PromoteCampaignDraftRequest request); @BetaApi("The surface for use by generated code is not stable yet and may change in the future.") final OperationCallable<PromoteCampaignDraftRequest, Empty, Empty> promoteCampaignDraftOperationCallable(); final UnaryCallable<PromoteCampaignDraftRequest, Operation> promoteCampaignDraftCallable(); final ListCampaignDraftAsyncErrorsPagedResponse listCampaignDraftAsyncErrors(
      CampaignDraftName resourceName); final ListCampaignDraftAsyncErrorsPagedResponse listCampaignDraftAsyncErrors(
      String resourceName); final ListCampaignDraftAsyncErrorsPagedResponse listCampaignDraftAsyncErrors(
      ListCampaignDraftAsyncErrorsRequest request); final UnaryCallable<
          ListCampaignDraftAsyncErrorsRequest, ListCampaignDraftAsyncErrorsPagedResponse> listCampaignDraftAsyncErrorsPagedCallable(); final UnaryCallable<
          ListCampaignDraftAsyncErrorsRequest, ListCampaignDraftAsyncErrorsResponse> listCampaignDraftAsyncErrorsCallable(); @Override final void close(); @Override void shutdown(); @Override boolean isShutdown(); @Override boolean isTerminated(); @Override void shutdownNow(); @Override boolean awaitTermination(long duration, TimeUnit unit);  }