com.passkit.grpc.MessagesGrpc Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of sdk Show documentation
Show all versions of sdk Show documentation
SDK for the PassKit gRPC API that can be used to create, configure and manage Membership, Loyalty, Event Ticket, Coupon, Transit and Boarding Pass content for mobile wallet applications, including Apple Pay and Google Pay.
package com.passkit.grpc;
import static io.grpc.MethodDescriptor.generateFullMethodName;
import static io.grpc.stub.ClientCalls.asyncBidiStreamingCall;
import static io.grpc.stub.ClientCalls.asyncClientStreamingCall;
import static io.grpc.stub.ClientCalls.asyncServerStreamingCall;
import static io.grpc.stub.ClientCalls.asyncUnaryCall;
import static io.grpc.stub.ClientCalls.blockingServerStreamingCall;
import static io.grpc.stub.ClientCalls.blockingUnaryCall;
import static io.grpc.stub.ClientCalls.futureUnaryCall;
import static io.grpc.stub.ServerCalls.asyncBidiStreamingCall;
import static io.grpc.stub.ServerCalls.asyncClientStreamingCall;
import static io.grpc.stub.ServerCalls.asyncServerStreamingCall;
import static io.grpc.stub.ServerCalls.asyncUnaryCall;
import static io.grpc.stub.ServerCalls.asyncUnimplementedStreamingCall;
import static io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall;
/**
*/
@javax.annotation.Generated(
value = "by gRPC proto compiler (version 1.33.1)",
comments = "Source: io/core/a_rpc_others.proto")
public final class MessagesGrpc {
private MessagesGrpc() {}
public static final String SERVICE_NAME = "io.Messages";
// Static method descriptors that strictly reflect the proto.
private static volatile io.grpc.MethodDescriptor getSendMessageMethod;
@io.grpc.stub.annotations.RpcMethod(
fullMethodName = SERVICE_NAME + '/' + "sendMessage",
requestType = com.passkit.grpc.MessageOuterClass.Message.class,
responseType = com.passkit.grpc.CommonObjects.Id.class,
methodType = io.grpc.MethodDescriptor.MethodType.UNARY)
public static io.grpc.MethodDescriptor getSendMessageMethod() {
io.grpc.MethodDescriptor getSendMessageMethod;
if ((getSendMessageMethod = MessagesGrpc.getSendMessageMethod) == null) {
synchronized (MessagesGrpc.class) {
if ((getSendMessageMethod = MessagesGrpc.getSendMessageMethod) == null) {
MessagesGrpc.getSendMessageMethod = getSendMessageMethod =
io.grpc.MethodDescriptor.newBuilder()
.setType(io.grpc.MethodDescriptor.MethodType.UNARY)
.setFullMethodName(generateFullMethodName(SERVICE_NAME, "sendMessage"))
.setSampledToLocalTracing(true)
.setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller(
com.passkit.grpc.MessageOuterClass.Message.getDefaultInstance()))
.setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller(
com.passkit.grpc.CommonObjects.Id.getDefaultInstance()))
.setSchemaDescriptor(new MessagesMethodDescriptorSupplier("sendMessage"))
.build();
}
}
}
return getSendMessageMethod;
}
private static volatile io.grpc.MethodDescriptor getGetMessagesMethod;
@io.grpc.stub.annotations.RpcMethod(
fullMethodName = SERVICE_NAME + '/' + "getMessages",
requestType = com.passkit.grpc.PaginationOuterClass.Pagination.class,
responseType = com.passkit.grpc.MessageOuterClass.Message.class,
methodType = io.grpc.MethodDescriptor.MethodType.SERVER_STREAMING)
public static io.grpc.MethodDescriptor getGetMessagesMethod() {
io.grpc.MethodDescriptor getGetMessagesMethod;
if ((getGetMessagesMethod = MessagesGrpc.getGetMessagesMethod) == null) {
synchronized (MessagesGrpc.class) {
if ((getGetMessagesMethod = MessagesGrpc.getGetMessagesMethod) == null) {
MessagesGrpc.getGetMessagesMethod = getGetMessagesMethod =
io.grpc.MethodDescriptor.newBuilder()
.setType(io.grpc.MethodDescriptor.MethodType.SERVER_STREAMING)
.setFullMethodName(generateFullMethodName(SERVICE_NAME, "getMessages"))
.setSampledToLocalTracing(true)
.setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller(
com.passkit.grpc.PaginationOuterClass.Pagination.getDefaultInstance()))
.setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller(
com.passkit.grpc.MessageOuterClass.Message.getDefaultInstance()))
.setSchemaDescriptor(new MessagesMethodDescriptorSupplier("getMessages"))
.build();
}
}
}
return getGetMessagesMethod;
}
/**
* Creates a new async stub that supports all call types for the service
*/
public static MessagesStub newStub(io.grpc.Channel channel) {
io.grpc.stub.AbstractStub.StubFactory factory =
new io.grpc.stub.AbstractStub.StubFactory() {
@java.lang.Override
public MessagesStub newStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) {
return new MessagesStub(channel, callOptions);
}
};
return MessagesStub.newStub(factory, channel);
}
/**
* Creates a new blocking-style stub that supports unary and streaming output calls on the service
*/
public static MessagesBlockingStub newBlockingStub(
io.grpc.Channel channel) {
io.grpc.stub.AbstractStub.StubFactory factory =
new io.grpc.stub.AbstractStub.StubFactory() {
@java.lang.Override
public MessagesBlockingStub newStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) {
return new MessagesBlockingStub(channel, callOptions);
}
};
return MessagesBlockingStub.newStub(factory, channel);
}
/**
* Creates a new ListenableFuture-style stub that supports unary calls on the service
*/
public static MessagesFutureStub newFutureStub(
io.grpc.Channel channel) {
io.grpc.stub.AbstractStub.StubFactory factory =
new io.grpc.stub.AbstractStub.StubFactory() {
@java.lang.Override
public MessagesFutureStub newStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) {
return new MessagesFutureStub(channel, callOptions);
}
};
return MessagesFutureStub.newStub(factory, channel);
}
/**
*/
public static abstract class MessagesImplBase implements io.grpc.BindableService {
/**
*/
public void sendMessage(com.passkit.grpc.MessageOuterClass.Message request,
io.grpc.stub.StreamObserver responseObserver) {
asyncUnimplementedUnaryCall(getSendMessageMethod(), responseObserver);
}
/**
*/
public void getMessages(com.passkit.grpc.PaginationOuterClass.Pagination request,
io.grpc.stub.StreamObserver responseObserver) {
asyncUnimplementedUnaryCall(getGetMessagesMethod(), responseObserver);
}
@java.lang.Override public final io.grpc.ServerServiceDefinition bindService() {
return io.grpc.ServerServiceDefinition.builder(getServiceDescriptor())
.addMethod(
getSendMessageMethod(),
asyncUnaryCall(
new MethodHandlers<
com.passkit.grpc.MessageOuterClass.Message,
com.passkit.grpc.CommonObjects.Id>(
this, METHODID_SEND_MESSAGE)))
.addMethod(
getGetMessagesMethod(),
asyncServerStreamingCall(
new MethodHandlers<
com.passkit.grpc.PaginationOuterClass.Pagination,
com.passkit.grpc.MessageOuterClass.Message>(
this, METHODID_GET_MESSAGES)))
.build();
}
}
/**
*/
public static final class MessagesStub extends io.grpc.stub.AbstractAsyncStub {
private MessagesStub(
io.grpc.Channel channel, io.grpc.CallOptions callOptions) {
super(channel, callOptions);
}
@java.lang.Override
protected MessagesStub build(
io.grpc.Channel channel, io.grpc.CallOptions callOptions) {
return new MessagesStub(channel, callOptions);
}
/**
*/
public void sendMessage(com.passkit.grpc.MessageOuterClass.Message request,
io.grpc.stub.StreamObserver responseObserver) {
asyncUnaryCall(
getChannel().newCall(getSendMessageMethod(), getCallOptions()), request, responseObserver);
}
/**
*/
public void getMessages(com.passkit.grpc.PaginationOuterClass.Pagination request,
io.grpc.stub.StreamObserver responseObserver) {
asyncServerStreamingCall(
getChannel().newCall(getGetMessagesMethod(), getCallOptions()), request, responseObserver);
}
}
/**
*/
public static final class MessagesBlockingStub extends io.grpc.stub.AbstractBlockingStub {
private MessagesBlockingStub(
io.grpc.Channel channel, io.grpc.CallOptions callOptions) {
super(channel, callOptions);
}
@java.lang.Override
protected MessagesBlockingStub build(
io.grpc.Channel channel, io.grpc.CallOptions callOptions) {
return new MessagesBlockingStub(channel, callOptions);
}
/**
*/
public com.passkit.grpc.CommonObjects.Id sendMessage(com.passkit.grpc.MessageOuterClass.Message request) {
return blockingUnaryCall(
getChannel(), getSendMessageMethod(), getCallOptions(), request);
}
/**
*/
public java.util.Iterator getMessages(
com.passkit.grpc.PaginationOuterClass.Pagination request) {
return blockingServerStreamingCall(
getChannel(), getGetMessagesMethod(), getCallOptions(), request);
}
}
/**
*/
public static final class MessagesFutureStub extends io.grpc.stub.AbstractFutureStub {
private MessagesFutureStub(
io.grpc.Channel channel, io.grpc.CallOptions callOptions) {
super(channel, callOptions);
}
@java.lang.Override
protected MessagesFutureStub build(
io.grpc.Channel channel, io.grpc.CallOptions callOptions) {
return new MessagesFutureStub(channel, callOptions);
}
/**
*/
public com.google.common.util.concurrent.ListenableFuture sendMessage(
com.passkit.grpc.MessageOuterClass.Message request) {
return futureUnaryCall(
getChannel().newCall(getSendMessageMethod(), getCallOptions()), request);
}
}
private static final int METHODID_SEND_MESSAGE = 0;
private static final int METHODID_GET_MESSAGES = 1;
private static final class MethodHandlers implements
io.grpc.stub.ServerCalls.UnaryMethod,
io.grpc.stub.ServerCalls.ServerStreamingMethod,
io.grpc.stub.ServerCalls.ClientStreamingMethod,
io.grpc.stub.ServerCalls.BidiStreamingMethod {
private final MessagesImplBase serviceImpl;
private final int methodId;
MethodHandlers(MessagesImplBase serviceImpl, int methodId) {
this.serviceImpl = serviceImpl;
this.methodId = methodId;
}
@java.lang.Override
@java.lang.SuppressWarnings("unchecked")
public void invoke(Req request, io.grpc.stub.StreamObserver responseObserver) {
switch (methodId) {
case METHODID_SEND_MESSAGE:
serviceImpl.sendMessage((com.passkit.grpc.MessageOuterClass.Message) request,
(io.grpc.stub.StreamObserver) responseObserver);
break;
case METHODID_GET_MESSAGES:
serviceImpl.getMessages((com.passkit.grpc.PaginationOuterClass.Pagination) request,
(io.grpc.stub.StreamObserver) responseObserver);
break;
default:
throw new AssertionError();
}
}
@java.lang.Override
@java.lang.SuppressWarnings("unchecked")
public io.grpc.stub.StreamObserver invoke(
io.grpc.stub.StreamObserver responseObserver) {
switch (methodId) {
default:
throw new AssertionError();
}
}
}
private static abstract class MessagesBaseDescriptorSupplier
implements io.grpc.protobuf.ProtoFileDescriptorSupplier, io.grpc.protobuf.ProtoServiceDescriptorSupplier {
MessagesBaseDescriptorSupplier() {}
@java.lang.Override
public com.google.protobuf.Descriptors.FileDescriptor getFileDescriptor() {
return com.passkit.grpc.ARpcOthers.getDescriptor();
}
@java.lang.Override
public com.google.protobuf.Descriptors.ServiceDescriptor getServiceDescriptor() {
return getFileDescriptor().findServiceByName("Messages");
}
}
private static final class MessagesFileDescriptorSupplier
extends MessagesBaseDescriptorSupplier {
MessagesFileDescriptorSupplier() {}
}
private static final class MessagesMethodDescriptorSupplier
extends MessagesBaseDescriptorSupplier
implements io.grpc.protobuf.ProtoMethodDescriptorSupplier {
private final String methodName;
MessagesMethodDescriptorSupplier(String methodName) {
this.methodName = methodName;
}
@java.lang.Override
public com.google.protobuf.Descriptors.MethodDescriptor getMethodDescriptor() {
return getServiceDescriptor().findMethodByName(methodName);
}
}
private static volatile io.grpc.ServiceDescriptor serviceDescriptor;
public static io.grpc.ServiceDescriptor getServiceDescriptor() {
io.grpc.ServiceDescriptor result = serviceDescriptor;
if (result == null) {
synchronized (MessagesGrpc.class) {
result = serviceDescriptor;
if (result == null) {
serviceDescriptor = result = io.grpc.ServiceDescriptor.newBuilder(SERVICE_NAME)
.setSchemaDescriptor(new MessagesFileDescriptorSupplier())
.addMethod(getSendMessageMethod())
.addMethod(getGetMessagesMethod())
.build();
}
}
}
return result;
}
}