org.yamcs.protobuf.AbstractIamApi Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of yamcs-api Show documentation
Show all versions of yamcs-api Show documentation
Used by external clients to communicate with Yamcs
package org.yamcs.protobuf;
import com.google.protobuf.Descriptors.MethodDescriptor;
import com.google.protobuf.Descriptors.ServiceDescriptor;
import com.google.protobuf.Empty;
import com.google.protobuf.Message;
import org.yamcs.api.Api;
import org.yamcs.api.Observer;
/**
* Handles incoming requests related to Identity and Access Management (IAM)
*/
// @javax.annotation.processing.Generated(value = "org.yamcs.protoc.ServiceGenerator", date = "2019-11-25T14:47:49.712Z")
public abstract class AbstractIamApi implements Api {
/**
* List privileges
*/
public abstract void listPrivileges(T ctx, Empty request, Observer observer);
/**
* List roles
*/
public abstract void listRoles(T ctx, Empty request, Observer observer);
/**
* Get a role
*/
public abstract void getRole(T ctx, GetRoleRequest request, Observer observer);
/**
* Delete a role assignment
*/
public abstract void deleteRoleAssignment(T ctx, DeleteRoleAssignmentRequest request, Observer observer);
/**
* List users
*/
public abstract void listUsers(T ctx, Empty request, Observer observer);
/**
* Get a user
*/
public abstract void getUser(T ctx, GetUserRequest request, Observer observer);
/**
* Create a user
*/
public abstract void createUser(T ctx, CreateUserRequest request, Observer observer);
/**
* Update a user
*/
public abstract void updateUser(T ctx, UpdateUserRequest request, Observer observer);
/**
* Get own user
*/
public abstract void getOwnUser(T ctx, Empty request, Observer observer);
/**
* Delete an external identity
*/
public abstract void deleteIdentity(T ctx, DeleteIdentityRequest request, Observer observer);
/**
* List groups
*/
public abstract void listGroups(T ctx, Empty request, Observer observer);
/**
* Get a group
*/
public abstract void getGroup(T ctx, GetGroupRequest request, Observer observer);
/**
* Create a group
*/
public abstract void createGroup(T ctx, CreateGroupRequest request, Observer observer);
/**
* Update a group
*/
public abstract void updateGroup(T ctx, UpdateGroupRequest request, Observer observer);
/**
* Delete a group
*/
public abstract void deleteGroup(T ctx, DeleteGroupRequest request, Observer observer);
/**
* List service accounts
*/
public abstract void listServiceAccounts(T ctx, Empty request, Observer observer);
/**
* Get a service account
*/
public abstract void getServiceAccount(T ctx, GetServiceAccountRequest request, Observer observer);
/**
* Delete a service account
*/
public abstract void deleteServiceAccount(T ctx, DeleteServiceAccountRequest request, Observer observer);
/**
* Create a service account
*/
public abstract void createServiceAccount(T ctx, CreateServiceAccountRequest request, Observer observer);
@Override
public final ServiceDescriptor getDescriptorForType() {
return IamProto.getDescriptor().getServices().get(0);
}
@Override
public final Message getRequestPrototype(MethodDescriptor method) {
if (method.getService() != getDescriptorForType()) {
throw new IllegalArgumentException("Method not contained by this service.");
}
switch (method.getIndex()) {
case 0:
return Empty.getDefaultInstance();
case 1:
return Empty.getDefaultInstance();
case 2:
return GetRoleRequest.getDefaultInstance();
case 3:
return DeleteRoleAssignmentRequest.getDefaultInstance();
case 4:
return Empty.getDefaultInstance();
case 5:
return GetUserRequest.getDefaultInstance();
case 6:
return CreateUserRequest.getDefaultInstance();
case 7:
return UpdateUserRequest.getDefaultInstance();
case 8:
return Empty.getDefaultInstance();
case 9:
return DeleteIdentityRequest.getDefaultInstance();
case 10:
return Empty.getDefaultInstance();
case 11:
return GetGroupRequest.getDefaultInstance();
case 12:
return CreateGroupRequest.getDefaultInstance();
case 13:
return UpdateGroupRequest.getDefaultInstance();
case 14:
return DeleteGroupRequest.getDefaultInstance();
case 15:
return Empty.getDefaultInstance();
case 16:
return GetServiceAccountRequest.getDefaultInstance();
case 17:
return DeleteServiceAccountRequest.getDefaultInstance();
case 18:
return CreateServiceAccountRequest.getDefaultInstance();
default:
throw new IllegalStateException();
}
}
@Override
public final Message getResponsePrototype(MethodDescriptor method) {
if (method.getService() != getDescriptorForType()) {
throw new IllegalArgumentException("Method not contained by this service.");
}
switch (method.getIndex()) {
case 0:
return ListPrivilegesResponse.getDefaultInstance();
case 1:
return ListRolesResponse.getDefaultInstance();
case 2:
return RoleInfo.getDefaultInstance();
case 3:
return Empty.getDefaultInstance();
case 4:
return ListUsersResponse.getDefaultInstance();
case 5:
return UserInfo.getDefaultInstance();
case 6:
return UserInfo.getDefaultInstance();
case 7:
return UserInfo.getDefaultInstance();
case 8:
return UserInfo.getDefaultInstance();
case 9:
return Empty.getDefaultInstance();
case 10:
return ListGroupsResponse.getDefaultInstance();
case 11:
return GroupInfo.getDefaultInstance();
case 12:
return GroupInfo.getDefaultInstance();
case 13:
return GroupInfo.getDefaultInstance();
case 14:
return GroupInfo.getDefaultInstance();
case 15:
return ListServiceAccountsResponse.getDefaultInstance();
case 16:
return ServiceAccountInfo.getDefaultInstance();
case 17:
return Empty.getDefaultInstance();
case 18:
return CreateServiceAccountResponse.getDefaultInstance();
default:
throw new IllegalStateException();
}
}
@Override
@SuppressWarnings("unchecked")
public final void callMethod(MethodDescriptor method, T ctx, Message request, Observer future) {
if (method.getService() != getDescriptorForType()) {
throw new IllegalArgumentException("Method not contained by this service.");
}
switch (method.getIndex()) {
case 0:
listPrivileges(ctx, (Empty) request, (Observer)(Object) future);
return;
case 1:
listRoles(ctx, (Empty) request, (Observer)(Object) future);
return;
case 2:
getRole(ctx, (GetRoleRequest) request, (Observer)(Object) future);
return;
case 3:
deleteRoleAssignment(ctx, (DeleteRoleAssignmentRequest) request, (Observer)(Object) future);
return;
case 4:
listUsers(ctx, (Empty) request, (Observer)(Object) future);
return;
case 5:
getUser(ctx, (GetUserRequest) request, (Observer)(Object) future);
return;
case 6:
createUser(ctx, (CreateUserRequest) request, (Observer)(Object) future);
return;
case 7:
updateUser(ctx, (UpdateUserRequest) request, (Observer)(Object) future);
return;
case 8:
getOwnUser(ctx, (Empty) request, (Observer)(Object) future);
return;
case 9:
deleteIdentity(ctx, (DeleteIdentityRequest) request, (Observer)(Object) future);
return;
case 10:
listGroups(ctx, (Empty) request, (Observer)(Object) future);
return;
case 11:
getGroup(ctx, (GetGroupRequest) request, (Observer)(Object) future);
return;
case 12:
createGroup(ctx, (CreateGroupRequest) request, (Observer)(Object) future);
return;
case 13:
updateGroup(ctx, (UpdateGroupRequest) request, (Observer)(Object) future);
return;
case 14:
deleteGroup(ctx, (DeleteGroupRequest) request, (Observer)(Object) future);
return;
case 15:
listServiceAccounts(ctx, (Empty) request, (Observer)(Object) future);
return;
case 16:
getServiceAccount(ctx, (GetServiceAccountRequest) request, (Observer)(Object) future);
return;
case 17:
deleteServiceAccount(ctx, (DeleteServiceAccountRequest) request, (Observer)(Object) future);
return;
case 18:
createServiceAccount(ctx, (CreateServiceAccountRequest) request, (Observer)(Object) future);
return;
default:
throw new IllegalStateException();
}
}
}