Update API Key Status.
rpc UpdateApiKeyStatus
UpdateApiKeyStatus
user_api.v1.UpdateApiKeyStatus
user_api.v1.UpdateApiKeyStatus
Update API Key Status.
requests UpdateApiKeyStatusRequest
UpdateApiKeyStatusRequest
user_api.v1.UpdateApiKeyStatusRequest
user_api.v1.UpdateApiKeyStatusRequest
Field | Type | Description | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
client_id | string | Client ID. | ||||||||||||
api_key | string | API Key. | ||||||||||||
api_key_status | ApiKeyStatus enum |
|
resp, _ := apiKeyManagerService.UpdateApiKeyStatus(ctx, &v1.UpdateApiKeyStatusRequest{
ApiKey: "API_KEY",
ApiKeyStatus: v1.ApiKeyStatus_API_KEY_STATUS_UNSPECIFIED,
ClientId: "CLIENT_ID",
})
fmt.Println(resp)
const updateapikeystatusrequest = new UpdateApiKeyStatusRequest();
updateapikeystatusrequest.setApiKey("API_KEY");
updateapikeystatusrequest.setApiKeyStatus(ApiKeyStatus.API_KEY_STATUS_ACTIVE);
updateapikeystatusrequest.setClientId("CLIENT_ID");
service.updateApiKeyStatus(updateapikeystatusrequest, (err, value:UpdateApiKeyStatusResponse|null) => {
const resp = JSON.stringify(err ? err : value);
console.log("received ", resp);
})
using System;
using Grpc.Core;
using UserApi.V1;
namespace main
{
class Program
{
static void Main(string[] args)
{
Channel channel = new Channel("user-mgmt.YOUR_SANDBOX_ID.knoxnetworks.io:443", ChannelCredentials.Insecure);
var client = new ApiKeyManagerService.ApiKeyManagerServiceClient(channel);
var headers = new Metadata();
var updateApiKeyStatusRequest = new UpdateApiKeyStatusRequest{
ApiKey = "API_KEY",
ApiKeyStatus = ApiKeyStatus.Api_key_status_unspecified,
ClientId = "CLIENT_ID",
};
var reply = client.UpdateApiKeyStatus(updateApiKeyStatusRequest, headers);
Console.WriteLine("Response: " + reply);
channel.ShutdownAsync().Wait();
}
}
}
package demo;
import io.grpc.Channel;
import io.grpc.ManagedChannel;
import io.grpc.ManagedChannelBuilder;
import user_api.v1.ApiKeyManagerServiceGrpc;
import user_api.v1.User.ApiKeyStatus;
import user_api.v1.User.UpdateApiKeyStatusRequest;
import user_api.v1.User.UpdateApiKeyStatusResponse;
public class App {
public static void main(String[] args) {
ManagedChannel channel = ManagedChannelBuilder
.forAddress("user-mgmt.YOUR_SANDBOX_ID.knoxnetworks.io", 443)
.usePlaintext()
.build();
ApiKeyManagerServiceGrpc.ApiKeyManagerServiceBlockingStub blockStub =
ApiKeyManagerServiceGrpc.newBlockingStub(channel);
UpdateApiKeyStatusRequest req_UpdateApiKeyStatusRequest =
UpdateApiKeyStatusRequest.newBuilder()
.setApiKey("API_KEY")
.setApiKeyStatus(ApiKeyStatus.API_KEY_STATUS_UNSPECIFIED)
.setClientId("CLIENT_ID")
.build();
UpdateApiKeyStatusResponse resp = blockStub.updateApiKeyStatus(req_UpdateApiKeyStatusRequest);
System.out.println(resp);
channel.shutdown();
}
}
const updateapikeystatusrequest = new UpdateApiKeyStatusRequest();
updateapikeystatusrequest.setApiKey("API_KEY");
updateapikeystatusrequest.setApiKeyStatus(ApiKeyStatus.API_KEY_STATUS_UNSPECIFIED);
updateapikeystatusrequest.setClientId("CLIENT_ID");
service.updateApiKeyStatus(updateapikeystatusrequest, (err, value) => {
const resp = JSON.stringify(err ? err : value);
console.log("received ", resp);
})
extern crate grpc-sdks;
use tonic::transport::Channel;
use grpc-sdks::user_api::v1::api_key_manager_service_client::ApiKeyManagerServiceClient;
use grpc-sdks::user_api::v1::ApiKeyStatus;
use grpc-sdks::user_api::v1::UpdateApiKeyStatusRequest;
#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
let channel = Channel::from_static("user-mgmt.YOUR_SANDBOX_ID.knoxnetworks.io")
.connect()
.await?;
let mut client = ApiKeyManagerServiceClient::new(channel);
let request = tonic::Request::new(
UpdateApiKeyStatusRequest{
api_key: String::from("API_KEY"),
api_key_status: ApiKeyStatus::ApiKeyStatusUnspecified as i32,
client_id: String::from("CLIENT_ID")
});
// sending request and waiting for response
let response = client.update_api_key_status(request).await?.into_inner();
println!("RESPONSE={:?}", response);
Ok(())
}
package app
import io.grpc.ManagedChannelBuilder
import user_api.v1.ApiKeyManagerServiceGrpc
import user_api.v1.User.ApiKeyStatus
import user_api.v1.User.UpdateApiKeyStatusRequest
import user_api.v1.User.UpdateApiKeyStatusResponse
fun main() {
val channel = ManagedChannelBuilder
.forAddress("user-mgmt.YOUR_SANDBOX_ID.knoxnetworks.io", 443)
.usePlaintext()
.build()
var blockStub = ApiKeyManagerServiceGrpc.newBlockingStub(channel)
val req_UpdateApiKeyStatusRequest = UpdateApiKeyStatusRequest.newBuilder()
.setApiKey("API_KEY")
.setApiKeyStatus(ApiKeyStatus.API_KEY_STATUS_UNSPECIFIED)
.setClientId("CLIENT_ID")
.build()
val resp = blockStub.updateApiKeyStatus(req_UpdateApiKeyStatusRequest)
println(resp)
channel.shutdown()
}
returns UpdateApiKeyStatusResponse
UpdateApiKeyStatusResponse
user_api.v1.UpdateApiKeyStatusResponse
user_api.v1.UpdateApiKeyStatusResponse
{}