deletePolicy
Delete a policy
Deleting the policy using the Policy's Policy ID.
/a1-policy/v2/policies/{policy_id}
Usage and SDK Samples
curl -X DELETE \
-H "Accept: */*,application/problem+json" \
"http://localhost/a1-policy/v2/policies/{policy_id}"
import org.openapitools.client.*;
import org.openapitools.client.auth.*;
import org.openapitools.client.model.*;
import org.openapitools.client.api.A1PolicyManagementApi;
import java.io.File;
import java.util.*;
public class A1PolicyManagementApiExample {
public static void main(String[] args) {
// Create an instance of the API class
A1PolicyManagementApi apiInstance = new A1PolicyManagementApi();
String policyId = policyId_example; // String |
try {
Object result = apiInstance.deletePolicy(policyId);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling A1PolicyManagementApi#deletePolicy");
e.printStackTrace();
}
}
}
import 'package:openapi/api.dart';
final api_instance = DefaultApi();
final String policyId = new String(); // String |
try {
final result = await api_instance.deletePolicy(policyId);
print(result);
} catch (e) {
print('Exception when calling DefaultApi->deletePolicy: $e\n');
}
import org.openapitools.client.api.A1PolicyManagementApi;
public class A1PolicyManagementApiExample {
public static void main(String[] args) {
A1PolicyManagementApi apiInstance = new A1PolicyManagementApi();
String policyId = policyId_example; // String |
try {
Object result = apiInstance.deletePolicy(policyId);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling A1PolicyManagementApi#deletePolicy");
e.printStackTrace();
}
}
}
// Create an instance of the API class
A1PolicyManagementApi *apiInstance = [[A1PolicyManagementApi alloc] init];
String *policyId = policyId_example; // (default to null)
// Delete a policy
[apiInstance deletePolicyWith:policyId
completionHandler: ^(Object output, NSError* error) {
if (output) {
NSLog(@"%@", output);
}
if (error) {
NSLog(@"Error: %@", error);
}
}];
var A1PolicyManagementService = require('a1_policy_management_service');
// Create an instance of the API class
var api = new A1PolicyManagementService.A1PolicyManagementApi()
var policyId = policyId_example; // {String}
var callback = function(error, data, response) {
if (error) {
console.error(error);
} else {
console.log('API called successfully. Returned data: ' + data);
}
};
api.deletePolicy(policyId, callback);
using System;
using System.Diagnostics;
using Org.OpenAPITools.Api;
using Org.OpenAPITools.Client;
using Org.OpenAPITools.Model;
namespace Example
{
public class deletePolicyExample
{
public void main()
{
// Create an instance of the API class
var apiInstance = new A1PolicyManagementApi();
var policyId = policyId_example; // String | (default to null)
try {
// Delete a policy
Object result = apiInstance.deletePolicy(policyId);
Debug.WriteLine(result);
} catch (Exception e) {
Debug.Print("Exception when calling A1PolicyManagementApi.deletePolicy: " + e.Message );
}
}
}
}
<?php
require_once(__DIR__ . '/vendor/autoload.php');
// Create an instance of the API class
$api_instance = new OpenAPITools\Client\Api\A1PolicyManagementApi();
$policyId = policyId_example; // String |
try {
$result = $api_instance->deletePolicy($policyId);
print_r($result);
} catch (Exception $e) {
echo 'Exception when calling A1PolicyManagementApi->deletePolicy: ', $e->getMessage(), PHP_EOL;
}
?>
use Data::Dumper;
use WWW::OPenAPIClient::Configuration;
use WWW::OPenAPIClient::A1PolicyManagementApi;
# Create an instance of the API class
my $api_instance = WWW::OPenAPIClient::A1PolicyManagementApi->new();
my $policyId = policyId_example; # String |
eval {
my $result = $api_instance->deletePolicy(policyId => $policyId);
print Dumper($result);
};
if ($@) {
warn "Exception when calling A1PolicyManagementApi->deletePolicy: $@\n";
}
from __future__ import print_statement
import time
import openapi_client
from openapi_client.rest import ApiException
from pprint import pprint
# Create an instance of the API class
api_instance = openapi_client.A1PolicyManagementApi()
policyId = policyId_example # String | (default to null)
try:
# Delete a policy
api_response = api_instance.delete_policy(policyId)
pprint(api_response)
except ApiException as e:
print("Exception when calling A1PolicyManagementApi->deletePolicy: %s\n" % e)
extern crate A1PolicyManagementApi;
pub fn main() {
let policyId = policyId_example; // String
let mut context = A1PolicyManagementApi::Context::default();
let result = client.deletePolicy(policyId, &context).wait();
println!("{:?}", result);
}
Scopes
Parameters
Name | Description |
---|---|
policy_id* |
String
Required
|