createBlackListDevice
Create to the blacklist.
/blacklist/{serialNumber}
Usage and SDK Samples
curl -X POST \
-H "X-API-KEY: [[apiKey]]" \
-H "Authorization: Bearer [[accessToken]]" \
-H "Content-Type: application/json" \
"https://localhost:16002/api/v1/blacklist/{serialNumber}" \
-d '{
"reason" : "reason",
"serialNumber" : "serialNumber",
"created" : 0,
"author" : "author"
}'
import org.openapitools.client.*;
import org.openapitools.client.auth.*;
import org.openapitools.client.model.*;
import org.openapitools.client.api.BlacklistApi;
import java.io.File;
import java.util.*;
public class BlacklistApiExample {
public static void main(String[] args) {
ApiClient defaultClient = Configuration.getDefaultApiClient();
// Configure API key authorization: ApiKeyAuth
ApiKeyAuth ApiKeyAuth = (ApiKeyAuth) defaultClient.getAuthentication("ApiKeyAuth");
ApiKeyAuth.setApiKey("YOUR API KEY");
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//ApiKeyAuth.setApiKeyPrefix("Token");
// Configure Bearer (JWT) access token for authorization: bearerAuth
HttpBearerAuth bearerAuth = (HttpBearerAuth) defaultClient.getAuthentication("bearerAuth");
bearerAuth.setBearerToken("BEARER TOKEN");
// Create an instance of the API class
BlacklistApi apiInstance = new BlacklistApi();
String serialNumber = serialNumber_example; // String | Pagination start (starts at 1. If not specified, 1 is assumed)
BlackDeviceInfo blackDeviceInfo = ; // BlackDeviceInfo |
try {
apiInstance.createBlackListDevice(serialNumber, blackDeviceInfo);
} catch (ApiException e) {
System.err.println("Exception when calling BlacklistApi#createBlackListDevice");
e.printStackTrace();
}
}
}
import org.openapitools.client.api.BlacklistApi;
public class BlacklistApiExample {
public static void main(String[] args) {
BlacklistApi apiInstance = new BlacklistApi();
String serialNumber = serialNumber_example; // String | Pagination start (starts at 1. If not specified, 1 is assumed)
BlackDeviceInfo blackDeviceInfo = ; // BlackDeviceInfo |
try {
apiInstance.createBlackListDevice(serialNumber, blackDeviceInfo);
} catch (ApiException e) {
System.err.println("Exception when calling BlacklistApi#createBlackListDevice");
e.printStackTrace();
}
}
}
Configuration *apiConfig = [Configuration sharedConfig];
// Configure API key authorization: (authentication scheme: ApiKeyAuth)
[apiConfig setApiKey:@"YOUR_API_KEY" forApiKeyIdentifier:@"X-API-KEY"];
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
//[apiConfig setApiKeyPrefix:@"Bearer" forApiKeyIdentifier:@"X-API-KEY"];
// Configure Bearer (JWT) access token for authorization: bearerAuth
[apiConfig setAccessToken:@"YOUR_ACCESS_TOKEN"];
// Create an instance of the API class
BlacklistApi *apiInstance = [[BlacklistApi alloc] init];
String *serialNumber = serialNumber_example; // Pagination start (starts at 1. If not specified, 1 is assumed) (default to null)
BlackDeviceInfo *blackDeviceInfo = ; // (optional)
// Create to the blacklist.
[apiInstance createBlackListDeviceWith:serialNumber
blackDeviceInfo:blackDeviceInfo
completionHandler: ^(NSError* error) {
if (error) {
NSLog(@"Error: %@", error);
}
}];
var UCentralGatewayApi = require('u_central_gateway_api');
var defaultClient = UCentralGatewayApi.ApiClient.instance;
// Configure API key authorization: ApiKeyAuth
var ApiKeyAuth = defaultClient.authentications['ApiKeyAuth'];
ApiKeyAuth.apiKey = "YOUR API KEY";
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//ApiKeyAuth.apiKeyPrefix['X-API-KEY'] = "Token";
// Configure Bearer (JWT) access token for authorization: bearerAuth
var bearerAuth = defaultClient.authentications['bearerAuth'];
bearerAuth.accessToken = "YOUR ACCESS TOKEN";
// Create an instance of the API class
var api = new UCentralGatewayApi.BlacklistApi()
var serialNumber = serialNumber_example; // {String} Pagination start (starts at 1. If not specified, 1 is assumed)
var opts = {
'blackDeviceInfo': // {BlackDeviceInfo}
};
var callback = function(error, data, response) {
if (error) {
console.error(error);
} else {
console.log('API called successfully.');
}
};
api.createBlackListDevice(serialNumber, opts, callback);
using System;
using System.Diagnostics;
using Org.OpenAPITools.Api;
using Org.OpenAPITools.Client;
using Org.OpenAPITools.Model;
namespace Example
{
public class createBlackListDeviceExample
{
public void main()
{
// Configure API key authorization: ApiKeyAuth
Configuration.Default.ApiKey.Add("X-API-KEY", "YOUR_API_KEY");
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// Configuration.Default.ApiKeyPrefix.Add("X-API-KEY", "Bearer");
// Configure Bearer (JWT) access token for authorization: bearerAuth
Configuration.Default.AccessToken = "YOUR_ACCESS_TOKEN";
// Create an instance of the API class
var apiInstance = new BlacklistApi();
var serialNumber = serialNumber_example; // String | Pagination start (starts at 1. If not specified, 1 is assumed) (default to null)
var blackDeviceInfo = new BlackDeviceInfo(); // BlackDeviceInfo | (optional)
try {
// Create to the blacklist.
apiInstance.createBlackListDevice(serialNumber, blackDeviceInfo);
} catch (Exception e) {
Debug.Print("Exception when calling BlacklistApi.createBlackListDevice: " + e.Message );
}
}
}
}
<?php
require_once(__DIR__ . '/vendor/autoload.php');
// Configure API key authorization: ApiKeyAuth
OpenAPITools\Client\Configuration::getDefaultConfiguration()->setApiKey('X-API-KEY', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// OpenAPITools\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('X-API-KEY', 'Bearer');
// Configure Bearer (JWT) access token for authorization: bearerAuth
OpenAPITools\Client\Configuration::getDefaultConfiguration()->setAccessToken('', 'YOUR_ACCESS_TOKEN');
// Create an instance of the API class
$api_instance = new OpenAPITools\Client\Api\BlacklistApi();
$serialNumber = serialNumber_example; // String | Pagination start (starts at 1. If not specified, 1 is assumed)
$blackDeviceInfo = ; // BlackDeviceInfo |
try {
$api_instance->createBlackListDevice($serialNumber, $blackDeviceInfo);
} catch (Exception $e) {
echo 'Exception when calling BlacklistApi->createBlackListDevice: ', $e->getMessage(), PHP_EOL;
}
?>
use Data::Dumper;
use WWW::OPenAPIClient::Configuration;
use WWW::OPenAPIClient::BlacklistApi;
# Configure API key authorization: ApiKeyAuth
$WWW::OPenAPIClient::Configuration::api_key->{'X-API-KEY'} = 'YOUR_API_KEY';
# uncomment below to setup prefix (e.g. Bearer) for API key, if needed
#$WWW::OPenAPIClient::Configuration::api_key_prefix->{'X-API-KEY'} = "Bearer";
# Configure Bearer (JWT) access token for authorization: bearerAuth
$WWW::OPenAPIClient::Configuration::access_token = 'YOUR_ACCESS_TOKEN';
# Create an instance of the API class
my $api_instance = WWW::OPenAPIClient::BlacklistApi->new();
my $serialNumber = serialNumber_example; # String | Pagination start (starts at 1. If not specified, 1 is assumed)
my $blackDeviceInfo = WWW::OPenAPIClient::Object::BlackDeviceInfo->new(); # BlackDeviceInfo |
eval {
$api_instance->createBlackListDevice(serialNumber => $serialNumber, blackDeviceInfo => $blackDeviceInfo);
};
if ($@) {
warn "Exception when calling BlacklistApi->createBlackListDevice: $@\n";
}
from __future__ import print_statement
import time
import openapi_client
from openapi_client.rest import ApiException
from pprint import pprint
# Configure API key authorization: ApiKeyAuth
openapi_client.configuration.api_key['X-API-KEY'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# openapi_client.configuration.api_key_prefix['X-API-KEY'] = 'Bearer'
# Configure Bearer (JWT) access token for authorization: bearerAuth
openapi_client.configuration.access_token = 'YOUR_ACCESS_TOKEN'
# Create an instance of the API class
api_instance = openapi_client.BlacklistApi()
serialNumber = serialNumber_example # String | Pagination start (starts at 1. If not specified, 1 is assumed) (default to null)
blackDeviceInfo = # BlackDeviceInfo | (optional)
try:
# Create to the blacklist.
api_instance.create_black_list_device(serialNumber, blackDeviceInfo=blackDeviceInfo)
except ApiException as e:
print("Exception when calling BlacklistApi->createBlackListDevice: %s\n" % e)
extern crate BlacklistApi;
pub fn main() {
let serialNumber = serialNumber_example; // String
let blackDeviceInfo = ; // BlackDeviceInfo
let mut context = BlacklistApi::Context::default();
let result = client.createBlackListDevice(serialNumber, blackDeviceInfo, &context).wait();
println!("{:?}", result);
}
Scopes
Parameters
Name | Description |
---|---|
serialNumber* |
String
Pagination start (starts at 1. If not specified, 1 is assumed)
Required
|
Name | Description |
---|---|
blackDeviceInfo |
Add blacklisted device |