/**
 * Code generated by mercury. DO NOT EDIT.
 * versions:
 * 	mercury v0.9.7
 * 	protoc   v3.10.1
 * source: padlock.proto
 */

import * as mercury from "@llkennedy/mercury";
import { google } from "@llkennedy/protoc-gen-tsjson";
import { 
	ObjectDecryptSegmentedRequest as padlock__ObjectDecryptSegmentedRequest,
	ObjectSignResponse as padlock__ObjectSignResponse,
	ObjectDecryptRequest as padlock__ObjectDecryptRequest,
	ObjectVerifyResponse as padlock__ObjectVerifyResponse,
	ModuleListSlotsRequest as padlock__ModuleListSlotsRequest,
	ObjectDecryptResponse as padlock__ObjectDecryptResponse,
	ObjectSignSegmentedRequest as padlock__ObjectSignSegmentedRequest,
	ApplicationListModulesRequest as padlock__ApplicationListModulesRequest,
	ApplicationConnectRequest as padlock__ApplicationConnectRequest,
	SessionGenerateKeyPairRequest as padlock__SessionGenerateKeyPairRequest,
	SessionCloseResponse as padlock__SessionCloseResponse,
	ModuleListSlotsResponse as padlock__ModuleListSlotsResponse,
	SessionListObjectsRequest as padlock__SessionListObjectsRequest,
	ObjectEncryptSegmentedRequest as padlock__ObjectEncryptSegmentedRequest,
	ObjectDestroyObjectRequest as padlock__ObjectDestroyObjectRequest,
	ModuleInfoRequest as padlock__ModuleInfoRequest,
	ObjectEncryptResponse as padlock__ObjectEncryptResponse,
	ObjectListAttributeValuesUpdate as padlock__ObjectListAttributeValuesUpdate,
	ApplicationListModulesResponse as padlock__ApplicationListModulesResponse,
	SlotOpenSessionUpdate as padlock__SlotOpenSessionUpdate,
	ObjectEncryptSegmentedResponse as padlock__ObjectEncryptSegmentedResponse,
	ObjectWrapKeyResponse as padlock__ObjectWrapKeyResponse,
	SessionLoginRequest as padlock__SessionLoginRequest,
	ObjectSignRequest as padlock__ObjectSignRequest,
	AuthHello as padlock__AuthHello,
	SessionGenerateRandomResponse as padlock__SessionGenerateRandomResponse,
	ModuleInfoResponse as padlock__ModuleInfoResponse,
	SessionID as padlock__SessionID,
	SlotOpenSessionRequest as padlock__SlotOpenSessionRequest,
	ObjectEncryptRequest as padlock__ObjectEncryptRequest,
	SlotInitTokenResponse as padlock__SlotInitTokenResponse,
	ObjectListAttributeValuesRequest as padlock__ObjectListAttributeValuesRequest,
	SessionGenerateRandomRequest as padlock__SessionGenerateRandomRequest,
	ObjectVerifyRequest as padlock__ObjectVerifyRequest,
	ObjectSignSegmentedResponse as padlock__ObjectSignSegmentedResponse,
	SlotListMechanismsRequest as padlock__SlotListMechanismsRequest,
	SessionCloseRequest as padlock__SessionCloseRequest,
	SessionLoginResponse as padlock__SessionLoginResponse,
	ObjectDestroyObjectResponse as padlock__ObjectDestroyObjectResponse,
	AuthToken as padlock__AuthToken,
	SessionLogoutResponse as padlock__SessionLogoutResponse,
	SlotInitTokenRequest as padlock__SlotInitTokenRequest,
	ApplicationConnectUpdate as padlock__ApplicationConnectUpdate,
	SlotListMechanismsResponse as padlock__SlotListMechanismsResponse,
	ObjectUnwrapKeyRequest as padlock__ObjectUnwrapKeyRequest,
	ObjectDecryptSegmentedResponse as padlock__ObjectDecryptSegmentedResponse,
	ObjectVerifySegmentedRequest as padlock__ObjectVerifySegmentedRequest,
	ObjectCopyObjectRequest as padlock__ObjectCopyObjectRequest,
	ObjectVerifySegmentedResponse as padlock__ObjectVerifySegmentedResponse,
	SessionCreateObjectRequest as padlock__SessionCreateObjectRequest,
	SessionGenerateKeyRequest as padlock__SessionGenerateKeyRequest,
	SessionGenerateKeyPairResponse as padlock__SessionGenerateKeyPairResponse,
	ObjectWrapKeyRequest as padlock__ObjectWrapKeyRequest
} from "./padlock";
import { 
	P11Object as padlock__P11Object
} from "./pkcs11";

export class ExposedPadlockClient extends mercury.Client {
	constructor(basePath: string | undefined = "localhost/api/ExposedPadlock", useTLS: boolean | undefined = true, client: mercury.AxiosInstance | undefined = undefined) {
		super(basePath, useTLS, client);
	}
	public async Hello(req: padlock__AuthHello): Promise<padlock__AuthToken> {
		return this.SendUnary("Hello", mercury.HTTPMethod.POST, req, padlock__AuthToken.Parse);
	}
	public async ApplicationListModules(req: padlock__ApplicationListModulesRequest): Promise<padlock__ApplicationListModulesResponse> {
		return this.SendUnary("ApplicationListModules", mercury.HTTPMethod.GET, req, padlock__ApplicationListModulesResponse.Parse);
	}
	public async ApplicationConnect(req: padlock__ApplicationConnectRequest): Promise<mercury.ServerStream<padlock__ApplicationConnectRequest, padlock__ApplicationConnectUpdate>> {
		return this.StartServerStream<padlock__ApplicationConnectRequest, padlock__ApplicationConnectUpdate>("ApplicationConnect", req, padlock__ApplicationConnectUpdate.Parse);
	}
	public async ModuleListSlots(req: padlock__ModuleListSlotsRequest): Promise<padlock__ModuleListSlotsResponse> {
		return this.SendUnary("ModuleListSlots", mercury.HTTPMethod.GET, req, padlock__ModuleListSlotsResponse.Parse);
	}
	public async ModuleInfo(req: padlock__ModuleInfoRequest): Promise<padlock__ModuleInfoResponse> {
		return this.SendUnary("ModuleInfo", mercury.HTTPMethod.GET, req, padlock__ModuleInfoResponse.Parse);
	}
	public async SlotListMechanisms(req: padlock__SlotListMechanismsRequest): Promise<padlock__SlotListMechanismsResponse> {
		return this.SendUnary("SlotListMechanisms", mercury.HTTPMethod.GET, req, padlock__SlotListMechanismsResponse.Parse);
	}
	public async SlotInitToken(req: padlock__SlotInitTokenRequest): Promise<padlock__SlotInitTokenResponse> {
		return this.SendUnary("SlotInitToken", mercury.HTTPMethod.POST, req, padlock__SlotInitTokenResponse.Parse);
	}
	public async SlotOpenSession(req: padlock__SlotOpenSessionRequest): Promise<mercury.ServerStream<padlock__SlotOpenSessionRequest, padlock__SlotOpenSessionUpdate>> {
		return this.StartServerStream<padlock__SlotOpenSessionRequest, padlock__SlotOpenSessionUpdate>("SlotOpenSession", req, padlock__SlotOpenSessionUpdate.Parse);
	}
	public async SessionKeepAlive(req: padlock__SessionID): Promise<google.protobuf.Empty> {
		return this.SendUnary("SessionKeepAlive", mercury.HTTPMethod.POST, req, google.protobuf.Empty.Parse);
	}
	public async SessionClose(req: padlock__SessionCloseRequest): Promise<padlock__SessionCloseResponse> {
		return this.SendUnary("SessionClose", mercury.HTTPMethod.DELETE, req, padlock__SessionCloseResponse.Parse);
	}
	public async SessionLogin(req: padlock__SessionLoginRequest): Promise<padlock__SessionLoginResponse> {
		return this.SendUnary("SessionLogin", mercury.HTTPMethod.PUT, req, padlock__SessionLoginResponse.Parse);
	}
	public async SessionLogout(req: padlock__SessionID): Promise<padlock__SessionLogoutResponse> {
		return this.SendUnary("SessionLogout", mercury.HTTPMethod.PUT, req, padlock__SessionLogoutResponse.Parse);
	}
	public async SessionListObjects(req: padlock__SessionListObjectsRequest): Promise<mercury.ServerStream<padlock__SessionListObjectsRequest, padlock__P11Object>> {
		return this.StartServerStream<padlock__SessionListObjectsRequest, padlock__P11Object>("SessionListObjects", req, padlock__P11Object.Parse);
	}
	public async SessionCreateObject(req: padlock__SessionCreateObjectRequest): Promise<padlock__P11Object> {
		return this.SendUnary("SessionCreateObject", mercury.HTTPMethod.POST, req, padlock__P11Object.Parse);
	}
	public async SessionGenerateRandom(req: padlock__SessionGenerateRandomRequest): Promise<padlock__SessionGenerateRandomResponse> {
		return this.SendUnary("SessionGenerateRandom", mercury.HTTPMethod.POST, req, padlock__SessionGenerateRandomResponse.Parse);
	}
	public async SessionGenerateKeyPair(req: padlock__SessionGenerateKeyPairRequest): Promise<padlock__SessionGenerateKeyPairResponse> {
		return this.SendUnary("SessionGenerateKeyPair", mercury.HTTPMethod.POST, req, padlock__SessionGenerateKeyPairResponse.Parse);
	}
	public async SessionGenerateKey(req: padlock__SessionGenerateKeyRequest): Promise<padlock__P11Object> {
		return this.SendUnary("SessionGenerateKey", mercury.HTTPMethod.POST, req, padlock__P11Object.Parse);
	}
	public async ObjectListAttributeValues(req: padlock__ObjectListAttributeValuesRequest): Promise<mercury.ServerStream<padlock__ObjectListAttributeValuesRequest, padlock__ObjectListAttributeValuesUpdate>> {
		return this.StartServerStream<padlock__ObjectListAttributeValuesRequest, padlock__ObjectListAttributeValuesUpdate>("ObjectListAttributeValues", req, padlock__ObjectListAttributeValuesUpdate.Parse);
	}
	public async Encrypt(req: padlock__ObjectEncryptRequest): Promise<padlock__ObjectEncryptResponse> {
		return this.SendUnary("Encrypt", mercury.HTTPMethod.POST, req, padlock__ObjectEncryptResponse.Parse);
	}
	public async EncryptSegmented(): Promise<mercury.DualStream<padlock__ObjectEncryptSegmentedRequest, padlock__ObjectEncryptSegmentedResponse>> {
		return this.StartDualStream<padlock__ObjectEncryptSegmentedRequest, padlock__ObjectEncryptSegmentedResponse>("EncryptSegmented", padlock__ObjectEncryptSegmentedResponse.Parse);
	}
	public async Decrypt(req: padlock__ObjectDecryptRequest): Promise<padlock__ObjectDecryptResponse> {
		return this.SendUnary("Decrypt", mercury.HTTPMethod.POST, req, padlock__ObjectDecryptResponse.Parse);
	}
	public async DecryptSegmented(): Promise<mercury.DualStream<padlock__ObjectDecryptSegmentedRequest, padlock__ObjectDecryptSegmentedResponse>> {
		return this.StartDualStream<padlock__ObjectDecryptSegmentedRequest, padlock__ObjectDecryptSegmentedResponse>("DecryptSegmented", padlock__ObjectDecryptSegmentedResponse.Parse);
	}
	public async Sign(req: padlock__ObjectSignRequest): Promise<padlock__ObjectSignResponse> {
		return this.SendUnary("Sign", mercury.HTTPMethod.POST, req, padlock__ObjectSignResponse.Parse);
	}
	public async SignSegmented(): Promise<mercury.ClientStream<padlock__ObjectSignSegmentedRequest, padlock__ObjectSignSegmentedResponse>> {
		return this.StartClientStream<padlock__ObjectSignSegmentedRequest, padlock__ObjectSignSegmentedResponse>("SignSegmented", padlock__ObjectSignSegmentedResponse.Parse);
	}
	public async Verify(req: padlock__ObjectVerifyRequest): Promise<padlock__ObjectVerifyResponse> {
		return this.SendUnary("Verify", mercury.HTTPMethod.POST, req, padlock__ObjectVerifyResponse.Parse);
	}
	public async VerifySegmented(): Promise<mercury.ClientStream<padlock__ObjectVerifySegmentedRequest, padlock__ObjectVerifySegmentedResponse>> {
		return this.StartClientStream<padlock__ObjectVerifySegmentedRequest, padlock__ObjectVerifySegmentedResponse>("VerifySegmented", padlock__ObjectVerifySegmentedResponse.Parse);
	}
	public async WrapKey(req: padlock__ObjectWrapKeyRequest): Promise<padlock__ObjectWrapKeyResponse> {
		return this.SendUnary("WrapKey", mercury.HTTPMethod.PUT, req, padlock__ObjectWrapKeyResponse.Parse);
	}
	public async UnwrapKey(req: padlock__ObjectUnwrapKeyRequest): Promise<padlock__P11Object> {
		return this.SendUnary("UnwrapKey", mercury.HTTPMethod.PUT, req, padlock__P11Object.Parse);
	}
	public async DestroyObject(req: padlock__ObjectDestroyObjectRequest): Promise<padlock__ObjectDestroyObjectResponse> {
		return this.SendUnary("DestroyObject", mercury.HTTPMethod.DELETE, req, padlock__ObjectDestroyObjectResponse.Parse);
	}
	public async CopyObject(req: padlock__ObjectCopyObjectRequest): Promise<padlock__P11Object> {
		return this.SendUnary("CopyObject", mercury.HTTPMethod.PUT, req, padlock__P11Object.Parse);
	}
}
