public static final HttpJsonStorageTransferServiceStub create(ClientContext clientContext)
      throws IOException {
    return new HttpJsonStorageTransferServiceStub(
        StorageTransferServiceStubSettings.newHttpJsonBuilder().build(), clientContext);
  }
}",
                          request -> {
                            Map<String, String> fields = new HashMap<>();
                            ProtoRestSerializer<TransferProto.UpdateTransferJobRequest> serializer =
                                ProtoRestSerializer.create();
                            serializer.putPathParam(fields, "jobName", request.getJobName());
                            return fields;
                          })
                      .setQueryParamsExtractor(
                          request -> {
                            Map<String, List<String>> fields = new HashMap<>();
                            ProtoRestSerializer<TransferProto.UpdateTransferJobRequest> serializer =
                                ProtoRestSerializer.create();
                            serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int");
                            return fields;
                          })
                      .setRequestBodyExtractor(
                          request ->
                              ProtoRestSerializer.create()
                                  .toBody("*", request.toBuilder().clearJobName().build(), true))
                      .build())
              .setResponseParser(
                  ProtoMessageResponseParser.<TransferTypes.TransferJob>newBuilder()
                      .setDefaultInstance(TransferTypes.TransferJob.getDefaultInstance())
                      .setDefaultTypeRegistry(typeRegistry)
                      .build())
              .build();

  private static final ApiMethodDescriptor<
          TransferProto.GetTransferJobRequest, TransferTypes.TransferJob>
      getTransferJobMethodDescriptor =
          ApiMethodDescriptor
              .<TransferProto.GetTransferJobRequest, TransferTypes.TransferJob>newBuilder()
              .setFullMethodName("google.storagetransfer.v1.StorageTransferService/GetTransferJob")
              .setHttpMethod("GET")
              .setType(ApiMethodDescriptor.MethodType.UNARY)
              .setRequestFormatter(
                  ProtoMessageRequestFormatter.<TransferProto.GetTransferJobRequest>newBuilder()
                      .setPath(
                          "/v1/{jobName=transferJobs/**}",
                          request -> {
                            Map<String, String> fields = new HashMap<>();
                            ProtoRestSerializer<TransferProto.GetTransferJobRequest> serializer =
                                ProtoRestSerializer.create();
                            serializer.putPathParam(fields, "jobName", request.getJobName());
                            return fields;
                          })
                      .setQueryParamsExtractor(
                          request -> {
                            Map<String, List<String>> fields = new HashMap<>();
                            ProtoRestSerializer<TransferProto.GetTransferJobRequest> serializer =
                                ProtoRestSerializer.create();
                            serializer.putQueryParam(fields, "projectId", request.getProjectId());
                            serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int");
                            return fields;
                          })
                      .setRequestBodyExtractor(request -> null)
                      .build())
              .setResponseParser(
                  ProtoMessageResponseParser.<TransferTypes.TransferJob>newBuilder()
                      .setDefaultInstance(TransferTypes.TransferJob.getDefaultInstance())
                      .setDefaultTypeRegistry(typeRegistry)
                      .build())
              .build();

  private static final ApiMethodDescriptor<
          TransferProto.ListTransferJobsRequest, TransferProto.ListTransferJobsResponse>
      listTransferJobsMethodDescriptor =
          ApiMethodDescriptor
              .<TransferProto.ListTransferJobsRequest, TransferProto.ListTransferJobsResponse>
                  newBuilder()
              .setFullMethodName(
                  "google.storagetransfer.v1.StorageTransferService/ListTransferJobs")
              .setHttpMethod("GET")
              .setType(ApiMethodDescriptor.MethodType.UNARY)
              .setRequestFormatter(
                  ProtoMessageRequestFormatter.<TransferProto.ListTransferJobsRequest>newBuilder()
                      .setPath(
                          "/v1/transferJobs",
                          request -> {
                            Map<String, String> fields = new HashMap<>();
                            ProtoRestSerializer<TransferProto.ListTransferJobsRequest> serializer =
                                ProtoRestSerializer.create();
                            return fields;
                          })
                      .setQueryParamsExtractor(
                          request -> {
                            Map<String, List<String>> fields = new HashMap<>();
                            ProtoRestSerializer<TransferProto.ListTransferJobsRequest> serializer =
                                ProtoRestSerializer.create();
                            serializer.putQueryParam(fields, "filter", request.getFilter());
                            serializer.putQueryParam(fields, "pageSize", request.getPageSize());
                            serializer.putQueryParam(fields, "pageToken", request.getPageToken());
                            serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int");
                            return fields;
                          })
                      .setRequestBodyExtractor(request -> null)
                      .build())
              .setResponseParser(
                  ProtoMessageResponseParser.<TransferProto.ListTransferJobsResponse>newBuilder()
                      .setDefaultInstance(
                          TransferProto.ListTransferJobsResponse.getDefaultInstance())
                      .setDefaultTypeRegistry(typeRegistry)
                      .build())
              .build();

  private static final ApiMethodDescriptor<TransferProto.PauseTransferOperationRequest, Empty>
      pauseTransferOperationMethodDescriptor =
          ApiMethodDescriptor.<TransferProto.PauseTransferOperationRequest, Empty>newBuilder()
              .setFullMethodName(
                  "google.storagetransfer.v1.StorageTransferService/PauseTransferOperation")
              .setHttpMethod("POST")
              .setType(ApiMethodDescriptor.MethodType.UNARY)
              .setRequestFormatter(
                  ProtoMessageRequestFormatter
                      .<TransferProto.PauseTransferOperationRequest>newBuilder()
                      .setPath(
                          "/v1/{name=transferOperations/**}:pause",
                          request -> {
                            Map<String, String> fields = new HashMap<>();
                            ProtoRestSerializer<TransferProto.PauseTransferOperationRequest>
                                serializer = ProtoRestSerializer.create();
                            serializer.putPathParam(fields, "name", request.getName());
                            return fields;
                          })
                      .setQueryParamsExtractor(
                          request -> {
                            Map<String, List<String>> fields = new HashMap<>();
                            ProtoRestSerializer<TransferProto.PauseTransferOperationRequest>
                                serializer = ProtoRestSerializer.create();
                            serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int");
                            return fields;
                          })
                      .setRequestBodyExtractor(
                          request ->
                              ProtoRestSerializer.create()
                                  .toBody("*", request.toBuilder().clearName().build(), true))
                      .build())
              .setResponseParser(
                  ProtoMessageResponseParser.<Empty>newBuilder()
                      .setDefaultInstance(Empty.getDefaultInstance())
                      .setDefaultTypeRegistry(typeRegistry)
                      .build())
              .build();

  private static final ApiMethodDescriptor<TransferProto.ResumeTransferOperationRequest, Empty>
      resumeTransferOperationMethodDescriptor =
          ApiMethodDescriptor.<TransferProto.ResumeTransferOperationRequest, Empty>newBuilder()
              .setFullMethodName(
                  "google.storagetransfer.v1.StorageTransferService/ResumeTransferOperation")
              .setHttpMethod("POST")
              .setType(ApiMethodDescriptor.MethodType.UNARY)
              .setRequestFormatter(
                  ProtoMessageRequestFormatter
                      .<TransferProto.ResumeTransferOperationRequest>newBuilder()
                      .setPath(
                          "/v1/{name=transferOperations/**}:resume",
                          request -> {
                            Map<String, String> fields = new HashMap<>();
                            ProtoRestSerializer<TransferProto.ResumeTransferOperationRequest>
                                serializer = ProtoRestSerializer.create();
                            serializer.putPathParam(fields, "name", request.getName());
                            return fields;
                          })
                      .setQueryParamsExtractor(
                          request -> {
                            Map<String, List<String>> fields = new HashMap<>();
                            ProtoRestSerializer<TransferProto.ResumeTransferOperationRequest>
                                serializer = ProtoRestSerializer.create();
                            serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int");
                            return fields;
                          })
                      .setRequestBodyExtractor(
                          request ->
                              ProtoRestSerializer.create()
                                  .toBody("*", request.toBuilder().clearName().build(), true))
                      .build())
              .setResponseParser(
                  ProtoMessageResponseParser.<Empty>newBuilder()
                      .setDefaultInstance(Empty.getDefaultInstance())
                      .setDefaultTypeRegistry(typeRegistry)
                      .build())
              .build();

  private static final ApiMethodDescriptor<TransferProto.RunTransferJobRequest, Operation>
      runTransferJobMethodDescriptor =
          ApiMethodDescriptor.<TransferProto.RunTransferJobRequest, Operation>newBuilder()
              .setFullMethodName("google.storagetransfer.v1.StorageTransferService/RunTransferJob")
              .setHttpMethod("POST")
              .setType(ApiMethodDescriptor.MethodType.UNARY)
              .setRequestFormatter(
                  ProtoMessageRequestFormatter.<TransferProto.RunTransferJobRequest>newBuilder()
                      .setPath(
                          "/v1/{jobName=transferJobs/**}:run",
                          request -> {
                            Map<String, String> fields = new HashMap<>();
                            ProtoRestSerializer<TransferProto.RunTransferJobRequest> serializer =
                                ProtoRestSerializer.create();
                            serializer.putPathParam(fields, "jobName", request.getJobName());
                            return fields;
                          })
                      .setQueryParamsExtractor(
                          request -> {
                            Map<String, List<String>> fields = new HashMap<>();
                            ProtoRestSerializer<TransferProto.RunTransferJobRequest> serializer =
                                ProtoRestSerializer.create();
                            serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int");
                            return fields;
                          })
                      .setRequestBodyExtractor(
                          request ->
                              ProtoRestSerializer.create()
                                  .toBody("*", request.toBuilder().clearJobName().build(), true))
                      .build())
              .setResponseParser(
                  ProtoMessageResponseParser.<Operation>newBuilder()
                      .setDefaultInstance(Operation.getDefaultInstance())
                      .setDefaultTypeRegistry(typeRegistry)
                      .build())
              .setOperationSnapshotFactory(
                  (TransferProto.RunTransferJobRequest request, Operation response) ->
                      HttpJsonOperationSnapshot.create(response))
              .build();

  private static final ApiMethodDescriptor<TransferProto.DeleteTransferJobRequest, Empty>
      deleteTransferJobMethodDescriptor =
          ApiMethodDescriptor.<TransferProto.DeleteTransferJobRequest, Empty>newBuilder()
              .setFullMethodName(
                  "google.storagetransfer.v1.StorageTransferService/DeleteTransferJob")
              .setHttpMethod("DELETE")
              .setType(ApiMethodDescriptor.MethodType.UNARY)
              .setRequestFormatter(
                  ProtoMessageRequestFormatter.<TransferProto.DeleteTransferJobRequest>newBuilder()
                      .setPath(
                          "/v1/{jobName=transferJobs/**}",
                          request -> {
                            Map<String, String> fields = new HashMap<>();
                            ProtoRestSerializer<TransferProto.DeleteTransferJobRequest> serializer =
                                ProtoRestSerializer.create();
                            serializer.putPathParam(fields, "jobName", request.getJobName());
                            return fields;
                          })
                      .setQueryParamsExtractor(
                          request -> {
                            Map<String, List<String>> fields = new HashMap<>();
                            ProtoRestSerializer<TransferProto.DeleteTransferJobRequest> serializer =
                                ProtoRestSerializer.create();
                            serializer.putQueryParam(fields, "projectId", request.getProjectId());
                            serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int");
                            return fields;
                          })
                      .setRequestBodyExtractor(request -> null)
                      .build())
              .setResponseParser(
                  ProtoMessageResponseParser.<Empty>newBuilder()
                      .setDefaultInstance(Empty.getDefaultInstance())
                      .setDefaultTypeRegistry(typeRegistry)
                      .build())
              .build();

  private static final ApiMethodDescriptor<
          TransferProto.CreateAgentPoolRequest, TransferTypes.AgentPool>
      createAgentPoolMethodDescriptor =
          ApiMethodDescriptor
              .<TransferProto.CreateAgentPoolRequest, TransferTypes.AgentPool>newBuilder()
              .setFullMethodName("google.storagetransfer.v1.StorageTransferService/CreateAgentPool")
              .setHttpMethod("POST")
              .setType(ApiMethodDescriptor.MethodType.UNARY)
              .setRequestFormatter(
                  ProtoMessageRequestFormatter.<TransferProto.CreateAgentPoolRequest>newBuilder()
                      .setPath(
                          "/v1/projects/{projectId=*}/agentPools",
                          request -> {
                            Map<String, String> fields = new HashMap<>();
                            ProtoRestSerializer<TransferProto.CreateAgentPoolRequest> serializer =
                                ProtoRestSerializer.create();
                            serializer.putPathParam(fields, "projectId", request.getProjectId());
                            return fields;
                          })
                      .setQueryParamsExtractor(
                          request -> {
                            Map<String, List<String>> fields = new HashMap<>();
                            ProtoRestSerializer<TransferProto.CreateAgentPoolRequest> serializer =
                                ProtoRestSerializer.create();
                            serializer.putQueryParam(
                                fields, "agentPoolId", request.getAgentPoolId());
                            serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int");
                            return fields;
                          })
                      .setRequestBodyExtractor(
                          request ->
                              ProtoRestSerializer.create()
                                  .toBody("agentPool", request.getAgentPool(), true))
                      .build())
              .setResponseParser(
                  ProtoMessageResponseParser.<TransferTypes.AgentPool>newBuilder()
                      .setDefaultInstance(TransferTypes.AgentPool.getDefaultInstance())
                      .setDefaultTypeRegistry(typeRegistry)
                      .build())
              .build();

  private static final ApiMethodDescriptor<
          TransferProto.UpdateAgentPoolRequest, TransferTypes.AgentPool>
      updateAgentPoolMethodDescriptor =
          ApiMethodDescriptor
              .<TransferProto.UpdateAgentPoolRequest, TransferTypes.AgentPool>newBuilder()
              .setFullMethodName("google.storagetransfer.v1.StorageTransferService/UpdateAgentPool")
              .setHttpMethod("PATCH")
              .setType(ApiMethodDescriptor.MethodType.UNARY)
              .setRequestFormatter(
                  ProtoMessageRequestFormatter.<TransferProto.UpdateAgentPoolRequest>newBuilder()
                      .setPath(
                          "/v1/{agentPool.name=projects/
java-storage-transfer/google-cloud-storage-transfer/src/main/java/com/google/storagetransfer/v1/proto/stub/HttpJsonStorageTransferServiceStub.java