using System;
using Grpc.Core;
using VcApi.V1;
namespace main
{
class Program
{
static void Main(string[] args)
{
Channel channel = new Channel("vc.YOUR_SANDBOX_ID.knoxnetworks.io:443", ChannelCredentials.Insecure);
var client = new CredentialAdapterService.CredentialAdapterServiceClient(channel);
var headers = new Metadata();
var updateVerifiableCredentialStatusRequest = new UpdateVerifiableCredentialStatusRequest{
CredentialType = CredentialType.Credential_type_permanent_resident_card,
Did = "did:method-name:zDIDMultibase58Encoded",
UpdateType = UpdateVerifiableCredentialStatusType.Update_verifiable_credential_status_type_revocation,
};
var reply = client.UpdateVerifiableCredentialStatus(updateVerifiableCredentialStatusRequest, headers);
Console.WriteLine("Response: " + reply);
channel.ShutdownAsync().Wait();
}
}
}
extern crate grpc-sdks;
use tonic::transport::Channel;
use grpc-sdks::vc_api::v1::UpdateVerifiableCredentialStatusType;
use grpc-sdks::vc_api::v1::UpdateVerifiableCredentialStatusRequest;
use grpc-sdks::vc_api::v1::credential_adapter_service_client::CredentialAdapterServiceClient;
use grpc-sdks::vc_api::v1::CredentialType;
#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
let channel = Channel::from_static("vc.YOUR_SANDBOX_ID.knoxnetworks.io")
.connect()
.await?;
let mut client = CredentialAdapterServiceClient::new(channel);
let request = tonic::Request::new(
UpdateVerifiableCredentialStatusRequest{
credential_type: CredentialType::CredentialTypePermanentResidentCard as i32,
did: String::from("did:method-name:zDIDMultibase58Encoded"),
update_type: UpdateVerifiableCredentialStatusType::UpdateVerifiableCredentialStatusTypeRevocation as i32
});
// sending request and waiting for response
let response = client.update_verifiable_credential_status(request).await?.into_inner();
println!("RESPONSE={:?}", response);
Ok(())
}
package app
import io.grpc.ManagedChannelBuilder
import vc_api.v1.CredentialAdapterServiceGrpc
import vc_api.v1.Vc.CredentialType
import vc_api.v1.Vc.UpdateVerifiableCredentialStatusRequest
import vc_api.v1.Vc.UpdateVerifiableCredentialStatusResponse
import vc_api.v1.Vc.UpdateVerifiableCredentialStatusType
fun main() {
val channel = ManagedChannelBuilder
.forAddress("vc.YOUR_SANDBOX_ID.knoxnetworks.io", 443)
.usePlaintext()
.build()
var blockStub = CredentialAdapterServiceGrpc.newBlockingStub(channel)
val req_UpdateVerifiableCredentialStatusRequest = UpdateVerifiableCredentialStatusRequest.newBuilder()
.setCredentialType(CredentialType.CREDENTIAL_TYPE_PERMANENT_RESIDENT_CARD)
.setDid("did:method-name:zDIDMultibase58Encoded")
.setUpdateType(UpdateVerifiableCredentialStatusType.UPDATE_VERIFIABLE_CREDENTIAL_STATUS_TYPE_REVOCATION)
.build()
val resp = blockStub.updateVerifiableCredentialStatus(req_UpdateVerifiableCredentialStatusRequest)
println(resp)
channel.shutdown()
}