TMI (Threat Modeling Improved) API

Assets

patchThreatModelAsset

Partially update asset

Apply JSON Patch operations to partially update a asset


/threat_models/{threat_model_id}/assets/{asset_id}

Usage and SDK Samples

curl -X PATCH\
 -H "Authorization: Bearer [[accessToken]]"\
-H "Accept: application/json"\
-H "Content-Type: application/json-patch+json"\
"http://localhost:8080/threat_models/{threat_model_id}/assets/{asset_id}"
import io.swagger.client.*;
import io.swagger.client.auth.*;
import io.swagger.client.model.*;
import io.swagger.client.api.AssetsApi;

import java.io.File;
import java.util.*;

public class AssetsApiExample {

    public static void main(String[] args) {
        ApiClient defaultClient = Configuration.getDefaultApiClient();


        AssetsApi apiInstance = new AssetsApi();
        array[threats_threat_id_body] body = ; // array[threats_threat_id_body] | 
        UUID threatModelId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // UUID | Unique identifier of the threat model (UUID)
        UUID assetId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // UUID | Asset ID
        try {
            Asset result = apiInstance.patchThreatModelAsset(body, threatModelId, assetId);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling AssetsApi#patchThreatModelAsset");
            e.printStackTrace();
        }
    }
}
import io.swagger.client.api.AssetsApi;

public class AssetsApiExample {

    public static void main(String[] args) {
        AssetsApi apiInstance = new AssetsApi();
        array[threats_threat_id_body] body = ; // array[threats_threat_id_body] | 
        UUID threatModelId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // UUID | Unique identifier of the threat model (UUID)
        UUID assetId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // UUID | Asset ID
        try {
            Asset result = apiInstance.patchThreatModelAsset(body, threatModelId, assetId);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling AssetsApi#patchThreatModelAsset");
            e.printStackTrace();
        }
    }
}
Configuration *apiConfig = [Configuration sharedConfig];
array[threats_threat_id_body] *body = ; // 
UUID *threatModelId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // Unique identifier of the threat model (UUID)
UUID *assetId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // Asset ID

AssetsApi *apiInstance = [[AssetsApi alloc] init];

// Partially update asset
[apiInstance patchThreatModelAssetWith:body
    threatModelId:threatModelId
    assetId:assetId
              completionHandler: ^(Asset output, NSError* error) {
                            if (output) {
                                NSLog(@"%@", output);
                            }
                            if (error) {
                                NSLog(@"Error: %@", error);
                            }
                        }];
var TmiThreatModelingImprovedApi = require('tmi__threat_modeling_improved_api');
var defaultClient = TmiThreatModelingImprovedApi.ApiClient.instance;


var api = new TmiThreatModelingImprovedApi.AssetsApi()
var body = ; // {{array[threats_threat_id_body]}} 
var threatModelId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // {{UUID}} Unique identifier of the threat model (UUID)
var assetId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // {{UUID}} Asset ID

var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
};
api.patchThreatModelAsset(bodythreatModelIdassetId, callback);
using System;
using System.Diagnostics;
using IO.Swagger.Api;
using IO.Swagger.Client;
using IO.Swagger.Model;

namespace Example
{
    public class patchThreatModelAssetExample
    {
        public void main()
        {


            var apiInstance = new AssetsApi();
            var body = new array[threats_threat_id_body](); // array[threats_threat_id_body] | 
            var threatModelId = new UUID(); // UUID | Unique identifier of the threat model (UUID)
            var assetId = new UUID(); // UUID | Asset ID

            try
            {
                // Partially update asset
                Asset result = apiInstance.patchThreatModelAsset(body, threatModelId, assetId);
                Debug.WriteLine(result);
            }
            catch (Exception e)
            {
                Debug.Print("Exception when calling AssetsApi.patchThreatModelAsset: " + e.Message );
            }
        }
    }
}
<?php
require_once(__DIR__ . '/vendor/autoload.php');


$api_instance = new Swagger\Client\ApiAssetsApi();
$body = ; // array[threats_threat_id_body] | 
$threatModelId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // UUID | Unique identifier of the threat model (UUID)
$assetId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // UUID | Asset ID

try {
    $result = $api_instance->patchThreatModelAsset($body, $threatModelId, $assetId);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling AssetsApi->patchThreatModelAsset: ', $e->getMessage(), PHP_EOL;
}
?>
use Data::Dumper;
use WWW::SwaggerClient::Configuration;
use WWW::SwaggerClient::AssetsApi;


my $api_instance = WWW::SwaggerClient::AssetsApi->new();
my $body = [WWW::SwaggerClient::Object::array[threats_threat_id_body]->new()]; # array[threats_threat_id_body] | 
my $threatModelId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; # UUID | Unique identifier of the threat model (UUID)
my $assetId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; # UUID | Asset ID

eval { 
    my $result = $api_instance->patchThreatModelAsset(body => $body, threatModelId => $threatModelId, assetId => $assetId);
    print Dumper($result);
};
if ($@) {
    warn "Exception when calling AssetsApi->patchThreatModelAsset: $@\n";
}
from __future__ import print_statement
import time
import swagger_client
from swagger_client.rest import ApiException
from pprint import pprint


# create an instance of the API class
api_instance = swagger_client.AssetsApi()
body =  # array[threats_threat_id_body] | 
threatModelId = 38400000-8cf0-11bd-b23e-10b96e4ef00d # UUID | Unique identifier of the threat model (UUID)
assetId = 38400000-8cf0-11bd-b23e-10b96e4ef00d # UUID | Asset ID

try: 
    # Partially update asset
    api_response = api_instance.patch_threat_model_asset(body, threatModelId, assetId)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling AssetsApi->patchThreatModelAsset: %s\n" % e)

Parameters

Path parameters
Name Description
threat_model_id*
UUID (uuid)
Unique identifier of the threat model (UUID)
Required
asset_id*
UUID (uuid)
Asset ID
Required
Body parameters
Name Description
body *

Responses

Status: 200 - Successfully patched asset

Status: 400 - Error response

Status: 401 - Error response

Status: 403 - Error response

Status: 404 - Error response


Authentication

authorizeOAuthProvider

Initiate OAuth authorization flow

Redirects user to OAuth provider's authorization page. Supports client callback URL for seamless client integration. Generates state parameter for CSRF protection.


/oauth2/authorize

Usage and SDK Samples

curl -X GET\
-H "Accept: application/json"\
"http://localhost:8080/oauth2/authorize?idp=&client_callback=&state=&login_hint=&scope="
import io.swagger.client.*;
import io.swagger.client.auth.*;
import io.swagger.client.model.*;
import io.swagger.client.api.AuthenticationApi;

import java.io.File;
import java.util.*;

public class AuthenticationApiExample {

    public static void main(String[] args) {
        
        AuthenticationApi apiInstance = new AuthenticationApi();
        String scope = scope_example; // String | OAuth 2.0 scope parameter. For OpenID Connect, must include "openid". Supports "profile" and "email" scopes. Other scopes are silently ignored. Space-separated values.
        String idp = idp_example; // String | OAuth provider identifier. Defaults to 'test' provider in non-production builds if not specified.
        String clientCallback = clientCallback_example; // String | Client callback URL where TMI should redirect after successful OAuth completion with tokens as query parameters. If not provided, tokens are returned as JSON response.
        String state = state_example; // String | CSRF protection state parameter. Recommended for security. Will be included in the callback response.
        String loginHint = loginHint_example; // String | User identity hint for test OAuth provider. Allows specifying a desired user identity for testing and automation. Only supported by the test provider (ignored by production providers like Google, GitHub, etc.). Must be 3-20 characters, alphanumeric and hyphens only.
        try {
            apiInstance.authorizeOAuthProvider(scope, idp, clientCallback, state, loginHint);
        } catch (ApiException e) {
            System.err.println("Exception when calling AuthenticationApi#authorizeOAuthProvider");
            e.printStackTrace();
        }
    }
}
import io.swagger.client.api.AuthenticationApi;

public class AuthenticationApiExample {

    public static void main(String[] args) {
        AuthenticationApi apiInstance = new AuthenticationApi();
        String scope = scope_example; // String | OAuth 2.0 scope parameter. For OpenID Connect, must include "openid". Supports "profile" and "email" scopes. Other scopes are silently ignored. Space-separated values.
        String idp = idp_example; // String | OAuth provider identifier. Defaults to 'test' provider in non-production builds if not specified.
        String clientCallback = clientCallback_example; // String | Client callback URL where TMI should redirect after successful OAuth completion with tokens as query parameters. If not provided, tokens are returned as JSON response.
        String state = state_example; // String | CSRF protection state parameter. Recommended for security. Will be included in the callback response.
        String loginHint = loginHint_example; // String | User identity hint for test OAuth provider. Allows specifying a desired user identity for testing and automation. Only supported by the test provider (ignored by production providers like Google, GitHub, etc.). Must be 3-20 characters, alphanumeric and hyphens only.
        try {
            apiInstance.authorizeOAuthProvider(scope, idp, clientCallback, state, loginHint);
        } catch (ApiException e) {
            System.err.println("Exception when calling AuthenticationApi#authorizeOAuthProvider");
            e.printStackTrace();
        }
    }
}
String *scope = scope_example; // OAuth 2.0 scope parameter. For OpenID Connect, must include "openid". Supports "profile" and "email" scopes. Other scopes are silently ignored. Space-separated values.
String *idp = idp_example; // OAuth provider identifier. Defaults to 'test' provider in non-production builds if not specified. (optional)
String *clientCallback = clientCallback_example; // Client callback URL where TMI should redirect after successful OAuth completion with tokens as query parameters. If not provided, tokens are returned as JSON response. (optional)
String *state = state_example; // CSRF protection state parameter. Recommended for security. Will be included in the callback response. (optional)
String *loginHint = loginHint_example; // User identity hint for test OAuth provider. Allows specifying a desired user identity for testing and automation. Only supported by the test provider (ignored by production providers like Google, GitHub, etc.). Must be 3-20 characters, alphanumeric and hyphens only. (optional)

AuthenticationApi *apiInstance = [[AuthenticationApi alloc] init];

// Initiate OAuth authorization flow
[apiInstance authorizeOAuthProviderWith:scope
    idp:idp
    clientCallback:clientCallback
    state:state
    loginHint:loginHint
              completionHandler: ^(NSError* error) {
                            if (error) {
                                NSLog(@"Error: %@", error);
                            }
                        }];
var TmiThreatModelingImprovedApi = require('tmi__threat_modeling_improved_api');

var api = new TmiThreatModelingImprovedApi.AuthenticationApi()
var scope = scope_example; // {{String}} OAuth 2.0 scope parameter. For OpenID Connect, must include "openid". Supports "profile" and "email" scopes. Other scopes are silently ignored. Space-separated values.
var opts = { 
  'idp': idp_example, // {{String}} OAuth provider identifier. Defaults to 'test' provider in non-production builds if not specified.
  'clientCallback': clientCallback_example, // {{String}} Client callback URL where TMI should redirect after successful OAuth completion with tokens as query parameters. If not provided, tokens are returned as JSON response.
  'state': state_example, // {{String}} CSRF protection state parameter. Recommended for security. Will be included in the callback response.
  'loginHint': loginHint_example // {{String}} User identity hint for test OAuth provider. Allows specifying a desired user identity for testing and automation. Only supported by the test provider (ignored by production providers like Google, GitHub, etc.). Must be 3-20 characters, alphanumeric and hyphens only.
};
var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully.');
  }
};
api.authorizeOAuthProvider(scope, opts, callback);
using System;
using System.Diagnostics;
using IO.Swagger.Api;
using IO.Swagger.Client;
using IO.Swagger.Model;

namespace Example
{
    public class authorizeOAuthProviderExample
    {
        public void main()
        {

            var apiInstance = new AuthenticationApi();
            var scope = scope_example;  // String | OAuth 2.0 scope parameter. For OpenID Connect, must include "openid". Supports "profile" and "email" scopes. Other scopes are silently ignored. Space-separated values.
            var idp = idp_example;  // String | OAuth provider identifier. Defaults to 'test' provider in non-production builds if not specified. (optional) 
            var clientCallback = clientCallback_example;  // String | Client callback URL where TMI should redirect after successful OAuth completion with tokens as query parameters. If not provided, tokens are returned as JSON response. (optional) 
            var state = state_example;  // String | CSRF protection state parameter. Recommended for security. Will be included in the callback response. (optional) 
            var loginHint = loginHint_example;  // String | User identity hint for test OAuth provider. Allows specifying a desired user identity for testing and automation. Only supported by the test provider (ignored by production providers like Google, GitHub, etc.). Must be 3-20 characters, alphanumeric and hyphens only. (optional) 

            try
            {
                // Initiate OAuth authorization flow
                apiInstance.authorizeOAuthProvider(scope, idp, clientCallback, state, loginHint);
            }
            catch (Exception e)
            {
                Debug.Print("Exception when calling AuthenticationApi.authorizeOAuthProvider: " + e.Message );
            }
        }
    }
}
<?php
require_once(__DIR__ . '/vendor/autoload.php');

$api_instance = new Swagger\Client\ApiAuthenticationApi();
$scope = scope_example; // String | OAuth 2.0 scope parameter. For OpenID Connect, must include "openid". Supports "profile" and "email" scopes. Other scopes are silently ignored. Space-separated values.
$idp = idp_example; // String | OAuth provider identifier. Defaults to 'test' provider in non-production builds if not specified.
$clientCallback = clientCallback_example; // String | Client callback URL where TMI should redirect after successful OAuth completion with tokens as query parameters. If not provided, tokens are returned as JSON response.
$state = state_example; // String | CSRF protection state parameter. Recommended for security. Will be included in the callback response.
$loginHint = loginHint_example; // String | User identity hint for test OAuth provider. Allows specifying a desired user identity for testing and automation. Only supported by the test provider (ignored by production providers like Google, GitHub, etc.). Must be 3-20 characters, alphanumeric and hyphens only.

try {
    $api_instance->authorizeOAuthProvider($scope, $idp, $clientCallback, $state, $loginHint);
} catch (Exception $e) {
    echo 'Exception when calling AuthenticationApi->authorizeOAuthProvider: ', $e->getMessage(), PHP_EOL;
}
?>
use Data::Dumper;
use WWW::SwaggerClient::Configuration;
use WWW::SwaggerClient::AuthenticationApi;

my $api_instance = WWW::SwaggerClient::AuthenticationApi->new();
my $scope = scope_example; # String | OAuth 2.0 scope parameter. For OpenID Connect, must include "openid". Supports "profile" and "email" scopes. Other scopes are silently ignored. Space-separated values.
my $idp = idp_example; # String | OAuth provider identifier. Defaults to 'test' provider in non-production builds if not specified.
my $clientCallback = clientCallback_example; # String | Client callback URL where TMI should redirect after successful OAuth completion with tokens as query parameters. If not provided, tokens are returned as JSON response.
my $state = state_example; # String | CSRF protection state parameter. Recommended for security. Will be included in the callback response.
my $loginHint = loginHint_example; # String | User identity hint for test OAuth provider. Allows specifying a desired user identity for testing and automation. Only supported by the test provider (ignored by production providers like Google, GitHub, etc.). Must be 3-20 characters, alphanumeric and hyphens only.

eval { 
    $api_instance->authorizeOAuthProvider(scope => $scope, idp => $idp, clientCallback => $clientCallback, state => $state, loginHint => $loginHint);
};
if ($@) {
    warn "Exception when calling AuthenticationApi->authorizeOAuthProvider: $@\n";
}
from __future__ import print_statement
import time
import swagger_client
from swagger_client.rest import ApiException
from pprint import pprint

# create an instance of the API class
api_instance = swagger_client.AuthenticationApi()
scope = scope_example # String | OAuth 2.0 scope parameter. For OpenID Connect, must include "openid". Supports "profile" and "email" scopes. Other scopes are silently ignored. Space-separated values.
idp = idp_example # String | OAuth provider identifier. Defaults to 'test' provider in non-production builds if not specified. (optional)
clientCallback = clientCallback_example # String | Client callback URL where TMI should redirect after successful OAuth completion with tokens as query parameters. If not provided, tokens are returned as JSON response. (optional)
state = state_example # String | CSRF protection state parameter. Recommended for security. Will be included in the callback response. (optional)
loginHint = loginHint_example # String | User identity hint for test OAuth provider. Allows specifying a desired user identity for testing and automation. Only supported by the test provider (ignored by production providers like Google, GitHub, etc.). Must be 3-20 characters, alphanumeric and hyphens only. (optional)

try: 
    # Initiate OAuth authorization flow
    api_instance.authorize_o_auth_provider(scope, idp=idp, clientCallback=clientCallback, state=state, loginHint=loginHint)
except ApiException as e:
    print("Exception when calling AuthenticationApi->authorizeOAuthProvider: %s\n" % e)

Parameters

Query parameters
Name Description
idp
String
OAuth provider identifier. Defaults to 'test' provider in non-production builds if not specified.
client_callback
String (uri)
Client callback URL where TMI should redirect after successful OAuth completion with tokens as query parameters. If not provided, tokens are returned as JSON response.
state
String
CSRF protection state parameter. Recommended for security. Will be included in the callback response.
login_hint
String
User identity hint for test OAuth provider. Allows specifying a desired user identity for testing and automation. Only supported by the test provider (ignored by production providers like Google, GitHub, etc.). Must be 3-20 characters, alphanumeric and hyphens only.
scope*
String
OAuth 2.0 scope parameter. For OpenID Connect, must include "openid". Supports "profile" and "email" scopes. Other scopes are silently ignored. Space-separated values.
Required

Responses

Status: 302 - Redirect to OAuth provider authorization page

Name Type Format Description
Location String uri

Status: 400 - Invalid provider or provider not configured

Status: 500 - Internal server error generating authorization URL


exchangeOAuthCode

Exchange OAuth authorization code for JWT tokens

Provider-neutral endpoint to exchange OAuth authorization codes for TMI JWT tokens. Supports Google, GitHub, and Microsoft OAuth providers.


/oauth2/token

Usage and SDK Samples

curl -X POST\
-H "Accept: application/json"\
-H "Content-Type: application/json"\
"http://localhost:8080/oauth2/token?idp="
import io.swagger.client.*;
import io.swagger.client.auth.*;
import io.swagger.client.model.*;
import io.swagger.client.api.AuthenticationApi;

import java.io.File;
import java.util.*;

public class AuthenticationApiExample {

    public static void main(String[] args) {
        
        AuthenticationApi apiInstance = new AuthenticationApi();
        Oauth2_token_body body = ; // Oauth2_token_body | 
        String idp = idp_example; // String | OAuth provider identifier. Defaults to 'test' provider in non-production builds if not specified.
        try {
            AuthTokenResponse result = apiInstance.exchangeOAuthCode(body, idp);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling AuthenticationApi#exchangeOAuthCode");
            e.printStackTrace();
        }
    }
}
import io.swagger.client.api.AuthenticationApi;

public class AuthenticationApiExample {

    public static void main(String[] args) {
        AuthenticationApi apiInstance = new AuthenticationApi();
        Oauth2_token_body body = ; // Oauth2_token_body | 
        String idp = idp_example; // String | OAuth provider identifier. Defaults to 'test' provider in non-production builds if not specified.
        try {
            AuthTokenResponse result = apiInstance.exchangeOAuthCode(body, idp);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling AuthenticationApi#exchangeOAuthCode");
            e.printStackTrace();
        }
    }
}
Oauth2_token_body *body = ; // 
String *idp = idp_example; // OAuth provider identifier. Defaults to 'test' provider in non-production builds if not specified. (optional)

AuthenticationApi *apiInstance = [[AuthenticationApi alloc] init];

// Exchange OAuth authorization code for JWT tokens
[apiInstance exchangeOAuthCodeWith:body
    idp:idp
              completionHandler: ^(AuthTokenResponse output, NSError* error) {
                            if (output) {
                                NSLog(@"%@", output);
                            }
                            if (error) {
                                NSLog(@"Error: %@", error);
                            }
                        }];
var TmiThreatModelingImprovedApi = require('tmi__threat_modeling_improved_api');

var api = new TmiThreatModelingImprovedApi.AuthenticationApi()
var body = ; // {{Oauth2_token_body}} 
var opts = { 
  'idp': idp_example // {{String}} OAuth provider identifier. Defaults to 'test' provider in non-production builds if not specified.
};
var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
};
api.exchangeOAuthCode(body, opts, callback);
using System;
using System.Diagnostics;
using IO.Swagger.Api;
using IO.Swagger.Client;
using IO.Swagger.Model;

namespace Example
{
    public class exchangeOAuthCodeExample
    {
        public void main()
        {

            var apiInstance = new AuthenticationApi();
            var body = new Oauth2_token_body(); // Oauth2_token_body | 
            var idp = idp_example;  // String | OAuth provider identifier. Defaults to 'test' provider in non-production builds if not specified. (optional) 

            try
            {
                // Exchange OAuth authorization code for JWT tokens
                AuthTokenResponse result = apiInstance.exchangeOAuthCode(body, idp);
                Debug.WriteLine(result);
            }
            catch (Exception e)
            {
                Debug.Print("Exception when calling AuthenticationApi.exchangeOAuthCode: " + e.Message );
            }
        }
    }
}
<?php
require_once(__DIR__ . '/vendor/autoload.php');

$api_instance = new Swagger\Client\ApiAuthenticationApi();
$body = ; // Oauth2_token_body | 
$idp = idp_example; // String | OAuth provider identifier. Defaults to 'test' provider in non-production builds if not specified.

try {
    $result = $api_instance->exchangeOAuthCode($body, $idp);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling AuthenticationApi->exchangeOAuthCode: ', $e->getMessage(), PHP_EOL;
}
?>
use Data::Dumper;
use WWW::SwaggerClient::Configuration;
use WWW::SwaggerClient::AuthenticationApi;

my $api_instance = WWW::SwaggerClient::AuthenticationApi->new();
my $body = WWW::SwaggerClient::Object::Oauth2_token_body->new(); # Oauth2_token_body | 
my $idp = idp_example; # String | OAuth provider identifier. Defaults to 'test' provider in non-production builds if not specified.

eval { 
    my $result = $api_instance->exchangeOAuthCode(body => $body, idp => $idp);
    print Dumper($result);
};
if ($@) {
    warn "Exception when calling AuthenticationApi->exchangeOAuthCode: $@\n";
}
from __future__ import print_statement
import time
import swagger_client
from swagger_client.rest import ApiException
from pprint import pprint

# create an instance of the API class
api_instance = swagger_client.AuthenticationApi()
body =  # Oauth2_token_body | 
idp = idp_example # String | OAuth provider identifier. Defaults to 'test' provider in non-production builds if not specified. (optional)

try: 
    # Exchange OAuth authorization code for JWT tokens
    api_response = api_instance.exchange_o_auth_code(body, idp=idp)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling AuthenticationApi->exchangeOAuthCode: %s\n" % e)

Parameters

Body parameters
Name Description
body *
Query parameters
Name Description
idp
String
OAuth provider identifier. Defaults to 'test' provider in non-production builds if not specified.

Responses

Status: 200 - OAuth exchange successful, TMI JWT tokens issued

Status: 400 - Bad request - invalid provider, missing parameters, or invalid state

Status: 500 - Internal server error - OAuth provider communication failed


getAuthProviders

List available OAuth providers

Returns a list of configured OAuth providers available for authentication


/oauth2/providers

Usage and SDK Samples

curl -X GET\
-H "Accept: application/json"\
"http://localhost:8080/oauth2/providers"
import io.swagger.client.*;
import io.swagger.client.auth.*;
import io.swagger.client.model.*;
import io.swagger.client.api.AuthenticationApi;

import java.io.File;
import java.util.*;

public class AuthenticationApiExample {

    public static void main(String[] args) {
        
        AuthenticationApi apiInstance = new AuthenticationApi();
        try {
            inline_response_200_4 result = apiInstance.getAuthProviders();
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling AuthenticationApi#getAuthProviders");
            e.printStackTrace();
        }
    }
}
import io.swagger.client.api.AuthenticationApi;

public class AuthenticationApiExample {

    public static void main(String[] args) {
        AuthenticationApi apiInstance = new AuthenticationApi();
        try {
            inline_response_200_4 result = apiInstance.getAuthProviders();
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling AuthenticationApi#getAuthProviders");
            e.printStackTrace();
        }
    }
}

AuthenticationApi *apiInstance = [[AuthenticationApi alloc] init];

// List available OAuth providers
[apiInstance getAuthProvidersWithCompletionHandler: 
              ^(inline_response_200_4 output, NSError* error) {
                            if (output) {
                                NSLog(@"%@", output);
                            }
                            if (error) {
                                NSLog(@"Error: %@", error);
                            }
                        }];
var TmiThreatModelingImprovedApi = require('tmi__threat_modeling_improved_api');

var api = new TmiThreatModelingImprovedApi.AuthenticationApi()
var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
};
api.getAuthProviders(callback);
using System;
using System.Diagnostics;
using IO.Swagger.Api;
using IO.Swagger.Client;
using IO.Swagger.Model;

namespace Example
{
    public class getAuthProvidersExample
    {
        public void main()
        {

            var apiInstance = new AuthenticationApi();

            try
            {
                // List available OAuth providers
                inline_response_200_4 result = apiInstance.getAuthProviders();
                Debug.WriteLine(result);
            }
            catch (Exception e)
            {
                Debug.Print("Exception when calling AuthenticationApi.getAuthProviders: " + e.Message );
            }
        }
    }
}
<?php
require_once(__DIR__ . '/vendor/autoload.php');

$api_instance = new Swagger\Client\ApiAuthenticationApi();

try {
    $result = $api_instance->getAuthProviders();
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling AuthenticationApi->getAuthProviders: ', $e->getMessage(), PHP_EOL;
}
?>
use Data::Dumper;
use WWW::SwaggerClient::Configuration;
use WWW::SwaggerClient::AuthenticationApi;

my $api_instance = WWW::SwaggerClient::AuthenticationApi->new();

eval { 
    my $result = $api_instance->getAuthProviders();
    print Dumper($result);
};
if ($@) {
    warn "Exception when calling AuthenticationApi->getAuthProviders: $@\n";
}
from __future__ import print_statement
import time
import swagger_client
from swagger_client.rest import ApiException
from pprint import pprint

# create an instance of the API class
api_instance = swagger_client.AuthenticationApi()

try: 
    # List available OAuth providers
    api_response = api_instance.get_auth_providers()
    pprint(api_response)
except ApiException as e:
    print("Exception when calling AuthenticationApi->getAuthProviders: %s\n" % e)

Parameters

Responses

Status: 200 - List of available OAuth providers

Status: 500 - Error response


getCurrentUser

Get current user information

Returns information about the currently authenticated user


/oauth2/userinfo

Usage and SDK Samples

curl -X GET\
 -H "Authorization: Bearer [[accessToken]]"\
-H "Accept: application/json"\
"http://localhost:8080/oauth2/userinfo"
import io.swagger.client.*;
import io.swagger.client.auth.*;
import io.swagger.client.model.*;
import io.swagger.client.api.AuthenticationApi;

import java.io.File;
import java.util.*;

public class AuthenticationApiExample {

    public static void main(String[] args) {
        ApiClient defaultClient = Configuration.getDefaultApiClient();


        AuthenticationApi apiInstance = new AuthenticationApi();
        try {
            inline_response_200_6 result = apiInstance.getCurrentUser();
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling AuthenticationApi#getCurrentUser");
            e.printStackTrace();
        }
    }
}
import io.swagger.client.api.AuthenticationApi;

public class AuthenticationApiExample {

    public static void main(String[] args) {
        AuthenticationApi apiInstance = new AuthenticationApi();
        try {
            inline_response_200_6 result = apiInstance.getCurrentUser();
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling AuthenticationApi#getCurrentUser");
            e.printStackTrace();
        }
    }
}
Configuration *apiConfig = [Configuration sharedConfig];

AuthenticationApi *apiInstance = [[AuthenticationApi alloc] init];

// Get current user information
[apiInstance getCurrentUserWithCompletionHandler: 
              ^(inline_response_200_6 output, NSError* error) {
                            if (output) {
                                NSLog(@"%@", output);
                            }
                            if (error) {
                                NSLog(@"Error: %@", error);
                            }
                        }];
var TmiThreatModelingImprovedApi = require('tmi__threat_modeling_improved_api');
var defaultClient = TmiThreatModelingImprovedApi.ApiClient.instance;


var api = new TmiThreatModelingImprovedApi.AuthenticationApi()
var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
};
api.getCurrentUser(callback);
using System;
using System.Diagnostics;
using IO.Swagger.Api;
using IO.Swagger.Client;
using IO.Swagger.Model;

namespace Example
{
    public class getCurrentUserExample
    {
        public void main()
        {


            var apiInstance = new AuthenticationApi();

            try
            {
                // Get current user information
                inline_response_200_6 result = apiInstance.getCurrentUser();
                Debug.WriteLine(result);
            }
            catch (Exception e)
            {
                Debug.Print("Exception when calling AuthenticationApi.getCurrentUser: " + e.Message );
            }
        }
    }
}
<?php
require_once(__DIR__ . '/vendor/autoload.php');


$api_instance = new Swagger\Client\ApiAuthenticationApi();

try {
    $result = $api_instance->getCurrentUser();
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling AuthenticationApi->getCurrentUser: ', $e->getMessage(), PHP_EOL;
}
?>
use Data::Dumper;
use WWW::SwaggerClient::Configuration;
use WWW::SwaggerClient::AuthenticationApi;


my $api_instance = WWW::SwaggerClient::AuthenticationApi->new();

eval { 
    my $result = $api_instance->getCurrentUser();
    print Dumper($result);
};
if ($@) {
    warn "Exception when calling AuthenticationApi->getCurrentUser: $@\n";
}
from __future__ import print_statement
import time
import swagger_client
from swagger_client.rest import ApiException
from pprint import pprint


# create an instance of the API class
api_instance = swagger_client.AuthenticationApi()

try: 
    # Get current user information
    api_response = api_instance.get_current_user()
    pprint(api_response)
except ApiException as e:
    print("Exception when calling AuthenticationApi->getCurrentUser: %s\n" % e)

Parameters

Responses

Status: 200 - Current user information

Status: 401 - Error response

Status: 500 - Error response


getCurrentUserProfile

Get current user profile

Returns detailed information about the currently authenticated user including groups and identity provider


/users/me

Usage and SDK Samples

curl -X GET\
 -H "Authorization: Bearer [[accessToken]]"\
-H "Accept: application/json"\
"http://localhost:8080/users/me"
import io.swagger.client.*;
import io.swagger.client.auth.*;
import io.swagger.client.model.*;
import io.swagger.client.api.AuthenticationApi;

import java.io.File;
import java.util.*;

public class AuthenticationApiExample {

    public static void main(String[] args) {
        ApiClient defaultClient = Configuration.getDefaultApiClient();


        AuthenticationApi apiInstance = new AuthenticationApi();
        try {
            User result = apiInstance.getCurrentUserProfile();
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling AuthenticationApi#getCurrentUserProfile");
            e.printStackTrace();
        }
    }
}
import io.swagger.client.api.AuthenticationApi;

public class AuthenticationApiExample {

    public static void main(String[] args) {
        AuthenticationApi apiInstance = new AuthenticationApi();
        try {
            User result = apiInstance.getCurrentUserProfile();
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling AuthenticationApi#getCurrentUserProfile");
            e.printStackTrace();
        }
    }
}
Configuration *apiConfig = [Configuration sharedConfig];

AuthenticationApi *apiInstance = [[AuthenticationApi alloc] init];

// Get current user profile
[apiInstance getCurrentUserProfileWithCompletionHandler: 
              ^(User output, NSError* error) {
                            if (output) {
                                NSLog(@"%@", output);
                            }
                            if (error) {
                                NSLog(@"Error: %@", error);
                            }
                        }];
var TmiThreatModelingImprovedApi = require('tmi__threat_modeling_improved_api');
var defaultClient = TmiThreatModelingImprovedApi.ApiClient.instance;


var api = new TmiThreatModelingImprovedApi.AuthenticationApi()
var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
};
api.getCurrentUserProfile(callback);
using System;
using System.Diagnostics;
using IO.Swagger.Api;
using IO.Swagger.Client;
using IO.Swagger.Model;

namespace Example
{
    public class getCurrentUserProfileExample
    {
        public void main()
        {


            var apiInstance = new AuthenticationApi();

            try
            {
                // Get current user profile
                User result = apiInstance.getCurrentUserProfile();
                Debug.WriteLine(result);
            }
            catch (Exception e)
            {
                Debug.Print("Exception when calling AuthenticationApi.getCurrentUserProfile: " + e.Message );
            }
        }
    }
}
<?php
require_once(__DIR__ . '/vendor/autoload.php');


$api_instance = new Swagger\Client\ApiAuthenticationApi();

try {
    $result = $api_instance->getCurrentUserProfile();
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling AuthenticationApi->getCurrentUserProfile: ', $e->getMessage(), PHP_EOL;
}
?>
use Data::Dumper;
use WWW::SwaggerClient::Configuration;
use WWW::SwaggerClient::AuthenticationApi;


my $api_instance = WWW::SwaggerClient::AuthenticationApi->new();

eval { 
    my $result = $api_instance->getCurrentUserProfile();
    print Dumper($result);
};
if ($@) {
    warn "Exception when calling AuthenticationApi->getCurrentUserProfile: $@\n";
}
from __future__ import print_statement
import time
import swagger_client
from swagger_client.rest import ApiException
from pprint import pprint


# create an instance of the API class
api_instance = swagger_client.AuthenticationApi()

try: 
    # Get current user profile
    api_response = api_instance.get_current_user_profile()
    pprint(api_response)
except ApiException as e:
    print("Exception when calling AuthenticationApi->getCurrentUserProfile: %s\n" % e)

Parameters

Responses

Status: 200 - Current user profile

Status: 401 - Error response

Status: 500 - Error response


getProviderGroups

Get groups for identity provider

Returns groups available from a specific identity provider for autocomplete and discovery


/oauth2/providers/{idp}/groups

Usage and SDK Samples

curl -X GET\
 -H "Authorization: Bearer [[accessToken]]"\
-H "Accept: application/json"\
"http://localhost:8080/oauth2/providers/{idp}/groups"
import io.swagger.client.*;
import io.swagger.client.auth.*;
import io.swagger.client.model.*;
import io.swagger.client.api.AuthenticationApi;

import java.io.File;
import java.util.*;

public class AuthenticationApiExample {

    public static void main(String[] args) {
        ApiClient defaultClient = Configuration.getDefaultApiClient();


        AuthenticationApi apiInstance = new AuthenticationApi();
        String idp = idp_example; // String | Identity provider ID (e.g., saml_okta, saml_azure)
        try {
            inline_response_200_5 result = apiInstance.getProviderGroups(idp);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling AuthenticationApi#getProviderGroups");
            e.printStackTrace();
        }
    }
}
import io.swagger.client.api.AuthenticationApi;

public class AuthenticationApiExample {

    public static void main(String[] args) {
        AuthenticationApi apiInstance = new AuthenticationApi();
        String idp = idp_example; // String | Identity provider ID (e.g., saml_okta, saml_azure)
        try {
            inline_response_200_5 result = apiInstance.getProviderGroups(idp);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling AuthenticationApi#getProviderGroups");
            e.printStackTrace();
        }
    }
}
Configuration *apiConfig = [Configuration sharedConfig];
String *idp = idp_example; // Identity provider ID (e.g., saml_okta, saml_azure)

AuthenticationApi *apiInstance = [[AuthenticationApi alloc] init];

// Get groups for identity provider
[apiInstance getProviderGroupsWith:idp
              completionHandler: ^(inline_response_200_5 output, NSError* error) {
                            if (output) {
                                NSLog(@"%@", output);
                            }
                            if (error) {
                                NSLog(@"Error: %@", error);
                            }
                        }];
var TmiThreatModelingImprovedApi = require('tmi__threat_modeling_improved_api');
var defaultClient = TmiThreatModelingImprovedApi.ApiClient.instance;


var api = new TmiThreatModelingImprovedApi.AuthenticationApi()
var idp = idp_example; // {{String}} Identity provider ID (e.g., saml_okta, saml_azure)

var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
};
api.getProviderGroups(idp, callback);
using System;
using System.Diagnostics;
using IO.Swagger.Api;
using IO.Swagger.Client;
using IO.Swagger.Model;

namespace Example
{
    public class getProviderGroupsExample
    {
        public void main()
        {


            var apiInstance = new AuthenticationApi();
            var idp = idp_example;  // String | Identity provider ID (e.g., saml_okta, saml_azure)

            try
            {
                // Get groups for identity provider
                inline_response_200_5 result = apiInstance.getProviderGroups(idp);
                Debug.WriteLine(result);
            }
            catch (Exception e)
            {
                Debug.Print("Exception when calling AuthenticationApi.getProviderGroups: " + e.Message );
            }
        }
    }
}
<?php
require_once(__DIR__ . '/vendor/autoload.php');


$api_instance = new Swagger\Client\ApiAuthenticationApi();
$idp = idp_example; // String | Identity provider ID (e.g., saml_okta, saml_azure)

try {
    $result = $api_instance->getProviderGroups($idp);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling AuthenticationApi->getProviderGroups: ', $e->getMessage(), PHP_EOL;
}
?>
use Data::Dumper;
use WWW::SwaggerClient::Configuration;
use WWW::SwaggerClient::AuthenticationApi;


my $api_instance = WWW::SwaggerClient::AuthenticationApi->new();
my $idp = idp_example; # String | Identity provider ID (e.g., saml_okta, saml_azure)

eval { 
    my $result = $api_instance->getProviderGroups(idp => $idp);
    print Dumper($result);
};
if ($@) {
    warn "Exception when calling AuthenticationApi->getProviderGroups: $@\n";
}
from __future__ import print_statement
import time
import swagger_client
from swagger_client.rest import ApiException
from pprint import pprint


# create an instance of the API class
api_instance = swagger_client.AuthenticationApi()
idp = idp_example # String | Identity provider ID (e.g., saml_okta, saml_azure)

try: 
    # Get groups for identity provider
    api_response = api_instance.get_provider_groups(idp)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling AuthenticationApi->getProviderGroups: %s\n" % e)

Parameters

Path parameters
Name Description
idp*
String
Identity provider ID (e.g., saml_okta, saml_azure)
Required

Responses

Status: 200 - List of groups from the identity provider

Status: 401 - Error response

Status: 404 - Error response

Status: 500 - Error response


getSAMLMetadata

Get SAML service provider metadata

Returns the SP metadata XML for SAML configuration


/saml/metadata

Usage and SDK Samples

curl -X GET\
-H "Accept: application/samlmetadata+xml,application/json"\
"http://localhost:8080/saml/metadata"
import io.swagger.client.*;
import io.swagger.client.auth.*;
import io.swagger.client.model.*;
import io.swagger.client.api.AuthenticationApi;

import java.io.File;
import java.util.*;

public class AuthenticationApiExample {

    public static void main(String[] args) {
        
        AuthenticationApi apiInstance = new AuthenticationApi();
        try {
            'String' result = apiInstance.getSAMLMetadata();
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling AuthenticationApi#getSAMLMetadata");
            e.printStackTrace();
        }
    }
}
import io.swagger.client.api.AuthenticationApi;

public class AuthenticationApiExample {

    public static void main(String[] args) {
        AuthenticationApi apiInstance = new AuthenticationApi();
        try {
            'String' result = apiInstance.getSAMLMetadata();
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling AuthenticationApi#getSAMLMetadata");
            e.printStackTrace();
        }
    }
}

AuthenticationApi *apiInstance = [[AuthenticationApi alloc] init];

// Get SAML service provider metadata
[apiInstance getSAMLMetadataWithCompletionHandler: 
              ^('String' output, NSError* error) {
                            if (output) {
                                NSLog(@"%@", output);
                            }
                            if (error) {
                                NSLog(@"Error: %@", error);
                            }
                        }];
var TmiThreatModelingImprovedApi = require('tmi__threat_modeling_improved_api');

var api = new TmiThreatModelingImprovedApi.AuthenticationApi()
var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
};
api.getSAMLMetadata(callback);
using System;
using System.Diagnostics;
using IO.Swagger.Api;
using IO.Swagger.Client;
using IO.Swagger.Model;

namespace Example
{
    public class getSAMLMetadataExample
    {
        public void main()
        {

            var apiInstance = new AuthenticationApi();

            try
            {
                // Get SAML service provider metadata
                'String' result = apiInstance.getSAMLMetadata();
                Debug.WriteLine(result);
            }
            catch (Exception e)
            {
                Debug.Print("Exception when calling AuthenticationApi.getSAMLMetadata: " + e.Message );
            }
        }
    }
}
<?php
require_once(__DIR__ . '/vendor/autoload.php');

$api_instance = new Swagger\Client\ApiAuthenticationApi();

try {
    $result = $api_instance->getSAMLMetadata();
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling AuthenticationApi->getSAMLMetadata: ', $e->getMessage(), PHP_EOL;
}
?>
use Data::Dumper;
use WWW::SwaggerClient::Configuration;
use WWW::SwaggerClient::AuthenticationApi;

my $api_instance = WWW::SwaggerClient::AuthenticationApi->new();

eval { 
    my $result = $api_instance->getSAMLMetadata();
    print Dumper($result);
};
if ($@) {
    warn "Exception when calling AuthenticationApi->getSAMLMetadata: $@\n";
}
from __future__ import print_statement
import time
import swagger_client
from swagger_client.rest import ApiException
from pprint import pprint

# create an instance of the API class
api_instance = swagger_client.AuthenticationApi()

try: 
    # Get SAML service provider metadata
    api_response = api_instance.get_saml_metadata()
    pprint(api_response)
except ApiException as e:
    print("Exception when calling AuthenticationApi->getSAMLMetadata: %s\n" % e)

Parameters

Responses

Status: 200 - SAML metadata XML

Status: 500 - Failed to generate metadata


handleOAuthCallback

Handle OAuth callback

Exchanges OAuth authorization code for JWT tokens. If client_callback was provided during authorization, redirects to client with tokens. Otherwise returns tokens as JSON response.


/oauth2/callback

Usage and SDK Samples

curl -X GET\
-H "Accept: application/json"\
"http://localhost:8080/oauth2/callback?code=&state="
import io.swagger.client.*;
import io.swagger.client.auth.*;
import io.swagger.client.model.*;
import io.swagger.client.api.AuthenticationApi;

import java.io.File;
import java.util.*;

public class AuthenticationApiExample {

    public static void main(String[] args) {
        
        AuthenticationApi apiInstance = new AuthenticationApi();
        String code = code_example; // String | Authorization code from the OAuth provider
        String state = state_example; // String | Optional state parameter for CSRF protection
        try {
            AuthTokenResponse result = apiInstance.handleOAuthCallback(code, state);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling AuthenticationApi#handleOAuthCallback");
            e.printStackTrace();
        }
    }
}
import io.swagger.client.api.AuthenticationApi;

public class AuthenticationApiExample {

    public static void main(String[] args) {
        AuthenticationApi apiInstance = new AuthenticationApi();
        String code = code_example; // String | Authorization code from the OAuth provider
        String state = state_example; // String | Optional state parameter for CSRF protection
        try {
            AuthTokenResponse result = apiInstance.handleOAuthCallback(code, state);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling AuthenticationApi#handleOAuthCallback");
            e.printStackTrace();
        }
    }
}
String *code = code_example; // Authorization code from the OAuth provider
String *state = state_example; // Optional state parameter for CSRF protection (optional)

AuthenticationApi *apiInstance = [[AuthenticationApi alloc] init];

// Handle OAuth callback
[apiInstance handleOAuthCallbackWith:code
    state:state
              completionHandler: ^(AuthTokenResponse output, NSError* error) {
                            if (output) {
                                NSLog(@"%@", output);
                            }
                            if (error) {
                                NSLog(@"Error: %@", error);
                            }
                        }];
var TmiThreatModelingImprovedApi = require('tmi__threat_modeling_improved_api');

var api = new TmiThreatModelingImprovedApi.AuthenticationApi()
var code = code_example; // {{String}} Authorization code from the OAuth provider
var opts = { 
  'state': state_example // {{String}} Optional state parameter for CSRF protection
};
var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
};
api.handleOAuthCallback(code, opts, callback);
using System;
using System.Diagnostics;
using IO.Swagger.Api;
using IO.Swagger.Client;
using IO.Swagger.Model;

namespace Example
{
    public class handleOAuthCallbackExample
    {
        public void main()
        {

            var apiInstance = new AuthenticationApi();
            var code = code_example;  // String | Authorization code from the OAuth provider
            var state = state_example;  // String | Optional state parameter for CSRF protection (optional) 

            try
            {
                // Handle OAuth callback
                AuthTokenResponse result = apiInstance.handleOAuthCallback(code, state);
                Debug.WriteLine(result);
            }
            catch (Exception e)
            {
                Debug.Print("Exception when calling AuthenticationApi.handleOAuthCallback: " + e.Message );
            }
        }
    }
}
<?php
require_once(__DIR__ . '/vendor/autoload.php');

$api_instance = new Swagger\Client\ApiAuthenticationApi();
$code = code_example; // String | Authorization code from the OAuth provider
$state = state_example; // String | Optional state parameter for CSRF protection

try {
    $result = $api_instance->handleOAuthCallback($code, $state);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling AuthenticationApi->handleOAuthCallback: ', $e->getMessage(), PHP_EOL;
}
?>
use Data::Dumper;
use WWW::SwaggerClient::Configuration;
use WWW::SwaggerClient::AuthenticationApi;

my $api_instance = WWW::SwaggerClient::AuthenticationApi->new();
my $code = code_example; # String | Authorization code from the OAuth provider
my $state = state_example; # String | Optional state parameter for CSRF protection

eval { 
    my $result = $api_instance->handleOAuthCallback(code => $code, state => $state);
    print Dumper($result);
};
if ($@) {
    warn "Exception when calling AuthenticationApi->handleOAuthCallback: $@\n";
}
from __future__ import print_statement
import time
import swagger_client
from swagger_client.rest import ApiException
from pprint import pprint

# create an instance of the API class
api_instance = swagger_client.AuthenticationApi()
code = code_example # String | Authorization code from the OAuth provider
state = state_example # String | Optional state parameter for CSRF protection (optional)

try: 
    # Handle OAuth callback
    api_response = api_instance.handle_o_auth_callback(code, state=state)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling AuthenticationApi->handleOAuthCallback: %s\n" % e)

Parameters

Query parameters
Name Description
code*
String
Authorization code from the OAuth provider
Required
state
String
Optional state parameter for CSRF protection

Responses

Status: 200 - JWT tokens issued successfully (legacy mode when no client_callback provided)

Status: 302 - Redirect to client callback URL with tokens (when client_callback was provided)

Name Type Format Description
Location String uri

Status: 400 - Error response

Status: 401 - Error response

Status: 500 - Error response


initiateSAMLLogin

Initiate SAML authentication

Starts SAML authentication flow by redirecting to IdP


/saml/login

Usage and SDK Samples

curl -X GET\
-H "Accept: application/json"\
"http://localhost:8080/saml/login?client_callback="
import io.swagger.client.*;
import io.swagger.client.auth.*;
import io.swagger.client.model.*;
import io.swagger.client.api.AuthenticationApi;

import java.io.File;
import java.util.*;

public class AuthenticationApiExample {

    public static void main(String[] args) {
        
        AuthenticationApi apiInstance = new AuthenticationApi();
        String clientCallback = clientCallback_example; // String | Client callback URL to redirect after authentication
        try {
            apiInstance.initiateSAMLLogin(clientCallback);
        } catch (ApiException e) {
            System.err.println("Exception when calling AuthenticationApi#initiateSAMLLogin");
            e.printStackTrace();
        }
    }
}
import io.swagger.client.api.AuthenticationApi;

public class AuthenticationApiExample {

    public static void main(String[] args) {
        AuthenticationApi apiInstance = new AuthenticationApi();
        String clientCallback = clientCallback_example; // String | Client callback URL to redirect after authentication
        try {
            apiInstance.initiateSAMLLogin(clientCallback);
        } catch (ApiException e) {
            System.err.println("Exception when calling AuthenticationApi#initiateSAMLLogin");
            e.printStackTrace();
        }
    }
}
String *clientCallback = clientCallback_example; // Client callback URL to redirect after authentication (optional)

AuthenticationApi *apiInstance = [[AuthenticationApi alloc] init];

// Initiate SAML authentication
[apiInstance initiateSAMLLoginWith:clientCallback
              completionHandler: ^(NSError* error) {
                            if (error) {
                                NSLog(@"Error: %@", error);
                            }
                        }];
var TmiThreatModelingImprovedApi = require('tmi__threat_modeling_improved_api');

var api = new TmiThreatModelingImprovedApi.AuthenticationApi()
var opts = { 
  'clientCallback': clientCallback_example // {{String}} Client callback URL to redirect after authentication
};
var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully.');
  }
};
api.initiateSAMLLogin(opts, callback);
using System;
using System.Diagnostics;
using IO.Swagger.Api;
using IO.Swagger.Client;
using IO.Swagger.Model;

namespace Example
{
    public class initiateSAMLLoginExample
    {
        public void main()
        {

            var apiInstance = new AuthenticationApi();
            var clientCallback = clientCallback_example;  // String | Client callback URL to redirect after authentication (optional) 

            try
            {
                // Initiate SAML authentication
                apiInstance.initiateSAMLLogin(clientCallback);
            }
            catch (Exception e)
            {
                Debug.Print("Exception when calling AuthenticationApi.initiateSAMLLogin: " + e.Message );
            }
        }
    }
}
<?php
require_once(__DIR__ . '/vendor/autoload.php');

$api_instance = new Swagger\Client\ApiAuthenticationApi();
$clientCallback = clientCallback_example; // String | Client callback URL to redirect after authentication

try {
    $api_instance->initiateSAMLLogin($clientCallback);
} catch (Exception $e) {
    echo 'Exception when calling AuthenticationApi->initiateSAMLLogin: ', $e->getMessage(), PHP_EOL;
}
?>
use Data::Dumper;
use WWW::SwaggerClient::Configuration;
use WWW::SwaggerClient::AuthenticationApi;

my $api_instance = WWW::SwaggerClient::AuthenticationApi->new();
my $clientCallback = clientCallback_example; # String | Client callback URL to redirect after authentication

eval { 
    $api_instance->initiateSAMLLogin(clientCallback => $clientCallback);
};
if ($@) {
    warn "Exception when calling AuthenticationApi->initiateSAMLLogin: $@\n";
}
from __future__ import print_statement
import time
import swagger_client
from swagger_client.rest import ApiException
from pprint import pprint

# create an instance of the API class
api_instance = swagger_client.AuthenticationApi()
clientCallback = clientCallback_example # String | Client callback URL to redirect after authentication (optional)

try: 
    # Initiate SAML authentication
    api_instance.initiate_saml_login(clientCallback=clientCallback)
except ApiException as e:
    print("Exception when calling AuthenticationApi->initiateSAMLLogin: %s\n" % e)

Parameters

Query parameters
Name Description
client_callback
String (uri)
Client callback URL to redirect after authentication

Responses

Status: 302 - Redirect to SAML IdP for authentication

Status: 500 - Failed to initiate SAML authentication


introspectToken

Token Introspection

Introspects a JWT token to determine its validity and metadata as per RFC 7662


/oauth2/introspect

Usage and SDK Samples

curl -X POST\
-H "Accept: application/json"\
-H "Content-Type: application/x-www-form-urlencoded"\
"http://localhost:8080/oauth2/introspect"
import io.swagger.client.*;
import io.swagger.client.auth.*;
import io.swagger.client.model.*;
import io.swagger.client.api.AuthenticationApi;

import java.io.File;
import java.util.*;

public class AuthenticationApiExample {

    public static void main(String[] args) {
        
        AuthenticationApi apiInstance = new AuthenticationApi();
        String token = token_example; // String | 
        String tokenTypeHint = tokenTypeHint_example; // String | 
        try {
            inline_response_200_3 result = apiInstance.introspectToken(token, tokenTypeHint);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling AuthenticationApi#introspectToken");
            e.printStackTrace();
        }
    }
}
import io.swagger.client.api.AuthenticationApi;

public class AuthenticationApiExample {

    public static void main(String[] args) {
        AuthenticationApi apiInstance = new AuthenticationApi();
        String token = token_example; // String | 
        String tokenTypeHint = tokenTypeHint_example; // String | 
        try {
            inline_response_200_3 result = apiInstance.introspectToken(token, tokenTypeHint);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling AuthenticationApi#introspectToken");
            e.printStackTrace();
        }
    }
}
String *token = token_example; // 
String *tokenTypeHint = tokenTypeHint_example; // 

AuthenticationApi *apiInstance = [[AuthenticationApi alloc] init];

// Token Introspection
[apiInstance introspectTokenWith:token
    tokenTypeHint:tokenTypeHint
              completionHandler: ^(inline_response_200_3 output, NSError* error) {
                            if (output) {
                                NSLog(@"%@", output);
                            }
                            if (error) {
                                NSLog(@"Error: %@", error);
                            }
                        }];
var TmiThreatModelingImprovedApi = require('tmi__threat_modeling_improved_api');

var api = new TmiThreatModelingImprovedApi.AuthenticationApi()
var token = token_example; // {{String}} 
var tokenTypeHint = tokenTypeHint_example; // {{String}} 

var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
};
api.introspectToken(tokentokenTypeHint, callback);
using System;
using System.Diagnostics;
using IO.Swagger.Api;
using IO.Swagger.Client;
using IO.Swagger.Model;

namespace Example
{
    public class introspectTokenExample
    {
        public void main()
        {

            var apiInstance = new AuthenticationApi();
            var token = token_example;  // String | 
            var tokenTypeHint = tokenTypeHint_example;  // String | 

            try
            {
                // Token Introspection
                inline_response_200_3 result = apiInstance.introspectToken(token, tokenTypeHint);
                Debug.WriteLine(result);
            }
            catch (Exception e)
            {
                Debug.Print("Exception when calling AuthenticationApi.introspectToken: " + e.Message );
            }
        }
    }
}
<?php
require_once(__DIR__ . '/vendor/autoload.php');

$api_instance = new Swagger\Client\ApiAuthenticationApi();
$token = token_example; // String | 
$tokenTypeHint = tokenTypeHint_example; // String | 

try {
    $result = $api_instance->introspectToken($token, $tokenTypeHint);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling AuthenticationApi->introspectToken: ', $e->getMessage(), PHP_EOL;
}
?>
use Data::Dumper;
use WWW::SwaggerClient::Configuration;
use WWW::SwaggerClient::AuthenticationApi;

my $api_instance = WWW::SwaggerClient::AuthenticationApi->new();
my $token = token_example; # String | 
my $tokenTypeHint = tokenTypeHint_example; # String | 

eval { 
    my $result = $api_instance->introspectToken(token => $token, tokenTypeHint => $tokenTypeHint);
    print Dumper($result);
};
if ($@) {
    warn "Exception when calling AuthenticationApi->introspectToken: $@\n";
}
from __future__ import print_statement
import time
import swagger_client
from swagger_client.rest import ApiException
from pprint import pprint

# create an instance of the API class
api_instance = swagger_client.AuthenticationApi()
token = token_example # String | 
tokenTypeHint = tokenTypeHint_example # String | 

try: 
    # Token Introspection
    api_response = api_instance.introspect_token(token, tokenTypeHint)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling AuthenticationApi->introspectToken: %s\n" % e)

Parameters

Form parameters
Name Description
token*
String
Required
token_type_hint*
String
Required

Responses

Status: 200 - Token introspection result

Status: 400 - Invalid request


logoutUser

Logout user

Invalidates the user's JWT token by adding it to a blacklist, effectively ending the session. Once logged out, the token cannot be used for further authenticated requests until it naturally expires. The token blacklist is maintained in Redis with automatic cleanup based on token expiration times.


/oauth2/revoke

Usage and SDK Samples

curl -X POST\
 -H "Authorization: Bearer [[accessToken]]"\
-H "Accept: application/json"\
-H "Content-Type: application/json"\
"http://localhost:8080/oauth2/revoke"
import io.swagger.client.*;
import io.swagger.client.auth.*;
import io.swagger.client.model.*;
import io.swagger.client.api.AuthenticationApi;

import java.io.File;
import java.util.*;

public class AuthenticationApiExample {

    public static void main(String[] args) {
        ApiClient defaultClient = Configuration.getDefaultApiClient();


        AuthenticationApi apiInstance = new AuthenticationApi();
        Object body = ; // Object | Empty request body - token is provided via Authorization header
        try {
            apiInstance.logoutUser(body);
        } catch (ApiException e) {
            System.err.println("Exception when calling AuthenticationApi#logoutUser");
            e.printStackTrace();
        }
    }
}
import io.swagger.client.api.AuthenticationApi;

public class AuthenticationApiExample {

    public static void main(String[] args) {
        AuthenticationApi apiInstance = new AuthenticationApi();
        Object body = ; // Object | Empty request body - token is provided via Authorization header
        try {
            apiInstance.logoutUser(body);
        } catch (ApiException e) {
            System.err.println("Exception when calling AuthenticationApi#logoutUser");
            e.printStackTrace();
        }
    }
}
Configuration *apiConfig = [Configuration sharedConfig];
Object *body = ; // Empty request body - token is provided via Authorization header (optional)

AuthenticationApi *apiInstance = [[AuthenticationApi alloc] init];

// Logout user
[apiInstance logoutUserWith:body
              completionHandler: ^(NSError* error) {
                            if (error) {
                                NSLog(@"Error: %@", error);
                            }
                        }];
var TmiThreatModelingImprovedApi = require('tmi__threat_modeling_improved_api');
var defaultClient = TmiThreatModelingImprovedApi.ApiClient.instance;


var api = new TmiThreatModelingImprovedApi.AuthenticationApi()
var opts = { 
  'body':  // {{Object}} Empty request body - token is provided via Authorization header
};
var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully.');
  }
};
api.logoutUser(opts, callback);
using System;
using System.Diagnostics;
using IO.Swagger.Api;
using IO.Swagger.Client;
using IO.Swagger.Model;

namespace Example
{
    public class logoutUserExample
    {
        public void main()
        {


            var apiInstance = new AuthenticationApi();
            var body = new Object(); // Object | Empty request body - token is provided via Authorization header (optional) 

            try
            {
                // Logout user
                apiInstance.logoutUser(body);
            }
            catch (Exception e)
            {
                Debug.Print("Exception when calling AuthenticationApi.logoutUser: " + e.Message );
            }
        }
    }
}
<?php
require_once(__DIR__ . '/vendor/autoload.php');


$api_instance = new Swagger\Client\ApiAuthenticationApi();
$body = ; // Object | Empty request body - token is provided via Authorization header

try {
    $api_instance->logoutUser($body);
} catch (Exception $e) {
    echo 'Exception when calling AuthenticationApi->logoutUser: ', $e->getMessage(), PHP_EOL;
}
?>
use Data::Dumper;
use WWW::SwaggerClient::Configuration;
use WWW::SwaggerClient::AuthenticationApi;


my $api_instance = WWW::SwaggerClient::AuthenticationApi->new();
my $body = WWW::SwaggerClient::Object::Object->new(); # Object | Empty request body - token is provided via Authorization header

eval { 
    $api_instance->logoutUser(body => $body);
};
if ($@) {
    warn "Exception when calling AuthenticationApi->logoutUser: $@\n";
}
from __future__ import print_statement
import time
import swagger_client
from swagger_client.rest import ApiException
from pprint import pprint


# create an instance of the API class
api_instance = swagger_client.AuthenticationApi()
body =  # Object | Empty request body - token is provided via Authorization header (optional)

try: 
    # Logout user
    api_instance.logout_user(body=body)
except ApiException as e:
    print("Exception when calling AuthenticationApi->logoutUser: %s\n" % e)

Parameters

Body parameters
Name Description
body

Responses

Status: 204 - User logged out successfully. The JWT token has been invalidated and added to the blacklist.

Name Type Format Description
X-Request-ID String

Status: 401 - Authentication failed - invalid, missing, or malformed token

Status: 500 - Internal server error - token blacklisting failed


processSAMLLogout

SAML Single Logout

Handles SAML logout requests from IdP


/saml/slo

Usage and SDK Samples

curl -X GET\
-H "Accept: application/json"\
"http://localhost:8080/saml/slo?SAMLRequest="
import io.swagger.client.*;
import io.swagger.client.auth.*;
import io.swagger.client.model.*;
import io.swagger.client.api.AuthenticationApi;

import java.io.File;
import java.util.*;

public class AuthenticationApiExample {

    public static void main(String[] args) {
        
        AuthenticationApi apiInstance = new AuthenticationApi();
        String sAMLRequest = sAMLRequest_example; // String | Base64-encoded SAML logout request
        try {
            inline_response_200_8 result = apiInstance.processSAMLLogout(sAMLRequest);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling AuthenticationApi#processSAMLLogout");
            e.printStackTrace();
        }
    }
}
import io.swagger.client.api.AuthenticationApi;

public class AuthenticationApiExample {

    public static void main(String[] args) {
        AuthenticationApi apiInstance = new AuthenticationApi();
        String sAMLRequest = sAMLRequest_example; // String | Base64-encoded SAML logout request
        try {
            inline_response_200_8 result = apiInstance.processSAMLLogout(sAMLRequest);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling AuthenticationApi#processSAMLLogout");
            e.printStackTrace();
        }
    }
}
String *sAMLRequest = sAMLRequest_example; // Base64-encoded SAML logout request

AuthenticationApi *apiInstance = [[AuthenticationApi alloc] init];

// SAML Single Logout
[apiInstance processSAMLLogoutWith:sAMLRequest
              completionHandler: ^(inline_response_200_8 output, NSError* error) {
                            if (output) {
                                NSLog(@"%@", output);
                            }
                            if (error) {
                                NSLog(@"Error: %@", error);
                            }
                        }];
var TmiThreatModelingImprovedApi = require('tmi__threat_modeling_improved_api');

var api = new TmiThreatModelingImprovedApi.AuthenticationApi()
var sAMLRequest = sAMLRequest_example; // {{String}} Base64-encoded SAML logout request

var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
};
api.processSAMLLogout(sAMLRequest, callback);
using System;
using System.Diagnostics;
using IO.Swagger.Api;
using IO.Swagger.Client;
using IO.Swagger.Model;

namespace Example
{
    public class processSAMLLogoutExample
    {
        public void main()
        {

            var apiInstance = new AuthenticationApi();
            var sAMLRequest = sAMLRequest_example;  // String | Base64-encoded SAML logout request

            try
            {
                // SAML Single Logout
                inline_response_200_8 result = apiInstance.processSAMLLogout(sAMLRequest);
                Debug.WriteLine(result);
            }
            catch (Exception e)
            {
                Debug.Print("Exception when calling AuthenticationApi.processSAMLLogout: " + e.Message );
            }
        }
    }
}
<?php
require_once(__DIR__ . '/vendor/autoload.php');

$api_instance = new Swagger\Client\ApiAuthenticationApi();
$sAMLRequest = sAMLRequest_example; // String | Base64-encoded SAML logout request

try {
    $result = $api_instance->processSAMLLogout($sAMLRequest);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling AuthenticationApi->processSAMLLogout: ', $e->getMessage(), PHP_EOL;
}
?>
use Data::Dumper;
use WWW::SwaggerClient::Configuration;
use WWW::SwaggerClient::AuthenticationApi;

my $api_instance = WWW::SwaggerClient::AuthenticationApi->new();
my $sAMLRequest = sAMLRequest_example; # String | Base64-encoded SAML logout request

eval { 
    my $result = $api_instance->processSAMLLogout(sAMLRequest => $sAMLRequest);
    print Dumper($result);
};
if ($@) {
    warn "Exception when calling AuthenticationApi->processSAMLLogout: $@\n";
}
from __future__ import print_statement
import time
import swagger_client
from swagger_client.rest import ApiException
from pprint import pprint

# create an instance of the API class
api_instance = swagger_client.AuthenticationApi()
sAMLRequest = sAMLRequest_example # String | Base64-encoded SAML logout request

try: 
    # SAML Single Logout
    api_response = api_instance.process_saml_logout(sAMLRequest)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling AuthenticationApi->processSAMLLogout: %s\n" % e)

Parameters

Query parameters
Name Description
SAMLRequest*
String
Base64-encoded SAML logout request
Required

Responses

Status: 200 - Logout successful

Status: 400 - Invalid SAML logout request


processSAMLLogoutPost

SAML Single Logout (POST)

Handles SAML logout requests from IdP via POST


/saml/slo

Usage and SDK Samples

curl -X POST\
-H "Accept: application/json"\
-H "Content-Type: application/x-www-form-urlencoded"\
"http://localhost:8080/saml/slo"
import io.swagger.client.*;
import io.swagger.client.auth.*;
import io.swagger.client.model.*;
import io.swagger.client.api.AuthenticationApi;

import java.io.File;
import java.util.*;

public class AuthenticationApiExample {

    public static void main(String[] args) {
        
        AuthenticationApi apiInstance = new AuthenticationApi();
        String sAMLRequest = sAMLRequest_example; // String | 
        try {
            inline_response_200_8 result = apiInstance.processSAMLLogoutPost(sAMLRequest);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling AuthenticationApi#processSAMLLogoutPost");
            e.printStackTrace();
        }
    }
}
import io.swagger.client.api.AuthenticationApi;

public class AuthenticationApiExample {

    public static void main(String[] args) {
        AuthenticationApi apiInstance = new AuthenticationApi();
        String sAMLRequest = sAMLRequest_example; // String | 
        try {
            inline_response_200_8 result = apiInstance.processSAMLLogoutPost(sAMLRequest);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling AuthenticationApi#processSAMLLogoutPost");
            e.printStackTrace();
        }
    }
}
String *sAMLRequest = sAMLRequest_example; //  (optional)

AuthenticationApi *apiInstance = [[AuthenticationApi alloc] init];

// SAML Single Logout (POST)
[apiInstance processSAMLLogoutPostWith:sAMLRequest
              completionHandler: ^(inline_response_200_8 output, NSError* error) {
                            if (output) {
                                NSLog(@"%@", output);
                            }
                            if (error) {
                                NSLog(@"Error: %@", error);
                            }
                        }];
var TmiThreatModelingImprovedApi = require('tmi__threat_modeling_improved_api');

var api = new TmiThreatModelingImprovedApi.AuthenticationApi()
var opts = { 
  'sAMLRequest': sAMLRequest_example // {{String}} 
};
var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
};
api.processSAMLLogoutPost(opts, callback);
using System;
using System.Diagnostics;
using IO.Swagger.Api;
using IO.Swagger.Client;
using IO.Swagger.Model;

namespace Example
{
    public class processSAMLLogoutPostExample
    {
        public void main()
        {

            var apiInstance = new AuthenticationApi();
            var sAMLRequest = sAMLRequest_example;  // String |  (optional) 

            try
            {
                // SAML Single Logout (POST)
                inline_response_200_8 result = apiInstance.processSAMLLogoutPost(sAMLRequest);
                Debug.WriteLine(result);
            }
            catch (Exception e)
            {
                Debug.Print("Exception when calling AuthenticationApi.processSAMLLogoutPost: " + e.Message );
            }
        }
    }
}
<?php
require_once(__DIR__ . '/vendor/autoload.php');

$api_instance = new Swagger\Client\ApiAuthenticationApi();
$sAMLRequest = sAMLRequest_example; // String | 

try {
    $result = $api_instance->processSAMLLogoutPost($sAMLRequest);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling AuthenticationApi->processSAMLLogoutPost: ', $e->getMessage(), PHP_EOL;
}
?>
use Data::Dumper;
use WWW::SwaggerClient::Configuration;
use WWW::SwaggerClient::AuthenticationApi;

my $api_instance = WWW::SwaggerClient::AuthenticationApi->new();
my $sAMLRequest = sAMLRequest_example; # String | 

eval { 
    my $result = $api_instance->processSAMLLogoutPost(sAMLRequest => $sAMLRequest);
    print Dumper($result);
};
if ($@) {
    warn "Exception when calling AuthenticationApi->processSAMLLogoutPost: $@\n";
}
from __future__ import print_statement
import time
import swagger_client
from swagger_client.rest import ApiException
from pprint import pprint

# create an instance of the API class
api_instance = swagger_client.AuthenticationApi()
sAMLRequest = sAMLRequest_example # String |  (optional)

try: 
    # SAML Single Logout (POST)
    api_response = api_instance.process_saml_logout_post(sAMLRequest=sAMLRequest)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling AuthenticationApi->processSAMLLogoutPost: %s\n" % e)

Parameters

Form parameters
Name Description
SAMLRequest
String

Responses

Status: 200 - Logout successful

Status: 400 - Invalid SAML logout request


processSAMLResponse

SAML Assertion Consumer Service

Processes SAML responses from IdP after authentication


/saml/acs

Usage and SDK Samples

curl -X POST\
-H "Accept: application/json"\
-H "Content-Type: application/x-www-form-urlencoded"\
"http://localhost:8080/saml/acs"
import io.swagger.client.*;
import io.swagger.client.auth.*;
import io.swagger.client.model.*;
import io.swagger.client.api.AuthenticationApi;

import java.io.File;
import java.util.*;

public class AuthenticationApiExample {

    public static void main(String[] args) {
        
        AuthenticationApi apiInstance = new AuthenticationApi();
        String sAMLResponse = sAMLResponse_example; // String | 
        String relayState = relayState_example; // String | 
        try {
            AuthTokenResponse result = apiInstance.processSAMLResponse(sAMLResponse, relayState);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling AuthenticationApi#processSAMLResponse");
            e.printStackTrace();
        }
    }
}
import io.swagger.client.api.AuthenticationApi;

public class AuthenticationApiExample {

    public static void main(String[] args) {
        AuthenticationApi apiInstance = new AuthenticationApi();
        String sAMLResponse = sAMLResponse_example; // String | 
        String relayState = relayState_example; // String | 
        try {
            AuthTokenResponse result = apiInstance.processSAMLResponse(sAMLResponse, relayState);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling AuthenticationApi#processSAMLResponse");
            e.printStackTrace();
        }
    }
}
String *sAMLResponse = sAMLResponse_example; //  (optional)
String *relayState = relayState_example; //  (optional)

AuthenticationApi *apiInstance = [[AuthenticationApi alloc] init];

// SAML Assertion Consumer Service
[apiInstance processSAMLResponseWith:sAMLResponse
    relayState:relayState
              completionHandler: ^(AuthTokenResponse output, NSError* error) {
                            if (output) {
                                NSLog(@"%@", output);
                            }
                            if (error) {
                                NSLog(@"Error: %@", error);
                            }
                        }];
var TmiThreatModelingImprovedApi = require('tmi__threat_modeling_improved_api');

var api = new TmiThreatModelingImprovedApi.AuthenticationApi()
var opts = { 
  'sAMLResponse': sAMLResponse_example // {{String}} 
  'relayState': relayState_example // {{String}} 
};
var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
};
api.processSAMLResponse(opts, callback);
using System;
using System.Diagnostics;
using IO.Swagger.Api;
using IO.Swagger.Client;
using IO.Swagger.Model;

namespace Example
{
    public class processSAMLResponseExample
    {
        public void main()
        {

            var apiInstance = new AuthenticationApi();
            var sAMLResponse = sAMLResponse_example;  // String |  (optional) 
            var relayState = relayState_example;  // String |  (optional) 

            try
            {
                // SAML Assertion Consumer Service
                AuthTokenResponse result = apiInstance.processSAMLResponse(sAMLResponse, relayState);
                Debug.WriteLine(result);
            }
            catch (Exception e)
            {
                Debug.Print("Exception when calling AuthenticationApi.processSAMLResponse: " + e.Message );
            }
        }
    }
}
<?php
require_once(__DIR__ . '/vendor/autoload.php');

$api_instance = new Swagger\Client\ApiAuthenticationApi();
$sAMLResponse = sAMLResponse_example; // String | 
$relayState = relayState_example; // String | 

try {
    $result = $api_instance->processSAMLResponse($sAMLResponse, $relayState);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling AuthenticationApi->processSAMLResponse: ', $e->getMessage(), PHP_EOL;
}
?>
use Data::Dumper;
use WWW::SwaggerClient::Configuration;
use WWW::SwaggerClient::AuthenticationApi;

my $api_instance = WWW::SwaggerClient::AuthenticationApi->new();
my $sAMLResponse = sAMLResponse_example; # String | 
my $relayState = relayState_example; # String | 

eval { 
    my $result = $api_instance->processSAMLResponse(sAMLResponse => $sAMLResponse, relayState => $relayState);
    print Dumper($result);
};
if ($@) {
    warn "Exception when calling AuthenticationApi->processSAMLResponse: $@\n";
}
from __future__ import print_statement
import time
import swagger_client
from swagger_client.rest import ApiException
from pprint import pprint

# create an instance of the API class
api_instance = swagger_client.AuthenticationApi()
sAMLResponse = sAMLResponse_example # String |  (optional)
relayState = relayState_example # String |  (optional)

try: 
    # SAML Assertion Consumer Service
    api_response = api_instance.process_saml_response(sAMLResponse=sAMLResponse, relayState=relayState)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling AuthenticationApi->processSAMLResponse: %s\n" % e)

Parameters

Form parameters
Name Description
SAMLResponse
String
RelayState
String

Responses

Status: 200 - Authentication successful

Status: 302 - Redirect to client callback with token

Status: 400 - Invalid SAML response

Status: 401 - Authentication failed


refreshToken

Refresh JWT token

Exchanges a refresh token for a new JWT access token


/oauth2/refresh

Usage and SDK Samples

curl -X POST\
-H "Accept: application/json"\
-H "Content-Type: application/json"\
"http://localhost:8080/oauth2/refresh"
import io.swagger.client.*;
import io.swagger.client.auth.*;
import io.swagger.client.model.*;
import io.swagger.client.api.AuthenticationApi;

import java.io.File;
import java.util.*;

public class AuthenticationApiExample {

    public static void main(String[] args) {
        
        AuthenticationApi apiInstance = new AuthenticationApi();
        Oauth2_refresh_body body = ; // Oauth2_refresh_body | 
        try {
            AuthTokenResponse result = apiInstance.refreshToken(body);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling AuthenticationApi#refreshToken");
            e.printStackTrace();
        }
    }
}
import io.swagger.client.api.AuthenticationApi;

public class AuthenticationApiExample {

    public static void main(String[] args) {
        AuthenticationApi apiInstance = new AuthenticationApi();
        Oauth2_refresh_body body = ; // Oauth2_refresh_body | 
        try {
            AuthTokenResponse result = apiInstance.refreshToken(body);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling AuthenticationApi#refreshToken");
            e.printStackTrace();
        }
    }
}
Oauth2_refresh_body *body = ; //  (optional)

AuthenticationApi *apiInstance = [[AuthenticationApi alloc] init];

// Refresh JWT token
[apiInstance refreshTokenWith:body
              completionHandler: ^(AuthTokenResponse output, NSError* error) {
                            if (output) {
                                NSLog(@"%@", output);
                            }
                            if (error) {
                                NSLog(@"Error: %@", error);
                            }
                        }];
var TmiThreatModelingImprovedApi = require('tmi__threat_modeling_improved_api');

var api = new TmiThreatModelingImprovedApi.AuthenticationApi()
var opts = { 
  'body':  // {{Oauth2_refresh_body}} 
};
var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
};
api.refreshToken(opts, callback);
using System;
using System.Diagnostics;
using IO.Swagger.Api;
using IO.Swagger.Client;
using IO.Swagger.Model;

namespace Example
{
    public class refreshTokenExample
    {
        public void main()
        {

            var apiInstance = new AuthenticationApi();
            var body = new Oauth2_refresh_body(); // Oauth2_refresh_body |  (optional) 

            try
            {
                // Refresh JWT token
                AuthTokenResponse result = apiInstance.refreshToken(body);
                Debug.WriteLine(result);
            }
            catch (Exception e)
            {
                Debug.Print("Exception when calling AuthenticationApi.refreshToken: " + e.Message );
            }
        }
    }
}
<?php
require_once(__DIR__ . '/vendor/autoload.php');

$api_instance = new Swagger\Client\ApiAuthenticationApi();
$body = ; // Oauth2_refresh_body | 

try {
    $result = $api_instance->refreshToken($body);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling AuthenticationApi->refreshToken: ', $e->getMessage(), PHP_EOL;
}
?>
use Data::Dumper;
use WWW::SwaggerClient::Configuration;
use WWW::SwaggerClient::AuthenticationApi;

my $api_instance = WWW::SwaggerClient::AuthenticationApi->new();
my $body = WWW::SwaggerClient::Object::Oauth2_refresh_body->new(); # Oauth2_refresh_body | 

eval { 
    my $result = $api_instance->refreshToken(body => $body);
    print Dumper($result);
};
if ($@) {
    warn "Exception when calling AuthenticationApi->refreshToken: $@\n";
}
from __future__ import print_statement
import time
import swagger_client
from swagger_client.rest import ApiException
from pprint import pprint

# create an instance of the API class
api_instance = swagger_client.AuthenticationApi()
body =  # Oauth2_refresh_body |  (optional)

try: 
    # Refresh JWT token
    api_response = api_instance.refresh_token(body=body)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling AuthenticationApi->refreshToken: %s\n" % e)

Parameters

Body parameters
Name Description
body

Responses

Status: 200 - New JWT issued successfully

Status: 400 - Bad request - missing or invalid refresh token

Status: 401 - Unauthorized - invalid or expired refresh token

Status: 500 - Internal server error


Collaboration

createDiagramCollaborationSession

Create diagram collaboration session

Creates a new collaboration session for real-time diagram editing. Only one collaboration session can exist per diagram at a time. If a session already exists, returns 409 with a link to join the existing session.


/threat_models/{threat_model_id}/diagrams/{diagram_id}/collaborate

Usage and SDK Samples

curl -X POST\
 -H "Authorization: Bearer [[accessToken]]"\
-H "Accept: application/json"\
"http://localhost:8080/threat_models/{threat_model_id}/diagrams/{diagram_id}/collaborate"
import io.swagger.client.*;
import io.swagger.client.auth.*;
import io.swagger.client.model.*;
import io.swagger.client.api.CollaborationApi;

import java.io.File;
import java.util.*;

public class CollaborationApiExample {

    public static void main(String[] args) {
        ApiClient defaultClient = Configuration.getDefaultApiClient();


        CollaborationApi apiInstance = new CollaborationApi();
        UUID threatModelId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // UUID | Unique identifier of the threat model (UUID)
        UUID diagramId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // UUID | Unique identifier of the diagram (UUID)
        try {
            CollaborationSession result = apiInstance.createDiagramCollaborationSession(threatModelId, diagramId);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling CollaborationApi#createDiagramCollaborationSession");
            e.printStackTrace();
        }
    }
}
import io.swagger.client.api.CollaborationApi;

public class CollaborationApiExample {

    public static void main(String[] args) {
        CollaborationApi apiInstance = new CollaborationApi();
        UUID threatModelId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // UUID | Unique identifier of the threat model (UUID)
        UUID diagramId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // UUID | Unique identifier of the diagram (UUID)
        try {
            CollaborationSession result = apiInstance.createDiagramCollaborationSession(threatModelId, diagramId);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling CollaborationApi#createDiagramCollaborationSession");
            e.printStackTrace();
        }
    }
}
Configuration *apiConfig = [Configuration sharedConfig];
UUID *threatModelId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // Unique identifier of the threat model (UUID)
UUID *diagramId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // Unique identifier of the diagram (UUID)

CollaborationApi *apiInstance = [[CollaborationApi alloc] init];

// Create diagram collaboration session
[apiInstance createDiagramCollaborationSessionWith:threatModelId
    diagramId:diagramId
              completionHandler: ^(CollaborationSession output, NSError* error) {
                            if (output) {
                                NSLog(@"%@", output);
                            }
                            if (error) {
                                NSLog(@"Error: %@", error);
                            }
                        }];
var TmiThreatModelingImprovedApi = require('tmi__threat_modeling_improved_api');
var defaultClient = TmiThreatModelingImprovedApi.ApiClient.instance;


var api = new TmiThreatModelingImprovedApi.CollaborationApi()
var threatModelId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // {{UUID}} Unique identifier of the threat model (UUID)
var diagramId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // {{UUID}} Unique identifier of the diagram (UUID)

var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
};
api.createDiagramCollaborationSession(threatModelId, diagramId, callback);
using System;
using System.Diagnostics;
using IO.Swagger.Api;
using IO.Swagger.Client;
using IO.Swagger.Model;

namespace Example
{
    public class createDiagramCollaborationSessionExample
    {
        public void main()
        {


            var apiInstance = new CollaborationApi();
            var threatModelId = new UUID(); // UUID | Unique identifier of the threat model (UUID)
            var diagramId = new UUID(); // UUID | Unique identifier of the diagram (UUID)

            try
            {
                // Create diagram collaboration session
                CollaborationSession result = apiInstance.createDiagramCollaborationSession(threatModelId, diagramId);
                Debug.WriteLine(result);
            }
            catch (Exception e)
            {
                Debug.Print("Exception when calling CollaborationApi.createDiagramCollaborationSession: " + e.Message );
            }
        }
    }
}
<?php
require_once(__DIR__ . '/vendor/autoload.php');


$api_instance = new Swagger\Client\ApiCollaborationApi();
$threatModelId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // UUID | Unique identifier of the threat model (UUID)
$diagramId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // UUID | Unique identifier of the diagram (UUID)

try {
    $result = $api_instance->createDiagramCollaborationSession($threatModelId, $diagramId);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling CollaborationApi->createDiagramCollaborationSession: ', $e->getMessage(), PHP_EOL;
}
?>
use Data::Dumper;
use WWW::SwaggerClient::Configuration;
use WWW::SwaggerClient::CollaborationApi;


my $api_instance = WWW::SwaggerClient::CollaborationApi->new();
my $threatModelId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; # UUID | Unique identifier of the threat model (UUID)
my $diagramId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; # UUID | Unique identifier of the diagram (UUID)

eval { 
    my $result = $api_instance->createDiagramCollaborationSession(threatModelId => $threatModelId, diagramId => $diagramId);
    print Dumper($result);
};
if ($@) {
    warn "Exception when calling CollaborationApi->createDiagramCollaborationSession: $@\n";
}
from __future__ import print_statement
import time
import swagger_client
from swagger_client.rest import ApiException
from pprint import pprint


# create an instance of the API class
api_instance = swagger_client.CollaborationApi()
threatModelId = 38400000-8cf0-11bd-b23e-10b96e4ef00d # UUID | Unique identifier of the threat model (UUID)
diagramId = 38400000-8cf0-11bd-b23e-10b96e4ef00d # UUID | Unique identifier of the diagram (UUID)

try: 
    # Create diagram collaboration session
    api_response = api_instance.create_diagram_collaboration_session(threatModelId, diagramId)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling CollaborationApi->createDiagramCollaborationSession: %s\n" % e)

Parameters

Path parameters
Name Description
threat_model_id*
UUID (uuid)
Unique identifier of the threat model (UUID)
Required
diagram_id*
UUID (uuid)
Unique identifier of the diagram (UUID)
Required

Responses

Status: 201 - Collaboration session created successfully. The 201 status indicates successful creation - clients must NOT evaluate the payload to determine success.

Status: 400 - Error response

Status: 401 - Error response

Status: 403 - Error response

Status: 404 - Error response

Status: 409 - Collaboration session already exists for this diagram

Status: 500 - Error response


endDiagramCollaborationSession

End diagram collaboration session

Terminates the active collaboration session for a diagram


/threat_models/{threat_model_id}/diagrams/{diagram_id}/collaborate

Usage and SDK Samples

curl -X DELETE\
 -H "Authorization: Bearer [[accessToken]]"\
-H "Accept: application/json"\
"http://localhost:8080/threat_models/{threat_model_id}/diagrams/{diagram_id}/collaborate"
import io.swagger.client.*;
import io.swagger.client.auth.*;
import io.swagger.client.model.*;
import io.swagger.client.api.CollaborationApi;

import java.io.File;
import java.util.*;

public class CollaborationApiExample {

    public static void main(String[] args) {
        ApiClient defaultClient = Configuration.getDefaultApiClient();


        CollaborationApi apiInstance = new CollaborationApi();
        UUID threatModelId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // UUID | Unique identifier of the threat model (UUID)
        UUID diagramId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // UUID | Unique identifier of the diagram (UUID)
        try {
            apiInstance.endDiagramCollaborationSession(threatModelId, diagramId);
        } catch (ApiException e) {
            System.err.println("Exception when calling CollaborationApi#endDiagramCollaborationSession");
            e.printStackTrace();
        }
    }
}
import io.swagger.client.api.CollaborationApi;

public class CollaborationApiExample {

    public static void main(String[] args) {
        CollaborationApi apiInstance = new CollaborationApi();
        UUID threatModelId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // UUID | Unique identifier of the threat model (UUID)
        UUID diagramId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // UUID | Unique identifier of the diagram (UUID)
        try {
            apiInstance.endDiagramCollaborationSession(threatModelId, diagramId);
        } catch (ApiException e) {
            System.err.println("Exception when calling CollaborationApi#endDiagramCollaborationSession");
            e.printStackTrace();
        }
    }
}
Configuration *apiConfig = [Configuration sharedConfig];
UUID *threatModelId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // Unique identifier of the threat model (UUID)
UUID *diagramId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // Unique identifier of the diagram (UUID)

CollaborationApi *apiInstance = [[CollaborationApi alloc] init];

// End diagram collaboration session
[apiInstance endDiagramCollaborationSessionWith:threatModelId
    diagramId:diagramId
              completionHandler: ^(NSError* error) {
                            if (error) {
                                NSLog(@"Error: %@", error);
                            }
                        }];
var TmiThreatModelingImprovedApi = require('tmi__threat_modeling_improved_api');
var defaultClient = TmiThreatModelingImprovedApi.ApiClient.instance;


var api = new TmiThreatModelingImprovedApi.CollaborationApi()
var threatModelId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // {{UUID}} Unique identifier of the threat model (UUID)
var diagramId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // {{UUID}} Unique identifier of the diagram (UUID)

var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully.');
  }
};
api.endDiagramCollaborationSession(threatModelId, diagramId, callback);
using System;
using System.Diagnostics;
using IO.Swagger.Api;
using IO.Swagger.Client;
using IO.Swagger.Model;

namespace Example
{
    public class endDiagramCollaborationSessionExample
    {
        public void main()
        {


            var apiInstance = new CollaborationApi();
            var threatModelId = new UUID(); // UUID | Unique identifier of the threat model (UUID)
            var diagramId = new UUID(); // UUID | Unique identifier of the diagram (UUID)

            try
            {
                // End diagram collaboration session
                apiInstance.endDiagramCollaborationSession(threatModelId, diagramId);
            }
            catch (Exception e)
            {
                Debug.Print("Exception when calling CollaborationApi.endDiagramCollaborationSession: " + e.Message );
            }
        }
    }
}
<?php
require_once(__DIR__ . '/vendor/autoload.php');


$api_instance = new Swagger\Client\ApiCollaborationApi();
$threatModelId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // UUID | Unique identifier of the threat model (UUID)
$diagramId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // UUID | Unique identifier of the diagram (UUID)

try {
    $api_instance->endDiagramCollaborationSession($threatModelId, $diagramId);
} catch (Exception $e) {
    echo 'Exception when calling CollaborationApi->endDiagramCollaborationSession: ', $e->getMessage(), PHP_EOL;
}
?>
use Data::Dumper;
use WWW::SwaggerClient::Configuration;
use WWW::SwaggerClient::CollaborationApi;


my $api_instance = WWW::SwaggerClient::CollaborationApi->new();
my $threatModelId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; # UUID | Unique identifier of the threat model (UUID)
my $diagramId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; # UUID | Unique identifier of the diagram (UUID)

eval { 
    $api_instance->endDiagramCollaborationSession(threatModelId => $threatModelId, diagramId => $diagramId);
};
if ($@) {
    warn "Exception when calling CollaborationApi->endDiagramCollaborationSession: $@\n";
}
from __future__ import print_statement
import time
import swagger_client
from swagger_client.rest import ApiException
from pprint import pprint


# create an instance of the API class
api_instance = swagger_client.CollaborationApi()
threatModelId = 38400000-8cf0-11bd-b23e-10b96e4ef00d # UUID | Unique identifier of the threat model (UUID)
diagramId = 38400000-8cf0-11bd-b23e-10b96e4ef00d # UUID | Unique identifier of the diagram (UUID)

try: 
    # End diagram collaboration session
    api_instance.end_diagram_collaboration_session(threatModelId, diagramId)
except ApiException as e:
    print("Exception when calling CollaborationApi->endDiagramCollaborationSession: %s\n" % e)

Parameters

Path parameters
Name Description
threat_model_id*
UUID (uuid)
Unique identifier of the threat model (UUID)
Required
diagram_id*
UUID (uuid)
Unique identifier of the diagram (UUID)
Required

Responses

Status: 204 - Collaboration session ended successfully

Status: 401 - Error response

Status: 403 - Error response

Status: 404 - Error response

Status: 500 - Error response


getCollaborationSessions

List active collaboration sessions

Returns all currently active collaboration sessions for diagrams. Clients can use this endpoint to discover existing sessions before connecting via WebSocket.


/collaboration/sessions

Usage and SDK Samples

curl -X GET\
 -H "Authorization: Bearer [[accessToken]]"\
-H "Accept: application/json"\
"http://localhost:8080/collaboration/sessions"
import io.swagger.client.*;
import io.swagger.client.auth.*;
import io.swagger.client.model.*;
import io.swagger.client.api.CollaborationApi;

import java.io.File;
import java.util.*;

public class CollaborationApiExample {

    public static void main(String[] args) {
        ApiClient defaultClient = Configuration.getDefaultApiClient();


        CollaborationApi apiInstance = new CollaborationApi();
        try {
            array[CollaborationSession] result = apiInstance.getCollaborationSessions();
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling CollaborationApi#getCollaborationSessions");
            e.printStackTrace();
        }
    }
}
import io.swagger.client.api.CollaborationApi;

public class CollaborationApiExample {

    public static void main(String[] args) {
        CollaborationApi apiInstance = new CollaborationApi();
        try {
            array[CollaborationSession] result = apiInstance.getCollaborationSessions();
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling CollaborationApi#getCollaborationSessions");
            e.printStackTrace();
        }
    }
}
Configuration *apiConfig = [Configuration sharedConfig];

CollaborationApi *apiInstance = [[CollaborationApi alloc] init];

// List active collaboration sessions
[apiInstance getCollaborationSessionsWithCompletionHandler: 
              ^(array[CollaborationSession] output, NSError* error) {
                            if (output) {
                                NSLog(@"%@", output);
                            }
                            if (error) {
                                NSLog(@"Error: %@", error);
                            }
                        }];
var TmiThreatModelingImprovedApi = require('tmi__threat_modeling_improved_api');
var defaultClient = TmiThreatModelingImprovedApi.ApiClient.instance;


var api = new TmiThreatModelingImprovedApi.CollaborationApi()
var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
};
api.getCollaborationSessions(callback);
using System;
using System.Diagnostics;
using IO.Swagger.Api;
using IO.Swagger.Client;
using IO.Swagger.Model;

namespace Example
{
    public class getCollaborationSessionsExample
    {
        public void main()
        {


            var apiInstance = new CollaborationApi();

            try
            {
                // List active collaboration sessions
                array[CollaborationSession] result = apiInstance.getCollaborationSessions();
                Debug.WriteLine(result);
            }
            catch (Exception e)
            {
                Debug.Print("Exception when calling CollaborationApi.getCollaborationSessions: " + e.Message );
            }
        }
    }
}
<?php
require_once(__DIR__ . '/vendor/autoload.php');


$api_instance = new Swagger\Client\ApiCollaborationApi();

try {
    $result = $api_instance->getCollaborationSessions();
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling CollaborationApi->getCollaborationSessions: ', $e->getMessage(), PHP_EOL;
}
?>
use Data::Dumper;
use WWW::SwaggerClient::Configuration;
use WWW::SwaggerClient::CollaborationApi;


my $api_instance = WWW::SwaggerClient::CollaborationApi->new();

eval { 
    my $result = $api_instance->getCollaborationSessions();
    print Dumper($result);
};
if ($@) {
    warn "Exception when calling CollaborationApi->getCollaborationSessions: $@\n";
}
from __future__ import print_statement
import time
import swagger_client
from swagger_client.rest import ApiException
from pprint import pprint


# create an instance of the API class
api_instance = swagger_client.CollaborationApi()

try: 
    # List active collaboration sessions
    api_response = api_instance.get_collaboration_sessions()
    pprint(api_response)
except ApiException as e:
    print("Exception when calling CollaborationApi->getCollaborationSessions: %s\n" % e)

Parameters

Responses

Status: 200 - List of active collaboration sessions

Status: 401 - Authentication failed - invalid, missing, or malformed token

Status: 500 - Internal server error


getDiagramCollaborationSession

Get diagram collaboration session

Retrieves the current collaboration session details for a diagram. The session payload indicates who has been authorized to the session, not who is currently active in the WebSocket session. The 200 status indicates successful retrieval - clients must NOT evaluate the payload to determine session status.


/threat_models/{threat_model_id}/diagrams/{diagram_id}/collaborate

Usage and SDK Samples

curl -X GET\
 -H "Authorization: Bearer [[accessToken]]"\
-H "Accept: application/json"\
"http://localhost:8080/threat_models/{threat_model_id}/diagrams/{diagram_id}/collaborate"
import io.swagger.client.*;
import io.swagger.client.auth.*;
import io.swagger.client.model.*;
import io.swagger.client.api.CollaborationApi;

import java.io.File;
import java.util.*;

public class CollaborationApiExample {

    public static void main(String[] args) {
        ApiClient defaultClient = Configuration.getDefaultApiClient();


        CollaborationApi apiInstance = new CollaborationApi();
        UUID threatModelId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // UUID | Unique identifier of the threat model (UUID)
        UUID diagramId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // UUID | Unique identifier of the diagram (UUID)
        try {
            CollaborationSession result = apiInstance.getDiagramCollaborationSession(threatModelId, diagramId);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling CollaborationApi#getDiagramCollaborationSession");
            e.printStackTrace();
        }
    }
}
import io.swagger.client.api.CollaborationApi;

public class CollaborationApiExample {

    public static void main(String[] args) {
        CollaborationApi apiInstance = new CollaborationApi();
        UUID threatModelId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // UUID | Unique identifier of the threat model (UUID)
        UUID diagramId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // UUID | Unique identifier of the diagram (UUID)
        try {
            CollaborationSession result = apiInstance.getDiagramCollaborationSession(threatModelId, diagramId);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling CollaborationApi#getDiagramCollaborationSession");
            e.printStackTrace();
        }
    }
}
Configuration *apiConfig = [Configuration sharedConfig];
UUID *threatModelId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // Unique identifier of the threat model (UUID)
UUID *diagramId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // Unique identifier of the diagram (UUID)

CollaborationApi *apiInstance = [[CollaborationApi alloc] init];

// Get diagram collaboration session
[apiInstance getDiagramCollaborationSessionWith:threatModelId
    diagramId:diagramId
              completionHandler: ^(CollaborationSession output, NSError* error) {
                            if (output) {
                                NSLog(@"%@", output);
                            }
                            if (error) {
                                NSLog(@"Error: %@", error);
                            }
                        }];
var TmiThreatModelingImprovedApi = require('tmi__threat_modeling_improved_api');
var defaultClient = TmiThreatModelingImprovedApi.ApiClient.instance;


var api = new TmiThreatModelingImprovedApi.CollaborationApi()
var threatModelId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // {{UUID}} Unique identifier of the threat model (UUID)
var diagramId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // {{UUID}} Unique identifier of the diagram (UUID)

var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
};
api.getDiagramCollaborationSession(threatModelId, diagramId, callback);
using System;
using System.Diagnostics;
using IO.Swagger.Api;
using IO.Swagger.Client;
using IO.Swagger.Model;

namespace Example
{
    public class getDiagramCollaborationSessionExample
    {
        public void main()
        {


            var apiInstance = new CollaborationApi();
            var threatModelId = new UUID(); // UUID | Unique identifier of the threat model (UUID)
            var diagramId = new UUID(); // UUID | Unique identifier of the diagram (UUID)

            try
            {
                // Get diagram collaboration session
                CollaborationSession result = apiInstance.getDiagramCollaborationSession(threatModelId, diagramId);
                Debug.WriteLine(result);
            }
            catch (Exception e)
            {
                Debug.Print("Exception when calling CollaborationApi.getDiagramCollaborationSession: " + e.Message );
            }
        }
    }
}
<?php
require_once(__DIR__ . '/vendor/autoload.php');


$api_instance = new Swagger\Client\ApiCollaborationApi();
$threatModelId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // UUID | Unique identifier of the threat model (UUID)
$diagramId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // UUID | Unique identifier of the diagram (UUID)

try {
    $result = $api_instance->getDiagramCollaborationSession($threatModelId, $diagramId);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling CollaborationApi->getDiagramCollaborationSession: ', $e->getMessage(), PHP_EOL;
}
?>
use Data::Dumper;
use WWW::SwaggerClient::Configuration;
use WWW::SwaggerClient::CollaborationApi;


my $api_instance = WWW::SwaggerClient::CollaborationApi->new();
my $threatModelId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; # UUID | Unique identifier of the threat model (UUID)
my $diagramId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; # UUID | Unique identifier of the diagram (UUID)

eval { 
    my $result = $api_instance->getDiagramCollaborationSession(threatModelId => $threatModelId, diagramId => $diagramId);
    print Dumper($result);
};
if ($@) {
    warn "Exception when calling CollaborationApi->getDiagramCollaborationSession: $@\n";
}
from __future__ import print_statement
import time
import swagger_client
from swagger_client.rest import ApiException
from pprint import pprint


# create an instance of the API class
api_instance = swagger_client.CollaborationApi()
threatModelId = 38400000-8cf0-11bd-b23e-10b96e4ef00d # UUID | Unique identifier of the threat model (UUID)
diagramId = 38400000-8cf0-11bd-b23e-10b96e4ef00d # UUID | Unique identifier of the diagram (UUID)

try: 
    # Get diagram collaboration session
    api_response = api_instance.get_diagram_collaboration_session(threatModelId, diagramId)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling CollaborationApi->getDiagramCollaborationSession: %s\n" % e)

Parameters

Path parameters
Name Description
threat_model_id*
UUID (uuid)
Unique identifier of the threat model (UUID)
Required
diagram_id*
UUID (uuid)
Unique identifier of the diagram (UUID)
Required

Responses

Status: 200 - Collaboration session details

Status: 401 - Error response

Status: 403 - Error response

Status: 404 - Error response

Status: 500 - Error response


Documents

patchThreatModelDocument

Partially update document

Apply JSON Patch operations to partially update a document


/threat_models/{threat_model_id}/documents/{document_id}

Usage and SDK Samples

curl -X PATCH\
 -H "Authorization: Bearer [[accessToken]]"\
-H "Accept: application/json"\
-H "Content-Type: application/json-patch+json"\
"http://localhost:8080/threat_models/{threat_model_id}/documents/{document_id}"
import io.swagger.client.*;
import io.swagger.client.auth.*;
import io.swagger.client.model.*;
import io.swagger.client.api.DocumentsApi;

import java.io.File;
import java.util.*;

public class DocumentsApiExample {

    public static void main(String[] args) {
        ApiClient defaultClient = Configuration.getDefaultApiClient();


        DocumentsApi apiInstance = new DocumentsApi();
        array[threats_threat_id_body] body = ; // array[threats_threat_id_body] | 
        UUID threatModelId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // UUID | Unique identifier of the threat model (UUID)
        UUID documentId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // UUID | Document ID
        try {
            Document result = apiInstance.patchThreatModelDocument(body, threatModelId, documentId);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling DocumentsApi#patchThreatModelDocument");
            e.printStackTrace();
        }
    }
}
import io.swagger.client.api.DocumentsApi;

public class DocumentsApiExample {

    public static void main(String[] args) {
        DocumentsApi apiInstance = new DocumentsApi();
        array[threats_threat_id_body] body = ; // array[threats_threat_id_body] | 
        UUID threatModelId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // UUID | Unique identifier of the threat model (UUID)
        UUID documentId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // UUID | Document ID
        try {
            Document result = apiInstance.patchThreatModelDocument(body, threatModelId, documentId);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling DocumentsApi#patchThreatModelDocument");
            e.printStackTrace();
        }
    }
}
Configuration *apiConfig = [Configuration sharedConfig];
array[threats_threat_id_body] *body = ; // 
UUID *threatModelId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // Unique identifier of the threat model (UUID)
UUID *documentId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // Document ID

DocumentsApi *apiInstance = [[DocumentsApi alloc] init];

// Partially update document
[apiInstance patchThreatModelDocumentWith:body
    threatModelId:threatModelId
    documentId:documentId
              completionHandler: ^(Document output, NSError* error) {
                            if (output) {
                                NSLog(@"%@", output);
                            }
                            if (error) {
                                NSLog(@"Error: %@", error);
                            }
                        }];
var TmiThreatModelingImprovedApi = require('tmi__threat_modeling_improved_api');
var defaultClient = TmiThreatModelingImprovedApi.ApiClient.instance;


var api = new TmiThreatModelingImprovedApi.DocumentsApi()
var body = ; // {{array[threats_threat_id_body]}} 
var threatModelId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // {{UUID}} Unique identifier of the threat model (UUID)
var documentId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // {{UUID}} Document ID

var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
};
api.patchThreatModelDocument(bodythreatModelIddocumentId, callback);
using System;
using System.Diagnostics;
using IO.Swagger.Api;
using IO.Swagger.Client;
using IO.Swagger.Model;

namespace Example
{
    public class patchThreatModelDocumentExample
    {
        public void main()
        {


            var apiInstance = new DocumentsApi();
            var body = new array[threats_threat_id_body](); // array[threats_threat_id_body] | 
            var threatModelId = new UUID(); // UUID | Unique identifier of the threat model (UUID)
            var documentId = new UUID(); // UUID | Document ID

            try
            {
                // Partially update document
                Document result = apiInstance.patchThreatModelDocument(body, threatModelId, documentId);
                Debug.WriteLine(result);
            }
            catch (Exception e)
            {
                Debug.Print("Exception when calling DocumentsApi.patchThreatModelDocument: " + e.Message );
            }
        }
    }
}
<?php
require_once(__DIR__ . '/vendor/autoload.php');


$api_instance = new Swagger\Client\ApiDocumentsApi();
$body = ; // array[threats_threat_id_body] | 
$threatModelId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // UUID | Unique identifier of the threat model (UUID)
$documentId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // UUID | Document ID

try {
    $result = $api_instance->patchThreatModelDocument($body, $threatModelId, $documentId);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling DocumentsApi->patchThreatModelDocument: ', $e->getMessage(), PHP_EOL;
}
?>
use Data::Dumper;
use WWW::SwaggerClient::Configuration;
use WWW::SwaggerClient::DocumentsApi;


my $api_instance = WWW::SwaggerClient::DocumentsApi->new();
my $body = [WWW::SwaggerClient::Object::array[threats_threat_id_body]->new()]; # array[threats_threat_id_body] | 
my $threatModelId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; # UUID | Unique identifier of the threat model (UUID)
my $documentId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; # UUID | Document ID

eval { 
    my $result = $api_instance->patchThreatModelDocument(body => $body, threatModelId => $threatModelId, documentId => $documentId);
    print Dumper($result);
};
if ($@) {
    warn "Exception when calling DocumentsApi->patchThreatModelDocument: $@\n";
}
from __future__ import print_statement
import time
import swagger_client
from swagger_client.rest import ApiException
from pprint import pprint


# create an instance of the API class
api_instance = swagger_client.DocumentsApi()
body =  # array[threats_threat_id_body] | 
threatModelId = 38400000-8cf0-11bd-b23e-10b96e4ef00d # UUID | Unique identifier of the threat model (UUID)
documentId = 38400000-8cf0-11bd-b23e-10b96e4ef00d # UUID | Document ID

try: 
    # Partially update document
    api_response = api_instance.patch_threat_model_document(body, threatModelId, documentId)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling DocumentsApi->patchThreatModelDocument: %s\n" % e)

Parameters

Path parameters
Name Description
threat_model_id*
UUID (uuid)
Unique identifier of the threat model (UUID)
Required
document_id*
UUID (uuid)
Document ID
Required
Body parameters
Name Description
body *

Responses

Status: 200 - Successfully patched document

Status: 400 - Error response

Status: 401 - Error response

Status: 403 - Error response

Status: 404 - Error response


General

getApiInfo

Get API information

Returns service, API, and operator information without authentication


/

Usage and SDK Samples

curl -X GET\
-H "Accept: application/json"\
"http://localhost:8080/"
import io.swagger.client.*;
import io.swagger.client.auth.*;
import io.swagger.client.model.*;
import io.swagger.client.api.GeneralApi;

import java.io.File;
import java.util.*;

public class GeneralApiExample {

    public static void main(String[] args) {
        
        GeneralApi apiInstance = new GeneralApi();
        try {
            ApiInfo result = apiInstance.getApiInfo();
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling GeneralApi#getApiInfo");
            e.printStackTrace();
        }
    }
}
import io.swagger.client.api.GeneralApi;

public class GeneralApiExample {

    public static void main(String[] args) {
        GeneralApi apiInstance = new GeneralApi();
        try {
            ApiInfo result = apiInstance.getApiInfo();
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling GeneralApi#getApiInfo");
            e.printStackTrace();
        }
    }
}

GeneralApi *apiInstance = [[GeneralApi alloc] init];

// Get API information
[apiInstance getApiInfoWithCompletionHandler: 
              ^(ApiInfo output, NSError* error) {
                            if (output) {
                                NSLog(@"%@", output);
                            }
                            if (error) {
                                NSLog(@"Error: %@", error);
                            }
                        }];
var TmiThreatModelingImprovedApi = require('tmi__threat_modeling_improved_api');

var api = new TmiThreatModelingImprovedApi.GeneralApi()
var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
};
api.getApiInfo(callback);
using System;
using System.Diagnostics;
using IO.Swagger.Api;
using IO.Swagger.Client;
using IO.Swagger.Model;

namespace Example
{
    public class getApiInfoExample
    {
        public void main()
        {

            var apiInstance = new GeneralApi();

            try
            {
                // Get API information
                ApiInfo result = apiInstance.getApiInfo();
                Debug.WriteLine(result);
            }
            catch (Exception e)
            {
                Debug.Print("Exception when calling GeneralApi.getApiInfo: " + e.Message );
            }
        }
    }
}
<?php
require_once(__DIR__ . '/vendor/autoload.php');

$api_instance = new Swagger\Client\ApiGeneralApi();

try {
    $result = $api_instance->getApiInfo();
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling GeneralApi->getApiInfo: ', $e->getMessage(), PHP_EOL;
}
?>
use Data::Dumper;
use WWW::SwaggerClient::Configuration;
use WWW::SwaggerClient::GeneralApi;

my $api_instance = WWW::SwaggerClient::GeneralApi->new();

eval { 
    my $result = $api_instance->getApiInfo();
    print Dumper($result);
};
if ($@) {
    warn "Exception when calling GeneralApi->getApiInfo: $@\n";
}
from __future__ import print_statement
import time
import swagger_client
from swagger_client.rest import ApiException
from pprint import pprint

# create an instance of the API class
api_instance = swagger_client.GeneralApi()

try: 
    # Get API information
    api_response = api_instance.get_api_info()
    pprint(api_response)
except ApiException as e:
    print("Exception when calling GeneralApi->getApiInfo: %s\n" % e)

Parameters

Responses

Status: 200 - Service and API information

Status: 400 - Error response

Status: 500 - Error response


Notes

patchThreatModelNote

Partially update note

Apply JSON Patch operations to partially update a note


/threat_models/{threat_model_id}/notes/{note_id}

Usage and SDK Samples

curl -X PATCH\
 -H "Authorization: Bearer [[accessToken]]"\
-H "Accept: application/json"\
-H "Content-Type: application/json-patch+json"\
"http://localhost:8080/threat_models/{threat_model_id}/notes/{note_id}"
import io.swagger.client.*;
import io.swagger.client.auth.*;
import io.swagger.client.model.*;
import io.swagger.client.api.NotesApi;

import java.io.File;
import java.util.*;

public class NotesApiExample {

    public static void main(String[] args) {
        ApiClient defaultClient = Configuration.getDefaultApiClient();


        NotesApi apiInstance = new NotesApi();
        array[threats_threat_id_body] body = ; // array[threats_threat_id_body] | 
        UUID threatModelId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // UUID | Unique identifier of the threat model (UUID)
        UUID noteId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // UUID | Note ID
        try {
            Note result = apiInstance.patchThreatModelNote(body, threatModelId, noteId);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling NotesApi#patchThreatModelNote");
            e.printStackTrace();
        }
    }
}
import io.swagger.client.api.NotesApi;

public class NotesApiExample {

    public static void main(String[] args) {
        NotesApi apiInstance = new NotesApi();
        array[threats_threat_id_body] body = ; // array[threats_threat_id_body] | 
        UUID threatModelId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // UUID | Unique identifier of the threat model (UUID)
        UUID noteId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // UUID | Note ID
        try {
            Note result = apiInstance.patchThreatModelNote(body, threatModelId, noteId);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling NotesApi#patchThreatModelNote");
            e.printStackTrace();
        }
    }
}
Configuration *apiConfig = [Configuration sharedConfig];
array[threats_threat_id_body] *body = ; // 
UUID *threatModelId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // Unique identifier of the threat model (UUID)
UUID *noteId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // Note ID

NotesApi *apiInstance = [[NotesApi alloc] init];

// Partially update note
[apiInstance patchThreatModelNoteWith:body
    threatModelId:threatModelId
    noteId:noteId
              completionHandler: ^(Note output, NSError* error) {
                            if (output) {
                                NSLog(@"%@", output);
                            }
                            if (error) {
                                NSLog(@"Error: %@", error);
                            }
                        }];
var TmiThreatModelingImprovedApi = require('tmi__threat_modeling_improved_api');
var defaultClient = TmiThreatModelingImprovedApi.ApiClient.instance;


var api = new TmiThreatModelingImprovedApi.NotesApi()
var body = ; // {{array[threats_threat_id_body]}} 
var threatModelId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // {{UUID}} Unique identifier of the threat model (UUID)
var noteId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // {{UUID}} Note ID

var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
};
api.patchThreatModelNote(bodythreatModelIdnoteId, callback);
using System;
using System.Diagnostics;
using IO.Swagger.Api;
using IO.Swagger.Client;
using IO.Swagger.Model;

namespace Example
{
    public class patchThreatModelNoteExample
    {
        public void main()
        {


            var apiInstance = new NotesApi();
            var body = new array[threats_threat_id_body](); // array[threats_threat_id_body] | 
            var threatModelId = new UUID(); // UUID | Unique identifier of the threat model (UUID)
            var noteId = new UUID(); // UUID | Note ID

            try
            {
                // Partially update note
                Note result = apiInstance.patchThreatModelNote(body, threatModelId, noteId);
                Debug.WriteLine(result);
            }
            catch (Exception e)
            {
                Debug.Print("Exception when calling NotesApi.patchThreatModelNote: " + e.Message );
            }
        }
    }
}
<?php
require_once(__DIR__ . '/vendor/autoload.php');


$api_instance = new Swagger\Client\ApiNotesApi();
$body = ; // array[threats_threat_id_body] | 
$threatModelId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // UUID | Unique identifier of the threat model (UUID)
$noteId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // UUID | Note ID

try {
    $result = $api_instance->patchThreatModelNote($body, $threatModelId, $noteId);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling NotesApi->patchThreatModelNote: ', $e->getMessage(), PHP_EOL;
}
?>
use Data::Dumper;
use WWW::SwaggerClient::Configuration;
use WWW::SwaggerClient::NotesApi;


my $api_instance = WWW::SwaggerClient::NotesApi->new();
my $body = [WWW::SwaggerClient::Object::array[threats_threat_id_body]->new()]; # array[threats_threat_id_body] | 
my $threatModelId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; # UUID | Unique identifier of the threat model (UUID)
my $noteId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; # UUID | Note ID

eval { 
    my $result = $api_instance->patchThreatModelNote(body => $body, threatModelId => $threatModelId, noteId => $noteId);
    print Dumper($result);
};
if ($@) {
    warn "Exception when calling NotesApi->patchThreatModelNote: $@\n";
}
from __future__ import print_statement
import time
import swagger_client
from swagger_client.rest import ApiException
from pprint import pprint


# create an instance of the API class
api_instance = swagger_client.NotesApi()
body =  # array[threats_threat_id_body] | 
threatModelId = 38400000-8cf0-11bd-b23e-10b96e4ef00d # UUID | Unique identifier of the threat model (UUID)
noteId = 38400000-8cf0-11bd-b23e-10b96e4ef00d # UUID | Note ID

try: 
    # Partially update note
    api_response = api_instance.patch_threat_model_note(body, threatModelId, noteId)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling NotesApi->patchThreatModelNote: %s\n" % e)

Parameters

Path parameters
Name Description
threat_model_id*
UUID (uuid)
Unique identifier of the threat model (UUID)
Required
note_id*
UUID (uuid)
Note ID
Required
Body parameters
Name Description
body *

Responses

Status: 200 - Successfully patched note

Status: 400 - Error response

Status: 401 - Error response

Status: 403 - Error response

Status: 404 - Error response


OAuthDiscovery

getOAuthProtectedResourceMetadata

OAuth 2.0 Protected Resource Metadata

Returns OAuth 2.0 protected resource metadata as per RFC 9728


/.well-known/oauth-protected-resource

Usage and SDK Samples

curl -X GET\
-H "Accept: application/json"\
"http://localhost:8080/.well-known/oauth-protected-resource"
import io.swagger.client.*;
import io.swagger.client.auth.*;
import io.swagger.client.model.*;
import io.swagger.client.api.OAuthDiscoveryApi;

import java.io.File;
import java.util.*;

public class OAuthDiscoveryApiExample {

    public static void main(String[] args) {
        
        OAuthDiscoveryApi apiInstance = new OAuthDiscoveryApi();
        try {
            OAuthProtectedResourceMetadata result = apiInstance.getOAuthProtectedResourceMetadata();
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling OAuthDiscoveryApi#getOAuthProtectedResourceMetadata");
            e.printStackTrace();
        }
    }
}
import io.swagger.client.api.OAuthDiscoveryApi;

public class OAuthDiscoveryApiExample {

    public static void main(String[] args) {
        OAuthDiscoveryApi apiInstance = new OAuthDiscoveryApi();
        try {
            OAuthProtectedResourceMetadata result = apiInstance.getOAuthProtectedResourceMetadata();
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling OAuthDiscoveryApi#getOAuthProtectedResourceMetadata");
            e.printStackTrace();
        }
    }
}

OAuthDiscoveryApi *apiInstance = [[OAuthDiscoveryApi alloc] init];

// OAuth 2.0 Protected Resource Metadata
[apiInstance getOAuthProtectedResourceMetadataWithCompletionHandler: 
              ^(OAuthProtectedResourceMetadata output, NSError* error) {
                            if (output) {
                                NSLog(@"%@", output);
                            }
                            if (error) {
                                NSLog(@"Error: %@", error);
                            }
                        }];
var TmiThreatModelingImprovedApi = require('tmi__threat_modeling_improved_api');

var api = new TmiThreatModelingImprovedApi.OAuthDiscoveryApi()
var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
};
api.getOAuthProtectedResourceMetadata(callback);
using System;
using System.Diagnostics;
using IO.Swagger.Api;
using IO.Swagger.Client;
using IO.Swagger.Model;

namespace Example
{
    public class getOAuthProtectedResourceMetadataExample
    {
        public void main()
        {

            var apiInstance = new OAuthDiscoveryApi();

            try
            {
                // OAuth 2.0 Protected Resource Metadata
                OAuthProtectedResourceMetadata result = apiInstance.getOAuthProtectedResourceMetadata();
                Debug.WriteLine(result);
            }
            catch (Exception e)
            {
                Debug.Print("Exception when calling OAuthDiscoveryApi.getOAuthProtectedResourceMetadata: " + e.Message );
            }
        }
    }
}
<?php
require_once(__DIR__ . '/vendor/autoload.php');

$api_instance = new Swagger\Client\ApiOAuthDiscoveryApi();

try {
    $result = $api_instance->getOAuthProtectedResourceMetadata();
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling OAuthDiscoveryApi->getOAuthProtectedResourceMetadata: ', $e->getMessage(), PHP_EOL;
}
?>
use Data::Dumper;
use WWW::SwaggerClient::Configuration;
use WWW::SwaggerClient::OAuthDiscoveryApi;

my $api_instance = WWW::SwaggerClient::OAuthDiscoveryApi->new();

eval { 
    my $result = $api_instance->getOAuthProtectedResourceMetadata();
    print Dumper($result);
};
if ($@) {
    warn "Exception when calling OAuthDiscoveryApi->getOAuthProtectedResourceMetadata: $@\n";
}
from __future__ import print_statement
import time
import swagger_client
from swagger_client.rest import ApiException
from pprint import pprint

# create an instance of the API class
api_instance = swagger_client.OAuthDiscoveryApi()

try: 
    # OAuth 2.0 Protected Resource Metadata
    api_response = api_instance.get_o_auth_protected_resource_metadata()
    pprint(api_response)
except ApiException as e:
    print("Exception when calling OAuthDiscoveryApi->getOAuthProtectedResourceMetadata: %s\n" % e)

Parameters

Responses

Status: 200 - OAuth 2.0 protected resource metadata

Status: 400 - Error response

Status: 500 - Error response


OIDCDiscovery

getJWKS

JSON Web Key Set

Returns the JSON Web Key Set (JWKS) for JWT signature verification


/.well-known/jwks.json

Usage and SDK Samples

curl -X GET\
-H "Accept: application/json"\
"http://localhost:8080/.well-known/jwks.json"
import io.swagger.client.*;
import io.swagger.client.auth.*;
import io.swagger.client.model.*;
import io.swagger.client.api.OIDCDiscoveryApi;

import java.io.File;
import java.util.*;

public class OIDCDiscoveryApiExample {

    public static void main(String[] args) {
        
        OIDCDiscoveryApi apiInstance = new OIDCDiscoveryApi();
        try {
            inline_response_200_2 result = apiInstance.getJWKS();
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling OIDCDiscoveryApi#getJWKS");
            e.printStackTrace();
        }
    }
}
import io.swagger.client.api.OIDCDiscoveryApi;

public class OIDCDiscoveryApiExample {

    public static void main(String[] args) {
        OIDCDiscoveryApi apiInstance = new OIDCDiscoveryApi();
        try {
            inline_response_200_2 result = apiInstance.getJWKS();
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling OIDCDiscoveryApi#getJWKS");
            e.printStackTrace();
        }
    }
}

OIDCDiscoveryApi *apiInstance = [[OIDCDiscoveryApi alloc] init];

// JSON Web Key Set
[apiInstance getJWKSWithCompletionHandler: 
              ^(inline_response_200_2 output, NSError* error) {
                            if (output) {
                                NSLog(@"%@", output);
                            }
                            if (error) {
                                NSLog(@"Error: %@", error);
                            }
                        }];
var TmiThreatModelingImprovedApi = require('tmi__threat_modeling_improved_api');

var api = new TmiThreatModelingImprovedApi.OIDCDiscoveryApi()
var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
};
api.getJWKS(callback);
using System;
using System.Diagnostics;
using IO.Swagger.Api;
using IO.Swagger.Client;
using IO.Swagger.Model;

namespace Example
{
    public class getJWKSExample
    {
        public void main()
        {

            var apiInstance = new OIDCDiscoveryApi();

            try
            {
                // JSON Web Key Set
                inline_response_200_2 result = apiInstance.getJWKS();
                Debug.WriteLine(result);
            }
            catch (Exception e)
            {
                Debug.Print("Exception when calling OIDCDiscoveryApi.getJWKS: " + e.Message );
            }
        }
    }
}
<?php
require_once(__DIR__ . '/vendor/autoload.php');

$api_instance = new Swagger\Client\ApiOIDCDiscoveryApi();

try {
    $result = $api_instance->getJWKS();
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling OIDCDiscoveryApi->getJWKS: ', $e->getMessage(), PHP_EOL;
}
?>
use Data::Dumper;
use WWW::SwaggerClient::Configuration;
use WWW::SwaggerClient::OIDCDiscoveryApi;

my $api_instance = WWW::SwaggerClient::OIDCDiscoveryApi->new();

eval { 
    my $result = $api_instance->getJWKS();
    print Dumper($result);
};
if ($@) {
    warn "Exception when calling OIDCDiscoveryApi->getJWKS: $@\n";
}
from __future__ import print_statement
import time
import swagger_client
from swagger_client.rest import ApiException
from pprint import pprint

# create an instance of the API class
api_instance = swagger_client.OIDCDiscoveryApi()

try: 
    # JSON Web Key Set
    api_response = api_instance.get_jwks()
    pprint(api_response)
except ApiException as e:
    print("Exception when calling OIDCDiscoveryApi->getJWKS: %s\n" % e)

Parameters

Responses

Status: 200 - JSON Web Key Set

Status: 400 - Error response

Status: 500 - Error response


getOAuthAuthorizationServerMetadata

OAuth 2.0 Authorization Server Metadata

Returns OAuth 2.0 authorization server metadata as per RFC 8414


/.well-known/oauth-authorization-server

Usage and SDK Samples

curl -X GET\
-H "Accept: application/json"\
"http://localhost:8080/.well-known/oauth-authorization-server"
import io.swagger.client.*;
import io.swagger.client.auth.*;
import io.swagger.client.model.*;
import io.swagger.client.api.OIDCDiscoveryApi;

import java.io.File;
import java.util.*;

public class OIDCDiscoveryApiExample {

    public static void main(String[] args) {
        
        OIDCDiscoveryApi apiInstance = new OIDCDiscoveryApi();
        try {
            inline_response_200_1 result = apiInstance.getOAuthAuthorizationServerMetadata();
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling OIDCDiscoveryApi#getOAuthAuthorizationServerMetadata");
            e.printStackTrace();
        }
    }
}
import io.swagger.client.api.OIDCDiscoveryApi;

public class OIDCDiscoveryApiExample {

    public static void main(String[] args) {
        OIDCDiscoveryApi apiInstance = new OIDCDiscoveryApi();
        try {
            inline_response_200_1 result = apiInstance.getOAuthAuthorizationServerMetadata();
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling OIDCDiscoveryApi#getOAuthAuthorizationServerMetadata");
            e.printStackTrace();
        }
    }
}

OIDCDiscoveryApi *apiInstance = [[OIDCDiscoveryApi alloc] init];

// OAuth 2.0 Authorization Server Metadata
[apiInstance getOAuthAuthorizationServerMetadataWithCompletionHandler: 
              ^(inline_response_200_1 output, NSError* error) {
                            if (output) {
                                NSLog(@"%@", output);
                            }
                            if (error) {
                                NSLog(@"Error: %@", error);
                            }
                        }];
var TmiThreatModelingImprovedApi = require('tmi__threat_modeling_improved_api');

var api = new TmiThreatModelingImprovedApi.OIDCDiscoveryApi()
var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
};
api.getOAuthAuthorizationServerMetadata(callback);
using System;
using System.Diagnostics;
using IO.Swagger.Api;
using IO.Swagger.Client;
using IO.Swagger.Model;

namespace Example
{
    public class getOAuthAuthorizationServerMetadataExample
    {
        public void main()
        {

            var apiInstance = new OIDCDiscoveryApi();

            try
            {
                // OAuth 2.0 Authorization Server Metadata
                inline_response_200_1 result = apiInstance.getOAuthAuthorizationServerMetadata();
                Debug.WriteLine(result);
            }
            catch (Exception e)
            {
                Debug.Print("Exception when calling OIDCDiscoveryApi.getOAuthAuthorizationServerMetadata: " + e.Message );
            }
        }
    }
}
<?php
require_once(__DIR__ . '/vendor/autoload.php');

$api_instance = new Swagger\Client\ApiOIDCDiscoveryApi();

try {
    $result = $api_instance->getOAuthAuthorizationServerMetadata();
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling OIDCDiscoveryApi->getOAuthAuthorizationServerMetadata: ', $e->getMessage(), PHP_EOL;
}
?>
use Data::Dumper;
use WWW::SwaggerClient::Configuration;
use WWW::SwaggerClient::OIDCDiscoveryApi;

my $api_instance = WWW::SwaggerClient::OIDCDiscoveryApi->new();

eval { 
    my $result = $api_instance->getOAuthAuthorizationServerMetadata();
    print Dumper($result);
};
if ($@) {
    warn "Exception when calling OIDCDiscoveryApi->getOAuthAuthorizationServerMetadata: $@\n";
}
from __future__ import print_statement
import time
import swagger_client
from swagger_client.rest import ApiException
from pprint import pprint

# create an instance of the API class
api_instance = swagger_client.OIDCDiscoveryApi()

try: 
    # OAuth 2.0 Authorization Server Metadata
    api_response = api_instance.get_o_auth_authorization_server_metadata()
    pprint(api_response)
except ApiException as e:
    print("Exception when calling OIDCDiscoveryApi->getOAuthAuthorizationServerMetadata: %s\n" % e)

Parameters

Responses

Status: 200 - OAuth 2.0 authorization server metadata

Status: 400 - Error response

Status: 500 - Error response


getOpenIDConfiguration

OpenID Connect Discovery Configuration

Returns OpenID Connect provider configuration metadata as per RFC 8414


/.well-known/openid-configuration

Usage and SDK Samples

curl -X GET\
-H "Accept: application/json"\
"http://localhost:8080/.well-known/openid-configuration"
import io.swagger.client.*;
import io.swagger.client.auth.*;
import io.swagger.client.model.*;
import io.swagger.client.api.OIDCDiscoveryApi;

import java.io.File;
import java.util.*;

public class OIDCDiscoveryApiExample {

    public static void main(String[] args) {
        
        OIDCDiscoveryApi apiInstance = new OIDCDiscoveryApi();
        try {
            inline_response_200 result = apiInstance.getOpenIDConfiguration();
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling OIDCDiscoveryApi#getOpenIDConfiguration");
            e.printStackTrace();
        }
    }
}
import io.swagger.client.api.OIDCDiscoveryApi;

public class OIDCDiscoveryApiExample {

    public static void main(String[] args) {
        OIDCDiscoveryApi apiInstance = new OIDCDiscoveryApi();
        try {
            inline_response_200 result = apiInstance.getOpenIDConfiguration();
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling OIDCDiscoveryApi#getOpenIDConfiguration");
            e.printStackTrace();
        }
    }
}

OIDCDiscoveryApi *apiInstance = [[OIDCDiscoveryApi alloc] init];

// OpenID Connect Discovery Configuration
[apiInstance getOpenIDConfigurationWithCompletionHandler: 
              ^(inline_response_200 output, NSError* error) {
                            if (output) {
                                NSLog(@"%@", output);
                            }
                            if (error) {
                                NSLog(@"Error: %@", error);
                            }
                        }];
var TmiThreatModelingImprovedApi = require('tmi__threat_modeling_improved_api');

var api = new TmiThreatModelingImprovedApi.OIDCDiscoveryApi()
var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
};
api.getOpenIDConfiguration(callback);
using System;
using System.Diagnostics;
using IO.Swagger.Api;
using IO.Swagger.Client;
using IO.Swagger.Model;

namespace Example
{
    public class getOpenIDConfigurationExample
    {
        public void main()
        {

            var apiInstance = new OIDCDiscoveryApi();

            try
            {
                // OpenID Connect Discovery Configuration
                inline_response_200 result = apiInstance.getOpenIDConfiguration();
                Debug.WriteLine(result);
            }
            catch (Exception e)
            {
                Debug.Print("Exception when calling OIDCDiscoveryApi.getOpenIDConfiguration: " + e.Message );
            }
        }
    }
}
<?php
require_once(__DIR__ . '/vendor/autoload.php');

$api_instance = new Swagger\Client\ApiOIDCDiscoveryApi();

try {
    $result = $api_instance->getOpenIDConfiguration();
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling OIDCDiscoveryApi->getOpenIDConfiguration: ', $e->getMessage(), PHP_EOL;
}
?>
use Data::Dumper;
use WWW::SwaggerClient::Configuration;
use WWW::SwaggerClient::OIDCDiscoveryApi;

my $api_instance = WWW::SwaggerClient::OIDCDiscoveryApi->new();

eval { 
    my $result = $api_instance->getOpenIDConfiguration();
    print Dumper($result);
};
if ($@) {
    warn "Exception when calling OIDCDiscoveryApi->getOpenIDConfiguration: $@\n";
}
from __future__ import print_statement
import time
import swagger_client
from swagger_client.rest import ApiException
from pprint import pprint

# create an instance of the API class
api_instance = swagger_client.OIDCDiscoveryApi()

try: 
    # OpenID Connect Discovery Configuration
    api_response = api_instance.get_open_id_configuration()
    pprint(api_response)
except ApiException as e:
    print("Exception when calling OIDCDiscoveryApi->getOpenIDConfiguration: %s\n" % e)

Parameters

Responses

Status: 200 - OpenID Connect configuration metadata

Status: 400 - Error response

Status: 500 - Error response


Repositories

patchThreatModelRepository

Partially update repository

Apply JSON Patch operations to partially update a repository


/threat_models/{threat_model_id}/repositories/{repository_id}

Usage and SDK Samples

curl -X PATCH\
 -H "Authorization: Bearer [[accessToken]]"\
-H "Accept: application/json"\
-H "Content-Type: application/json-patch+json"\
"http://localhost:8080/threat_models/{threat_model_id}/repositories/{repository_id}"
import io.swagger.client.*;
import io.swagger.client.auth.*;
import io.swagger.client.model.*;
import io.swagger.client.api.RepositoriesApi;

import java.io.File;
import java.util.*;

public class RepositoriesApiExample {

    public static void main(String[] args) {
        ApiClient defaultClient = Configuration.getDefaultApiClient();


        RepositoriesApi apiInstance = new RepositoriesApi();
        array[threats_threat_id_body] body = ; // array[threats_threat_id_body] | 
        UUID threatModelId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // UUID | Unique identifier of the threat model (UUID)
        UUID repositoryId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // UUID | Repository ID
        try {
            Repository result = apiInstance.patchThreatModelRepository(body, threatModelId, repositoryId);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling RepositoriesApi#patchThreatModelRepository");
            e.printStackTrace();
        }
    }
}
import io.swagger.client.api.RepositoriesApi;

public class RepositoriesApiExample {

    public static void main(String[] args) {
        RepositoriesApi apiInstance = new RepositoriesApi();
        array[threats_threat_id_body] body = ; // array[threats_threat_id_body] | 
        UUID threatModelId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // UUID | Unique identifier of the threat model (UUID)
        UUID repositoryId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // UUID | Repository ID
        try {
            Repository result = apiInstance.patchThreatModelRepository(body, threatModelId, repositoryId);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling RepositoriesApi#patchThreatModelRepository");
            e.printStackTrace();
        }
    }
}
Configuration *apiConfig = [Configuration sharedConfig];
array[threats_threat_id_body] *body = ; // 
UUID *threatModelId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // Unique identifier of the threat model (UUID)
UUID *repositoryId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // Repository ID

RepositoriesApi *apiInstance = [[RepositoriesApi alloc] init];

// Partially update repository
[apiInstance patchThreatModelRepositoryWith:body
    threatModelId:threatModelId
    repositoryId:repositoryId
              completionHandler: ^(Repository output, NSError* error) {
                            if (output) {
                                NSLog(@"%@", output);
                            }
                            if (error) {
                                NSLog(@"Error: %@", error);
                            }
                        }];
var TmiThreatModelingImprovedApi = require('tmi__threat_modeling_improved_api');
var defaultClient = TmiThreatModelingImprovedApi.ApiClient.instance;


var api = new TmiThreatModelingImprovedApi.RepositoriesApi()
var body = ; // {{array[threats_threat_id_body]}} 
var threatModelId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // {{UUID}} Unique identifier of the threat model (UUID)
var repositoryId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // {{UUID}} Repository ID

var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
};
api.patchThreatModelRepository(bodythreatModelIdrepositoryId, callback);
using System;
using System.Diagnostics;
using IO.Swagger.Api;
using IO.Swagger.Client;
using IO.Swagger.Model;

namespace Example
{
    public class patchThreatModelRepositoryExample
    {
        public void main()
        {


            var apiInstance = new RepositoriesApi();
            var body = new array[threats_threat_id_body](); // array[threats_threat_id_body] | 
            var threatModelId = new UUID(); // UUID | Unique identifier of the threat model (UUID)
            var repositoryId = new UUID(); // UUID | Repository ID

            try
            {
                // Partially update repository
                Repository result = apiInstance.patchThreatModelRepository(body, threatModelId, repositoryId);
                Debug.WriteLine(result);
            }
            catch (Exception e)
            {
                Debug.Print("Exception when calling RepositoriesApi.patchThreatModelRepository: " + e.Message );
            }
        }
    }
}
<?php
require_once(__DIR__ . '/vendor/autoload.php');


$api_instance = new Swagger\Client\ApiRepositoriesApi();
$body = ; // array[threats_threat_id_body] | 
$threatModelId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // UUID | Unique identifier of the threat model (UUID)
$repositoryId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // UUID | Repository ID

try {
    $result = $api_instance->patchThreatModelRepository($body, $threatModelId, $repositoryId);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling RepositoriesApi->patchThreatModelRepository: ', $e->getMessage(), PHP_EOL;
}
?>
use Data::Dumper;
use WWW::SwaggerClient::Configuration;
use WWW::SwaggerClient::RepositoriesApi;


my $api_instance = WWW::SwaggerClient::RepositoriesApi->new();
my $body = [WWW::SwaggerClient::Object::array[threats_threat_id_body]->new()]; # array[threats_threat_id_body] | 
my $threatModelId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; # UUID | Unique identifier of the threat model (UUID)
my $repositoryId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; # UUID | Repository ID

eval { 
    my $result = $api_instance->patchThreatModelRepository(body => $body, threatModelId => $threatModelId, repositoryId => $repositoryId);
    print Dumper($result);
};
if ($@) {
    warn "Exception when calling RepositoriesApi->patchThreatModelRepository: $@\n";
}
from __future__ import print_statement
import time
import swagger_client
from swagger_client.rest import ApiException
from pprint import pprint


# create an instance of the API class
api_instance = swagger_client.RepositoriesApi()
body =  # array[threats_threat_id_body] | 
threatModelId = 38400000-8cf0-11bd-b23e-10b96e4ef00d # UUID | Unique identifier of the threat model (UUID)
repositoryId = 38400000-8cf0-11bd-b23e-10b96e4ef00d # UUID | Repository ID

try: 
    # Partially update repository
    api_response = api_instance.patch_threat_model_repository(body, threatModelId, repositoryId)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling RepositoriesApi->patchThreatModelRepository: %s\n" % e)

Parameters

Path parameters
Name Description
threat_model_id*
UUID (uuid)
Unique identifier of the threat model (UUID)
Required
repository_id*
UUID (uuid)
Repository ID
Required
Body parameters
Name Description
body *

Responses

Status: 200 - Successfully patched repository

Status: 400 - Error response

Status: 401 - Error response

Status: 403 - Error response

Status: 404 - Error response


ThreatModelSubResources

bulkCreateDiagramMetadata

Bulk create diagram metadata

Creates multiple metadata entries in a single operation for the specified diagram


/threat_models/{threat_model_id}/diagrams/{diagram_id}/metadata/bulk

Usage and SDK Samples

curl -X POST\
 -H "Authorization: Bearer [[accessToken]]"\
-H "Accept: application/json"\
-H "Content-Type: application/json"\
"http://localhost:8080/threat_models/{threat_model_id}/diagrams/{diagram_id}/metadata/bulk"
import io.swagger.client.*;
import io.swagger.client.auth.*;
import io.swagger.client.model.*;
import io.swagger.client.api.ThreatModelSubResourcesApi;

import java.io.File;
import java.util.*;

public class ThreatModelSubResourcesApiExample {

    public static void main(String[] args) {
        ApiClient defaultClient = Configuration.getDefaultApiClient();


        ThreatModelSubResourcesApi apiInstance = new ThreatModelSubResourcesApi();
        array[Metadata] body = ; // array[Metadata] | 
        UUID threatModelId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // UUID | Unique identifier of the threat model (UUID)
        UUID diagramId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // UUID | Unique identifier of the diagram (UUID)
        try {
            array[Metadata] result = apiInstance.bulkCreateDiagramMetadata(body, threatModelId, diagramId);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling ThreatModelSubResourcesApi#bulkCreateDiagramMetadata");
            e.printStackTrace();
        }
    }
}
import io.swagger.client.api.ThreatModelSubResourcesApi;

public class ThreatModelSubResourcesApiExample {

    public static void main(String[] args) {
        ThreatModelSubResourcesApi apiInstance = new ThreatModelSubResourcesApi();
        array[Metadata] body = ; // array[Metadata] | 
        UUID threatModelId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // UUID | Unique identifier of the threat model (UUID)
        UUID diagramId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // UUID | Unique identifier of the diagram (UUID)
        try {
            array[Metadata] result = apiInstance.bulkCreateDiagramMetadata(body, threatModelId, diagramId);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling ThreatModelSubResourcesApi#bulkCreateDiagramMetadata");
            e.printStackTrace();
        }
    }
}
Configuration *apiConfig = [Configuration sharedConfig];
array[Metadata] *body = ; // 
UUID *threatModelId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // Unique identifier of the threat model (UUID)
UUID *diagramId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // Unique identifier of the diagram (UUID)

ThreatModelSubResourcesApi *apiInstance = [[ThreatModelSubResourcesApi alloc] init];

// Bulk create diagram metadata
[apiInstance bulkCreateDiagramMetadataWith:body
    threatModelId:threatModelId
    diagramId:diagramId
              completionHandler: ^(array[Metadata] output, NSError* error) {
                            if (output) {
                                NSLog(@"%@", output);
                            }
                            if (error) {
                                NSLog(@"Error: %@", error);
                            }
                        }];
var TmiThreatModelingImprovedApi = require('tmi__threat_modeling_improved_api');
var defaultClient = TmiThreatModelingImprovedApi.ApiClient.instance;


var api = new TmiThreatModelingImprovedApi.ThreatModelSubResourcesApi()
var body = ; // {{array[Metadata]}} 
var threatModelId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // {{UUID}} Unique identifier of the threat model (UUID)
var diagramId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // {{UUID}} Unique identifier of the diagram (UUID)

var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
};
api.bulkCreateDiagramMetadata(bodythreatModelIddiagramId, callback);
using System;
using System.Diagnostics;
using IO.Swagger.Api;
using IO.Swagger.Client;
using IO.Swagger.Model;

namespace Example
{
    public class bulkCreateDiagramMetadataExample
    {
        public void main()
        {


            var apiInstance = new ThreatModelSubResourcesApi();
            var body = new array[Metadata](); // array[Metadata] | 
            var threatModelId = new UUID(); // UUID | Unique identifier of the threat model (UUID)
            var diagramId = new UUID(); // UUID | Unique identifier of the diagram (UUID)

            try
            {
                // Bulk create diagram metadata
                array[Metadata] result = apiInstance.bulkCreateDiagramMetadata(body, threatModelId, diagramId);
                Debug.WriteLine(result);
            }
            catch (Exception e)
            {
                Debug.Print("Exception when calling ThreatModelSubResourcesApi.bulkCreateDiagramMetadata: " + e.Message );
            }
        }
    }
}
<?php
require_once(__DIR__ . '/vendor/autoload.php');


$api_instance = new Swagger\Client\ApiThreatModelSubResourcesApi();
$body = ; // array[Metadata] | 
$threatModelId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // UUID | Unique identifier of the threat model (UUID)
$diagramId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // UUID | Unique identifier of the diagram (UUID)

try {
    $result = $api_instance->bulkCreateDiagramMetadata($body, $threatModelId, $diagramId);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling ThreatModelSubResourcesApi->bulkCreateDiagramMetadata: ', $e->getMessage(), PHP_EOL;
}
?>
use Data::Dumper;
use WWW::SwaggerClient::Configuration;
use WWW::SwaggerClient::ThreatModelSubResourcesApi;


my $api_instance = WWW::SwaggerClient::ThreatModelSubResourcesApi->new();
my $body = [WWW::SwaggerClient::Object::array[Metadata]->new()]; # array[Metadata] | 
my $threatModelId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; # UUID | Unique identifier of the threat model (UUID)
my $diagramId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; # UUID | Unique identifier of the diagram (UUID)

eval { 
    my $result = $api_instance->bulkCreateDiagramMetadata(body => $body, threatModelId => $threatModelId, diagramId => $diagramId);
    print Dumper($result);
};
if ($@) {
    warn "Exception when calling ThreatModelSubResourcesApi->bulkCreateDiagramMetadata: $@\n";
}
from __future__ import print_statement
import time
import swagger_client
from swagger_client.rest import ApiException
from pprint import pprint


# create an instance of the API class
api_instance = swagger_client.ThreatModelSubResourcesApi()
body =  # array[Metadata] | 
threatModelId = 38400000-8cf0-11bd-b23e-10b96e4ef00d # UUID | Unique identifier of the threat model (UUID)
diagramId = 38400000-8cf0-11bd-b23e-10b96e4ef00d # UUID | Unique identifier of the diagram (UUID)

try: 
    # Bulk create diagram metadata
    api_response = api_instance.bulk_create_diagram_metadata(body, threatModelId, diagramId)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling ThreatModelSubResourcesApi->bulkCreateDiagramMetadata: %s\n" % e)

Parameters

Path parameters
Name Description
threat_model_id*
UUID (uuid)
Unique identifier of the threat model (UUID)
Required
diagram_id*
UUID (uuid)
Unique identifier of the diagram (UUID)
Required
Body parameters
Name Description
body *

Responses

Status: 201 - Metadata entries created successfully

Status: 400 - Error response

Status: 401 - Error response

Status: 403 - Error response

Status: 404 - Error response

Status: 500 - Error response


bulkCreateDocumentMetadata

Bulk create document metadata

Creates multiple metadata entries in a single operation for the specified document


/threat_models/{threat_model_id}/documents/{document_id}/metadata/bulk

Usage and SDK Samples

curl -X POST\
 -H "Authorization: Bearer [[accessToken]]"\
-H "Accept: application/json"\
-H "Content-Type: application/json"\
"http://localhost:8080/threat_models/{threat_model_id}/documents/{document_id}/metadata/bulk"
import io.swagger.client.*;
import io.swagger.client.auth.*;
import io.swagger.client.model.*;
import io.swagger.client.api.ThreatModelSubResourcesApi;

import java.io.File;
import java.util.*;

public class ThreatModelSubResourcesApiExample {

    public static void main(String[] args) {
        ApiClient defaultClient = Configuration.getDefaultApiClient();


        ThreatModelSubResourcesApi apiInstance = new ThreatModelSubResourcesApi();
        array[Metadata] body = ; // array[Metadata] | 
        UUID threatModelId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // UUID | Unique identifier of the threat model (UUID)
        UUID documentId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // UUID | Unique identifier of the document (UUID)
        try {
            array[Metadata] result = apiInstance.bulkCreateDocumentMetadata(body, threatModelId, documentId);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling ThreatModelSubResourcesApi#bulkCreateDocumentMetadata");
            e.printStackTrace();
        }
    }
}
import io.swagger.client.api.ThreatModelSubResourcesApi;

public class ThreatModelSubResourcesApiExample {

    public static void main(String[] args) {
        ThreatModelSubResourcesApi apiInstance = new ThreatModelSubResourcesApi();
        array[Metadata] body = ; // array[Metadata] | 
        UUID threatModelId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // UUID | Unique identifier of the threat model (UUID)
        UUID documentId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // UUID | Unique identifier of the document (UUID)
        try {
            array[Metadata] result = apiInstance.bulkCreateDocumentMetadata(body, threatModelId, documentId);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling ThreatModelSubResourcesApi#bulkCreateDocumentMetadata");
            e.printStackTrace();
        }
    }
}
Configuration *apiConfig = [Configuration sharedConfig];
array[Metadata] *body = ; // 
UUID *threatModelId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // Unique identifier of the threat model (UUID)
UUID *documentId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // Unique identifier of the document (UUID)

ThreatModelSubResourcesApi *apiInstance = [[ThreatModelSubResourcesApi alloc] init];

// Bulk create document metadata
[apiInstance bulkCreateDocumentMetadataWith:body
    threatModelId:threatModelId
    documentId:documentId
              completionHandler: ^(array[Metadata] output, NSError* error) {
                            if (output) {
                                NSLog(@"%@", output);
                            }
                            if (error) {
                                NSLog(@"Error: %@", error);
                            }
                        }];
var TmiThreatModelingImprovedApi = require('tmi__threat_modeling_improved_api');
var defaultClient = TmiThreatModelingImprovedApi.ApiClient.instance;


var api = new TmiThreatModelingImprovedApi.ThreatModelSubResourcesApi()
var body = ; // {{array[Metadata]}} 
var threatModelId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // {{UUID}} Unique identifier of the threat model (UUID)
var documentId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // {{UUID}} Unique identifier of the document (UUID)

var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
};
api.bulkCreateDocumentMetadata(bodythreatModelIddocumentId, callback);
using System;
using System.Diagnostics;
using IO.Swagger.Api;
using IO.Swagger.Client;
using IO.Swagger.Model;

namespace Example
{
    public class bulkCreateDocumentMetadataExample
    {
        public void main()
        {


            var apiInstance = new ThreatModelSubResourcesApi();
            var body = new array[Metadata](); // array[Metadata] | 
            var threatModelId = new UUID(); // UUID | Unique identifier of the threat model (UUID)
            var documentId = new UUID(); // UUID | Unique identifier of the document (UUID)

            try
            {
                // Bulk create document metadata
                array[Metadata] result = apiInstance.bulkCreateDocumentMetadata(body, threatModelId, documentId);
                Debug.WriteLine(result);
            }
            catch (Exception e)
            {
                Debug.Print("Exception when calling ThreatModelSubResourcesApi.bulkCreateDocumentMetadata: " + e.Message );
            }
        }
    }
}
<?php
require_once(__DIR__ . '/vendor/autoload.php');


$api_instance = new Swagger\Client\ApiThreatModelSubResourcesApi();
$body = ; // array[Metadata] | 
$threatModelId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // UUID | Unique identifier of the threat model (UUID)
$documentId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // UUID | Unique identifier of the document (UUID)

try {
    $result = $api_instance->bulkCreateDocumentMetadata($body, $threatModelId, $documentId);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling ThreatModelSubResourcesApi->bulkCreateDocumentMetadata: ', $e->getMessage(), PHP_EOL;
}
?>
use Data::Dumper;
use WWW::SwaggerClient::Configuration;
use WWW::SwaggerClient::ThreatModelSubResourcesApi;


my $api_instance = WWW::SwaggerClient::ThreatModelSubResourcesApi->new();
my $body = [WWW::SwaggerClient::Object::array[Metadata]->new()]; # array[Metadata] | 
my $threatModelId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; # UUID | Unique identifier of the threat model (UUID)
my $documentId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; # UUID | Unique identifier of the document (UUID)

eval { 
    my $result = $api_instance->bulkCreateDocumentMetadata(body => $body, threatModelId => $threatModelId, documentId => $documentId);
    print Dumper($result);
};
if ($@) {
    warn "Exception when calling ThreatModelSubResourcesApi->bulkCreateDocumentMetadata: $@\n";
}
from __future__ import print_statement
import time
import swagger_client
from swagger_client.rest import ApiException
from pprint import pprint


# create an instance of the API class
api_instance = swagger_client.ThreatModelSubResourcesApi()
body =  # array[Metadata] | 
threatModelId = 38400000-8cf0-11bd-b23e-10b96e4ef00d # UUID | Unique identifier of the threat model (UUID)
documentId = 38400000-8cf0-11bd-b23e-10b96e4ef00d # UUID | Unique identifier of the document (UUID)

try: 
    # Bulk create document metadata
    api_response = api_instance.bulk_create_document_metadata(body, threatModelId, documentId)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling ThreatModelSubResourcesApi->bulkCreateDocumentMetadata: %s\n" % e)

Parameters

Path parameters
Name Description
threat_model_id*
UUID (uuid)
Unique identifier of the threat model (UUID)
Required
document_id*
UUID (uuid)
Unique identifier of the document (UUID)
Required
Body parameters
Name Description
body *

Responses

Status: 201 - Metadata entries created successfully

Status: 400 - Error response

Status: 401 - Error response

Status: 403 - Error response

Status: 404 - Error response

Status: 500 - Error response


bulkCreateNoteMetadata

Bulk create note metadata

Creates multiple metadata key-value pairs for the specified note


/threat_models/{threat_model_id}/notes/{note_id}/metadata/bulk

Usage and SDK Samples

curl -X POST\
 -H "Authorization: Bearer [[accessToken]]"\
-H "Accept: application/json"\
-H "Content-Type: application/json"\
"http://localhost:8080/threat_models/{threat_model_id}/notes/{note_id}/metadata/bulk"
import io.swagger.client.*;
import io.swagger.client.auth.*;
import io.swagger.client.model.*;
import io.swagger.client.api.ThreatModelSubResourcesApi;

import java.io.File;
import java.util.*;

public class ThreatModelSubResourcesApiExample {

    public static void main(String[] args) {
        ApiClient defaultClient = Configuration.getDefaultApiClient();


        ThreatModelSubResourcesApi apiInstance = new ThreatModelSubResourcesApi();
        array[Metadata] body = ; // array[Metadata] | 
        UUID threatModelId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // UUID | Unique identifier of the threat model (UUID)
        UUID noteId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // UUID | Unique identifier of the note (UUID)
        try {
            array[Metadata] result = apiInstance.bulkCreateNoteMetadata(body, threatModelId, noteId);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling ThreatModelSubResourcesApi#bulkCreateNoteMetadata");
            e.printStackTrace();
        }
    }
}
import io.swagger.client.api.ThreatModelSubResourcesApi;

public class ThreatModelSubResourcesApiExample {

    public static void main(String[] args) {
        ThreatModelSubResourcesApi apiInstance = new ThreatModelSubResourcesApi();
        array[Metadata] body = ; // array[Metadata] | 
        UUID threatModelId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // UUID | Unique identifier of the threat model (UUID)
        UUID noteId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // UUID | Unique identifier of the note (UUID)
        try {
            array[Metadata] result = apiInstance.bulkCreateNoteMetadata(body, threatModelId, noteId);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling ThreatModelSubResourcesApi#bulkCreateNoteMetadata");
            e.printStackTrace();
        }
    }
}
Configuration *apiConfig = [Configuration sharedConfig];
array[Metadata] *body = ; // 
UUID *threatModelId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // Unique identifier of the threat model (UUID)
UUID *noteId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // Unique identifier of the note (UUID)

ThreatModelSubResourcesApi *apiInstance = [[ThreatModelSubResourcesApi alloc] init];

// Bulk create note metadata
[apiInstance bulkCreateNoteMetadataWith:body
    threatModelId:threatModelId
    noteId:noteId
              completionHandler: ^(array[Metadata] output, NSError* error) {
                            if (output) {
                                NSLog(@"%@", output);
                            }
                            if (error) {
                                NSLog(@"Error: %@", error);
                            }
                        }];
var TmiThreatModelingImprovedApi = require('tmi__threat_modeling_improved_api');
var defaultClient = TmiThreatModelingImprovedApi.ApiClient.instance;


var api = new TmiThreatModelingImprovedApi.ThreatModelSubResourcesApi()
var body = ; // {{array[Metadata]}} 
var threatModelId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // {{UUID}} Unique identifier of the threat model (UUID)
var noteId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // {{UUID}} Unique identifier of the note (UUID)

var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
};
api.bulkCreateNoteMetadata(bodythreatModelIdnoteId, callback);
using System;
using System.Diagnostics;
using IO.Swagger.Api;
using IO.Swagger.Client;
using IO.Swagger.Model;

namespace Example
{
    public class bulkCreateNoteMetadataExample
    {
        public void main()
        {


            var apiInstance = new ThreatModelSubResourcesApi();
            var body = new array[Metadata](); // array[Metadata] | 
            var threatModelId = new UUID(); // UUID | Unique identifier of the threat model (UUID)
            var noteId = new UUID(); // UUID | Unique identifier of the note (UUID)

            try
            {
                // Bulk create note metadata
                array[Metadata] result = apiInstance.bulkCreateNoteMetadata(body, threatModelId, noteId);
                Debug.WriteLine(result);
            }
            catch (Exception e)
            {
                Debug.Print("Exception when calling ThreatModelSubResourcesApi.bulkCreateNoteMetadata: " + e.Message );
            }
        }
    }
}
<?php
require_once(__DIR__ . '/vendor/autoload.php');


$api_instance = new Swagger\Client\ApiThreatModelSubResourcesApi();
$body = ; // array[Metadata] | 
$threatModelId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // UUID | Unique identifier of the threat model (UUID)
$noteId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // UUID | Unique identifier of the note (UUID)

try {
    $result = $api_instance->bulkCreateNoteMetadata($body, $threatModelId, $noteId);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling ThreatModelSubResourcesApi->bulkCreateNoteMetadata: ', $e->getMessage(), PHP_EOL;
}
?>
use Data::Dumper;
use WWW::SwaggerClient::Configuration;
use WWW::SwaggerClient::ThreatModelSubResourcesApi;


my $api_instance = WWW::SwaggerClient::ThreatModelSubResourcesApi->new();
my $body = [WWW::SwaggerClient::Object::array[Metadata]->new()]; # array[Metadata] | 
my $threatModelId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; # UUID | Unique identifier of the threat model (UUID)
my $noteId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; # UUID | Unique identifier of the note (UUID)

eval { 
    my $result = $api_instance->bulkCreateNoteMetadata(body => $body, threatModelId => $threatModelId, noteId => $noteId);
    print Dumper($result);
};
if ($@) {
    warn "Exception when calling ThreatModelSubResourcesApi->bulkCreateNoteMetadata: $@\n";
}
from __future__ import print_statement
import time
import swagger_client
from swagger_client.rest import ApiException
from pprint import pprint


# create an instance of the API class
api_instance = swagger_client.ThreatModelSubResourcesApi()
body =  # array[Metadata] | 
threatModelId = 38400000-8cf0-11bd-b23e-10b96e4ef00d # UUID | Unique identifier of the threat model (UUID)
noteId = 38400000-8cf0-11bd-b23e-10b96e4ef00d # UUID | Unique identifier of the note (UUID)

try: 
    # Bulk create note metadata
    api_response = api_instance.bulk_create_note_metadata(body, threatModelId, noteId)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling ThreatModelSubResourcesApi->bulkCreateNoteMetadata: %s\n" % e)

Parameters

Path parameters
Name Description
threat_model_id*
UUID (uuid)
Unique identifier of the threat model (UUID)
Required
note_id*
UUID (uuid)
Unique identifier of the note (UUID)
Required
Body parameters
Name Description
body *

Responses

Status: 201 - Metadata created successfully

Status: 400 - Error response

Status: 401 - Error response

Status: 403 - Error response

Status: 404 - Error response

Status: 500 - Error response


bulkCreateRepositoryMetadata

Bulk create source metadata

Creates multiple metadata entries in a single operation for the specified source reference


/threat_models/{threat_model_id}/repositories/{repository_id}/metadata/bulk

Usage and SDK Samples

curl -X POST\
 -H "Authorization: Bearer [[accessToken]]"\
-H "Accept: application/json"\
-H "Content-Type: application/json"\
"http://localhost:8080/threat_models/{threat_model_id}/repositories/{repository_id}/metadata/bulk"
import io.swagger.client.*;
import io.swagger.client.auth.*;
import io.swagger.client.model.*;
import io.swagger.client.api.ThreatModelSubResourcesApi;

import java.io.File;
import java.util.*;

public class ThreatModelSubResourcesApiExample {

    public static void main(String[] args) {
        ApiClient defaultClient = Configuration.getDefaultApiClient();


        ThreatModelSubResourcesApi apiInstance = new ThreatModelSubResourcesApi();
        array[Metadata] body = ; // array[Metadata] | 
        UUID threatModelId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // UUID | Unique identifier of the threat model (UUID)
        UUID repositoryId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // UUID | Unique identifier of the source reference (UUID)
        try {
            array[Metadata] result = apiInstance.bulkCreateRepositoryMetadata(body, threatModelId, repositoryId);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling ThreatModelSubResourcesApi#bulkCreateRepositoryMetadata");
            e.printStackTrace();
        }
    }
}
import io.swagger.client.api.ThreatModelSubResourcesApi;

public class ThreatModelSubResourcesApiExample {

    public static void main(String[] args) {
        ThreatModelSubResourcesApi apiInstance = new ThreatModelSubResourcesApi();
        array[Metadata] body = ; // array[Metadata] | 
        UUID threatModelId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // UUID | Unique identifier of the threat model (UUID)
        UUID repositoryId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // UUID | Unique identifier of the source reference (UUID)
        try {
            array[Metadata] result = apiInstance.bulkCreateRepositoryMetadata(body, threatModelId, repositoryId);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling ThreatModelSubResourcesApi#bulkCreateRepositoryMetadata");
            e.printStackTrace();
        }
    }
}
Configuration *apiConfig = [Configuration sharedConfig];
array[Metadata] *body = ; // 
UUID *threatModelId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // Unique identifier of the threat model (UUID)
UUID *repositoryId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // Unique identifier of the source reference (UUID)

ThreatModelSubResourcesApi *apiInstance = [[ThreatModelSubResourcesApi alloc] init];

// Bulk create source metadata
[apiInstance bulkCreateRepositoryMetadataWith:body
    threatModelId:threatModelId
    repositoryId:repositoryId
              completionHandler: ^(array[Metadata] output, NSError* error) {
                            if (output) {
                                NSLog(@"%@", output);
                            }
                            if (error) {
                                NSLog(@"Error: %@", error);
                            }
                        }];
var TmiThreatModelingImprovedApi = require('tmi__threat_modeling_improved_api');
var defaultClient = TmiThreatModelingImprovedApi.ApiClient.instance;


var api = new TmiThreatModelingImprovedApi.ThreatModelSubResourcesApi()
var body = ; // {{array[Metadata]}} 
var threatModelId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // {{UUID}} Unique identifier of the threat model (UUID)
var repositoryId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // {{UUID}} Unique identifier of the source reference (UUID)

var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
};
api.bulkCreateRepositoryMetadata(bodythreatModelIdrepositoryId, callback);
using System;
using System.Diagnostics;
using IO.Swagger.Api;
using IO.Swagger.Client;
using IO.Swagger.Model;

namespace Example
{
    public class bulkCreateRepositoryMetadataExample
    {
        public void main()
        {


            var apiInstance = new ThreatModelSubResourcesApi();
            var body = new array[Metadata](); // array[Metadata] | 
            var threatModelId = new UUID(); // UUID | Unique identifier of the threat model (UUID)
            var repositoryId = new UUID(); // UUID | Unique identifier of the source reference (UUID)

            try
            {
                // Bulk create source metadata
                array[Metadata] result = apiInstance.bulkCreateRepositoryMetadata(body, threatModelId, repositoryId);
                Debug.WriteLine(result);
            }
            catch (Exception e)
            {
                Debug.Print("Exception when calling ThreatModelSubResourcesApi.bulkCreateRepositoryMetadata: " + e.Message );
            }
        }
    }
}
<?php
require_once(__DIR__ . '/vendor/autoload.php');


$api_instance = new Swagger\Client\ApiThreatModelSubResourcesApi();
$body = ; // array[Metadata] | 
$threatModelId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // UUID | Unique identifier of the threat model (UUID)
$repositoryId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // UUID | Unique identifier of the source reference (UUID)

try {
    $result = $api_instance->bulkCreateRepositoryMetadata($body, $threatModelId, $repositoryId);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling ThreatModelSubResourcesApi->bulkCreateRepositoryMetadata: ', $e->getMessage(), PHP_EOL;
}
?>
use Data::Dumper;
use WWW::SwaggerClient::Configuration;
use WWW::SwaggerClient::ThreatModelSubResourcesApi;


my $api_instance = WWW::SwaggerClient::ThreatModelSubResourcesApi->new();
my $body = [WWW::SwaggerClient::Object::array[Metadata]->new()]; # array[Metadata] | 
my $threatModelId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; # UUID | Unique identifier of the threat model (UUID)
my $repositoryId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; # UUID | Unique identifier of the source reference (UUID)

eval { 
    my $result = $api_instance->bulkCreateRepositoryMetadata(body => $body, threatModelId => $threatModelId, repositoryId => $repositoryId);
    print Dumper($result);
};
if ($@) {
    warn "Exception when calling ThreatModelSubResourcesApi->bulkCreateRepositoryMetadata: $@\n";
}
from __future__ import print_statement
import time
import swagger_client
from swagger_client.rest import ApiException
from pprint import pprint


# create an instance of the API class
api_instance = swagger_client.ThreatModelSubResourcesApi()
body =  # array[Metadata] | 
threatModelId = 38400000-8cf0-11bd-b23e-10b96e4ef00d # UUID | Unique identifier of the threat model (UUID)
repositoryId = 38400000-8cf0-11bd-b23e-10b96e4ef00d # UUID | Unique identifier of the source reference (UUID)

try: 
    # Bulk create source metadata
    api_response = api_instance.bulk_create_repository_metadata(body, threatModelId, repositoryId)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling ThreatModelSubResourcesApi->bulkCreateRepositoryMetadata: %s\n" % e)

Parameters

Path parameters
Name Description
threat_model_id*
UUID (uuid)
Unique identifier of the threat model (UUID)
Required
repository_id*
UUID (uuid)
Unique identifier of the source reference (UUID)
Required
Body parameters
Name Description
body *

Responses

Status: 201 - Metadata entries created successfully

Status: 400 - Error response

Status: 401 - Error response

Status: 403 - Error response

Status: 404 - Error response

Status: 500 - Error response


bulkCreateThreatMetadata

Bulk create threat metadata

Creates multiple metadata entries in a single operation for the specified threat


/threat_models/{threat_model_id}/threats/{threat_id}/metadata/bulk

Usage and SDK Samples

curl -X POST\
 -H "Authorization: Bearer [[accessToken]]"\
-H "Accept: application/json"\
-H "Content-Type: application/json"\
"http://localhost:8080/threat_models/{threat_model_id}/threats/{threat_id}/metadata/bulk"
import io.swagger.client.*;
import io.swagger.client.auth.*;
import io.swagger.client.model.*;
import io.swagger.client.api.ThreatModelSubResourcesApi;

import java.io.File;
import java.util.*;

public class ThreatModelSubResourcesApiExample {

    public static void main(String[] args) {
        ApiClient defaultClient = Configuration.getDefaultApiClient();


        ThreatModelSubResourcesApi apiInstance = new ThreatModelSubResourcesApi();
        array[Metadata] body = ; // array[Metadata] | 
        UUID threatModelId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // UUID | Unique identifier of the threat model (UUID)
        UUID threatId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // UUID | Unique identifier of the threat (UUID)
        try {
            array[Metadata] result = apiInstance.bulkCreateThreatMetadata(body, threatModelId, threatId);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling ThreatModelSubResourcesApi#bulkCreateThreatMetadata");
            e.printStackTrace();
        }
    }
}
import io.swagger.client.api.ThreatModelSubResourcesApi;

public class ThreatModelSubResourcesApiExample {

    public static void main(String[] args) {
        ThreatModelSubResourcesApi apiInstance = new ThreatModelSubResourcesApi();
        array[Metadata] body = ; // array[Metadata] | 
        UUID threatModelId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // UUID | Unique identifier of the threat model (UUID)
        UUID threatId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // UUID | Unique identifier of the threat (UUID)
        try {
            array[Metadata] result = apiInstance.bulkCreateThreatMetadata(body, threatModelId, threatId);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling ThreatModelSubResourcesApi#bulkCreateThreatMetadata");
            e.printStackTrace();
        }
    }
}
Configuration *apiConfig = [Configuration sharedConfig];
array[Metadata] *body = ; // 
UUID *threatModelId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // Unique identifier of the threat model (UUID)
UUID *threatId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // Unique identifier of the threat (UUID)

ThreatModelSubResourcesApi *apiInstance = [[ThreatModelSubResourcesApi alloc] init];

// Bulk create threat metadata
[apiInstance bulkCreateThreatMetadataWith:body
    threatModelId:threatModelId
    threatId:threatId
              completionHandler: ^(array[Metadata] output, NSError* error) {
                            if (output) {
                                NSLog(@"%@", output);
                            }
                            if (error) {
                                NSLog(@"Error: %@", error);
                            }
                        }];
var TmiThreatModelingImprovedApi = require('tmi__threat_modeling_improved_api');
var defaultClient = TmiThreatModelingImprovedApi.ApiClient.instance;


var api = new TmiThreatModelingImprovedApi.ThreatModelSubResourcesApi()
var body = ; // {{array[Metadata]}} 
var threatModelId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // {{UUID}} Unique identifier of the threat model (UUID)
var threatId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // {{UUID}} Unique identifier of the threat (UUID)

var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
};
api.bulkCreateThreatMetadata(bodythreatModelIdthreatId, callback);
using System;
using System.Diagnostics;
using IO.Swagger.Api;
using IO.Swagger.Client;
using IO.Swagger.Model;

namespace Example
{
    public class bulkCreateThreatMetadataExample
    {
        public void main()
        {


            var apiInstance = new ThreatModelSubResourcesApi();
            var body = new array[Metadata](); // array[Metadata] | 
            var threatModelId = new UUID(); // UUID | Unique identifier of the threat model (UUID)
            var threatId = new UUID(); // UUID | Unique identifier of the threat (UUID)

            try
            {
                // Bulk create threat metadata
                array[Metadata] result = apiInstance.bulkCreateThreatMetadata(body, threatModelId, threatId);
                Debug.WriteLine(result);
            }
            catch (Exception e)
            {
                Debug.Print("Exception when calling ThreatModelSubResourcesApi.bulkCreateThreatMetadata: " + e.Message );
            }
        }
    }
}
<?php
require_once(__DIR__ . '/vendor/autoload.php');


$api_instance = new Swagger\Client\ApiThreatModelSubResourcesApi();
$body = ; // array[Metadata] | 
$threatModelId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // UUID | Unique identifier of the threat model (UUID)
$threatId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // UUID | Unique identifier of the threat (UUID)

try {
    $result = $api_instance->bulkCreateThreatMetadata($body, $threatModelId, $threatId);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling ThreatModelSubResourcesApi->bulkCreateThreatMetadata: ', $e->getMessage(), PHP_EOL;
}
?>
use Data::Dumper;
use WWW::SwaggerClient::Configuration;
use WWW::SwaggerClient::ThreatModelSubResourcesApi;


my $api_instance = WWW::SwaggerClient::ThreatModelSubResourcesApi->new();
my $body = [WWW::SwaggerClient::Object::array[Metadata]->new()]; # array[Metadata] | 
my $threatModelId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; # UUID | Unique identifier of the threat model (UUID)
my $threatId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; # UUID | Unique identifier of the threat (UUID)

eval { 
    my $result = $api_instance->bulkCreateThreatMetadata(body => $body, threatModelId => $threatModelId, threatId => $threatId);
    print Dumper($result);
};
if ($@) {
    warn "Exception when calling ThreatModelSubResourcesApi->bulkCreateThreatMetadata: $@\n";
}
from __future__ import print_statement
import time
import swagger_client
from swagger_client.rest import ApiException
from pprint import pprint


# create an instance of the API class
api_instance = swagger_client.ThreatModelSubResourcesApi()
body =  # array[Metadata] | 
threatModelId = 38400000-8cf0-11bd-b23e-10b96e4ef00d # UUID | Unique identifier of the threat model (UUID)
threatId = 38400000-8cf0-11bd-b23e-10b96e4ef00d # UUID | Unique identifier of the threat (UUID)

try: 
    # Bulk create threat metadata
    api_response = api_instance.bulk_create_threat_metadata(body, threatModelId, threatId)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling ThreatModelSubResourcesApi->bulkCreateThreatMetadata: %s\n" % e)

Parameters

Path parameters
Name Description
threat_model_id*
UUID (uuid)
Unique identifier of the threat model (UUID)
Required
threat_id*
UUID (uuid)
Unique identifier of the threat (UUID)
Required
Body parameters
Name Description
body *

Responses

Status: 201 - Metadata entries created successfully

Status: 400 - Error response

Status: 401 - Error response

Status: 403 - Error response

Status: 404 - Error response

Status: 500 - Error response


bulkCreateThreatModelAssetMetadata

Bulk create asset metadata

Creates multiple metadata key-value pairs for the specified asset


/threat_models/{threat_model_id}/assets/{asset_id}/metadata/bulk

Usage and SDK Samples

curl -X POST\
 -H "Authorization: Bearer [[accessToken]]"\
-H "Accept: application/json"\
-H "Content-Type: application/json"\
"http://localhost:8080/threat_models/{threat_model_id}/assets/{asset_id}/metadata/bulk"
import io.swagger.client.*;
import io.swagger.client.auth.*;
import io.swagger.client.model.*;
import io.swagger.client.api.ThreatModelSubResourcesApi;

import java.io.File;
import java.util.*;

public class ThreatModelSubResourcesApiExample {

    public static void main(String[] args) {
        ApiClient defaultClient = Configuration.getDefaultApiClient();


        ThreatModelSubResourcesApi apiInstance = new ThreatModelSubResourcesApi();
        array[Metadata] body = ; // array[Metadata] | 
        UUID threatModelId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // UUID | Unique identifier of the threat model (UUID)
        UUID assetId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // UUID | Unique identifier of the asset (UUID)
        try {
            array[Metadata] result = apiInstance.bulkCreateThreatModelAssetMetadata(body, threatModelId, assetId);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling ThreatModelSubResourcesApi#bulkCreateThreatModelAssetMetadata");
            e.printStackTrace();
        }
    }
}
import io.swagger.client.api.ThreatModelSubResourcesApi;

public class ThreatModelSubResourcesApiExample {

    public static void main(String[] args) {
        ThreatModelSubResourcesApi apiInstance = new ThreatModelSubResourcesApi();
        array[Metadata] body = ; // array[Metadata] | 
        UUID threatModelId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // UUID | Unique identifier of the threat model (UUID)
        UUID assetId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // UUID | Unique identifier of the asset (UUID)
        try {
            array[Metadata] result = apiInstance.bulkCreateThreatModelAssetMetadata(body, threatModelId, assetId);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling ThreatModelSubResourcesApi#bulkCreateThreatModelAssetMetadata");
            e.printStackTrace();
        }
    }
}
Configuration *apiConfig = [Configuration sharedConfig];
array[Metadata] *body = ; // 
UUID *threatModelId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // Unique identifier of the threat model (UUID)
UUID *assetId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // Unique identifier of the asset (UUID)

ThreatModelSubResourcesApi *apiInstance = [[ThreatModelSubResourcesApi alloc] init];

// Bulk create asset metadata
[apiInstance bulkCreateThreatModelAssetMetadataWith:body
    threatModelId:threatModelId
    assetId:assetId
              completionHandler: ^(array[Metadata] output, NSError* error) {
                            if (output) {
                                NSLog(@"%@", output);
                            }
                            if (error) {
                                NSLog(@"Error: %@", error);
                            }
                        }];
var TmiThreatModelingImprovedApi = require('tmi__threat_modeling_improved_api');
var defaultClient = TmiThreatModelingImprovedApi.ApiClient.instance;


var api = new TmiThreatModelingImprovedApi.ThreatModelSubResourcesApi()
var body = ; // {{array[Metadata]}} 
var threatModelId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // {{UUID}} Unique identifier of the threat model (UUID)
var assetId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // {{UUID}} Unique identifier of the asset (UUID)

var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
};
api.bulkCreateThreatModelAssetMetadata(bodythreatModelIdassetId, callback);
using System;
using System.Diagnostics;
using IO.Swagger.Api;
using IO.Swagger.Client;
using IO.Swagger.Model;

namespace Example
{
    public class bulkCreateThreatModelAssetMetadataExample
    {
        public void main()
        {


            var apiInstance = new ThreatModelSubResourcesApi();
            var body = new array[Metadata](); // array[Metadata] | 
            var threatModelId = new UUID(); // UUID | Unique identifier of the threat model (UUID)
            var assetId = new UUID(); // UUID | Unique identifier of the asset (UUID)

            try
            {
                // Bulk create asset metadata
                array[Metadata] result = apiInstance.bulkCreateThreatModelAssetMetadata(body, threatModelId, assetId);
                Debug.WriteLine(result);
            }
            catch (Exception e)
            {
                Debug.Print("Exception when calling ThreatModelSubResourcesApi.bulkCreateThreatModelAssetMetadata: " + e.Message );
            }
        }
    }
}
<?php
require_once(__DIR__ . '/vendor/autoload.php');


$api_instance = new Swagger\Client\ApiThreatModelSubResourcesApi();
$body = ; // array[Metadata] | 
$threatModelId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // UUID | Unique identifier of the threat model (UUID)
$assetId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // UUID | Unique identifier of the asset (UUID)

try {
    $result = $api_instance->bulkCreateThreatModelAssetMetadata($body, $threatModelId, $assetId);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling ThreatModelSubResourcesApi->bulkCreateThreatModelAssetMetadata: ', $e->getMessage(), PHP_EOL;
}
?>
use Data::Dumper;
use WWW::SwaggerClient::Configuration;
use WWW::SwaggerClient::ThreatModelSubResourcesApi;


my $api_instance = WWW::SwaggerClient::ThreatModelSubResourcesApi->new();
my $body = [WWW::SwaggerClient::Object::array[Metadata]->new()]; # array[Metadata] | 
my $threatModelId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; # UUID | Unique identifier of the threat model (UUID)
my $assetId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; # UUID | Unique identifier of the asset (UUID)

eval { 
    my $result = $api_instance->bulkCreateThreatModelAssetMetadata(body => $body, threatModelId => $threatModelId, assetId => $assetId);
    print Dumper($result);
};
if ($@) {
    warn "Exception when calling ThreatModelSubResourcesApi->bulkCreateThreatModelAssetMetadata: $@\n";
}
from __future__ import print_statement
import time
import swagger_client
from swagger_client.rest import ApiException
from pprint import pprint


# create an instance of the API class
api_instance = swagger_client.ThreatModelSubResourcesApi()
body =  # array[Metadata] | 
threatModelId = 38400000-8cf0-11bd-b23e-10b96e4ef00d # UUID | Unique identifier of the threat model (UUID)
assetId = 38400000-8cf0-11bd-b23e-10b96e4ef00d # UUID | Unique identifier of the asset (UUID)

try: 
    # Bulk create asset metadata
    api_response = api_instance.bulk_create_threat_model_asset_metadata(body, threatModelId, assetId)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling ThreatModelSubResourcesApi->bulkCreateThreatModelAssetMetadata: %s\n" % e)

Parameters

Path parameters
Name Description
threat_model_id*
UUID (uuid)
Unique identifier of the threat model (UUID)
Required
asset_id*
UUID (uuid)
Unique identifier of the asset (UUID)
Required
Body parameters
Name Description
body *

Responses

Status: 201 - Metadata created successfully

Status: 400 - Error response

Status: 401 - Error response

Status: 403 - Error response

Status: 404 - Error response

Status: 500 - Error response


bulkCreateThreatModelAssets

Bulk create assets

Creates multiple assets within the specified threat model (maximum 50 per request)


/threat_models/{threat_model_id}/assets/bulk

Usage and SDK Samples

curl -X POST\
 -H "Authorization: Bearer [[accessToken]]"\
-H "Accept: application/json"\
-H "Content-Type: application/json"\
"http://localhost:8080/threat_models/{threat_model_id}/assets/bulk"
import io.swagger.client.*;
import io.swagger.client.auth.*;
import io.swagger.client.model.*;
import io.swagger.client.api.ThreatModelSubResourcesApi;

import java.io.File;
import java.util.*;

public class ThreatModelSubResourcesApiExample {

    public static void main(String[] args) {
        ApiClient defaultClient = Configuration.getDefaultApiClient();


        ThreatModelSubResourcesApi apiInstance = new ThreatModelSubResourcesApi();
        array[Asset] body = ; // array[Asset] | 
        UUID threatModelId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // UUID | Unique identifier of the threat model (UUID)
        try {
            array[Asset] result = apiInstance.bulkCreateThreatModelAssets(body, threatModelId);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling ThreatModelSubResourcesApi#bulkCreateThreatModelAssets");
            e.printStackTrace();
        }
    }
}
import io.swagger.client.api.ThreatModelSubResourcesApi;

public class ThreatModelSubResourcesApiExample {

    public static void main(String[] args) {
        ThreatModelSubResourcesApi apiInstance = new ThreatModelSubResourcesApi();
        array[Asset] body = ; // array[Asset] | 
        UUID threatModelId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // UUID | Unique identifier of the threat model (UUID)
        try {
            array[Asset] result = apiInstance.bulkCreateThreatModelAssets(body, threatModelId);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling ThreatModelSubResourcesApi#bulkCreateThreatModelAssets");
            e.printStackTrace();
        }
    }
}
Configuration *apiConfig = [Configuration sharedConfig];
array[Asset] *body = ; // 
UUID *threatModelId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // Unique identifier of the threat model (UUID)

ThreatModelSubResourcesApi *apiInstance = [[ThreatModelSubResourcesApi alloc] init];

// Bulk create assets
[apiInstance bulkCreateThreatModelAssetsWith:body
    threatModelId:threatModelId
              completionHandler: ^(array[Asset] output, NSError* error) {
                            if (output) {
                                NSLog(@"%@", output);
                            }
                            if (error) {
                                NSLog(@"Error: %@", error);
                            }
                        }];
var TmiThreatModelingImprovedApi = require('tmi__threat_modeling_improved_api');
var defaultClient = TmiThreatModelingImprovedApi.ApiClient.instance;


var api = new TmiThreatModelingImprovedApi.ThreatModelSubResourcesApi()
var body = ; // {{array[Asset]}} 
var threatModelId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // {{UUID}} Unique identifier of the threat model (UUID)

var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
};
api.bulkCreateThreatModelAssets(bodythreatModelId, callback);
using System;
using System.Diagnostics;
using IO.Swagger.Api;
using IO.Swagger.Client;
using IO.Swagger.Model;

namespace Example
{
    public class bulkCreateThreatModelAssetsExample
    {
        public void main()
        {


            var apiInstance = new ThreatModelSubResourcesApi();
            var body = new array[Asset](); // array[Asset] | 
            var threatModelId = new UUID(); // UUID | Unique identifier of the threat model (UUID)

            try
            {
                // Bulk create assets
                array[Asset] result = apiInstance.bulkCreateThreatModelAssets(body, threatModelId);
                Debug.WriteLine(result);
            }
            catch (Exception e)
            {
                Debug.Print("Exception when calling ThreatModelSubResourcesApi.bulkCreateThreatModelAssets: " + e.Message );
            }
        }
    }
}
<?php
require_once(__DIR__ . '/vendor/autoload.php');


$api_instance = new Swagger\Client\ApiThreatModelSubResourcesApi();
$body = ; // array[Asset] | 
$threatModelId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // UUID | Unique identifier of the threat model (UUID)

try {
    $result = $api_instance->bulkCreateThreatModelAssets($body, $threatModelId);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling ThreatModelSubResourcesApi->bulkCreateThreatModelAssets: ', $e->getMessage(), PHP_EOL;
}
?>
use Data::Dumper;
use WWW::SwaggerClient::Configuration;
use WWW::SwaggerClient::ThreatModelSubResourcesApi;


my $api_instance = WWW::SwaggerClient::ThreatModelSubResourcesApi->new();
my $body = [WWW::SwaggerClient::Object::array[Asset]->new()]; # array[Asset] | 
my $threatModelId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; # UUID | Unique identifier of the threat model (UUID)

eval { 
    my $result = $api_instance->bulkCreateThreatModelAssets(body => $body, threatModelId => $threatModelId);
    print Dumper($result);
};
if ($@) {
    warn "Exception when calling ThreatModelSubResourcesApi->bulkCreateThreatModelAssets: $@\n";
}
from __future__ import print_statement
import time
import swagger_client
from swagger_client.rest import ApiException
from pprint import pprint


# create an instance of the API class
api_instance = swagger_client.ThreatModelSubResourcesApi()
body =  # array[Asset] | 
threatModelId = 38400000-8cf0-11bd-b23e-10b96e4ef00d # UUID | Unique identifier of the threat model (UUID)

try: 
    # Bulk create assets
    api_response = api_instance.bulk_create_threat_model_assets(body, threatModelId)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling ThreatModelSubResourcesApi->bulkCreateThreatModelAssets: %s\n" % e)

Parameters

Path parameters
Name Description
threat_model_id*
UUID (uuid)
Unique identifier of the threat model (UUID)
Required
Body parameters
Name Description
body *

Responses

Status: 201 - Assets created successfully

Status: 400 - Error response

Status: 401 - Error response

Status: 403 - Error response

Status: 404 - Error response

Status: 500 - Error response


bulkCreateThreatModelDocuments

Bulk create documents

Creates multiple documents in a single operation for the specified threat model


/threat_models/{threat_model_id}/documents/bulk

Usage and SDK Samples

curl -X POST\
 -H "Authorization: Bearer [[accessToken]]"\
-H "Accept: application/json"\
-H "Content-Type: application/json"\
"http://localhost:8080/threat_models/{threat_model_id}/documents/bulk"
import io.swagger.client.*;
import io.swagger.client.auth.*;
import io.swagger.client.model.*;
import io.swagger.client.api.ThreatModelSubResourcesApi;

import java.io.File;
import java.util.*;

public class ThreatModelSubResourcesApiExample {

    public static void main(String[] args) {
        ApiClient defaultClient = Configuration.getDefaultApiClient();


        ThreatModelSubResourcesApi apiInstance = new ThreatModelSubResourcesApi();
        array[Document] body = {
  "summary" : "Create multiple documents at once",
  "value" : [ {
    "name" : "Architecture Document",
    "description" : "System architecture documentation",
    "metadata" : [ {
      "key" : "type",
      "value" : "architecture"
    }, {
      "key" : "version",
      "value" : "2.1"
    } ],
    "uri" : "https://docs.company.com/architecture.pdf"
  }, {
    "name" : "Security Requirements",
    "description" : "Security requirements and compliance standards",
    "metadata" : [ {
      "key" : "classification",
      "value" : "internal"
    }, {
      "key" : "department",
      "value" : "security"
    } ],
    "uri" : "https://docs.company.com/security.pdf"
  } ]
}; // array[Document] | 
        UUID threatModelId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // UUID | Unique identifier of the threat model (UUID)
        try {
            array[Document] result = apiInstance.bulkCreateThreatModelDocuments(body, threatModelId);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling ThreatModelSubResourcesApi#bulkCreateThreatModelDocuments");
            e.printStackTrace();
        }
    }
}
import io.swagger.client.api.ThreatModelSubResourcesApi;

public class ThreatModelSubResourcesApiExample {

    public static void main(String[] args) {
        ThreatModelSubResourcesApi apiInstance = new ThreatModelSubResourcesApi();
        array[Document] body = {
  "summary" : "Create multiple documents at once",
  "value" : [ {
    "name" : "Architecture Document",
    "description" : "System architecture documentation",
    "metadata" : [ {
      "key" : "type",
      "value" : "architecture"
    }, {
      "key" : "version",
      "value" : "2.1"
    } ],
    "uri" : "https://docs.company.com/architecture.pdf"
  }, {
    "name" : "Security Requirements",
    "description" : "Security requirements and compliance standards",
    "metadata" : [ {
      "key" : "classification",
      "value" : "internal"
    }, {
      "key" : "department",
      "value" : "security"
    } ],
    "uri" : "https://docs.company.com/security.pdf"
  } ]
}; // array[Document] | 
        UUID threatModelId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // UUID | Unique identifier of the threat model (UUID)
        try {
            array[Document] result = apiInstance.bulkCreateThreatModelDocuments(body, threatModelId);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling ThreatModelSubResourcesApi#bulkCreateThreatModelDocuments");
            e.printStackTrace();
        }
    }
}
Configuration *apiConfig = [Configuration sharedConfig];
array[Document] *body = {
  "summary" : "Create multiple documents at once",
  "value" : [ {
    "name" : "Architecture Document",
    "description" : "System architecture documentation",
    "metadata" : [ {
      "key" : "type",
      "value" : "architecture"
    }, {
      "key" : "version",
      "value" : "2.1"
    } ],
    "uri" : "https://docs.company.com/architecture.pdf"
  }, {
    "name" : "Security Requirements",
    "description" : "Security requirements and compliance standards",
    "metadata" : [ {
      "key" : "classification",
      "value" : "internal"
    }, {
      "key" : "department",
      "value" : "security"
    } ],
    "uri" : "https://docs.company.com/security.pdf"
  } ]
}; // 
UUID *threatModelId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // Unique identifier of the threat model (UUID)

ThreatModelSubResourcesApi *apiInstance = [[ThreatModelSubResourcesApi alloc] init];

// Bulk create documents
[apiInstance bulkCreateThreatModelDocumentsWith:body
    threatModelId:threatModelId
              completionHandler: ^(array[Document] output, NSError* error) {
                            if (output) {
                                NSLog(@"%@", output);
                            }
                            if (error) {
                                NSLog(@"Error: %@", error);
                            }
                        }];
var TmiThreatModelingImprovedApi = require('tmi__threat_modeling_improved_api');
var defaultClient = TmiThreatModelingImprovedApi.ApiClient.instance;


var api = new TmiThreatModelingImprovedApi.ThreatModelSubResourcesApi()
var body = {
  "summary" : "Create multiple documents at once",
  "value" : [ {
    "name" : "Architecture Document",
    "description" : "System architecture documentation",
    "metadata" : [ {
      "key" : "type",
      "value" : "architecture"
    }, {
      "key" : "version",
      "value" : "2.1"
    } ],
    "uri" : "https://docs.company.com/architecture.pdf"
  }, {
    "name" : "Security Requirements",
    "description" : "Security requirements and compliance standards",
    "metadata" : [ {
      "key" : "classification",
      "value" : "internal"
    }, {
      "key" : "department",
      "value" : "security"
    } ],
    "uri" : "https://docs.company.com/security.pdf"
  } ]
}; // {{array[Document]}} 
var threatModelId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // {{UUID}} Unique identifier of the threat model (UUID)

var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
};
api.bulkCreateThreatModelDocuments(bodythreatModelId, callback);
using System;
using System.Diagnostics;
using IO.Swagger.Api;
using IO.Swagger.Client;
using IO.Swagger.Model;

namespace Example
{
    public class bulkCreateThreatModelDocumentsExample
    {
        public void main()
        {


            var apiInstance = new ThreatModelSubResourcesApi();
            var body = new array[Document](); // array[Document] | 
            var threatModelId = new UUID(); // UUID | Unique identifier of the threat model (UUID)

            try
            {
                // Bulk create documents
                array[Document] result = apiInstance.bulkCreateThreatModelDocuments(body, threatModelId);
                Debug.WriteLine(result);
            }
            catch (Exception e)
            {
                Debug.Print("Exception when calling ThreatModelSubResourcesApi.bulkCreateThreatModelDocuments: " + e.Message );
            }
        }
    }
}
<?php
require_once(__DIR__ . '/vendor/autoload.php');


$api_instance = new Swagger\Client\ApiThreatModelSubResourcesApi();
$body = {
  "summary" : "Create multiple documents at once",
  "value" : [ {
    "name" : "Architecture Document",
    "description" : "System architecture documentation",
    "metadata" : [ {
      "key" : "type",
      "value" : "architecture"
    }, {
      "key" : "version",
      "value" : "2.1"
    } ],
    "uri" : "https://docs.company.com/architecture.pdf"
  }, {
    "name" : "Security Requirements",
    "description" : "Security requirements and compliance standards",
    "metadata" : [ {
      "key" : "classification",
      "value" : "internal"
    }, {
      "key" : "department",
      "value" : "security"
    } ],
    "uri" : "https://docs.company.com/security.pdf"
  } ]
}; // array[Document] | 
$threatModelId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // UUID | Unique identifier of the threat model (UUID)

try {
    $result = $api_instance->bulkCreateThreatModelDocuments($body, $threatModelId);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling ThreatModelSubResourcesApi->bulkCreateThreatModelDocuments: ', $e->getMessage(), PHP_EOL;
}
?>
use Data::Dumper;
use WWW::SwaggerClient::Configuration;
use WWW::SwaggerClient::ThreatModelSubResourcesApi;


my $api_instance = WWW::SwaggerClient::ThreatModelSubResourcesApi->new();
my $body = [WWW::SwaggerClient::Object::array[Document]->new()]; # array[Document] | 
my $threatModelId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; # UUID | Unique identifier of the threat model (UUID)

eval { 
    my $result = $api_instance->bulkCreateThreatModelDocuments(body => $body, threatModelId => $threatModelId);
    print Dumper($result);
};
if ($@) {
    warn "Exception when calling ThreatModelSubResourcesApi->bulkCreateThreatModelDocuments: $@\n";
}
from __future__ import print_statement
import time
import swagger_client
from swagger_client.rest import ApiException
from pprint import pprint


# create an instance of the API class
api_instance = swagger_client.ThreatModelSubResourcesApi()
body = {
  "summary" : "Create multiple documents at once",
  "value" : [ {
    "name" : "Architecture Document",
    "description" : "System architecture documentation",
    "metadata" : [ {
      "key" : "type",
      "value" : "architecture"
    }, {
      "key" : "version",
      "value" : "2.1"
    } ],
    "uri" : "https://docs.company.com/architecture.pdf"
  }, {
    "name" : "Security Requirements",
    "description" : "Security requirements and compliance standards",
    "metadata" : [ {
      "key" : "classification",
      "value" : "internal"
    }, {
      "key" : "department",
      "value" : "security"
    } ],
    "uri" : "https://docs.company.com/security.pdf"
  } ]
} # array[Document] | 
threatModelId = 38400000-8cf0-11bd-b23e-10b96e4ef00d # UUID | Unique identifier of the threat model (UUID)

try: 
    # Bulk create documents
    api_response = api_instance.bulk_create_threat_model_documents(body, threatModelId)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling ThreatModelSubResourcesApi->bulkCreateThreatModelDocuments: %s\n" % e)

Parameters

Path parameters
Name Description
threat_model_id*
UUID (uuid)
Unique identifier of the threat model (UUID)
Required
Body parameters
Name Description
body *

Responses

Status: 201 - Documents created successfully

Status: 400 - Error response

Status: 401 - Error response

Status: 403 - Error response

Status: 404 - Error response

Status: 500 - Error response


bulkCreateThreatModelMetadata

Bulk create threat model metadata

Creates multiple metadata entries in a single operation for the specified threat model


/threat_models/{threat_model_id}/metadata/bulk

Usage and SDK Samples

curl -X POST\
 -H "Authorization: Bearer [[accessToken]]"\
-H "Accept: application/json"\
-H "Content-Type: application/json"\
"http://localhost:8080/threat_models/{threat_model_id}/metadata/bulk"
import io.swagger.client.*;
import io.swagger.client.auth.*;
import io.swagger.client.model.*;
import io.swagger.client.api.ThreatModelSubResourcesApi;

import java.io.File;
import java.util.*;

public class ThreatModelSubResourcesApiExample {

    public static void main(String[] args) {
        ApiClient defaultClient = Configuration.getDefaultApiClient();


        ThreatModelSubResourcesApi apiInstance = new ThreatModelSubResourcesApi();
        array[Metadata] body = ; // array[Metadata] | 
        UUID threatModelId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // UUID | Unique identifier of the threat model (UUID)
        try {
            array[Metadata] result = apiInstance.bulkCreateThreatModelMetadata(body, threatModelId);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling ThreatModelSubResourcesApi#bulkCreateThreatModelMetadata");
            e.printStackTrace();
        }
    }
}
import io.swagger.client.api.ThreatModelSubResourcesApi;

public class ThreatModelSubResourcesApiExample {

    public static void main(String[] args) {
        ThreatModelSubResourcesApi apiInstance = new ThreatModelSubResourcesApi();
        array[Metadata] body = ; // array[Metadata] | 
        UUID threatModelId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // UUID | Unique identifier of the threat model (UUID)
        try {
            array[Metadata] result = apiInstance.bulkCreateThreatModelMetadata(body, threatModelId);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling ThreatModelSubResourcesApi#bulkCreateThreatModelMetadata");
            e.printStackTrace();
        }
    }
}
Configuration *apiConfig = [Configuration sharedConfig];
array[Metadata] *body = ; // 
UUID *threatModelId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // Unique identifier of the threat model (UUID)

ThreatModelSubResourcesApi *apiInstance = [[ThreatModelSubResourcesApi alloc] init];

// Bulk create threat model metadata
[apiInstance bulkCreateThreatModelMetadataWith:body
    threatModelId:threatModelId
              completionHandler: ^(array[Metadata] output, NSError* error) {
                            if (output) {
                                NSLog(@"%@", output);
                            }
                            if (error) {
                                NSLog(@"Error: %@", error);
                            }
                        }];
var TmiThreatModelingImprovedApi = require('tmi__threat_modeling_improved_api');
var defaultClient = TmiThreatModelingImprovedApi.ApiClient.instance;


var api = new TmiThreatModelingImprovedApi.ThreatModelSubResourcesApi()
var body = ; // {{array[Metadata]}} 
var threatModelId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // {{UUID}} Unique identifier of the threat model (UUID)

var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
};
api.bulkCreateThreatModelMetadata(bodythreatModelId, callback);
using System;
using System.Diagnostics;
using IO.Swagger.Api;
using IO.Swagger.Client;
using IO.Swagger.Model;

namespace Example
{
    public class bulkCreateThreatModelMetadataExample
    {
        public void main()
        {


            var apiInstance = new ThreatModelSubResourcesApi();
            var body = new array[Metadata](); // array[Metadata] | 
            var threatModelId = new UUID(); // UUID | Unique identifier of the threat model (UUID)

            try
            {
                // Bulk create threat model metadata
                array[Metadata] result = apiInstance.bulkCreateThreatModelMetadata(body, threatModelId);
                Debug.WriteLine(result);
            }
            catch (Exception e)
            {
                Debug.Print("Exception when calling ThreatModelSubResourcesApi.bulkCreateThreatModelMetadata: " + e.Message );
            }
        }
    }
}
<?php
require_once(__DIR__ . '/vendor/autoload.php');


$api_instance = new Swagger\Client\ApiThreatModelSubResourcesApi();
$body = ; // array[Metadata] | 
$threatModelId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // UUID | Unique identifier of the threat model (UUID)

try {
    $result = $api_instance->bulkCreateThreatModelMetadata($body, $threatModelId);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling ThreatModelSubResourcesApi->bulkCreateThreatModelMetadata: ', $e->getMessage(), PHP_EOL;
}
?>
use Data::Dumper;
use WWW::SwaggerClient::Configuration;
use WWW::SwaggerClient::ThreatModelSubResourcesApi;


my $api_instance = WWW::SwaggerClient::ThreatModelSubResourcesApi->new();
my $body = [WWW::SwaggerClient::Object::array[Metadata]->new()]; # array[Metadata] | 
my $threatModelId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; # UUID | Unique identifier of the threat model (UUID)

eval { 
    my $result = $api_instance->bulkCreateThreatModelMetadata(body => $body, threatModelId => $threatModelId);
    print Dumper($result);
};
if ($@) {
    warn "Exception when calling ThreatModelSubResourcesApi->bulkCreateThreatModelMetadata: $@\n";
}
from __future__ import print_statement
import time
import swagger_client
from swagger_client.rest import ApiException
from pprint import pprint


# create an instance of the API class
api_instance = swagger_client.ThreatModelSubResourcesApi()
body =  # array[Metadata] | 
threatModelId = 38400000-8cf0-11bd-b23e-10b96e4ef00d # UUID | Unique identifier of the threat model (UUID)

try: 
    # Bulk create threat model metadata
    api_response = api_instance.bulk_create_threat_model_metadata(body, threatModelId)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling ThreatModelSubResourcesApi->bulkCreateThreatModelMetadata: %s\n" % e)

Parameters

Path parameters
Name Description
threat_model_id*
UUID (uuid)
Unique identifier of the threat model (UUID)
Required
Body parameters
Name Description
body *

Responses

Status: 201 - Metadata entries created successfully

Status: 400 - Error response

Status: 401 - Error response

Status: 403 - Error response

Status: 404 - Error response

Status: 500 - Error response


bulkCreateThreatModelRepositories

Bulk create sources

Creates multiple source references in a single operation for the specified threat model


/threat_models/{threat_model_id}/repositories/bulk

Usage and SDK Samples

curl -X POST\
 -H "Authorization: Bearer [[accessToken]]"\
-H "Accept: application/json"\
-H "Content-Type: application/json"\
"http://localhost:8080/threat_models/{threat_model_id}/repositories/bulk"
import io.swagger.client.*;
import io.swagger.client.auth.*;
import io.swagger.client.model.*;
import io.swagger.client.api.ThreatModelSubResourcesApi;

import java.io.File;
import java.util.*;

public class ThreatModelSubResourcesApiExample {

    public static void main(String[] args) {
        ApiClient defaultClient = Configuration.getDefaultApiClient();


        ThreatModelSubResourcesApi apiInstance = new ThreatModelSubResourcesApi();
        array[Repository] body = {
  "summary" : "Create multiple source references at once",
  "value" : [ {
    "name" : "User Authentication Module",
    "description" : "Core user authentication logic",
    "metadata" : [ {
      "key" : "language",
      "value" : "go"
    }, {
      "key" : "maintainer",
      "value" : "security-team"
    } ],
    "uri" : "https://github.com/company/repo/blob/main/oauth2/user.go"
  }, {
    "name" : "Database Connection Pool",
    "description" : "Database connection management",
    "metadata" : [ {
      "key" : "type",
      "value" : "infrastructure"
    }, {
      "key" : "criticality",
      "value" : "high"
    } ],
    "uri" : "https://github.com/company/repo/blob/main/db/pool.go"
  } ]
}; // array[Repository] | 
        UUID threatModelId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // UUID | Unique identifier of the threat model (UUID)
        try {
            array[Repository] result = apiInstance.bulkCreateThreatModelRepositories(body, threatModelId);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling ThreatModelSubResourcesApi#bulkCreateThreatModelRepositories");
            e.printStackTrace();
        }
    }
}
import io.swagger.client.api.ThreatModelSubResourcesApi;

public class ThreatModelSubResourcesApiExample {

    public static void main(String[] args) {
        ThreatModelSubResourcesApi apiInstance = new ThreatModelSubResourcesApi();
        array[Repository] body = {
  "summary" : "Create multiple source references at once",
  "value" : [ {
    "name" : "User Authentication Module",
    "description" : "Core user authentication logic",
    "metadata" : [ {
      "key" : "language",
      "value" : "go"
    }, {
      "key" : "maintainer",
      "value" : "security-team"
    } ],
    "uri" : "https://github.com/company/repo/blob/main/oauth2/user.go"
  }, {
    "name" : "Database Connection Pool",
    "description" : "Database connection management",
    "metadata" : [ {
      "key" : "type",
      "value" : "infrastructure"
    }, {
      "key" : "criticality",
      "value" : "high"
    } ],
    "uri" : "https://github.com/company/repo/blob/main/db/pool.go"
  } ]
}; // array[Repository] | 
        UUID threatModelId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // UUID | Unique identifier of the threat model (UUID)
        try {
            array[Repository] result = apiInstance.bulkCreateThreatModelRepositories(body, threatModelId);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling ThreatModelSubResourcesApi#bulkCreateThreatModelRepositories");
            e.printStackTrace();
        }
    }
}
Configuration *apiConfig = [Configuration sharedConfig];
array[Repository] *body = {
  "summary" : "Create multiple source references at once",
  "value" : [ {
    "name" : "User Authentication Module",
    "description" : "Core user authentication logic",
    "metadata" : [ {
      "key" : "language",
      "value" : "go"
    }, {
      "key" : "maintainer",
      "value" : "security-team"
    } ],
    "uri" : "https://github.com/company/repo/blob/main/oauth2/user.go"
  }, {
    "name" : "Database Connection Pool",
    "description" : "Database connection management",
    "metadata" : [ {
      "key" : "type",
      "value" : "infrastructure"
    }, {
      "key" : "criticality",
      "value" : "high"
    } ],
    "uri" : "https://github.com/company/repo/blob/main/db/pool.go"
  } ]
}; // 
UUID *threatModelId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // Unique identifier of the threat model (UUID)

ThreatModelSubResourcesApi *apiInstance = [[ThreatModelSubResourcesApi alloc] init];

// Bulk create sources
[apiInstance bulkCreateThreatModelRepositoriesWith:body
    threatModelId:threatModelId
              completionHandler: ^(array[Repository] output, NSError* error) {
                            if (output) {
                                NSLog(@"%@", output);
                            }
                            if (error) {
                                NSLog(@"Error: %@", error);
                            }
                        }];
var TmiThreatModelingImprovedApi = require('tmi__threat_modeling_improved_api');
var defaultClient = TmiThreatModelingImprovedApi.ApiClient.instance;


var api = new TmiThreatModelingImprovedApi.ThreatModelSubResourcesApi()
var body = {
  "summary" : "Create multiple source references at once",
  "value" : [ {
    "name" : "User Authentication Module",
    "description" : "Core user authentication logic",
    "metadata" : [ {
      "key" : "language",
      "value" : "go"
    }, {
      "key" : "maintainer",
      "value" : "security-team"
    } ],
    "uri" : "https://github.com/company/repo/blob/main/oauth2/user.go"
  }, {
    "name" : "Database Connection Pool",
    "description" : "Database connection management",
    "metadata" : [ {
      "key" : "type",
      "value" : "infrastructure"
    }, {
      "key" : "criticality",
      "value" : "high"
    } ],
    "uri" : "https://github.com/company/repo/blob/main/db/pool.go"
  } ]
}; // {{array[Repository]}} 
var threatModelId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // {{UUID}} Unique identifier of the threat model (UUID)

var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
};
api.bulkCreateThreatModelRepositories(bodythreatModelId, callback);
using System;
using System.Diagnostics;
using IO.Swagger.Api;
using IO.Swagger.Client;
using IO.Swagger.Model;

namespace Example
{
    public class bulkCreateThreatModelRepositoriesExample
    {
        public void main()
        {


            var apiInstance = new ThreatModelSubResourcesApi();
            var body = new array[Repository](); // array[Repository] | 
            var threatModelId = new UUID(); // UUID | Unique identifier of the threat model (UUID)

            try
            {
                // Bulk create sources
                array[Repository] result = apiInstance.bulkCreateThreatModelRepositories(body, threatModelId);
                Debug.WriteLine(result);
            }
            catch (Exception e)
            {
                Debug.Print("Exception when calling ThreatModelSubResourcesApi.bulkCreateThreatModelRepositories: " + e.Message );
            }
        }
    }
}
<?php
require_once(__DIR__ . '/vendor/autoload.php');


$api_instance = new Swagger\Client\ApiThreatModelSubResourcesApi();
$body = {
  "summary" : "Create multiple source references at once",
  "value" : [ {
    "name" : "User Authentication Module",
    "description" : "Core user authentication logic",
    "metadata" : [ {
      "key" : "language",
      "value" : "go"
    }, {
      "key" : "maintainer",
      "value" : "security-team"
    } ],
    "uri" : "https://github.com/company/repo/blob/main/oauth2/user.go"
  }, {
    "name" : "Database Connection Pool",
    "description" : "Database connection management",
    "metadata" : [ {
      "key" : "type",
      "value" : "infrastructure"
    }, {
      "key" : "criticality",
      "value" : "high"
    } ],
    "uri" : "https://github.com/company/repo/blob/main/db/pool.go"
  } ]
}; // array[Repository] | 
$threatModelId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // UUID | Unique identifier of the threat model (UUID)

try {
    $result = $api_instance->bulkCreateThreatModelRepositories($body, $threatModelId);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling ThreatModelSubResourcesApi->bulkCreateThreatModelRepositories: ', $e->getMessage(), PHP_EOL;
}
?>
use Data::Dumper;
use WWW::SwaggerClient::Configuration;
use WWW::SwaggerClient::ThreatModelSubResourcesApi;


my $api_instance = WWW::SwaggerClient::ThreatModelSubResourcesApi->new();
my $body = [WWW::SwaggerClient::Object::array[Repository]->new()]; # array[Repository] | 
my $threatModelId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; # UUID | Unique identifier of the threat model (UUID)

eval { 
    my $result = $api_instance->bulkCreateThreatModelRepositories(body => $body, threatModelId => $threatModelId);
    print Dumper($result);
};
if ($@) {
    warn "Exception when calling ThreatModelSubResourcesApi->bulkCreateThreatModelRepositories: $@\n";
}
from __future__ import print_statement
import time
import swagger_client
from swagger_client.rest import ApiException
from pprint import pprint


# create an instance of the API class
api_instance = swagger_client.ThreatModelSubResourcesApi()
body = {
  "summary" : "Create multiple source references at once",
  "value" : [ {
    "name" : "User Authentication Module",
    "description" : "Core user authentication logic",
    "metadata" : [ {
      "key" : "language",
      "value" : "go"
    }, {
      "key" : "maintainer",
      "value" : "security-team"
    } ],
    "uri" : "https://github.com/company/repo/blob/main/oauth2/user.go"
  }, {
    "name" : "Database Connection Pool",
    "description" : "Database connection management",
    "metadata" : [ {
      "key" : "type",
      "value" : "infrastructure"
    }, {
      "key" : "criticality",
      "value" : "high"
    } ],
    "uri" : "https://github.com/company/repo/blob/main/db/pool.go"
  } ]
} # array[Repository] | 
threatModelId = 38400000-8cf0-11bd-b23e-10b96e4ef00d # UUID | Unique identifier of the threat model (UUID)

try: 
    # Bulk create sources
    api_response = api_instance.bulk_create_threat_model_repositories(body, threatModelId)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling ThreatModelSubResourcesApi->bulkCreateThreatModelRepositories: %s\n" % e)

Parameters

Path parameters
Name Description
threat_model_id*
UUID (uuid)
Unique identifier of the threat model (UUID)
Required
Body parameters
Name Description
body *

Responses

Status: 201 - Sources created successfully

Status: 400 - Error response

Status: 401 - Error response

Status: 403 - Error response

Status: 404 - Error response

Status: 500 - Error response


bulkCreateThreatModelThreats

Bulk create threats

Creates multiple threats in a single operation for the specified threat model


/threat_models/{threat_model_id}/threats/bulk

Usage and SDK Samples

curl -X POST\
 -H "Authorization: Bearer [[accessToken]]"\
-H "Accept: application/json"\
-H "Content-Type: application/json"\
"http://localhost:8080/threat_models/{threat_model_id}/threats/bulk"
import io.swagger.client.*;
import io.swagger.client.auth.*;
import io.swagger.client.model.*;
import io.swagger.client.api.ThreatModelSubResourcesApi;

import java.io.File;
import java.util.*;

public class ThreatModelSubResourcesApiExample {

    public static void main(String[] args) {
        ApiClient defaultClient = Configuration.getDefaultApiClient();


        ThreatModelSubResourcesApi apiInstance = new ThreatModelSubResourcesApi();
        array[Threat] body = {
  "summary" : "Create multiple threats at once",
  "value" : [ {
    "name" : "SQL Injection Attack",
    "description" : "Attacker injects malicious SQL code through user input",
    "impact" : "High",
    "likelihood" : "Medium",
    "risk_rating" : "High",
    "metadata" : [ {
      "key" : "category",
      "value" : "injection"
    }, {
      "key" : "stride",
      "value" : "tampering"
    } ]
  }, {
    "name" : "Cross-Site Scripting (XSS)",
    "description" : "Malicious scripts executed in user's browser",
    "impact" : "Medium",
    "likelihood" : "High",
    "risk_rating" : "High",
    "metadata" : [ {
      "key" : "category",
      "value" : "xss"
    }, {
      "key" : "stride",
      "value" : "tampering"
    } ]
  } ]
}; // array[Threat] | 
        UUID threatModelId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // UUID | Unique identifier of the threat model (UUID)
        try {
            array[Threat] result = apiInstance.bulkCreateThreatModelThreats(body, threatModelId);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling ThreatModelSubResourcesApi#bulkCreateThreatModelThreats");
            e.printStackTrace();
        }
    }
}
import io.swagger.client.api.ThreatModelSubResourcesApi;

public class ThreatModelSubResourcesApiExample {

    public static void main(String[] args) {
        ThreatModelSubResourcesApi apiInstance = new ThreatModelSubResourcesApi();
        array[Threat] body = {
  "summary" : "Create multiple threats at once",
  "value" : [ {
    "name" : "SQL Injection Attack",
    "description" : "Attacker injects malicious SQL code through user input",
    "impact" : "High",
    "likelihood" : "Medium",
    "risk_rating" : "High",
    "metadata" : [ {
      "key" : "category",
      "value" : "injection"
    }, {
      "key" : "stride",
      "value" : "tampering"
    } ]
  }, {
    "name" : "Cross-Site Scripting (XSS)",
    "description" : "Malicious scripts executed in user's browser",
    "impact" : "Medium",
    "likelihood" : "High",
    "risk_rating" : "High",
    "metadata" : [ {
      "key" : "category",
      "value" : "xss"
    }, {
      "key" : "stride",
      "value" : "tampering"
    } ]
  } ]
}; // array[Threat] | 
        UUID threatModelId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // UUID | Unique identifier of the threat model (UUID)
        try {
            array[Threat] result = apiInstance.bulkCreateThreatModelThreats(body, threatModelId);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling ThreatModelSubResourcesApi#bulkCreateThreatModelThreats");
            e.printStackTrace();
        }
    }
}
Configuration *apiConfig = [Configuration sharedConfig];
array[Threat] *body = {
  "summary" : "Create multiple threats at once",
  "value" : [ {
    "name" : "SQL Injection Attack",
    "description" : "Attacker injects malicious SQL code through user input",
    "impact" : "High",
    "likelihood" : "Medium",
    "risk_rating" : "High",
    "metadata" : [ {
      "key" : "category",
      "value" : "injection"
    }, {
      "key" : "stride",
      "value" : "tampering"
    } ]
  }, {
    "name" : "Cross-Site Scripting (XSS)",
    "description" : "Malicious scripts executed in user's browser",
    "impact" : "Medium",
    "likelihood" : "High",
    "risk_rating" : "High",
    "metadata" : [ {
      "key" : "category",
      "value" : "xss"
    }, {
      "key" : "stride",
      "value" : "tampering"
    } ]
  } ]
}; // 
UUID *threatModelId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // Unique identifier of the threat model (UUID)

ThreatModelSubResourcesApi *apiInstance = [[ThreatModelSubResourcesApi alloc] init];

// Bulk create threats
[apiInstance bulkCreateThreatModelThreatsWith:body
    threatModelId:threatModelId
              completionHandler: ^(array[Threat] output, NSError* error) {
                            if (output) {
                                NSLog(@"%@", output);
                            }
                            if (error) {
                                NSLog(@"Error: %@", error);
                            }
                        }];
var TmiThreatModelingImprovedApi = require('tmi__threat_modeling_improved_api');
var defaultClient = TmiThreatModelingImprovedApi.ApiClient.instance;


var api = new TmiThreatModelingImprovedApi.ThreatModelSubResourcesApi()
var body = {
  "summary" : "Create multiple threats at once",
  "value" : [ {
    "name" : "SQL Injection Attack",
    "description" : "Attacker injects malicious SQL code through user input",
    "impact" : "High",
    "likelihood" : "Medium",
    "risk_rating" : "High",
    "metadata" : [ {
      "key" : "category",
      "value" : "injection"
    }, {
      "key" : "stride",
      "value" : "tampering"
    } ]
  }, {
    "name" : "Cross-Site Scripting (XSS)",
    "description" : "Malicious scripts executed in user's browser",
    "impact" : "Medium",
    "likelihood" : "High",
    "risk_rating" : "High",
    "metadata" : [ {
      "key" : "category",
      "value" : "xss"
    }, {
      "key" : "stride",
      "value" : "tampering"
    } ]
  } ]
}; // {{array[Threat]}} 
var threatModelId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // {{UUID}} Unique identifier of the threat model (UUID)

var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
};
api.bulkCreateThreatModelThreats(bodythreatModelId, callback);
using System;
using System.Diagnostics;
using IO.Swagger.Api;
using IO.Swagger.Client;
using IO.Swagger.Model;

namespace Example
{
    public class bulkCreateThreatModelThreatsExample
    {
        public void main()
        {


            var apiInstance = new ThreatModelSubResourcesApi();
            var body = new array[Threat](); // array[Threat] | 
            var threatModelId = new UUID(); // UUID | Unique identifier of the threat model (UUID)

            try
            {
                // Bulk create threats
                array[Threat] result = apiInstance.bulkCreateThreatModelThreats(body, threatModelId);
                Debug.WriteLine(result);
            }
            catch (Exception e)
            {
                Debug.Print("Exception when calling ThreatModelSubResourcesApi.bulkCreateThreatModelThreats: " + e.Message );
            }
        }
    }
}
<?php
require_once(__DIR__ . '/vendor/autoload.php');


$api_instance = new Swagger\Client\ApiThreatModelSubResourcesApi();
$body = {
  "summary" : "Create multiple threats at once",
  "value" : [ {
    "name" : "SQL Injection Attack",
    "description" : "Attacker injects malicious SQL code through user input",
    "impact" : "High",
    "likelihood" : "Medium",
    "risk_rating" : "High",
    "metadata" : [ {
      "key" : "category",
      "value" : "injection"
    }, {
      "key" : "stride",
      "value" : "tampering"
    } ]
  }, {
    "name" : "Cross-Site Scripting (XSS)",
    "description" : "Malicious scripts executed in user's browser",
    "impact" : "Medium",
    "likelihood" : "High",
    "risk_rating" : "High",
    "metadata" : [ {
      "key" : "category",
      "value" : "xss"
    }, {
      "key" : "stride",
      "value" : "tampering"
    } ]
  } ]
}; // array[Threat] | 
$threatModelId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // UUID | Unique identifier of the threat model (UUID)

try {
    $result = $api_instance->bulkCreateThreatModelThreats($body, $threatModelId);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling ThreatModelSubResourcesApi->bulkCreateThreatModelThreats: ', $e->getMessage(), PHP_EOL;
}
?>
use Data::Dumper;
use WWW::SwaggerClient::Configuration;
use WWW::SwaggerClient::ThreatModelSubResourcesApi;


my $api_instance = WWW::SwaggerClient::ThreatModelSubResourcesApi->new();
my $body = [WWW::SwaggerClient::Object::array[Threat]->new()]; # array[Threat] | 
my $threatModelId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; # UUID | Unique identifier of the threat model (UUID)

eval { 
    my $result = $api_instance->bulkCreateThreatModelThreats(body => $body, threatModelId => $threatModelId);
    print Dumper($result);
};
if ($@) {
    warn "Exception when calling ThreatModelSubResourcesApi->bulkCreateThreatModelThreats: $@\n";
}
from __future__ import print_statement
import time
import swagger_client
from swagger_client.rest import ApiException
from pprint import pprint


# create an instance of the API class
api_instance = swagger_client.ThreatModelSubResourcesApi()
body = {
  "summary" : "Create multiple threats at once",
  "value" : [ {
    "name" : "SQL Injection Attack",
    "description" : "Attacker injects malicious SQL code through user input",
    "impact" : "High",
    "likelihood" : "Medium",
    "risk_rating" : "High",
    "metadata" : [ {
      "key" : "category",
      "value" : "injection"
    }, {
      "key" : "stride",
      "value" : "tampering"
    } ]
  }, {
    "name" : "Cross-Site Scripting (XSS)",
    "description" : "Malicious scripts executed in user's browser",
    "impact" : "Medium",
    "likelihood" : "High",
    "risk_rating" : "High",
    "metadata" : [ {
      "key" : "category",
      "value" : "xss"
    }, {
      "key" : "stride",
      "value" : "tampering"
    } ]
  } ]
} # array[Threat] | 
threatModelId = 38400000-8cf0-11bd-b23e-10b96e4ef00d # UUID | Unique identifier of the threat model (UUID)

try: 
    # Bulk create threats
    api_response = api_instance.bulk_create_threat_model_threats(body, threatModelId)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling ThreatModelSubResourcesApi->bulkCreateThreatModelThreats: %s\n" % e)

Parameters

Path parameters
Name Description
threat_model_id*
UUID (uuid)
Unique identifier of the threat model (UUID)
Required
Body parameters
Name Description
body *

Responses

Status: 201 - Threats created successfully

Status: 400 - Error response

Status: 401 - Error response

Status: 403 - Error response

Status: 404 - Error response

Status: 500 - Error response


bulkUpdateNoteMetadata

Bulk update note metadata

Updates multiple metadata entries for the specified note in a single operation


/threat_models/{threat_model_id}/notes/{note_id}/metadata/bulk

Usage and SDK Samples

curl -X PUT\
 -H "Authorization: Bearer [[accessToken]]"\
-H "Accept: application/json"\
-H "Content-Type: application/json"\
"http://localhost:8080/threat_models/{threat_model_id}/notes/{note_id}/metadata/bulk"
import io.swagger.client.*;
import io.swagger.client.auth.*;
import io.swagger.client.model.*;
import io.swagger.client.api.ThreatModelSubResourcesApi;

import java.io.File;
import java.util.*;

public class ThreatModelSubResourcesApiExample {

    public static void main(String[] args) {
        ApiClient defaultClient = Configuration.getDefaultApiClient();


        ThreatModelSubResourcesApi apiInstance = new ThreatModelSubResourcesApi();
        array[Metadata] body = ; // array[Metadata] | 
        UUID threatModelId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // UUID | Unique identifier of the threat model (UUID)
        UUID noteId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // UUID | Unique identifier of the note (UUID)
        try {
            array[Metadata] result = apiInstance.bulkUpdateNoteMetadata(body, threatModelId, noteId);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling ThreatModelSubResourcesApi#bulkUpdateNoteMetadata");
            e.printStackTrace();
        }
    }
}
import io.swagger.client.api.ThreatModelSubResourcesApi;

public class ThreatModelSubResourcesApiExample {

    public static void main(String[] args) {
        ThreatModelSubResourcesApi apiInstance = new ThreatModelSubResourcesApi();
        array[Metadata] body = ; // array[Metadata] | 
        UUID threatModelId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // UUID | Unique identifier of the threat model (UUID)
        UUID noteId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // UUID | Unique identifier of the note (UUID)
        try {
            array[Metadata] result = apiInstance.bulkUpdateNoteMetadata(body, threatModelId, noteId);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling ThreatModelSubResourcesApi#bulkUpdateNoteMetadata");
            e.printStackTrace();
        }
    }
}
Configuration *apiConfig = [Configuration sharedConfig];
array[Metadata] *body = ; // 
UUID *threatModelId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // Unique identifier of the threat model (UUID)
UUID *noteId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // Unique identifier of the note (UUID)

ThreatModelSubResourcesApi *apiInstance = [[ThreatModelSubResourcesApi alloc] init];

// Bulk update note metadata
[apiInstance bulkUpdateNoteMetadataWith:body
    threatModelId:threatModelId
    noteId:noteId
              completionHandler: ^(array[Metadata] output, NSError* error) {
                            if (output) {
                                NSLog(@"%@", output);
                            }
                            if (error) {
                                NSLog(@"Error: %@", error);
                            }
                        }];
var TmiThreatModelingImprovedApi = require('tmi__threat_modeling_improved_api');
var defaultClient = TmiThreatModelingImprovedApi.ApiClient.instance;


var api = new TmiThreatModelingImprovedApi.ThreatModelSubResourcesApi()
var body = ; // {{array[Metadata]}} 
var threatModelId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // {{UUID}} Unique identifier of the threat model (UUID)
var noteId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // {{UUID}} Unique identifier of the note (UUID)

var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
};
api.bulkUpdateNoteMetadata(bodythreatModelIdnoteId, callback);
using System;
using System.Diagnostics;
using IO.Swagger.Api;
using IO.Swagger.Client;
using IO.Swagger.Model;

namespace Example
{
    public class bulkUpdateNoteMetadataExample
    {
        public void main()
        {


            var apiInstance = new ThreatModelSubResourcesApi();
            var body = new array[Metadata](); // array[Metadata] | 
            var threatModelId = new UUID(); // UUID | Unique identifier of the threat model (UUID)
            var noteId = new UUID(); // UUID | Unique identifier of the note (UUID)

            try
            {
                // Bulk update note metadata
                array[Metadata] result = apiInstance.bulkUpdateNoteMetadata(body, threatModelId, noteId);
                Debug.WriteLine(result);
            }
            catch (Exception e)
            {
                Debug.Print("Exception when calling ThreatModelSubResourcesApi.bulkUpdateNoteMetadata: " + e.Message );
            }
        }
    }
}
<?php
require_once(__DIR__ . '/vendor/autoload.php');


$api_instance = new Swagger\Client\ApiThreatModelSubResourcesApi();
$body = ; // array[Metadata] | 
$threatModelId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // UUID | Unique identifier of the threat model (UUID)
$noteId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // UUID | Unique identifier of the note (UUID)

try {
    $result = $api_instance->bulkUpdateNoteMetadata($body, $threatModelId, $noteId);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling ThreatModelSubResourcesApi->bulkUpdateNoteMetadata: ', $e->getMessage(), PHP_EOL;
}
?>
use Data::Dumper;
use WWW::SwaggerClient::Configuration;
use WWW::SwaggerClient::ThreatModelSubResourcesApi;


my $api_instance = WWW::SwaggerClient::ThreatModelSubResourcesApi->new();
my $body = [WWW::SwaggerClient::Object::array[Metadata]->new()]; # array[Metadata] | 
my $threatModelId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; # UUID | Unique identifier of the threat model (UUID)
my $noteId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; # UUID | Unique identifier of the note (UUID)

eval { 
    my $result = $api_instance->bulkUpdateNoteMetadata(body => $body, threatModelId => $threatModelId, noteId => $noteId);
    print Dumper($result);
};
if ($@) {
    warn "Exception when calling ThreatModelSubResourcesApi->bulkUpdateNoteMetadata: $@\n";
}
from __future__ import print_statement
import time
import swagger_client
from swagger_client.rest import ApiException
from pprint import pprint


# create an instance of the API class
api_instance = swagger_client.ThreatModelSubResourcesApi()
body =  # array[Metadata] | 
threatModelId = 38400000-8cf0-11bd-b23e-10b96e4ef00d # UUID | Unique identifier of the threat model (UUID)
noteId = 38400000-8cf0-11bd-b23e-10b96e4ef00d # UUID | Unique identifier of the note (UUID)

try: 
    # Bulk update note metadata
    api_response = api_instance.bulk_update_note_metadata(body, threatModelId, noteId)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling ThreatModelSubResourcesApi->bulkUpdateNoteMetadata: %s\n" % e)

Parameters

Path parameters
Name Description
threat_model_id*
UUID (uuid)
Unique identifier of the threat model (UUID)
Required
note_id*
UUID (uuid)
Unique identifier of the note (UUID)
Required
Body parameters
Name Description
body *

Responses

Status: 200 - Metadata entries updated successfully

Status: 400 - Error response

Status: 401 - Error response

Status: 403 - Error response

Status: 404 - Error response

Status: 500 - Error response


bulkUpdateThreatModelThreats

Bulk update threats

Updates multiple threats in a single operation for the specified threat model


/threat_models/{threat_model_id}/threats/bulk

Usage and SDK Samples

curl -X PUT\
 -H "Authorization: Bearer [[accessToken]]"\
-H "Accept: application/json"\
-H "Content-Type: application/json"\
"http://localhost:8080/threat_models/{threat_model_id}/threats/bulk"
import io.swagger.client.*;
import io.swagger.client.auth.*;
import io.swagger.client.model.*;
import io.swagger.client.api.ThreatModelSubResourcesApi;

import java.io.File;
import java.util.*;

public class ThreatModelSubResourcesApiExample {

    public static void main(String[] args) {
        ApiClient defaultClient = Configuration.getDefaultApiClient();


        ThreatModelSubResourcesApi apiInstance = new ThreatModelSubResourcesApi();
        array[Threat] body = {
  "summary" : "Update multiple threats at once",
  "value" : [ {
    "id" : "750e8400-e29b-41d4-a716-446655440001",
    "name" : "Updated SQL Injection Attack",
    "description" : "Updated description for SQL injection vulnerability",
    "impact" : "High",
    "likelihood" : "Low",
    "risk_rating" : "Medium",
    "metadata" : [ {
      "key" : "category",
      "value" : "injection"
    }, {
      "key" : "mitigation",
      "value" : "parameterized-queries"
    } ]
  } ]
}; // array[Threat] | 
        UUID threatModelId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // UUID | Unique identifier of the threat model (UUID)
        try {
            array[Threat] result = apiInstance.bulkUpdateThreatModelThreats(body, threatModelId);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling ThreatModelSubResourcesApi#bulkUpdateThreatModelThreats");
            e.printStackTrace();
        }
    }
}
import io.swagger.client.api.ThreatModelSubResourcesApi;

public class ThreatModelSubResourcesApiExample {

    public static void main(String[] args) {
        ThreatModelSubResourcesApi apiInstance = new ThreatModelSubResourcesApi();
        array[Threat] body = {
  "summary" : "Update multiple threats at once",
  "value" : [ {
    "id" : "750e8400-e29b-41d4-a716-446655440001",
    "name" : "Updated SQL Injection Attack",
    "description" : "Updated description for SQL injection vulnerability",
    "impact" : "High",
    "likelihood" : "Low",
    "risk_rating" : "Medium",
    "metadata" : [ {
      "key" : "category",
      "value" : "injection"
    }, {
      "key" : "mitigation",
      "value" : "parameterized-queries"
    } ]
  } ]
}; // array[Threat] | 
        UUID threatModelId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // UUID | Unique identifier of the threat model (UUID)
        try {
            array[Threat] result = apiInstance.bulkUpdateThreatModelThreats(body, threatModelId);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling ThreatModelSubResourcesApi#bulkUpdateThreatModelThreats");
            e.printStackTrace();
        }
    }
}
Configuration *apiConfig = [Configuration sharedConfig];
array[Threat] *body = {
  "summary" : "Update multiple threats at once",
  "value" : [ {
    "id" : "750e8400-e29b-41d4-a716-446655440001",
    "name" : "Updated SQL Injection Attack",
    "description" : "Updated description for SQL injection vulnerability",
    "impact" : "High",
    "likelihood" : "Low",
    "risk_rating" : "Medium",
    "metadata" : [ {
      "key" : "category",
      "value" : "injection"
    }, {
      "key" : "mitigation",
      "value" : "parameterized-queries"
    } ]
  } ]
}; // 
UUID *threatModelId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // Unique identifier of the threat model (UUID)

ThreatModelSubResourcesApi *apiInstance = [[ThreatModelSubResourcesApi alloc] init];

// Bulk update threats
[apiInstance bulkUpdateThreatModelThreatsWith:body
    threatModelId:threatModelId
              completionHandler: ^(array[Threat] output, NSError* error) {
                            if (output) {
                                NSLog(@"%@", output);
                            }
                            if (error) {
                                NSLog(@"Error: %@", error);
                            }
                        }];
var TmiThreatModelingImprovedApi = require('tmi__threat_modeling_improved_api');
var defaultClient = TmiThreatModelingImprovedApi.ApiClient.instance;


var api = new TmiThreatModelingImprovedApi.ThreatModelSubResourcesApi()
var body = {
  "summary" : "Update multiple threats at once",
  "value" : [ {
    "id" : "750e8400-e29b-41d4-a716-446655440001",
    "name" : "Updated SQL Injection Attack",
    "description" : "Updated description for SQL injection vulnerability",
    "impact" : "High",
    "likelihood" : "Low",
    "risk_rating" : "Medium",
    "metadata" : [ {
      "key" : "category",
      "value" : "injection"
    }, {
      "key" : "mitigation",
      "value" : "parameterized-queries"
    } ]
  } ]
}; // {{array[Threat]}} 
var threatModelId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // {{UUID}} Unique identifier of the threat model (UUID)

var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
};
api.bulkUpdateThreatModelThreats(bodythreatModelId, callback);
using System;
using System.Diagnostics;
using IO.Swagger.Api;
using IO.Swagger.Client;
using IO.Swagger.Model;

namespace Example
{
    public class bulkUpdateThreatModelThreatsExample
    {
        public void main()
        {


            var apiInstance = new ThreatModelSubResourcesApi();
            var body = new array[Threat](); // array[Threat] | 
            var threatModelId = new UUID(); // UUID | Unique identifier of the threat model (UUID)

            try
            {
                // Bulk update threats
                array[Threat] result = apiInstance.bulkUpdateThreatModelThreats(body, threatModelId);
                Debug.WriteLine(result);
            }
            catch (Exception e)
            {
                Debug.Print("Exception when calling ThreatModelSubResourcesApi.bulkUpdateThreatModelThreats: " + e.Message );
            }
        }
    }
}
<?php
require_once(__DIR__ . '/vendor/autoload.php');


$api_instance = new Swagger\Client\ApiThreatModelSubResourcesApi();
$body = {
  "summary" : "Update multiple threats at once",
  "value" : [ {
    "id" : "750e8400-e29b-41d4-a716-446655440001",
    "name" : "Updated SQL Injection Attack",
    "description" : "Updated description for SQL injection vulnerability",
    "impact" : "High",
    "likelihood" : "Low",
    "risk_rating" : "Medium",
    "metadata" : [ {
      "key" : "category",
      "value" : "injection"
    }, {
      "key" : "mitigation",
      "value" : "parameterized-queries"
    } ]
  } ]
}; // array[Threat] | 
$threatModelId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // UUID | Unique identifier of the threat model (UUID)

try {
    $result = $api_instance->bulkUpdateThreatModelThreats($body, $threatModelId);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling ThreatModelSubResourcesApi->bulkUpdateThreatModelThreats: ', $e->getMessage(), PHP_EOL;
}
?>
use Data::Dumper;
use WWW::SwaggerClient::Configuration;
use WWW::SwaggerClient::ThreatModelSubResourcesApi;


my $api_instance = WWW::SwaggerClient::ThreatModelSubResourcesApi->new();
my $body = [WWW::SwaggerClient::Object::array[Threat]->new()]; # array[Threat] | 
my $threatModelId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; # UUID | Unique identifier of the threat model (UUID)

eval { 
    my $result = $api_instance->bulkUpdateThreatModelThreats(body => $body, threatModelId => $threatModelId);
    print Dumper($result);
};
if ($@) {
    warn "Exception when calling ThreatModelSubResourcesApi->bulkUpdateThreatModelThreats: $@\n";
}
from __future__ import print_statement
import time
import swagger_client
from swagger_client.rest import ApiException
from pprint import pprint


# create an instance of the API class
api_instance = swagger_client.ThreatModelSubResourcesApi()
body = {
  "summary" : "Update multiple threats at once",
  "value" : [ {
    "id" : "750e8400-e29b-41d4-a716-446655440001",
    "name" : "Updated SQL Injection Attack",
    "description" : "Updated description for SQL injection vulnerability",
    "impact" : "High",
    "likelihood" : "Low",
    "risk_rating" : "Medium",
    "metadata" : [ {
      "key" : "category",
      "value" : "injection"
    }, {
      "key" : "mitigation",
      "value" : "parameterized-queries"
    } ]
  } ]
} # array[Threat] | 
threatModelId = 38400000-8cf0-11bd-b23e-10b96e4ef00d # UUID | Unique identifier of the threat model (UUID)

try: 
    # Bulk update threats
    api_response = api_instance.bulk_update_threat_model_threats(body, threatModelId)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling ThreatModelSubResourcesApi->bulkUpdateThreatModelThreats: %s\n" % e)

Parameters

Path parameters
Name Description
threat_model_id*
UUID (uuid)
Unique identifier of the threat model (UUID)
Required
Body parameters
Name Description
body *

Responses

Status: 200 - Threats updated successfully

Status: 400 - Error response

Status: 401 - Error response

Status: 403 - Error response

Status: 404 - Error response

Status: 500 - Error response


bulkUpsertDiagramMetadata

Bulk upsert diagram metadata

Creates or updates multiple metadata key-value pairs for the specified diagram


/threat_models/{threat_model_id}/diagrams/{diagram_id}/metadata/bulk

Usage and SDK Samples

curl -X PUT\
 -H "Authorization: Bearer [[accessToken]]"\
-H "Accept: application/json"\
-H "Content-Type: application/json"\
"http://localhost:8080/threat_models/{threat_model_id}/diagrams/{diagram_id}/metadata/bulk"
import io.swagger.client.*;
import io.swagger.client.auth.*;
import io.swagger.client.model.*;
import io.swagger.client.api.ThreatModelSubResourcesApi;

import java.io.File;
import java.util.*;

public class ThreatModelSubResourcesApiExample {

    public static void main(String[] args) {
        ApiClient defaultClient = Configuration.getDefaultApiClient();


        ThreatModelSubResourcesApi apiInstance = new ThreatModelSubResourcesApi();
        array[Metadata] body = ; // array[Metadata] | 
        UUID threatModelId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // UUID | Unique identifier of the threat model (UUID)
        UUID diagramId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // UUID | Unique identifier of the diagram (UUID)
        try {
            array[Metadata] result = apiInstance.bulkUpsertDiagramMetadata(body, threatModelId, diagramId);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling ThreatModelSubResourcesApi#bulkUpsertDiagramMetadata");
            e.printStackTrace();
        }
    }
}
import io.swagger.client.api.ThreatModelSubResourcesApi;

public class ThreatModelSubResourcesApiExample {

    public static void main(String[] args) {
        ThreatModelSubResourcesApi apiInstance = new ThreatModelSubResourcesApi();
        array[Metadata] body = ; // array[Metadata] | 
        UUID threatModelId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // UUID | Unique identifier of the threat model (UUID)
        UUID diagramId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // UUID | Unique identifier of the diagram (UUID)
        try {
            array[Metadata] result = apiInstance.bulkUpsertDiagramMetadata(body, threatModelId, diagramId);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling ThreatModelSubResourcesApi#bulkUpsertDiagramMetadata");
            e.printStackTrace();
        }
    }
}
Configuration *apiConfig = [Configuration sharedConfig];
array[Metadata] *body = ; // 
UUID *threatModelId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // Unique identifier of the threat model (UUID)
UUID *diagramId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // Unique identifier of the diagram (UUID)

ThreatModelSubResourcesApi *apiInstance = [[ThreatModelSubResourcesApi alloc] init];

// Bulk upsert diagram metadata
[apiInstance bulkUpsertDiagramMetadataWith:body
    threatModelId:threatModelId
    diagramId:diagramId
              completionHandler: ^(array[Metadata] output, NSError* error) {
                            if (output) {
                                NSLog(@"%@", output);
                            }
                            if (error) {
                                NSLog(@"Error: %@", error);
                            }
                        }];
var TmiThreatModelingImprovedApi = require('tmi__threat_modeling_improved_api');
var defaultClient = TmiThreatModelingImprovedApi.ApiClient.instance;


var api = new TmiThreatModelingImprovedApi.ThreatModelSubResourcesApi()
var body = ; // {{array[Metadata]}} 
var threatModelId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // {{UUID}} Unique identifier of the threat model (UUID)
var diagramId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // {{UUID}} Unique identifier of the diagram (UUID)

var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
};
api.bulkUpsertDiagramMetadata(bodythreatModelIddiagramId, callback);
using System;
using System.Diagnostics;
using IO.Swagger.Api;
using IO.Swagger.Client;
using IO.Swagger.Model;

namespace Example
{
    public class bulkUpsertDiagramMetadataExample
    {
        public void main()
        {


            var apiInstance = new ThreatModelSubResourcesApi();
            var body = new array[Metadata](); // array[Metadata] | 
            var threatModelId = new UUID(); // UUID | Unique identifier of the threat model (UUID)
            var diagramId = new UUID(); // UUID | Unique identifier of the diagram (UUID)

            try
            {
                // Bulk upsert diagram metadata
                array[Metadata] result = apiInstance.bulkUpsertDiagramMetadata(body, threatModelId, diagramId);
                Debug.WriteLine(result);
            }
            catch (Exception e)
            {
                Debug.Print("Exception when calling ThreatModelSubResourcesApi.bulkUpsertDiagramMetadata: " + e.Message );
            }
        }
    }
}
<?php
require_once(__DIR__ . '/vendor/autoload.php');


$api_instance = new Swagger\Client\ApiThreatModelSubResourcesApi();
$body = ; // array[Metadata] | 
$threatModelId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // UUID | Unique identifier of the threat model (UUID)
$diagramId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // UUID | Unique identifier of the diagram (UUID)

try {
    $result = $api_instance->bulkUpsertDiagramMetadata($body, $threatModelId, $diagramId);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling ThreatModelSubResourcesApi->bulkUpsertDiagramMetadata: ', $e->getMessage(), PHP_EOL;
}
?>
use Data::Dumper;
use WWW::SwaggerClient::Configuration;
use WWW::SwaggerClient::ThreatModelSubResourcesApi;


my $api_instance = WWW::SwaggerClient::ThreatModelSubResourcesApi->new();
my $body = [WWW::SwaggerClient::Object::array[Metadata]->new()]; # array[Metadata] | 
my $threatModelId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; # UUID | Unique identifier of the threat model (UUID)
my $diagramId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; # UUID | Unique identifier of the diagram (UUID)

eval { 
    my $result = $api_instance->bulkUpsertDiagramMetadata(body => $body, threatModelId => $threatModelId, diagramId => $diagramId);
    print Dumper($result);
};
if ($@) {
    warn "Exception when calling ThreatModelSubResourcesApi->bulkUpsertDiagramMetadata: $@\n";
}
from __future__ import print_statement
import time
import swagger_client
from swagger_client.rest import ApiException
from pprint import pprint


# create an instance of the API class
api_instance = swagger_client.ThreatModelSubResourcesApi()
body =  # array[Metadata] | 
threatModelId = 38400000-8cf0-11bd-b23e-10b96e4ef00d # UUID | Unique identifier of the threat model (UUID)
diagramId = 38400000-8cf0-11bd-b23e-10b96e4ef00d # UUID | Unique identifier of the diagram (UUID)

try: 
    # Bulk upsert diagram metadata
    api_response = api_instance.bulk_upsert_diagram_metadata(body, threatModelId, diagramId)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling ThreatModelSubResourcesApi->bulkUpsertDiagramMetadata: %s\n" % e)

Parameters

Path parameters
Name Description
threat_model_id*
UUID (uuid)
Unique identifier of the threat model (UUID)
Required
diagram_id*
UUID (uuid)
Unique identifier of the diagram (UUID)
Required
Body parameters
Name Description
body *

Responses

Status: 200 - Metadata upserted successfully

Status: 400 - Error response

Status: 401 - Error response

Status: 403 - Error response

Status: 404 - Error response

Status: 500 - Error response


bulkUpsertDocumentMetadata

Bulk upsert document metadata

Creates or updates multiple metadata key-value pairs for the specified document


/threat_models/{threat_model_id}/documents/{document_id}/metadata/bulk

Usage and SDK Samples

curl -X PUT\
 -H "Authorization: Bearer [[accessToken]]"\
-H "Accept: application/json"\
-H "Content-Type: application/json"\
"http://localhost:8080/threat_models/{threat_model_id}/documents/{document_id}/metadata/bulk"
import io.swagger.client.*;
import io.swagger.client.auth.*;
import io.swagger.client.model.*;
import io.swagger.client.api.ThreatModelSubResourcesApi;

import java.io.File;
import java.util.*;

public class ThreatModelSubResourcesApiExample {

    public static void main(String[] args) {
        ApiClient defaultClient = Configuration.getDefaultApiClient();


        ThreatModelSubResourcesApi apiInstance = new ThreatModelSubResourcesApi();
        array[Metadata] body = ; // array[Metadata] | 
        UUID threatModelId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // UUID | Unique identifier of the threat model (UUID)
        UUID documentId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // UUID | Unique identifier of the document (UUID)
        try {
            array[Metadata] result = apiInstance.bulkUpsertDocumentMetadata(body, threatModelId, documentId);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling ThreatModelSubResourcesApi#bulkUpsertDocumentMetadata");
            e.printStackTrace();
        }
    }
}
import io.swagger.client.api.ThreatModelSubResourcesApi;

public class ThreatModelSubResourcesApiExample {

    public static void main(String[] args) {
        ThreatModelSubResourcesApi apiInstance = new ThreatModelSubResourcesApi();
        array[Metadata] body = ; // array[Metadata] | 
        UUID threatModelId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // UUID | Unique identifier of the threat model (UUID)
        UUID documentId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // UUID | Unique identifier of the document (UUID)
        try {
            array[Metadata] result = apiInstance.bulkUpsertDocumentMetadata(body, threatModelId, documentId);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling ThreatModelSubResourcesApi#bulkUpsertDocumentMetadata");
            e.printStackTrace();
        }
    }
}
Configuration *apiConfig = [Configuration sharedConfig];
array[Metadata] *body = ; // 
UUID *threatModelId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // Unique identifier of the threat model (UUID)
UUID *documentId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // Unique identifier of the document (UUID)

ThreatModelSubResourcesApi *apiInstance = [[ThreatModelSubResourcesApi alloc] init];

// Bulk upsert document metadata
[apiInstance bulkUpsertDocumentMetadataWith:body
    threatModelId:threatModelId
    documentId:documentId
              completionHandler: ^(array[Metadata] output, NSError* error) {
                            if (output) {
                                NSLog(@"%@", output);
                            }
                            if (error) {
                                NSLog(@"Error: %@", error);
                            }
                        }];
var TmiThreatModelingImprovedApi = require('tmi__threat_modeling_improved_api');
var defaultClient = TmiThreatModelingImprovedApi.ApiClient.instance;


var api = new TmiThreatModelingImprovedApi.ThreatModelSubResourcesApi()
var body = ; // {{array[Metadata]}} 
var threatModelId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // {{UUID}} Unique identifier of the threat model (UUID)
var documentId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // {{UUID}} Unique identifier of the document (UUID)

var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
};
api.bulkUpsertDocumentMetadata(bodythreatModelIddocumentId, callback);
using System;
using System.Diagnostics;
using IO.Swagger.Api;
using IO.Swagger.Client;
using IO.Swagger.Model;

namespace Example
{
    public class bulkUpsertDocumentMetadataExample
    {
        public void main()
        {


            var apiInstance = new ThreatModelSubResourcesApi();
            var body = new array[Metadata](); // array[Metadata] | 
            var threatModelId = new UUID(); // UUID | Unique identifier of the threat model (UUID)
            var documentId = new UUID(); // UUID | Unique identifier of the document (UUID)

            try
            {
                // Bulk upsert document metadata
                array[Metadata] result = apiInstance.bulkUpsertDocumentMetadata(body, threatModelId, documentId);
                Debug.WriteLine(result);
            }
            catch (Exception e)
            {
                Debug.Print("Exception when calling ThreatModelSubResourcesApi.bulkUpsertDocumentMetadata: " + e.Message );
            }
        }
    }
}
<?php
require_once(__DIR__ . '/vendor/autoload.php');


$api_instance = new Swagger\Client\ApiThreatModelSubResourcesApi();
$body = ; // array[Metadata] | 
$threatModelId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // UUID | Unique identifier of the threat model (UUID)
$documentId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // UUID | Unique identifier of the document (UUID)

try {
    $result = $api_instance->bulkUpsertDocumentMetadata($body, $threatModelId, $documentId);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling ThreatModelSubResourcesApi->bulkUpsertDocumentMetadata: ', $e->getMessage(), PHP_EOL;
}
?>
use Data::Dumper;
use WWW::SwaggerClient::Configuration;
use WWW::SwaggerClient::ThreatModelSubResourcesApi;


my $api_instance = WWW::SwaggerClient::ThreatModelSubResourcesApi->new();
my $body = [WWW::SwaggerClient::Object::array[Metadata]->new()]; # array[Metadata] | 
my $threatModelId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; # UUID | Unique identifier of the threat model (UUID)
my $documentId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; # UUID | Unique identifier of the document (UUID)

eval { 
    my $result = $api_instance->bulkUpsertDocumentMetadata(body => $body, threatModelId => $threatModelId, documentId => $documentId);
    print Dumper($result);
};
if ($@) {
    warn "Exception when calling ThreatModelSubResourcesApi->bulkUpsertDocumentMetadata: $@\n";
}
from __future__ import print_statement
import time
import swagger_client
from swagger_client.rest import ApiException
from pprint import pprint


# create an instance of the API class
api_instance = swagger_client.ThreatModelSubResourcesApi()
body =  # array[Metadata] | 
threatModelId = 38400000-8cf0-11bd-b23e-10b96e4ef00d # UUID | Unique identifier of the threat model (UUID)
documentId = 38400000-8cf0-11bd-b23e-10b96e4ef00d # UUID | Unique identifier of the document (UUID)

try: 
    # Bulk upsert document metadata
    api_response = api_instance.bulk_upsert_document_metadata(body, threatModelId, documentId)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling ThreatModelSubResourcesApi->bulkUpsertDocumentMetadata: %s\n" % e)

Parameters

Path parameters
Name Description
threat_model_id*
UUID (uuid)
Unique identifier of the threat model (UUID)
Required
document_id*
UUID (uuid)
Unique identifier of the document (UUID)
Required
Body parameters
Name Description
body *

Responses

Status: 200 - Metadata upserted successfully

Status: 400 - Error response

Status: 401 - Error response

Status: 403 - Error response

Status: 404 - Error response

Status: 500 - Error response


bulkUpsertRepositoryMetadata

Bulk upsert repository metadata

Creates or updates multiple metadata key-value pairs for the specified repository


/threat_models/{threat_model_id}/repositories/{repository_id}/metadata/bulk

Usage and SDK Samples

curl -X PUT\
 -H "Authorization: Bearer [[accessToken]]"\
-H "Accept: application/json"\
-H "Content-Type: application/json"\
"http://localhost:8080/threat_models/{threat_model_id}/repositories/{repository_id}/metadata/bulk"
import io.swagger.client.*;
import io.swagger.client.auth.*;
import io.swagger.client.model.*;
import io.swagger.client.api.ThreatModelSubResourcesApi;

import java.io.File;
import java.util.*;

public class ThreatModelSubResourcesApiExample {

    public static void main(String[] args) {
        ApiClient defaultClient = Configuration.getDefaultApiClient();


        ThreatModelSubResourcesApi apiInstance = new ThreatModelSubResourcesApi();
        array[Metadata] body = ; // array[Metadata] | 
        UUID threatModelId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // UUID | Unique identifier of the threat model (UUID)
        UUID repositoryId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // UUID | Unique identifier of the source reference (UUID)
        try {
            array[Metadata] result = apiInstance.bulkUpsertRepositoryMetadata(body, threatModelId, repositoryId);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling ThreatModelSubResourcesApi#bulkUpsertRepositoryMetadata");
            e.printStackTrace();
        }
    }
}
import io.swagger.client.api.ThreatModelSubResourcesApi;

public class ThreatModelSubResourcesApiExample {

    public static void main(String[] args) {
        ThreatModelSubResourcesApi apiInstance = new ThreatModelSubResourcesApi();
        array[Metadata] body = ; // array[Metadata] | 
        UUID threatModelId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // UUID | Unique identifier of the threat model (UUID)
        UUID repositoryId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // UUID | Unique identifier of the source reference (UUID)
        try {
            array[Metadata] result = apiInstance.bulkUpsertRepositoryMetadata(body, threatModelId, repositoryId);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling ThreatModelSubResourcesApi#bulkUpsertRepositoryMetadata");
            e.printStackTrace();
        }
    }
}
Configuration *apiConfig = [Configuration sharedConfig];
array[Metadata] *body = ; // 
UUID *threatModelId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // Unique identifier of the threat model (UUID)
UUID *repositoryId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // Unique identifier of the source reference (UUID)

ThreatModelSubResourcesApi *apiInstance = [[ThreatModelSubResourcesApi alloc] init];

// Bulk upsert repository metadata
[apiInstance bulkUpsertRepositoryMetadataWith:body
    threatModelId:threatModelId
    repositoryId:repositoryId
              completionHandler: ^(array[Metadata] output, NSError* error) {
                            if (output) {
                                NSLog(@"%@", output);
                            }
                            if (error) {
                                NSLog(@"Error: %@", error);
                            }
                        }];
var TmiThreatModelingImprovedApi = require('tmi__threat_modeling_improved_api');
var defaultClient = TmiThreatModelingImprovedApi.ApiClient.instance;


var api = new TmiThreatModelingImprovedApi.ThreatModelSubResourcesApi()
var body = ; // {{array[Metadata]}} 
var threatModelId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // {{UUID}} Unique identifier of the threat model (UUID)
var repositoryId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // {{UUID}} Unique identifier of the source reference (UUID)

var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
};
api.bulkUpsertRepositoryMetadata(bodythreatModelIdrepositoryId, callback);
using System;
using System.Diagnostics;
using IO.Swagger.Api;
using IO.Swagger.Client;
using IO.Swagger.Model;

namespace Example
{
    public class bulkUpsertRepositoryMetadataExample
    {
        public void main()
        {


            var apiInstance = new ThreatModelSubResourcesApi();
            var body = new array[Metadata](); // array[Metadata] | 
            var threatModelId = new UUID(); // UUID | Unique identifier of the threat model (UUID)
            var repositoryId = new UUID(); // UUID | Unique identifier of the source reference (UUID)

            try
            {
                // Bulk upsert repository metadata
                array[Metadata] result = apiInstance.bulkUpsertRepositoryMetadata(body, threatModelId, repositoryId);
                Debug.WriteLine(result);
            }
            catch (Exception e)
            {
                Debug.Print("Exception when calling ThreatModelSubResourcesApi.bulkUpsertRepositoryMetadata: " + e.Message );
            }
        }
    }
}
<?php
require_once(__DIR__ . '/vendor/autoload.php');


$api_instance = new Swagger\Client\ApiThreatModelSubResourcesApi();
$body = ; // array[Metadata] | 
$threatModelId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // UUID | Unique identifier of the threat model (UUID)
$repositoryId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // UUID | Unique identifier of the source reference (UUID)

try {
    $result = $api_instance->bulkUpsertRepositoryMetadata($body, $threatModelId, $repositoryId);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling ThreatModelSubResourcesApi->bulkUpsertRepositoryMetadata: ', $e->getMessage(), PHP_EOL;
}
?>
use Data::Dumper;
use WWW::SwaggerClient::Configuration;
use WWW::SwaggerClient::ThreatModelSubResourcesApi;


my $api_instance = WWW::SwaggerClient::ThreatModelSubResourcesApi->new();
my $body = [WWW::SwaggerClient::Object::array[Metadata]->new()]; # array[Metadata] | 
my $threatModelId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; # UUID | Unique identifier of the threat model (UUID)
my $repositoryId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; # UUID | Unique identifier of the source reference (UUID)

eval { 
    my $result = $api_instance->bulkUpsertRepositoryMetadata(body => $body, threatModelId => $threatModelId, repositoryId => $repositoryId);
    print Dumper($result);
};
if ($@) {
    warn "Exception when calling ThreatModelSubResourcesApi->bulkUpsertRepositoryMetadata: $@\n";
}
from __future__ import print_statement
import time
import swagger_client
from swagger_client.rest import ApiException
from pprint import pprint


# create an instance of the API class
api_instance = swagger_client.ThreatModelSubResourcesApi()
body =  # array[Metadata] | 
threatModelId = 38400000-8cf0-11bd-b23e-10b96e4ef00d # UUID | Unique identifier of the threat model (UUID)
repositoryId = 38400000-8cf0-11bd-b23e-10b96e4ef00d # UUID | Unique identifier of the source reference (UUID)

try: 
    # Bulk upsert repository metadata
    api_response = api_instance.bulk_upsert_repository_metadata(body, threatModelId, repositoryId)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling ThreatModelSubResourcesApi->bulkUpsertRepositoryMetadata: %s\n" % e)

Parameters

Path parameters
Name Description
threat_model_id*
UUID (uuid)
Unique identifier of the threat model (UUID)
Required
repository_id*
UUID (uuid)
Unique identifier of the source reference (UUID)
Required
Body parameters
Name Description
body *

Responses

Status: 200 - Metadata upserted successfully

Status: 400 - Error response

Status: 401 - Error response

Status: 403 - Error response

Status: 404 - Error response

Status: 500 - Error response


bulkUpsertThreatMetadata

Bulk upsert threat metadata

Creates or updates multiple metadata key-value pairs for the specified threat


/threat_models/{threat_model_id}/threats/{threat_id}/metadata/bulk

Usage and SDK Samples

curl -X PUT\
 -H "Authorization: Bearer [[accessToken]]"\
-H "Accept: application/json"\
-H "Content-Type: application/json"\
"http://localhost:8080/threat_models/{threat_model_id}/threats/{threat_id}/metadata/bulk"
import io.swagger.client.*;
import io.swagger.client.auth.*;
import io.swagger.client.model.*;
import io.swagger.client.api.ThreatModelSubResourcesApi;

import java.io.File;
import java.util.*;

public class ThreatModelSubResourcesApiExample {

    public static void main(String[] args) {
        ApiClient defaultClient = Configuration.getDefaultApiClient();


        ThreatModelSubResourcesApi apiInstance = new ThreatModelSubResourcesApi();
        array[Metadata] body = ; // array[Metadata] | 
        UUID threatModelId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // UUID | Unique identifier of the threat model (UUID)
        UUID threatId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // UUID | Unique identifier of the threat (UUID)
        try {
            array[Metadata] result = apiInstance.bulkUpsertThreatMetadata(body, threatModelId, threatId);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling ThreatModelSubResourcesApi#bulkUpsertThreatMetadata");
            e.printStackTrace();
        }
    }
}
import io.swagger.client.api.ThreatModelSubResourcesApi;

public class ThreatModelSubResourcesApiExample {

    public static void main(String[] args) {
        ThreatModelSubResourcesApi apiInstance = new ThreatModelSubResourcesApi();
        array[Metadata] body = ; // array[Metadata] | 
        UUID threatModelId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // UUID | Unique identifier of the threat model (UUID)
        UUID threatId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // UUID | Unique identifier of the threat (UUID)
        try {
            array[Metadata] result = apiInstance.bulkUpsertThreatMetadata(body, threatModelId, threatId);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling ThreatModelSubResourcesApi#bulkUpsertThreatMetadata");
            e.printStackTrace();
        }
    }
}
Configuration *apiConfig = [Configuration sharedConfig];
array[Metadata] *body = ; // 
UUID *threatModelId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // Unique identifier of the threat model (UUID)
UUID *threatId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // Unique identifier of the threat (UUID)

ThreatModelSubResourcesApi *apiInstance = [[ThreatModelSubResourcesApi alloc] init];

// Bulk upsert threat metadata
[apiInstance bulkUpsertThreatMetadataWith:body
    threatModelId:threatModelId
    threatId:threatId
              completionHandler: ^(array[Metadata] output, NSError* error) {
                            if (output) {
                                NSLog(@"%@", output);
                            }
                            if (error) {
                                NSLog(@"Error: %@", error);
                            }
                        }];
var TmiThreatModelingImprovedApi = require('tmi__threat_modeling_improved_api');
var defaultClient = TmiThreatModelingImprovedApi.ApiClient.instance;


var api = new TmiThreatModelingImprovedApi.ThreatModelSubResourcesApi()
var body = ; // {{array[Metadata]}} 
var threatModelId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // {{UUID}} Unique identifier of the threat model (UUID)
var threatId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // {{UUID}} Unique identifier of the threat (UUID)

var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
};
api.bulkUpsertThreatMetadata(bodythreatModelIdthreatId, callback);
using System;
using System.Diagnostics;
using IO.Swagger.Api;
using IO.Swagger.Client;
using IO.Swagger.Model;

namespace Example
{
    public class bulkUpsertThreatMetadataExample
    {
        public void main()
        {


            var apiInstance = new ThreatModelSubResourcesApi();
            var body = new array[Metadata](); // array[Metadata] | 
            var threatModelId = new UUID(); // UUID | Unique identifier of the threat model (UUID)
            var threatId = new UUID(); // UUID | Unique identifier of the threat (UUID)

            try
            {
                // Bulk upsert threat metadata
                array[Metadata] result = apiInstance.bulkUpsertThreatMetadata(body, threatModelId, threatId);
                Debug.WriteLine(result);
            }
            catch (Exception e)
            {
                Debug.Print("Exception when calling ThreatModelSubResourcesApi.bulkUpsertThreatMetadata: " + e.Message );
            }
        }
    }
}
<?php
require_once(__DIR__ . '/vendor/autoload.php');


$api_instance = new Swagger\Client\ApiThreatModelSubResourcesApi();
$body = ; // array[Metadata] | 
$threatModelId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // UUID | Unique identifier of the threat model (UUID)
$threatId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // UUID | Unique identifier of the threat (UUID)

try {
    $result = $api_instance->bulkUpsertThreatMetadata($body, $threatModelId, $threatId);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling ThreatModelSubResourcesApi->bulkUpsertThreatMetadata: ', $e->getMessage(), PHP_EOL;
}
?>
use Data::Dumper;
use WWW::SwaggerClient::Configuration;
use WWW::SwaggerClient::ThreatModelSubResourcesApi;


my $api_instance = WWW::SwaggerClient::ThreatModelSubResourcesApi->new();
my $body = [WWW::SwaggerClient::Object::array[Metadata]->new()]; # array[Metadata] | 
my $threatModelId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; # UUID | Unique identifier of the threat model (UUID)
my $threatId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; # UUID | Unique identifier of the threat (UUID)

eval { 
    my $result = $api_instance->bulkUpsertThreatMetadata(body => $body, threatModelId => $threatModelId, threatId => $threatId);
    print Dumper($result);
};
if ($@) {
    warn "Exception when calling ThreatModelSubResourcesApi->bulkUpsertThreatMetadata: $@\n";
}
from __future__ import print_statement
import time
import swagger_client
from swagger_client.rest import ApiException
from pprint import pprint


# create an instance of the API class
api_instance = swagger_client.ThreatModelSubResourcesApi()
body =  # array[Metadata] | 
threatModelId = 38400000-8cf0-11bd-b23e-10b96e4ef00d # UUID | Unique identifier of the threat model (UUID)
threatId = 38400000-8cf0-11bd-b23e-10b96e4ef00d # UUID | Unique identifier of the threat (UUID)

try: 
    # Bulk upsert threat metadata
    api_response = api_instance.bulk_upsert_threat_metadata(body, threatModelId, threatId)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling ThreatModelSubResourcesApi->bulkUpsertThreatMetadata: %s\n" % e)

Parameters

Path parameters
Name Description
threat_model_id*
UUID (uuid)
Unique identifier of the threat model (UUID)
Required
threat_id*
UUID (uuid)
Unique identifier of the threat (UUID)
Required
Body parameters
Name Description
body *

Responses

Status: 200 - Metadata upserted successfully

Status: 400 - Error response

Status: 401 - Error response

Status: 403 - Error response

Status: 404 - Error response

Status: 500 - Error response


bulkUpsertThreatModelAssetMetadata

Bulk upsert asset metadata

Creates or updates multiple metadata key-value pairs for the specified asset


/threat_models/{threat_model_id}/assets/{asset_id}/metadata/bulk

Usage and SDK Samples

curl -X PUT\
 -H "Authorization: Bearer [[accessToken]]"\
-H "Accept: application/json"\
-H "Content-Type: application/json"\
"http://localhost:8080/threat_models/{threat_model_id}/assets/{asset_id}/metadata/bulk"
import io.swagger.client.*;
import io.swagger.client.auth.*;
import io.swagger.client.model.*;
import io.swagger.client.api.ThreatModelSubResourcesApi;

import java.io.File;
import java.util.*;

public class ThreatModelSubResourcesApiExample {

    public static void main(String[] args) {
        ApiClient defaultClient = Configuration.getDefaultApiClient();


        ThreatModelSubResourcesApi apiInstance = new ThreatModelSubResourcesApi();
        array[Metadata] body = ; // array[Metadata] | 
        UUID threatModelId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // UUID | Unique identifier of the threat model (UUID)
        UUID assetId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // UUID | Unique identifier of the asset (UUID)
        try {
            array[Metadata] result = apiInstance.bulkUpsertThreatModelAssetMetadata(body, threatModelId, assetId);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling ThreatModelSubResourcesApi#bulkUpsertThreatModelAssetMetadata");
            e.printStackTrace();
        }
    }
}
import io.swagger.client.api.ThreatModelSubResourcesApi;

public class ThreatModelSubResourcesApiExample {

    public static void main(String[] args) {
        ThreatModelSubResourcesApi apiInstance = new ThreatModelSubResourcesApi();
        array[Metadata] body = ; // array[Metadata] | 
        UUID threatModelId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // UUID | Unique identifier of the threat model (UUID)
        UUID assetId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // UUID | Unique identifier of the asset (UUID)
        try {
            array[Metadata] result = apiInstance.bulkUpsertThreatModelAssetMetadata(body, threatModelId, assetId);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling ThreatModelSubResourcesApi#bulkUpsertThreatModelAssetMetadata");
            e.printStackTrace();
        }
    }
}
Configuration *apiConfig = [Configuration sharedConfig];
array[Metadata] *body = ; // 
UUID *threatModelId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // Unique identifier of the threat model (UUID)
UUID *assetId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // Unique identifier of the asset (UUID)

ThreatModelSubResourcesApi *apiInstance = [[ThreatModelSubResourcesApi alloc] init];

// Bulk upsert asset metadata
[apiInstance bulkUpsertThreatModelAssetMetadataWith:body
    threatModelId:threatModelId
    assetId:assetId
              completionHandler: ^(array[Metadata] output, NSError* error) {
                            if (output) {
                                NSLog(@"%@", output);
                            }
                            if (error) {
                                NSLog(@"Error: %@", error);
                            }
                        }];
var TmiThreatModelingImprovedApi = require('tmi__threat_modeling_improved_api');
var defaultClient = TmiThreatModelingImprovedApi.ApiClient.instance;


var api = new TmiThreatModelingImprovedApi.ThreatModelSubResourcesApi()
var body = ; // {{array[Metadata]}} 
var threatModelId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // {{UUID}} Unique identifier of the threat model (UUID)
var assetId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // {{UUID}} Unique identifier of the asset (UUID)

var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
};
api.bulkUpsertThreatModelAssetMetadata(bodythreatModelIdassetId, callback);
using System;
using System.Diagnostics;
using IO.Swagger.Api;
using IO.Swagger.Client;
using IO.Swagger.Model;

namespace Example
{
    public class bulkUpsertThreatModelAssetMetadataExample
    {
        public void main()
        {


            var apiInstance = new ThreatModelSubResourcesApi();
            var body = new array[Metadata](); // array[Metadata] | 
            var threatModelId = new UUID(); // UUID | Unique identifier of the threat model (UUID)
            var assetId = new UUID(); // UUID | Unique identifier of the asset (UUID)

            try
            {
                // Bulk upsert asset metadata
                array[Metadata] result = apiInstance.bulkUpsertThreatModelAssetMetadata(body, threatModelId, assetId);
                Debug.WriteLine(result);
            }
            catch (Exception e)
            {
                Debug.Print("Exception when calling ThreatModelSubResourcesApi.bulkUpsertThreatModelAssetMetadata: " + e.Message );
            }
        }
    }
}
<?php
require_once(__DIR__ . '/vendor/autoload.php');


$api_instance = new Swagger\Client\ApiThreatModelSubResourcesApi();
$body = ; // array[Metadata] | 
$threatModelId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // UUID | Unique identifier of the threat model (UUID)
$assetId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // UUID | Unique identifier of the asset (UUID)

try {
    $result = $api_instance->bulkUpsertThreatModelAssetMetadata($body, $threatModelId, $assetId);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling ThreatModelSubResourcesApi->bulkUpsertThreatModelAssetMetadata: ', $e->getMessage(), PHP_EOL;
}
?>
use Data::Dumper;
use WWW::SwaggerClient::Configuration;
use WWW::SwaggerClient::ThreatModelSubResourcesApi;


my $api_instance = WWW::SwaggerClient::ThreatModelSubResourcesApi->new();
my $body = [WWW::SwaggerClient::Object::array[Metadata]->new()]; # array[Metadata] | 
my $threatModelId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; # UUID | Unique identifier of the threat model (UUID)
my $assetId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; # UUID | Unique identifier of the asset (UUID)

eval { 
    my $result = $api_instance->bulkUpsertThreatModelAssetMetadata(body => $body, threatModelId => $threatModelId, assetId => $assetId);
    print Dumper($result);
};
if ($@) {
    warn "Exception when calling ThreatModelSubResourcesApi->bulkUpsertThreatModelAssetMetadata: $@\n";
}
from __future__ import print_statement
import time
import swagger_client
from swagger_client.rest import ApiException
from pprint import pprint


# create an instance of the API class
api_instance = swagger_client.ThreatModelSubResourcesApi()
body =  # array[Metadata] | 
threatModelId = 38400000-8cf0-11bd-b23e-10b96e4ef00d # UUID | Unique identifier of the threat model (UUID)
assetId = 38400000-8cf0-11bd-b23e-10b96e4ef00d # UUID | Unique identifier of the asset (UUID)

try: 
    # Bulk upsert asset metadata
    api_response = api_instance.bulk_upsert_threat_model_asset_metadata(body, threatModelId, assetId)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling ThreatModelSubResourcesApi->bulkUpsertThreatModelAssetMetadata: %s\n" % e)

Parameters

Path parameters
Name Description
threat_model_id*
UUID (uuid)
Unique identifier of the threat model (UUID)
Required
asset_id*
UUID (uuid)
Unique identifier of the asset (UUID)
Required
Body parameters
Name Description
body *

Responses

Status: 200 - Metadata upserted successfully

Status: 400 - Error response

Status: 401 - Error response

Status: 403 - Error response

Status: 404 - Error response

Status: 500 - Error response


bulkUpsertThreatModelAssets

Bulk upsert assets

Create or update multiple assets in a single request


/threat_models/{threat_model_id}/assets/bulk

Usage and SDK Samples

curl -X PUT\
 -H "Authorization: Bearer [[accessToken]]"\
-H "Accept: application/json"\
-H "Content-Type: application/json"\
"http://localhost:8080/threat_models/{threat_model_id}/assets/bulk"
import io.swagger.client.*;
import io.swagger.client.auth.*;
import io.swagger.client.model.*;
import io.swagger.client.api.ThreatModelSubResourcesApi;

import java.io.File;
import java.util.*;

public class ThreatModelSubResourcesApiExample {

    public static void main(String[] args) {
        ApiClient defaultClient = Configuration.getDefaultApiClient();


        ThreatModelSubResourcesApi apiInstance = new ThreatModelSubResourcesApi();
        array[Asset] body = ; // array[Asset] | 
        UUID threatModelId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // UUID | Unique identifier of the threat model (UUID)
        try {
            array[Asset] result = apiInstance.bulkUpsertThreatModelAssets(body, threatModelId);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling ThreatModelSubResourcesApi#bulkUpsertThreatModelAssets");
            e.printStackTrace();
        }
    }
}
import io.swagger.client.api.ThreatModelSubResourcesApi;

public class ThreatModelSubResourcesApiExample {

    public static void main(String[] args) {
        ThreatModelSubResourcesApi apiInstance = new ThreatModelSubResourcesApi();
        array[Asset] body = ; // array[Asset] | 
        UUID threatModelId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // UUID | Unique identifier of the threat model (UUID)
        try {
            array[Asset] result = apiInstance.bulkUpsertThreatModelAssets(body, threatModelId);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling ThreatModelSubResourcesApi#bulkUpsertThreatModelAssets");
            e.printStackTrace();
        }
    }
}
Configuration *apiConfig = [Configuration sharedConfig];
array[Asset] *body = ; // 
UUID *threatModelId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // Unique identifier of the threat model (UUID)

ThreatModelSubResourcesApi *apiInstance = [[ThreatModelSubResourcesApi alloc] init];

// Bulk upsert assets
[apiInstance bulkUpsertThreatModelAssetsWith:body
    threatModelId:threatModelId
              completionHandler: ^(array[Asset] output, NSError* error) {
                            if (output) {
                                NSLog(@"%@", output);
                            }
                            if (error) {
                                NSLog(@"Error: %@", error);
                            }
                        }];
var TmiThreatModelingImprovedApi = require('tmi__threat_modeling_improved_api');
var defaultClient = TmiThreatModelingImprovedApi.ApiClient.instance;


var api = new TmiThreatModelingImprovedApi.ThreatModelSubResourcesApi()
var body = ; // {{array[Asset]}} 
var threatModelId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // {{UUID}} Unique identifier of the threat model (UUID)

var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
};
api.bulkUpsertThreatModelAssets(bodythreatModelId, callback);
using System;
using System.Diagnostics;
using IO.Swagger.Api;
using IO.Swagger.Client;
using IO.Swagger.Model;

namespace Example
{
    public class bulkUpsertThreatModelAssetsExample
    {
        public void main()
        {


            var apiInstance = new ThreatModelSubResourcesApi();
            var body = new array[Asset](); // array[Asset] | 
            var threatModelId = new UUID(); // UUID | Unique identifier of the threat model (UUID)

            try
            {
                // Bulk upsert assets
                array[Asset] result = apiInstance.bulkUpsertThreatModelAssets(body, threatModelId);
                Debug.WriteLine(result);
            }
            catch (Exception e)
            {
                Debug.Print("Exception when calling ThreatModelSubResourcesApi.bulkUpsertThreatModelAssets: " + e.Message );
            }
        }
    }
}
<?php
require_once(__DIR__ . '/vendor/autoload.php');


$api_instance = new Swagger\Client\ApiThreatModelSubResourcesApi();
$body = ; // array[Asset] | 
$threatModelId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // UUID | Unique identifier of the threat model (UUID)

try {
    $result = $api_instance->bulkUpsertThreatModelAssets($body, $threatModelId);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling ThreatModelSubResourcesApi->bulkUpsertThreatModelAssets: ', $e->getMessage(), PHP_EOL;
}
?>
use Data::Dumper;
use WWW::SwaggerClient::Configuration;
use WWW::SwaggerClient::ThreatModelSubResourcesApi;


my $api_instance = WWW::SwaggerClient::ThreatModelSubResourcesApi->new();
my $body = [WWW::SwaggerClient::Object::array[Asset]->new()]; # array[Asset] | 
my $threatModelId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; # UUID | Unique identifier of the threat model (UUID)

eval { 
    my $result = $api_instance->bulkUpsertThreatModelAssets(body => $body, threatModelId => $threatModelId);
    print Dumper($result);
};
if ($@) {
    warn "Exception when calling ThreatModelSubResourcesApi->bulkUpsertThreatModelAssets: $@\n";
}
from __future__ import print_statement
import time
import swagger_client
from swagger_client.rest import ApiException
from pprint import pprint


# create an instance of the API class
api_instance = swagger_client.ThreatModelSubResourcesApi()
body =  # array[Asset] | 
threatModelId = 38400000-8cf0-11bd-b23e-10b96e4ef00d # UUID | Unique identifier of the threat model (UUID)

try: 
    # Bulk upsert assets
    api_response = api_instance.bulk_upsert_threat_model_assets(body, threatModelId)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling ThreatModelSubResourcesApi->bulkUpsertThreatModelAssets: %s\n" % e)

Parameters

Path parameters
Name Description
threat_model_id*
UUID (uuid)
Unique identifier of the threat model (UUID)
Required
Body parameters
Name Description
body *

Responses

Status: 201 - Assets created successfully

Status: 400 - Error response

Status: 401 - Error response

Status: 403 - Error response

Status: 404 - Error response

Status: 500 - Error response


bulkUpsertThreatModelDocuments

Bulk upsert documents

Create or update multiple documents in a single request


/threat_models/{threat_model_id}/documents/bulk

Usage and SDK Samples

curl -X PUT\
 -H "Authorization: Bearer [[accessToken]]"\
-H "Accept: application/json"\
-H "Content-Type: application/json"\
"http://localhost:8080/threat_models/{threat_model_id}/documents/bulk"
import io.swagger.client.*;
import io.swagger.client.auth.*;
import io.swagger.client.model.*;
import io.swagger.client.api.ThreatModelSubResourcesApi;

import java.io.File;
import java.util.*;

public class ThreatModelSubResourcesApiExample {

    public static void main(String[] args) {
        ApiClient defaultClient = Configuration.getDefaultApiClient();


        ThreatModelSubResourcesApi apiInstance = new ThreatModelSubResourcesApi();
        array[Document] body = {
  "summary" : "Create multiple documents at once",
  "value" : [ {
    "name" : "Architecture Document",
    "description" : "System architecture documentation",
    "metadata" : [ {
      "key" : "type",
      "value" : "architecture"
    }, {
      "key" : "version",
      "value" : "2.1"
    } ],
    "uri" : "https://docs.company.com/architecture.pdf"
  }, {
    "name" : "Security Requirements",
    "description" : "Security requirements and compliance standards",
    "metadata" : [ {
      "key" : "classification",
      "value" : "internal"
    }, {
      "key" : "department",
      "value" : "security"
    } ],
    "uri" : "https://docs.company.com/security.pdf"
  } ]
}; // array[Document] | 
        UUID threatModelId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // UUID | Unique identifier of the threat model (UUID)
        try {
            array[Document] result = apiInstance.bulkUpsertThreatModelDocuments(body, threatModelId);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling ThreatModelSubResourcesApi#bulkUpsertThreatModelDocuments");
            e.printStackTrace();
        }
    }
}
import io.swagger.client.api.ThreatModelSubResourcesApi;

public class ThreatModelSubResourcesApiExample {

    public static void main(String[] args) {
        ThreatModelSubResourcesApi apiInstance = new ThreatModelSubResourcesApi();
        array[Document] body = {
  "summary" : "Create multiple documents at once",
  "value" : [ {
    "name" : "Architecture Document",
    "description" : "System architecture documentation",
    "metadata" : [ {
      "key" : "type",
      "value" : "architecture"
    }, {
      "key" : "version",
      "value" : "2.1"
    } ],
    "uri" : "https://docs.company.com/architecture.pdf"
  }, {
    "name" : "Security Requirements",
    "description" : "Security requirements and compliance standards",
    "metadata" : [ {
      "key" : "classification",
      "value" : "internal"
    }, {
      "key" : "department",
      "value" : "security"
    } ],
    "uri" : "https://docs.company.com/security.pdf"
  } ]
}; // array[Document] | 
        UUID threatModelId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // UUID | Unique identifier of the threat model (UUID)
        try {
            array[Document] result = apiInstance.bulkUpsertThreatModelDocuments(body, threatModelId);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling ThreatModelSubResourcesApi#bulkUpsertThreatModelDocuments");
            e.printStackTrace();
        }
    }
}
Configuration *apiConfig = [Configuration sharedConfig];
array[Document] *body = {
  "summary" : "Create multiple documents at once",
  "value" : [ {
    "name" : "Architecture Document",
    "description" : "System architecture documentation",
    "metadata" : [ {
      "key" : "type",
      "value" : "architecture"
    }, {
      "key" : "version",
      "value" : "2.1"
    } ],
    "uri" : "https://docs.company.com/architecture.pdf"
  }, {
    "name" : "Security Requirements",
    "description" : "Security requirements and compliance standards",
    "metadata" : [ {
      "key" : "classification",
      "value" : "internal"
    }, {
      "key" : "department",
      "value" : "security"
    } ],
    "uri" : "https://docs.company.com/security.pdf"
  } ]
}; // 
UUID *threatModelId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // Unique identifier of the threat model (UUID)

ThreatModelSubResourcesApi *apiInstance = [[ThreatModelSubResourcesApi alloc] init];

// Bulk upsert documents
[apiInstance bulkUpsertThreatModelDocumentsWith:body
    threatModelId:threatModelId
              completionHandler: ^(array[Document] output, NSError* error) {
                            if (output) {
                                NSLog(@"%@", output);
                            }
                            if (error) {
                                NSLog(@"Error: %@", error);
                            }
                        }];
var TmiThreatModelingImprovedApi = require('tmi__threat_modeling_improved_api');
var defaultClient = TmiThreatModelingImprovedApi.ApiClient.instance;


var api = new TmiThreatModelingImprovedApi.ThreatModelSubResourcesApi()
var body = {
  "summary" : "Create multiple documents at once",
  "value" : [ {
    "name" : "Architecture Document",
    "description" : "System architecture documentation",
    "metadata" : [ {
      "key" : "type",
      "value" : "architecture"
    }, {
      "key" : "version",
      "value" : "2.1"
    } ],
    "uri" : "https://docs.company.com/architecture.pdf"
  }, {
    "name" : "Security Requirements",
    "description" : "Security requirements and compliance standards",
    "metadata" : [ {
      "key" : "classification",
      "value" : "internal"
    }, {
      "key" : "department",
      "value" : "security"
    } ],
    "uri" : "https://docs.company.com/security.pdf"
  } ]
}; // {{array[Document]}} 
var threatModelId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // {{UUID}} Unique identifier of the threat model (UUID)

var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
};
api.bulkUpsertThreatModelDocuments(bodythreatModelId, callback);
using System;
using System.Diagnostics;
using IO.Swagger.Api;
using IO.Swagger.Client;
using IO.Swagger.Model;

namespace Example
{
    public class bulkUpsertThreatModelDocumentsExample
    {
        public void main()
        {


            var apiInstance = new ThreatModelSubResourcesApi();
            var body = new array[Document](); // array[Document] | 
            var threatModelId = new UUID(); // UUID | Unique identifier of the threat model (UUID)

            try
            {
                // Bulk upsert documents
                array[Document] result = apiInstance.bulkUpsertThreatModelDocuments(body, threatModelId);
                Debug.WriteLine(result);
            }
            catch (Exception e)
            {
                Debug.Print("Exception when calling ThreatModelSubResourcesApi.bulkUpsertThreatModelDocuments: " + e.Message );
            }
        }
    }
}
<?php
require_once(__DIR__ . '/vendor/autoload.php');


$api_instance = new Swagger\Client\ApiThreatModelSubResourcesApi();
$body = {
  "summary" : "Create multiple documents at once",
  "value" : [ {
    "name" : "Architecture Document",
    "description" : "System architecture documentation",
    "metadata" : [ {
      "key" : "type",
      "value" : "architecture"
    }, {
      "key" : "version",
      "value" : "2.1"
    } ],
    "uri" : "https://docs.company.com/architecture.pdf"
  }, {
    "name" : "Security Requirements",
    "description" : "Security requirements and compliance standards",
    "metadata" : [ {
      "key" : "classification",
      "value" : "internal"
    }, {
      "key" : "department",
      "value" : "security"
    } ],
    "uri" : "https://docs.company.com/security.pdf"
  } ]
}; // array[Document] | 
$threatModelId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // UUID | Unique identifier of the threat model (UUID)

try {
    $result = $api_instance->bulkUpsertThreatModelDocuments($body, $threatModelId);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling ThreatModelSubResourcesApi->bulkUpsertThreatModelDocuments: ', $e->getMessage(), PHP_EOL;
}
?>
use Data::Dumper;
use WWW::SwaggerClient::Configuration;
use WWW::SwaggerClient::ThreatModelSubResourcesApi;


my $api_instance = WWW::SwaggerClient::ThreatModelSubResourcesApi->new();
my $body = [WWW::SwaggerClient::Object::array[Document]->new()]; # array[Document] | 
my $threatModelId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; # UUID | Unique identifier of the threat model (UUID)

eval { 
    my $result = $api_instance->bulkUpsertThreatModelDocuments(body => $body, threatModelId => $threatModelId);
    print Dumper($result);
};
if ($@) {
    warn "Exception when calling ThreatModelSubResourcesApi->bulkUpsertThreatModelDocuments: $@\n";
}
from __future__ import print_statement
import time
import swagger_client
from swagger_client.rest import ApiException
from pprint import pprint


# create an instance of the API class
api_instance = swagger_client.ThreatModelSubResourcesApi()
body = {
  "summary" : "Create multiple documents at once",
  "value" : [ {
    "name" : "Architecture Document",
    "description" : "System architecture documentation",
    "metadata" : [ {
      "key" : "type",
      "value" : "architecture"
    }, {
      "key" : "version",
      "value" : "2.1"
    } ],
    "uri" : "https://docs.company.com/architecture.pdf"
  }, {
    "name" : "Security Requirements",
    "description" : "Security requirements and compliance standards",
    "metadata" : [ {
      "key" : "classification",
      "value" : "internal"
    }, {
      "key" : "department",
      "value" : "security"
    } ],
    "uri" : "https://docs.company.com/security.pdf"
  } ]
} # array[Document] | 
threatModelId = 38400000-8cf0-11bd-b23e-10b96e4ef00d # UUID | Unique identifier of the threat model (UUID)

try: 
    # Bulk upsert documents
    api_response = api_instance.bulk_upsert_threat_model_documents(body, threatModelId)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling ThreatModelSubResourcesApi->bulkUpsertThreatModelDocuments: %s\n" % e)

Parameters

Path parameters
Name Description
threat_model_id*
UUID (uuid)
Unique identifier of the threat model (UUID)
Required
Body parameters
Name Description
body *

Responses

Status: 201 - Documents created successfully

Status: 400 - Error response

Status: 401 - Error response

Status: 403 - Error response

Status: 404 - Error response

Status: 500 - Error response


bulkUpsertThreatModelMetadata

Bulk upsert threat model metadata

Creates or updates multiple metadata key-value pairs for the specified threat model


/threat_models/{threat_model_id}/metadata/bulk

Usage and SDK Samples

curl -X PUT\
 -H "Authorization: Bearer [[accessToken]]"\
-H "Accept: application/json"\
-H "Content-Type: application/json"\
"http://localhost:8080/threat_models/{threat_model_id}/metadata/bulk"
import io.swagger.client.*;
import io.swagger.client.auth.*;
import io.swagger.client.model.*;
import io.swagger.client.api.ThreatModelSubResourcesApi;

import java.io.File;
import java.util.*;

public class ThreatModelSubResourcesApiExample {

    public static void main(String[] args) {
        ApiClient defaultClient = Configuration.getDefaultApiClient();


        ThreatModelSubResourcesApi apiInstance = new ThreatModelSubResourcesApi();
        array[Metadata] body = ; // array[Metadata] | 
        UUID threatModelId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // UUID | Unique identifier of the threat model (UUID)
        try {
            array[Metadata] result = apiInstance.bulkUpsertThreatModelMetadata(body, threatModelId);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling ThreatModelSubResourcesApi#bulkUpsertThreatModelMetadata");
            e.printStackTrace();
        }
    }
}
import io.swagger.client.api.ThreatModelSubResourcesApi;

public class ThreatModelSubResourcesApiExample {

    public static void main(String[] args) {
        ThreatModelSubResourcesApi apiInstance = new ThreatModelSubResourcesApi();
        array[Metadata] body = ; // array[Metadata] | 
        UUID threatModelId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // UUID | Unique identifier of the threat model (UUID)
        try {
            array[Metadata] result = apiInstance.bulkUpsertThreatModelMetadata(body, threatModelId);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling ThreatModelSubResourcesApi#bulkUpsertThreatModelMetadata");
            e.printStackTrace();
        }
    }
}
Configuration *apiConfig = [Configuration sharedConfig];
array[Metadata] *body = ; // 
UUID *threatModelId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // Unique identifier of the threat model (UUID)

ThreatModelSubResourcesApi *apiInstance = [[ThreatModelSubResourcesApi alloc] init];

// Bulk upsert threat model metadata
[apiInstance bulkUpsertThreatModelMetadataWith:body
    threatModelId:threatModelId
              completionHandler: ^(array[Metadata] output, NSError* error) {
                            if (output) {
                                NSLog(@"%@", output);
                            }
                            if (error) {
                                NSLog(@"Error: %@", error);
                            }
                        }];
var TmiThreatModelingImprovedApi = require('tmi__threat_modeling_improved_api');
var defaultClient = TmiThreatModelingImprovedApi.ApiClient.instance;


var api = new TmiThreatModelingImprovedApi.ThreatModelSubResourcesApi()
var body = ; // {{array[Metadata]}} 
var threatModelId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // {{UUID}} Unique identifier of the threat model (UUID)

var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
};
api.bulkUpsertThreatModelMetadata(bodythreatModelId, callback);
using System;
using System.Diagnostics;
using IO.Swagger.Api;
using IO.Swagger.Client;
using IO.Swagger.Model;

namespace Example
{
    public class bulkUpsertThreatModelMetadataExample
    {
        public void main()
        {


            var apiInstance = new ThreatModelSubResourcesApi();
            var body = new array[Metadata](); // array[Metadata] | 
            var threatModelId = new UUID(); // UUID | Unique identifier of the threat model (UUID)

            try
            {
                // Bulk upsert threat model metadata
                array[Metadata] result = apiInstance.bulkUpsertThreatModelMetadata(body, threatModelId);
                Debug.WriteLine(result);
            }
            catch (Exception e)
            {
                Debug.Print("Exception when calling ThreatModelSubResourcesApi.bulkUpsertThreatModelMetadata: " + e.Message );
            }
        }
    }
}
<?php
require_once(__DIR__ . '/vendor/autoload.php');


$api_instance = new Swagger\Client\ApiThreatModelSubResourcesApi();
$body = ; // array[Metadata] | 
$threatModelId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // UUID | Unique identifier of the threat model (UUID)

try {
    $result = $api_instance->bulkUpsertThreatModelMetadata($body, $threatModelId);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling ThreatModelSubResourcesApi->bulkUpsertThreatModelMetadata: ', $e->getMessage(), PHP_EOL;
}
?>
use Data::Dumper;
use WWW::SwaggerClient::Configuration;
use WWW::SwaggerClient::ThreatModelSubResourcesApi;


my $api_instance = WWW::SwaggerClient::ThreatModelSubResourcesApi->new();
my $body = [WWW::SwaggerClient::Object::array[Metadata]->new()]; # array[Metadata] | 
my $threatModelId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; # UUID | Unique identifier of the threat model (UUID)

eval { 
    my $result = $api_instance->bulkUpsertThreatModelMetadata(body => $body, threatModelId => $threatModelId);
    print Dumper($result);
};
if ($@) {
    warn "Exception when calling ThreatModelSubResourcesApi->bulkUpsertThreatModelMetadata: $@\n";
}
from __future__ import print_statement
import time
import swagger_client
from swagger_client.rest import ApiException
from pprint import pprint


# create an instance of the API class
api_instance = swagger_client.ThreatModelSubResourcesApi()
body =  # array[Metadata] | 
threatModelId = 38400000-8cf0-11bd-b23e-10b96e4ef00d # UUID | Unique identifier of the threat model (UUID)

try: 
    # Bulk upsert threat model metadata
    api_response = api_instance.bulk_upsert_threat_model_metadata(body, threatModelId)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling ThreatModelSubResourcesApi->bulkUpsertThreatModelMetadata: %s\n" % e)

Parameters

Path parameters
Name Description
threat_model_id*
UUID (uuid)
Unique identifier of the threat model (UUID)
Required
Body parameters
Name Description
body *

Responses

Status: 200 - Metadata upserted successfully

Status: 400 - Error response

Status: 401 - Error response

Status: 403 - Error response

Status: 404 - Error response

Status: 500 - Error response


bulkUpsertThreatModelRepositories

Bulk upsert repositories

Create or update multiple repositories in a single request


/threat_models/{threat_model_id}/repositories/bulk

Usage and SDK Samples

curl -X PUT\
 -H "Authorization: Bearer [[accessToken]]"\
-H "Accept: application/json"\
-H "Content-Type: application/json"\
"http://localhost:8080/threat_models/{threat_model_id}/repositories/bulk"
import io.swagger.client.*;
import io.swagger.client.auth.*;
import io.swagger.client.model.*;
import io.swagger.client.api.ThreatModelSubResourcesApi;

import java.io.File;
import java.util.*;

public class ThreatModelSubResourcesApiExample {

    public static void main(String[] args) {
        ApiClient defaultClient = Configuration.getDefaultApiClient();


        ThreatModelSubResourcesApi apiInstance = new ThreatModelSubResourcesApi();
        array[Repository] body = {
  "summary" : "Create multiple source references at once",
  "value" : [ {
    "name" : "User Authentication Module",
    "description" : "Core user authentication logic",
    "metadata" : [ {
      "key" : "language",
      "value" : "go"
    }, {
      "key" : "maintainer",
      "value" : "security-team"
    } ],
    "uri" : "https://github.com/company/repo/blob/main/oauth2/user.go"
  }, {
    "name" : "Database Connection Pool",
    "description" : "Database connection management",
    "metadata" : [ {
      "key" : "type",
      "value" : "infrastructure"
    }, {
      "key" : "criticality",
      "value" : "high"
    } ],
    "uri" : "https://github.com/company/repo/blob/main/db/pool.go"
  } ]
}; // array[Repository] | 
        UUID threatModelId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // UUID | Unique identifier of the threat model (UUID)
        try {
            array[Repository] result = apiInstance.bulkUpsertThreatModelRepositories(body, threatModelId);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling ThreatModelSubResourcesApi#bulkUpsertThreatModelRepositories");
            e.printStackTrace();
        }
    }
}
import io.swagger.client.api.ThreatModelSubResourcesApi;

public class ThreatModelSubResourcesApiExample {

    public static void main(String[] args) {
        ThreatModelSubResourcesApi apiInstance = new ThreatModelSubResourcesApi();
        array[Repository] body = {
  "summary" : "Create multiple source references at once",
  "value" : [ {
    "name" : "User Authentication Module",
    "description" : "Core user authentication logic",
    "metadata" : [ {
      "key" : "language",
      "value" : "go"
    }, {
      "key" : "maintainer",
      "value" : "security-team"
    } ],
    "uri" : "https://github.com/company/repo/blob/main/oauth2/user.go"
  }, {
    "name" : "Database Connection Pool",
    "description" : "Database connection management",
    "metadata" : [ {
      "key" : "type",
      "value" : "infrastructure"
    }, {
      "key" : "criticality",
      "value" : "high"
    } ],
    "uri" : "https://github.com/company/repo/blob/main/db/pool.go"
  } ]
}; // array[Repository] | 
        UUID threatModelId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // UUID | Unique identifier of the threat model (UUID)
        try {
            array[Repository] result = apiInstance.bulkUpsertThreatModelRepositories(body, threatModelId);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling ThreatModelSubResourcesApi#bulkUpsertThreatModelRepositories");
            e.printStackTrace();
        }
    }
}
Configuration *apiConfig = [Configuration sharedConfig];
array[Repository] *body = {
  "summary" : "Create multiple source references at once",
  "value" : [ {
    "name" : "User Authentication Module",
    "description" : "Core user authentication logic",
    "metadata" : [ {
      "key" : "language",
      "value" : "go"
    }, {
      "key" : "maintainer",
      "value" : "security-team"
    } ],
    "uri" : "https://github.com/company/repo/blob/main/oauth2/user.go"
  }, {
    "name" : "Database Connection Pool",
    "description" : "Database connection management",
    "metadata" : [ {
      "key" : "type",
      "value" : "infrastructure"
    }, {
      "key" : "criticality",
      "value" : "high"
    } ],
    "uri" : "https://github.com/company/repo/blob/main/db/pool.go"
  } ]
}; // 
UUID *threatModelId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // Unique identifier of the threat model (UUID)

ThreatModelSubResourcesApi *apiInstance = [[ThreatModelSubResourcesApi alloc] init];

// Bulk upsert repositories
[apiInstance bulkUpsertThreatModelRepositoriesWith:body
    threatModelId:threatModelId
              completionHandler: ^(array[Repository] output, NSError* error) {
                            if (output) {
                                NSLog(@"%@", output);
                            }
                            if (error) {
                                NSLog(@"Error: %@", error);
                            }
                        }];
var TmiThreatModelingImprovedApi = require('tmi__threat_modeling_improved_api');
var defaultClient = TmiThreatModelingImprovedApi.ApiClient.instance;


var api = new TmiThreatModelingImprovedApi.ThreatModelSubResourcesApi()
var body = {
  "summary" : "Create multiple source references at once",
  "value" : [ {
    "name" : "User Authentication Module",
    "description" : "Core user authentication logic",
    "metadata" : [ {
      "key" : "language",
      "value" : "go"
    }, {
      "key" : "maintainer",
      "value" : "security-team"
    } ],
    "uri" : "https://github.com/company/repo/blob/main/oauth2/user.go"
  }, {
    "name" : "Database Connection Pool",
    "description" : "Database connection management",
    "metadata" : [ {
      "key" : "type",
      "value" : "infrastructure"
    }, {
      "key" : "criticality",
      "value" : "high"
    } ],
    "uri" : "https://github.com/company/repo/blob/main/db/pool.go"
  } ]
}; // {{array[Repository]}} 
var threatModelId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // {{UUID}} Unique identifier of the threat model (UUID)

var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
};
api.bulkUpsertThreatModelRepositories(bodythreatModelId, callback);
using System;
using System.Diagnostics;
using IO.Swagger.Api;
using IO.Swagger.Client;
using IO.Swagger.Model;

namespace Example
{
    public class bulkUpsertThreatModelRepositoriesExample
    {
        public void main()
        {


            var apiInstance = new ThreatModelSubResourcesApi();
            var body = new array[Repository](); // array[Repository] | 
            var threatModelId = new UUID(); // UUID | Unique identifier of the threat model (UUID)

            try
            {
                // Bulk upsert repositories
                array[Repository] result = apiInstance.bulkUpsertThreatModelRepositories(body, threatModelId);
                Debug.WriteLine(result);
            }
            catch (Exception e)
            {
                Debug.Print("Exception when calling ThreatModelSubResourcesApi.bulkUpsertThreatModelRepositories: " + e.Message );
            }
        }
    }
}
<?php
require_once(__DIR__ . '/vendor/autoload.php');


$api_instance = new Swagger\Client\ApiThreatModelSubResourcesApi();
$body = {
  "summary" : "Create multiple source references at once",
  "value" : [ {
    "name" : "User Authentication Module",
    "description" : "Core user authentication logic",
    "metadata" : [ {
      "key" : "language",
      "value" : "go"
    }, {
      "key" : "maintainer",
      "value" : "security-team"
    } ],
    "uri" : "https://github.com/company/repo/blob/main/oauth2/user.go"
  }, {
    "name" : "Database Connection Pool",
    "description" : "Database connection management",
    "metadata" : [ {
      "key" : "type",
      "value" : "infrastructure"
    }, {
      "key" : "criticality",
      "value" : "high"
    } ],
    "uri" : "https://github.com/company/repo/blob/main/db/pool.go"
  } ]
}; // array[Repository] | 
$threatModelId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // UUID | Unique identifier of the threat model (UUID)

try {
    $result = $api_instance->bulkUpsertThreatModelRepositories($body, $threatModelId);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling ThreatModelSubResourcesApi->bulkUpsertThreatModelRepositories: ', $e->getMessage(), PHP_EOL;
}
?>
use Data::Dumper;
use WWW::SwaggerClient::Configuration;
use WWW::SwaggerClient::ThreatModelSubResourcesApi;


my $api_instance = WWW::SwaggerClient::ThreatModelSubResourcesApi->new();
my $body = [WWW::SwaggerClient::Object::array[Repository]->new()]; # array[Repository] | 
my $threatModelId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; # UUID | Unique identifier of the threat model (UUID)

eval { 
    my $result = $api_instance->bulkUpsertThreatModelRepositories(body => $body, threatModelId => $threatModelId);
    print Dumper($result);
};
if ($@) {
    warn "Exception when calling ThreatModelSubResourcesApi->bulkUpsertThreatModelRepositories: $@\n";
}
from __future__ import print_statement
import time
import swagger_client
from swagger_client.rest import ApiException
from pprint import pprint


# create an instance of the API class
api_instance = swagger_client.ThreatModelSubResourcesApi()
body = {
  "summary" : "Create multiple source references at once",
  "value" : [ {
    "name" : "User Authentication Module",
    "description" : "Core user authentication logic",
    "metadata" : [ {
      "key" : "language",
      "value" : "go"
    }, {
      "key" : "maintainer",
      "value" : "security-team"
    } ],
    "uri" : "https://github.com/company/repo/blob/main/oauth2/user.go"
  }, {
    "name" : "Database Connection Pool",
    "description" : "Database connection management",
    "metadata" : [ {
      "key" : "type",
      "value" : "infrastructure"
    }, {
      "key" : "criticality",
      "value" : "high"
    } ],
    "uri" : "https://github.com/company/repo/blob/main/db/pool.go"
  } ]
} # array[Repository] | 
threatModelId = 38400000-8cf0-11bd-b23e-10b96e4ef00d # UUID | Unique identifier of the threat model (UUID)

try: 
    # Bulk upsert repositories
    api_response = api_instance.bulk_upsert_threat_model_repositories(body, threatModelId)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling ThreatModelSubResourcesApi->bulkUpsertThreatModelRepositories: %s\n" % e)

Parameters

Path parameters
Name Description
threat_model_id*
UUID (uuid)
Unique identifier of the threat model (UUID)
Required
Body parameters
Name Description
body *

Responses

Status: 201 - Sources created successfully

Status: 400 - Error response

Status: 401 - Error response

Status: 403 - Error response

Status: 404 - Error response

Status: 500 - Error response


createDiagramMetadata

Create diagram metadata

Creates a new metadata entry for the specified diagram


/threat_models/{threat_model_id}/diagrams/{diagram_id}/metadata

Usage and SDK Samples

curl -X POST\
 -H "Authorization: Bearer [[accessToken]]"\
-H "Accept: application/json"\
-H "Content-Type: application/json"\
"http://localhost:8080/threat_models/{threat_model_id}/diagrams/{diagram_id}/metadata"
import io.swagger.client.*;
import io.swagger.client.auth.*;
import io.swagger.client.model.*;
import io.swagger.client.api.ThreatModelSubResourcesApi;

import java.io.File;
import java.util.*;

public class ThreatModelSubResourcesApiExample {

    public static void main(String[] args) {
        ApiClient defaultClient = Configuration.getDefaultApiClient();


        ThreatModelSubResourcesApi apiInstance = new ThreatModelSubResourcesApi();
        Metadata body = ; // Metadata | 
        UUID threatModelId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // UUID | Unique identifier of the threat model (UUID)
        UUID diagramId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // UUID | Unique identifier of the diagram (UUID)
        try {
            Metadata result = apiInstance.createDiagramMetadata(body, threatModelId, diagramId);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling ThreatModelSubResourcesApi#createDiagramMetadata");
            e.printStackTrace();
        }
    }
}
import io.swagger.client.api.ThreatModelSubResourcesApi;

public class ThreatModelSubResourcesApiExample {

    public static void main(String[] args) {
        ThreatModelSubResourcesApi apiInstance = new ThreatModelSubResourcesApi();
        Metadata body = ; // Metadata | 
        UUID threatModelId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // UUID | Unique identifier of the threat model (UUID)
        UUID diagramId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // UUID | Unique identifier of the diagram (UUID)
        try {
            Metadata result = apiInstance.createDiagramMetadata(body, threatModelId, diagramId);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling ThreatModelSubResourcesApi#createDiagramMetadata");
            e.printStackTrace();
        }
    }
}
Configuration *apiConfig = [Configuration sharedConfig];
Metadata *body = ; // 
UUID *threatModelId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // Unique identifier of the threat model (UUID)
UUID *diagramId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // Unique identifier of the diagram (UUID)

ThreatModelSubResourcesApi *apiInstance = [[ThreatModelSubResourcesApi alloc] init];

// Create diagram metadata
[apiInstance createDiagramMetadataWith:body
    threatModelId:threatModelId
    diagramId:diagramId
              completionHandler: ^(Metadata output, NSError* error) {
                            if (output) {
                                NSLog(@"%@", output);
                            }
                            if (error) {
                                NSLog(@"Error: %@", error);
                            }
                        }];
var TmiThreatModelingImprovedApi = require('tmi__threat_modeling_improved_api');
var defaultClient = TmiThreatModelingImprovedApi.ApiClient.instance;


var api = new TmiThreatModelingImprovedApi.ThreatModelSubResourcesApi()
var body = ; // {{Metadata}} 
var threatModelId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // {{UUID}} Unique identifier of the threat model (UUID)
var diagramId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // {{UUID}} Unique identifier of the diagram (UUID)

var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
};
api.createDiagramMetadata(bodythreatModelIddiagramId, callback);
using System;
using System.Diagnostics;
using IO.Swagger.Api;
using IO.Swagger.Client;
using IO.Swagger.Model;

namespace Example
{
    public class createDiagramMetadataExample
    {
        public void main()
        {


            var apiInstance = new ThreatModelSubResourcesApi();
            var body = new Metadata(); // Metadata | 
            var threatModelId = new UUID(); // UUID | Unique identifier of the threat model (UUID)
            var diagramId = new UUID(); // UUID | Unique identifier of the diagram (UUID)

            try
            {
                // Create diagram metadata
                Metadata result = apiInstance.createDiagramMetadata(body, threatModelId, diagramId);
                Debug.WriteLine(result);
            }
            catch (Exception e)
            {
                Debug.Print("Exception when calling ThreatModelSubResourcesApi.createDiagramMetadata: " + e.Message );
            }
        }
    }
}
<?php
require_once(__DIR__ . '/vendor/autoload.php');


$api_instance = new Swagger\Client\ApiThreatModelSubResourcesApi();
$body = ; // Metadata | 
$threatModelId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // UUID | Unique identifier of the threat model (UUID)
$diagramId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // UUID | Unique identifier of the diagram (UUID)

try {
    $result = $api_instance->createDiagramMetadata($body, $threatModelId, $diagramId);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling ThreatModelSubResourcesApi->createDiagramMetadata: ', $e->getMessage(), PHP_EOL;
}
?>
use Data::Dumper;
use WWW::SwaggerClient::Configuration;
use WWW::SwaggerClient::ThreatModelSubResourcesApi;


my $api_instance = WWW::SwaggerClient::ThreatModelSubResourcesApi->new();
my $body = WWW::SwaggerClient::Object::Metadata->new(); # Metadata | 
my $threatModelId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; # UUID | Unique identifier of the threat model (UUID)
my $diagramId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; # UUID | Unique identifier of the diagram (UUID)

eval { 
    my $result = $api_instance->createDiagramMetadata(body => $body, threatModelId => $threatModelId, diagramId => $diagramId);
    print Dumper($result);
};
if ($@) {
    warn "Exception when calling ThreatModelSubResourcesApi->createDiagramMetadata: $@\n";
}
from __future__ import print_statement
import time
import swagger_client
from swagger_client.rest import ApiException
from pprint import pprint


# create an instance of the API class
api_instance = swagger_client.ThreatModelSubResourcesApi()
body =  # Metadata | 
threatModelId = 38400000-8cf0-11bd-b23e-10b96e4ef00d # UUID | Unique identifier of the threat model (UUID)
diagramId = 38400000-8cf0-11bd-b23e-10b96e4ef00d # UUID | Unique identifier of the diagram (UUID)

try: 
    # Create diagram metadata
    api_response = api_instance.create_diagram_metadata(body, threatModelId, diagramId)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling ThreatModelSubResourcesApi->createDiagramMetadata: %s\n" % e)

Parameters

Path parameters
Name Description
threat_model_id*
UUID (uuid)
Unique identifier of the threat model (UUID)
Required
diagram_id*
UUID (uuid)
Unique identifier of the diagram (UUID)
Required
Body parameters
Name Description
body *

Responses

Status: 201 - Metadata entry created successfully

Status: 400 - Error response

Status: 401 - Error response

Status: 403 - Error response

Status: 404 - Error response

Status: 500 - Error response


createDocumentMetadata

Create document metadata

Creates new metadata entry for the specified document


/threat_models/{threat_model_id}/documents/{document_id}/metadata

Usage and SDK Samples

curl -X POST\
 -H "Authorization: Bearer [[accessToken]]"\
-H "Accept: application/json"\
-H "Content-Type: application/json"\
"http://localhost:8080/threat_models/{threat_model_id}/documents/{document_id}/metadata"
import io.swagger.client.*;
import io.swagger.client.auth.*;
import io.swagger.client.model.*;
import io.swagger.client.api.ThreatModelSubResourcesApi;

import java.io.File;
import java.util.*;

public class ThreatModelSubResourcesApiExample {

    public static void main(String[] args) {
        ApiClient defaultClient = Configuration.getDefaultApiClient();


        ThreatModelSubResourcesApi apiInstance = new ThreatModelSubResourcesApi();
        Metadata body = ; // Metadata | 
        UUID threatModelId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // UUID | Unique identifier of the threat model (UUID)
        UUID documentId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // UUID | Unique identifier of the document (UUID)
        try {
            Metadata result = apiInstance.createDocumentMetadata(body, threatModelId, documentId);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling ThreatModelSubResourcesApi#createDocumentMetadata");
            e.printStackTrace();
        }
    }
}
import io.swagger.client.api.ThreatModelSubResourcesApi;

public class ThreatModelSubResourcesApiExample {

    public static void main(String[] args) {
        ThreatModelSubResourcesApi apiInstance = new ThreatModelSubResourcesApi();
        Metadata body = ; // Metadata | 
        UUID threatModelId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // UUID | Unique identifier of the threat model (UUID)
        UUID documentId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // UUID | Unique identifier of the document (UUID)
        try {
            Metadata result = apiInstance.createDocumentMetadata(body, threatModelId, documentId);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling ThreatModelSubResourcesApi#createDocumentMetadata");
            e.printStackTrace();
        }
    }
}
Configuration *apiConfig = [Configuration sharedConfig];
Metadata *body = ; // 
UUID *threatModelId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // Unique identifier of the threat model (UUID)
UUID *documentId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // Unique identifier of the document (UUID)

ThreatModelSubResourcesApi *apiInstance = [[ThreatModelSubResourcesApi alloc] init];

// Create document metadata
[apiInstance createDocumentMetadataWith:body
    threatModelId:threatModelId
    documentId:documentId
              completionHandler: ^(Metadata output, NSError* error) {
                            if (output) {
                                NSLog(@"%@", output);
                            }
                            if (error) {
                                NSLog(@"Error: %@", error);
                            }
                        }];
var TmiThreatModelingImprovedApi = require('tmi__threat_modeling_improved_api');
var defaultClient = TmiThreatModelingImprovedApi.ApiClient.instance;


var api = new TmiThreatModelingImprovedApi.ThreatModelSubResourcesApi()
var body = ; // {{Metadata}} 
var threatModelId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // {{UUID}} Unique identifier of the threat model (UUID)
var documentId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // {{UUID}} Unique identifier of the document (UUID)

var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
};
api.createDocumentMetadata(bodythreatModelIddocumentId, callback);
using System;
using System.Diagnostics;
using IO.Swagger.Api;
using IO.Swagger.Client;
using IO.Swagger.Model;

namespace Example
{
    public class createDocumentMetadataExample
    {
        public void main()
        {


            var apiInstance = new ThreatModelSubResourcesApi();
            var body = new Metadata(); // Metadata | 
            var threatModelId = new UUID(); // UUID | Unique identifier of the threat model (UUID)
            var documentId = new UUID(); // UUID | Unique identifier of the document (UUID)

            try
            {
                // Create document metadata
                Metadata result = apiInstance.createDocumentMetadata(body, threatModelId, documentId);
                Debug.WriteLine(result);
            }
            catch (Exception e)
            {
                Debug.Print("Exception when calling ThreatModelSubResourcesApi.createDocumentMetadata: " + e.Message );
            }
        }
    }
}
<?php
require_once(__DIR__ . '/vendor/autoload.php');


$api_instance = new Swagger\Client\ApiThreatModelSubResourcesApi();
$body = ; // Metadata | 
$threatModelId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // UUID | Unique identifier of the threat model (UUID)
$documentId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // UUID | Unique identifier of the document (UUID)

try {
    $result = $api_instance->createDocumentMetadata($body, $threatModelId, $documentId);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling ThreatModelSubResourcesApi->createDocumentMetadata: ', $e->getMessage(), PHP_EOL;
}
?>
use Data::Dumper;
use WWW::SwaggerClient::Configuration;
use WWW::SwaggerClient::ThreatModelSubResourcesApi;


my $api_instance = WWW::SwaggerClient::ThreatModelSubResourcesApi->new();
my $body = WWW::SwaggerClient::Object::Metadata->new(); # Metadata | 
my $threatModelId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; # UUID | Unique identifier of the threat model (UUID)
my $documentId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; # UUID | Unique identifier of the document (UUID)

eval { 
    my $result = $api_instance->createDocumentMetadata(body => $body, threatModelId => $threatModelId, documentId => $documentId);
    print Dumper($result);
};
if ($@) {
    warn "Exception when calling ThreatModelSubResourcesApi->createDocumentMetadata: $@\n";
}
from __future__ import print_statement
import time
import swagger_client
from swagger_client.rest import ApiException
from pprint import pprint


# create an instance of the API class
api_instance = swagger_client.ThreatModelSubResourcesApi()
body =  # Metadata | 
threatModelId = 38400000-8cf0-11bd-b23e-10b96e4ef00d # UUID | Unique identifier of the threat model (UUID)
documentId = 38400000-8cf0-11bd-b23e-10b96e4ef00d # UUID | Unique identifier of the document (UUID)

try: 
    # Create document metadata
    api_response = api_instance.create_document_metadata(body, threatModelId, documentId)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling ThreatModelSubResourcesApi->createDocumentMetadata: %s\n" % e)

Parameters

Path parameters
Name Description
threat_model_id*
UUID (uuid)
Unique identifier of the threat model (UUID)
Required
document_id*
UUID (uuid)
Unique identifier of the document (UUID)
Required
Body parameters
Name Description
body *

Responses

Status: 201 - Metadata entry created successfully

Status: 400 - Error response

Status: 401 - Error response

Status: 403 - Error response

Status: 404 - Error response

Status: 500 - Error response


createNoteMetadata

Create note metadata

Creates new metadata entry for the specified note


/threat_models/{threat_model_id}/notes/{note_id}/metadata

Usage and SDK Samples

curl -X POST\
 -H "Authorization: Bearer [[accessToken]]"\
-H "Accept: application/json"\
-H "Content-Type: application/json"\
"http://localhost:8080/threat_models/{threat_model_id}/notes/{note_id}/metadata"
import io.swagger.client.*;
import io.swagger.client.auth.*;
import io.swagger.client.model.*;
import io.swagger.client.api.ThreatModelSubResourcesApi;

import java.io.File;
import java.util.*;

public class ThreatModelSubResourcesApiExample {

    public static void main(String[] args) {
        ApiClient defaultClient = Configuration.getDefaultApiClient();


        ThreatModelSubResourcesApi apiInstance = new ThreatModelSubResourcesApi();
        Metadata body = ; // Metadata | 
        UUID threatModelId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // UUID | Unique identifier of the threat model (UUID)
        UUID noteId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // UUID | Unique identifier of the note (UUID)
        try {
            Metadata result = apiInstance.createNoteMetadata(body, threatModelId, noteId);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling ThreatModelSubResourcesApi#createNoteMetadata");
            e.printStackTrace();
        }
    }
}
import io.swagger.client.api.ThreatModelSubResourcesApi;

public class ThreatModelSubResourcesApiExample {

    public static void main(String[] args) {
        ThreatModelSubResourcesApi apiInstance = new ThreatModelSubResourcesApi();
        Metadata body = ; // Metadata | 
        UUID threatModelId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // UUID | Unique identifier of the threat model (UUID)
        UUID noteId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // UUID | Unique identifier of the note (UUID)
        try {
            Metadata result = apiInstance.createNoteMetadata(body, threatModelId, noteId);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling ThreatModelSubResourcesApi#createNoteMetadata");
            e.printStackTrace();
        }
    }
}
Configuration *apiConfig = [Configuration sharedConfig];
Metadata *body = ; // 
UUID *threatModelId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // Unique identifier of the threat model (UUID)
UUID *noteId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // Unique identifier of the note (UUID)

ThreatModelSubResourcesApi *apiInstance = [[ThreatModelSubResourcesApi alloc] init];

// Create note metadata
[apiInstance createNoteMetadataWith:body
    threatModelId:threatModelId
    noteId:noteId
              completionHandler: ^(Metadata output, NSError* error) {
                            if (output) {
                                NSLog(@"%@", output);
                            }
                            if (error) {
                                NSLog(@"Error: %@", error);
                            }
                        }];
var TmiThreatModelingImprovedApi = require('tmi__threat_modeling_improved_api');
var defaultClient = TmiThreatModelingImprovedApi.ApiClient.instance;


var api = new TmiThreatModelingImprovedApi.ThreatModelSubResourcesApi()
var body = ; // {{Metadata}} 
var threatModelId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // {{UUID}} Unique identifier of the threat model (UUID)
var noteId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // {{UUID}} Unique identifier of the note (UUID)

var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
};
api.createNoteMetadata(bodythreatModelIdnoteId, callback);
using System;
using System.Diagnostics;
using IO.Swagger.Api;
using IO.Swagger.Client;
using IO.Swagger.Model;

namespace Example
{
    public class createNoteMetadataExample
    {
        public void main()
        {


            var apiInstance = new ThreatModelSubResourcesApi();
            var body = new Metadata(); // Metadata | 
            var threatModelId = new UUID(); // UUID | Unique identifier of the threat model (UUID)
            var noteId = new UUID(); // UUID | Unique identifier of the note (UUID)

            try
            {
                // Create note metadata
                Metadata result = apiInstance.createNoteMetadata(body, threatModelId, noteId);
                Debug.WriteLine(result);
            }
            catch (Exception e)
            {
                Debug.Print("Exception when calling ThreatModelSubResourcesApi.createNoteMetadata: " + e.Message );
            }
        }
    }
}
<?php
require_once(__DIR__ . '/vendor/autoload.php');


$api_instance = new Swagger\Client\ApiThreatModelSubResourcesApi();
$body = ; // Metadata | 
$threatModelId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // UUID | Unique identifier of the threat model (UUID)
$noteId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // UUID | Unique identifier of the note (UUID)

try {
    $result = $api_instance->createNoteMetadata($body, $threatModelId, $noteId);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling ThreatModelSubResourcesApi->createNoteMetadata: ', $e->getMessage(), PHP_EOL;
}
?>
use Data::Dumper;
use WWW::SwaggerClient::Configuration;
use WWW::SwaggerClient::ThreatModelSubResourcesApi;


my $api_instance = WWW::SwaggerClient::ThreatModelSubResourcesApi->new();
my $body = WWW::SwaggerClient::Object::Metadata->new(); # Metadata | 
my $threatModelId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; # UUID | Unique identifier of the threat model (UUID)
my $noteId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; # UUID | Unique identifier of the note (UUID)

eval { 
    my $result = $api_instance->createNoteMetadata(body => $body, threatModelId => $threatModelId, noteId => $noteId);
    print Dumper($result);
};
if ($@) {
    warn "Exception when calling ThreatModelSubResourcesApi->createNoteMetadata: $@\n";
}
from __future__ import print_statement
import time
import swagger_client
from swagger_client.rest import ApiException
from pprint import pprint


# create an instance of the API class
api_instance = swagger_client.ThreatModelSubResourcesApi()
body =  # Metadata | 
threatModelId = 38400000-8cf0-11bd-b23e-10b96e4ef00d # UUID | Unique identifier of the threat model (UUID)
noteId = 38400000-8cf0-11bd-b23e-10b96e4ef00d # UUID | Unique identifier of the note (UUID)

try: 
    # Create note metadata
    api_response = api_instance.create_note_metadata(body, threatModelId, noteId)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling ThreatModelSubResourcesApi->createNoteMetadata: %s\n" % e)

Parameters

Path parameters
Name Description
threat_model_id*
UUID (uuid)
Unique identifier of the threat model (UUID)
Required
note_id*
UUID (uuid)
Unique identifier of the note (UUID)
Required
Body parameters
Name Description
body *

Responses

Status: 201 - Metadata entry created successfully

Status: 400 - Error response

Status: 401 - Error response

Status: 403 - Error response

Status: 404 - Error response

Status: 500 - Error response


createRepositoryMetadata

Create source metadata

Creates new metadata entry for the specified source reference


/threat_models/{threat_model_id}/repositories/{repository_id}/metadata

Usage and SDK Samples

curl -X POST\
 -H "Authorization: Bearer [[accessToken]]"\
-H "Accept: application/json"\
-H "Content-Type: application/json"\
"http://localhost:8080/threat_models/{threat_model_id}/repositories/{repository_id}/metadata"
import io.swagger.client.*;
import io.swagger.client.auth.*;
import io.swagger.client.model.*;
import io.swagger.client.api.ThreatModelSubResourcesApi;

import java.io.File;
import java.util.*;

public class ThreatModelSubResourcesApiExample {

    public static void main(String[] args) {
        ApiClient defaultClient = Configuration.getDefaultApiClient();


        ThreatModelSubResourcesApi apiInstance = new ThreatModelSubResourcesApi();
        Metadata body = ; // Metadata | 
        UUID threatModelId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // UUID | Unique identifier of the threat model (UUID)
        UUID repositoryId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // UUID | Unique identifier of the source reference (UUID)
        try {
            Metadata result = apiInstance.createRepositoryMetadata(body, threatModelId, repositoryId);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling ThreatModelSubResourcesApi#createRepositoryMetadata");
            e.printStackTrace();
        }
    }
}
import io.swagger.client.api.ThreatModelSubResourcesApi;

public class ThreatModelSubResourcesApiExample {

    public static void main(String[] args) {
        ThreatModelSubResourcesApi apiInstance = new ThreatModelSubResourcesApi();
        Metadata body = ; // Metadata | 
        UUID threatModelId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // UUID | Unique identifier of the threat model (UUID)
        UUID repositoryId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // UUID | Unique identifier of the source reference (UUID)
        try {
            Metadata result = apiInstance.createRepositoryMetadata(body, threatModelId, repositoryId);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling ThreatModelSubResourcesApi#createRepositoryMetadata");
            e.printStackTrace();
        }
    }
}
Configuration *apiConfig = [Configuration sharedConfig];
Metadata *body = ; // 
UUID *threatModelId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // Unique identifier of the threat model (UUID)
UUID *repositoryId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // Unique identifier of the source reference (UUID)

ThreatModelSubResourcesApi *apiInstance = [[ThreatModelSubResourcesApi alloc] init];

// Create source metadata
[apiInstance createRepositoryMetadataWith:body
    threatModelId:threatModelId
    repositoryId:repositoryId
              completionHandler: ^(Metadata output, NSError* error) {
                            if (output) {
                                NSLog(@"%@", output);
                            }
                            if (error) {
                                NSLog(@"Error: %@", error);
                            }
                        }];
var TmiThreatModelingImprovedApi = require('tmi__threat_modeling_improved_api');
var defaultClient = TmiThreatModelingImprovedApi.ApiClient.instance;


var api = new TmiThreatModelingImprovedApi.ThreatModelSubResourcesApi()
var body = ; // {{Metadata}} 
var threatModelId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // {{UUID}} Unique identifier of the threat model (UUID)
var repositoryId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // {{UUID}} Unique identifier of the source reference (UUID)

var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
};
api.createRepositoryMetadata(bodythreatModelIdrepositoryId, callback);
using System;
using System.Diagnostics;
using IO.Swagger.Api;
using IO.Swagger.Client;
using IO.Swagger.Model;

namespace Example
{
    public class createRepositoryMetadataExample
    {
        public void main()
        {


            var apiInstance = new ThreatModelSubResourcesApi();
            var body = new Metadata(); // Metadata | 
            var threatModelId = new UUID(); // UUID | Unique identifier of the threat model (UUID)
            var repositoryId = new UUID(); // UUID | Unique identifier of the source reference (UUID)

            try
            {
                // Create source metadata
                Metadata result = apiInstance.createRepositoryMetadata(body, threatModelId, repositoryId);
                Debug.WriteLine(result);
            }
            catch (Exception e)
            {
                Debug.Print("Exception when calling ThreatModelSubResourcesApi.createRepositoryMetadata: " + e.Message );
            }
        }
    }
}
<?php
require_once(__DIR__ . '/vendor/autoload.php');


$api_instance = new Swagger\Client\ApiThreatModelSubResourcesApi();
$body = ; // Metadata | 
$threatModelId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // UUID | Unique identifier of the threat model (UUID)
$repositoryId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // UUID | Unique identifier of the source reference (UUID)

try {
    $result = $api_instance->createRepositoryMetadata($body, $threatModelId, $repositoryId);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling ThreatModelSubResourcesApi->createRepositoryMetadata: ', $e->getMessage(), PHP_EOL;
}
?>
use Data::Dumper;
use WWW::SwaggerClient::Configuration;
use WWW::SwaggerClient::ThreatModelSubResourcesApi;


my $api_instance = WWW::SwaggerClient::ThreatModelSubResourcesApi->new();
my $body = WWW::SwaggerClient::Object::Metadata->new(); # Metadata | 
my $threatModelId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; # UUID | Unique identifier of the threat model (UUID)
my $repositoryId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; # UUID | Unique identifier of the source reference (UUID)

eval { 
    my $result = $api_instance->createRepositoryMetadata(body => $body, threatModelId => $threatModelId, repositoryId => $repositoryId);
    print Dumper($result);
};
if ($@) {
    warn "Exception when calling ThreatModelSubResourcesApi->createRepositoryMetadata: $@\n";
}
from __future__ import print_statement
import time
import swagger_client
from swagger_client.rest import ApiException
from pprint import pprint


# create an instance of the API class
api_instance = swagger_client.ThreatModelSubResourcesApi()
body =  # Metadata | 
threatModelId = 38400000-8cf0-11bd-b23e-10b96e4ef00d # UUID | Unique identifier of the threat model (UUID)
repositoryId = 38400000-8cf0-11bd-b23e-10b96e4ef00d # UUID | Unique identifier of the source reference (UUID)

try: 
    # Create source metadata
    api_response = api_instance.create_repository_metadata(body, threatModelId, repositoryId)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling ThreatModelSubResourcesApi->createRepositoryMetadata: %s\n" % e)

Parameters

Path parameters
Name Description
threat_model_id*
UUID (uuid)
Unique identifier of the threat model (UUID)
Required
repository_id*
UUID (uuid)
Unique identifier of the source reference (UUID)
Required
Body parameters
Name Description
body *

Responses

Status: 201 - Metadata entry created successfully

Status: 400 - Error response

Status: 401 - Error response

Status: 403 - Error response

Status: 404 - Error response

Status: 500 - Error response


createThreatMetadata

Create threat metadata

Creates new metadata entry for the specified threat


/threat_models/{threat_model_id}/threats/{threat_id}/metadata

Usage and SDK Samples

curl -X POST\
 -H "Authorization: Bearer [[accessToken]]"\
-H "Accept: application/json"\
-H "Content-Type: application/json"\
"http://localhost:8080/threat_models/{threat_model_id}/threats/{threat_id}/metadata"
import io.swagger.client.*;
import io.swagger.client.auth.*;
import io.swagger.client.model.*;
import io.swagger.client.api.ThreatModelSubResourcesApi;

import java.io.File;
import java.util.*;

public class ThreatModelSubResourcesApiExample {

    public static void main(String[] args) {
        ApiClient defaultClient = Configuration.getDefaultApiClient();


        ThreatModelSubResourcesApi apiInstance = new ThreatModelSubResourcesApi();
        Metadata body = ; // Metadata | 
        UUID threatModelId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // UUID | Unique identifier of the threat model (UUID)
        UUID threatId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // UUID | Unique identifier of the threat (UUID)
        try {
            Metadata result = apiInstance.createThreatMetadata(body, threatModelId, threatId);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling ThreatModelSubResourcesApi#createThreatMetadata");
            e.printStackTrace();
        }
    }
}
import io.swagger.client.api.ThreatModelSubResourcesApi;

public class ThreatModelSubResourcesApiExample {

    public static void main(String[] args) {
        ThreatModelSubResourcesApi apiInstance = new ThreatModelSubResourcesApi();
        Metadata body = ; // Metadata | 
        UUID threatModelId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // UUID | Unique identifier of the threat model (UUID)
        UUID threatId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // UUID | Unique identifier of the threat (UUID)
        try {
            Metadata result = apiInstance.createThreatMetadata(body, threatModelId, threatId);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling ThreatModelSubResourcesApi#createThreatMetadata");
            e.printStackTrace();
        }
    }
}
Configuration *apiConfig = [Configuration sharedConfig];
Metadata *body = ; // 
UUID *threatModelId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // Unique identifier of the threat model (UUID)
UUID *threatId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // Unique identifier of the threat (UUID)

ThreatModelSubResourcesApi *apiInstance = [[ThreatModelSubResourcesApi alloc] init];

// Create threat metadata
[apiInstance createThreatMetadataWith:body
    threatModelId:threatModelId
    threatId:threatId
              completionHandler: ^(Metadata output, NSError* error) {
                            if (output) {
                                NSLog(@"%@", output);
                            }
                            if (error) {
                                NSLog(@"Error: %@", error);
                            }
                        }];
var TmiThreatModelingImprovedApi = require('tmi__threat_modeling_improved_api');
var defaultClient = TmiThreatModelingImprovedApi.ApiClient.instance;


var api = new TmiThreatModelingImprovedApi.ThreatModelSubResourcesApi()
var body = ; // {{Metadata}} 
var threatModelId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // {{UUID}} Unique identifier of the threat model (UUID)
var threatId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // {{UUID}} Unique identifier of the threat (UUID)

var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
};
api.createThreatMetadata(bodythreatModelIdthreatId, callback);
using System;
using System.Diagnostics;
using IO.Swagger.Api;
using IO.Swagger.Client;
using IO.Swagger.Model;

namespace Example
{
    public class createThreatMetadataExample
    {
        public void main()
        {


            var apiInstance = new ThreatModelSubResourcesApi();
            var body = new Metadata(); // Metadata | 
            var threatModelId = new UUID(); // UUID | Unique identifier of the threat model (UUID)
            var threatId = new UUID(); // UUID | Unique identifier of the threat (UUID)

            try
            {
                // Create threat metadata
                Metadata result = apiInstance.createThreatMetadata(body, threatModelId, threatId);
                Debug.WriteLine(result);
            }
            catch (Exception e)
            {
                Debug.Print("Exception when calling ThreatModelSubResourcesApi.createThreatMetadata: " + e.Message );
            }
        }
    }
}
<?php
require_once(__DIR__ . '/vendor/autoload.php');


$api_instance = new Swagger\Client\ApiThreatModelSubResourcesApi();
$body = ; // Metadata | 
$threatModelId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // UUID | Unique identifier of the threat model (UUID)
$threatId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // UUID | Unique identifier of the threat (UUID)

try {
    $result = $api_instance->createThreatMetadata($body, $threatModelId, $threatId);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling ThreatModelSubResourcesApi->createThreatMetadata: ', $e->getMessage(), PHP_EOL;
}
?>
use Data::Dumper;
use WWW::SwaggerClient::Configuration;
use WWW::SwaggerClient::ThreatModelSubResourcesApi;


my $api_instance = WWW::SwaggerClient::ThreatModelSubResourcesApi->new();
my $body = WWW::SwaggerClient::Object::Metadata->new(); # Metadata | 
my $threatModelId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; # UUID | Unique identifier of the threat model (UUID)
my $threatId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; # UUID | Unique identifier of the threat (UUID)

eval { 
    my $result = $api_instance->createThreatMetadata(body => $body, threatModelId => $threatModelId, threatId => $threatId);
    print Dumper($result);
};
if ($@) {
    warn "Exception when calling ThreatModelSubResourcesApi->createThreatMetadata: $@\n";
}
from __future__ import print_statement
import time
import swagger_client
from swagger_client.rest import ApiException
from pprint import pprint


# create an instance of the API class
api_instance = swagger_client.ThreatModelSubResourcesApi()
body =  # Metadata | 
threatModelId = 38400000-8cf0-11bd-b23e-10b96e4ef00d # UUID | Unique identifier of the threat model (UUID)
threatId = 38400000-8cf0-11bd-b23e-10b96e4ef00d # UUID | Unique identifier of the threat (UUID)

try: 
    # Create threat metadata
    api_response = api_instance.create_threat_metadata(body, threatModelId, threatId)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling ThreatModelSubResourcesApi->createThreatMetadata: %s\n" % e)

Parameters

Path parameters
Name Description
threat_model_id*
UUID (uuid)
Unique identifier of the threat model (UUID)
Required
threat_id*
UUID (uuid)
Unique identifier of the threat (UUID)
Required
Body parameters
Name Description
body *

Responses

Status: 201 - Metadata entry created successfully

Status: 400 - Error response

Status: 401 - Error response

Status: 403 - Error response

Status: 404 - Error response

Status: 500 - Error response


createThreatModelAsset

Create a new asset

Creates a new asset within the specified threat model


/threat_models/{threat_model_id}/assets

Usage and SDK Samples

curl -X POST\
 -H "Authorization: Bearer [[accessToken]]"\
-H "Accept: application/json"\
-H "Content-Type: application/json"\
"http://localhost:8080/threat_models/{threat_model_id}/assets"
import io.swagger.client.*;
import io.swagger.client.auth.*;
import io.swagger.client.model.*;
import io.swagger.client.api.ThreatModelSubResourcesApi;

import java.io.File;
import java.util.*;

public class ThreatModelSubResourcesApiExample {

    public static void main(String[] args) {
        ApiClient defaultClient = Configuration.getDefaultApiClient();


        ThreatModelSubResourcesApi apiInstance = new ThreatModelSubResourcesApi();
        AssetInput body = ; // AssetInput | 
        UUID threatModelId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // UUID | Unique identifier of the threat model (UUID)
        try {
            Asset result = apiInstance.createThreatModelAsset(body, threatModelId);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling ThreatModelSubResourcesApi#createThreatModelAsset");
            e.printStackTrace();
        }
    }
}
import io.swagger.client.api.ThreatModelSubResourcesApi;

public class ThreatModelSubResourcesApiExample {

    public static void main(String[] args) {
        ThreatModelSubResourcesApi apiInstance = new ThreatModelSubResourcesApi();
        AssetInput body = ; // AssetInput | 
        UUID threatModelId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // UUID | Unique identifier of the threat model (UUID)
        try {
            Asset result = apiInstance.createThreatModelAsset(body, threatModelId);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling ThreatModelSubResourcesApi#createThreatModelAsset");
            e.printStackTrace();
        }
    }
}
Configuration *apiConfig = [Configuration sharedConfig];
AssetInput *body = ; // 
UUID *threatModelId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // Unique identifier of the threat model (UUID)

ThreatModelSubResourcesApi *apiInstance = [[ThreatModelSubResourcesApi alloc] init];

// Create a new asset
[apiInstance createThreatModelAssetWith:body
    threatModelId:threatModelId
              completionHandler: ^(Asset output, NSError* error) {
                            if (output) {
                                NSLog(@"%@", output);
                            }
                            if (error) {
                                NSLog(@"Error: %@", error);
                            }
                        }];
var TmiThreatModelingImprovedApi = require('tmi__threat_modeling_improved_api');
var defaultClient = TmiThreatModelingImprovedApi.ApiClient.instance;


var api = new TmiThreatModelingImprovedApi.ThreatModelSubResourcesApi()
var body = ; // {{AssetInput}} 
var threatModelId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // {{UUID}} Unique identifier of the threat model (UUID)

var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
};
api.createThreatModelAsset(bodythreatModelId, callback);
using System;
using System.Diagnostics;
using IO.Swagger.Api;
using IO.Swagger.Client;
using IO.Swagger.Model;

namespace Example
{
    public class createThreatModelAssetExample
    {
        public void main()
        {


            var apiInstance = new ThreatModelSubResourcesApi();
            var body = new AssetInput(); // AssetInput | 
            var threatModelId = new UUID(); // UUID | Unique identifier of the threat model (UUID)

            try
            {
                // Create a new asset
                Asset result = apiInstance.createThreatModelAsset(body, threatModelId);
                Debug.WriteLine(result);
            }
            catch (Exception e)
            {
                Debug.Print("Exception when calling ThreatModelSubResourcesApi.createThreatModelAsset: " + e.Message );
            }
        }
    }
}
<?php
require_once(__DIR__ . '/vendor/autoload.php');


$api_instance = new Swagger\Client\ApiThreatModelSubResourcesApi();
$body = ; // AssetInput | 
$threatModelId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // UUID | Unique identifier of the threat model (UUID)

try {
    $result = $api_instance->createThreatModelAsset($body, $threatModelId);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling ThreatModelSubResourcesApi->createThreatModelAsset: ', $e->getMessage(), PHP_EOL;
}
?>
use Data::Dumper;
use WWW::SwaggerClient::Configuration;
use WWW::SwaggerClient::ThreatModelSubResourcesApi;


my $api_instance = WWW::SwaggerClient::ThreatModelSubResourcesApi->new();
my $body = WWW::SwaggerClient::Object::AssetInput->new(); # AssetInput | 
my $threatModelId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; # UUID | Unique identifier of the threat model (UUID)

eval { 
    my $result = $api_instance->createThreatModelAsset(body => $body, threatModelId => $threatModelId);
    print Dumper($result);
};
if ($@) {
    warn "Exception when calling ThreatModelSubResourcesApi->createThreatModelAsset: $@\n";
}
from __future__ import print_statement
import time
import swagger_client
from swagger_client.rest import ApiException
from pprint import pprint


# create an instance of the API class
api_instance = swagger_client.ThreatModelSubResourcesApi()
body =  # AssetInput | 
threatModelId = 38400000-8cf0-11bd-b23e-10b96e4ef00d # UUID | Unique identifier of the threat model (UUID)

try: 
    # Create a new asset
    api_response = api_instance.create_threat_model_asset(body, threatModelId)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling ThreatModelSubResourcesApi->createThreatModelAsset: %s\n" % e)

Parameters

Path parameters
Name Description
threat_model_id*
UUID (uuid)
Unique identifier of the threat model (UUID)
Required
Body parameters
Name Description
body *

Responses

Status: 201 - Asset created successfully

Status: 400 - Error response

Status: 401 - Error response

Status: 403 - Error response

Status: 404 - Error response

Status: 500 - Error response


createThreatModelAssetMetadata

Add metadata to an asset

Adds a new metadata key-value pair to the specified asset


/threat_models/{threat_model_id}/assets/{asset_id}/metadata

Usage and SDK Samples

curl -X POST\
 -H "Authorization: Bearer [[accessToken]]"\
-H "Accept: application/json"\
-H "Content-Type: application/json"\
"http://localhost:8080/threat_models/{threat_model_id}/assets/{asset_id}/metadata"
import io.swagger.client.*;
import io.swagger.client.auth.*;
import io.swagger.client.model.*;
import io.swagger.client.api.ThreatModelSubResourcesApi;

import java.io.File;
import java.util.*;

public class ThreatModelSubResourcesApiExample {

    public static void main(String[] args) {
        ApiClient defaultClient = Configuration.getDefaultApiClient();


        ThreatModelSubResourcesApi apiInstance = new ThreatModelSubResourcesApi();
        Metadata body = ; // Metadata | 
        UUID threatModelId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // UUID | Unique identifier of the threat model (UUID)
        UUID assetId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // UUID | Unique identifier of the asset (UUID)
        try {
            Metadata result = apiInstance.createThreatModelAssetMetadata(body, threatModelId, assetId);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling ThreatModelSubResourcesApi#createThreatModelAssetMetadata");
            e.printStackTrace();
        }
    }
}
import io.swagger.client.api.ThreatModelSubResourcesApi;

public class ThreatModelSubResourcesApiExample {

    public static void main(String[] args) {
        ThreatModelSubResourcesApi apiInstance = new ThreatModelSubResourcesApi();
        Metadata body = ; // Metadata | 
        UUID threatModelId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // UUID | Unique identifier of the threat model (UUID)
        UUID assetId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // UUID | Unique identifier of the asset (UUID)
        try {
            Metadata result = apiInstance.createThreatModelAssetMetadata(body, threatModelId, assetId);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling ThreatModelSubResourcesApi#createThreatModelAssetMetadata");
            e.printStackTrace();
        }
    }
}
Configuration *apiConfig = [Configuration sharedConfig];
Metadata *body = ; // 
UUID *threatModelId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // Unique identifier of the threat model (UUID)
UUID *assetId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // Unique identifier of the asset (UUID)

ThreatModelSubResourcesApi *apiInstance = [[ThreatModelSubResourcesApi alloc] init];

// Add metadata to an asset
[apiInstance createThreatModelAssetMetadataWith:body
    threatModelId:threatModelId
    assetId:assetId
              completionHandler: ^(Metadata output, NSError* error) {
                            if (output) {
                                NSLog(@"%@", output);
                            }
                            if (error) {
                                NSLog(@"Error: %@", error);
                            }
                        }];
var TmiThreatModelingImprovedApi = require('tmi__threat_modeling_improved_api');
var defaultClient = TmiThreatModelingImprovedApi.ApiClient.instance;


var api = new TmiThreatModelingImprovedApi.ThreatModelSubResourcesApi()
var body = ; // {{Metadata}} 
var threatModelId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // {{UUID}} Unique identifier of the threat model (UUID)
var assetId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // {{UUID}} Unique identifier of the asset (UUID)

var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
};
api.createThreatModelAssetMetadata(bodythreatModelIdassetId, callback);
using System;
using System.Diagnostics;
using IO.Swagger.Api;
using IO.Swagger.Client;
using IO.Swagger.Model;

namespace Example
{
    public class createThreatModelAssetMetadataExample
    {
        public void main()
        {


            var apiInstance = new ThreatModelSubResourcesApi();
            var body = new Metadata(); // Metadata | 
            var threatModelId = new UUID(); // UUID | Unique identifier of the threat model (UUID)
            var assetId = new UUID(); // UUID | Unique identifier of the asset (UUID)

            try
            {
                // Add metadata to an asset
                Metadata result = apiInstance.createThreatModelAssetMetadata(body, threatModelId, assetId);
                Debug.WriteLine(result);
            }
            catch (Exception e)
            {
                Debug.Print("Exception when calling ThreatModelSubResourcesApi.createThreatModelAssetMetadata: " + e.Message );
            }
        }
    }
}
<?php
require_once(__DIR__ . '/vendor/autoload.php');


$api_instance = new Swagger\Client\ApiThreatModelSubResourcesApi();
$body = ; // Metadata | 
$threatModelId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // UUID | Unique identifier of the threat model (UUID)
$assetId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // UUID | Unique identifier of the asset (UUID)

try {
    $result = $api_instance->createThreatModelAssetMetadata($body, $threatModelId, $assetId);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling ThreatModelSubResourcesApi->createThreatModelAssetMetadata: ', $e->getMessage(), PHP_EOL;
}
?>
use Data::Dumper;
use WWW::SwaggerClient::Configuration;
use WWW::SwaggerClient::ThreatModelSubResourcesApi;


my $api_instance = WWW::SwaggerClient::ThreatModelSubResourcesApi->new();
my $body = WWW::SwaggerClient::Object::Metadata->new(); # Metadata | 
my $threatModelId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; # UUID | Unique identifier of the threat model (UUID)
my $assetId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; # UUID | Unique identifier of the asset (UUID)

eval { 
    my $result = $api_instance->createThreatModelAssetMetadata(body => $body, threatModelId => $threatModelId, assetId => $assetId);
    print Dumper($result);
};
if ($@) {
    warn "Exception when calling ThreatModelSubResourcesApi->createThreatModelAssetMetadata: $@\n";
}
from __future__ import print_statement
import time
import swagger_client
from swagger_client.rest import ApiException
from pprint import pprint


# create an instance of the API class
api_instance = swagger_client.ThreatModelSubResourcesApi()
body =  # Metadata | 
threatModelId = 38400000-8cf0-11bd-b23e-10b96e4ef00d # UUID | Unique identifier of the threat model (UUID)
assetId = 38400000-8cf0-11bd-b23e-10b96e4ef00d # UUID | Unique identifier of the asset (UUID)

try: 
    # Add metadata to an asset
    api_response = api_instance.create_threat_model_asset_metadata(body, threatModelId, assetId)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling ThreatModelSubResourcesApi->createThreatModelAssetMetadata: %s\n" % e)

Parameters

Path parameters
Name Description
threat_model_id*
UUID (uuid)
Unique identifier of the threat model (UUID)
Required
asset_id*
UUID (uuid)
Unique identifier of the asset (UUID)
Required
Body parameters
Name Description
body *

Responses

Status: 201 - Metadata created successfully

Status: 400 - Error response

Status: 401 - Error response

Status: 403 - Error response

Status: 404 - Error response

Status: 500 - Error response


createThreatModelDiagram

Create a new diagram

Creates a new diagram within the specified threat model


/threat_models/{threat_model_id}/diagrams

Usage and SDK Samples

curl -X POST\
 -H "Authorization: Bearer [[accessToken]]"\
-H "Accept: application/json"\
-H "Content-Type: application/json"\
"http://localhost:8080/threat_models/{threat_model_id}/diagrams"
import io.swagger.client.*;
import io.swagger.client.auth.*;
import io.swagger.client.model.*;
import io.swagger.client.api.ThreatModelSubResourcesApi;

import java.io.File;
import java.util.*;

public class ThreatModelSubResourcesApiExample {

    public static void main(String[] args) {
        ApiClient defaultClient = Configuration.getDefaultApiClient();


        ThreatModelSubResourcesApi apiInstance = new ThreatModelSubResourcesApi();
        CreateDiagramRequest body = ; // CreateDiagramRequest | 
        UUID threatModelId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // UUID | Unique identifier of the threat model (UUID)
        try {
            Diagram result = apiInstance.createThreatModelDiagram(body, threatModelId);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling ThreatModelSubResourcesApi#createThreatModelDiagram");
            e.printStackTrace();
        }
    }
}
import io.swagger.client.api.ThreatModelSubResourcesApi;

public class ThreatModelSubResourcesApiExample {

    public static void main(String[] args) {
        ThreatModelSubResourcesApi apiInstance = new ThreatModelSubResourcesApi();
        CreateDiagramRequest body = ; // CreateDiagramRequest | 
        UUID threatModelId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // UUID | Unique identifier of the threat model (UUID)
        try {
            Diagram result = apiInstance.createThreatModelDiagram(body, threatModelId);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling ThreatModelSubResourcesApi#createThreatModelDiagram");
            e.printStackTrace();
        }
    }
}
Configuration *apiConfig = [Configuration sharedConfig];
CreateDiagramRequest *body = ; // 
UUID *threatModelId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // Unique identifier of the threat model (UUID)

ThreatModelSubResourcesApi *apiInstance = [[ThreatModelSubResourcesApi alloc] init];

// Create a new diagram
[apiInstance createThreatModelDiagramWith:body
    threatModelId:threatModelId
              completionHandler: ^(Diagram output, NSError* error) {
                            if (output) {
                                NSLog(@"%@", output);
                            }
                            if (error) {
                                NSLog(@"Error: %@", error);
                            }
                        }];
var TmiThreatModelingImprovedApi = require('tmi__threat_modeling_improved_api');
var defaultClient = TmiThreatModelingImprovedApi.ApiClient.instance;


var api = new TmiThreatModelingImprovedApi.ThreatModelSubResourcesApi()
var body = ; // {{CreateDiagramRequest}} 
var threatModelId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // {{UUID}} Unique identifier of the threat model (UUID)

var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
};
api.createThreatModelDiagram(bodythreatModelId, callback);
using System;
using System.Diagnostics;
using IO.Swagger.Api;
using IO.Swagger.Client;
using IO.Swagger.Model;

namespace Example
{
    public class createThreatModelDiagramExample
    {
        public void main()
        {


            var apiInstance = new ThreatModelSubResourcesApi();
            var body = new CreateDiagramRequest(); // CreateDiagramRequest | 
            var threatModelId = new UUID(); // UUID | Unique identifier of the threat model (UUID)

            try
            {
                // Create a new diagram
                Diagram result = apiInstance.createThreatModelDiagram(body, threatModelId);
                Debug.WriteLine(result);
            }
            catch (Exception e)
            {
                Debug.Print("Exception when calling ThreatModelSubResourcesApi.createThreatModelDiagram: " + e.Message );
            }
        }
    }
}
<?php
require_once(__DIR__ . '/vendor/autoload.php');


$api_instance = new Swagger\Client\ApiThreatModelSubResourcesApi();
$body = ; // CreateDiagramRequest | 
$threatModelId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // UUID | Unique identifier of the threat model (UUID)

try {
    $result = $api_instance->createThreatModelDiagram($body, $threatModelId);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling ThreatModelSubResourcesApi->createThreatModelDiagram: ', $e->getMessage(), PHP_EOL;
}
?>
use Data::Dumper;
use WWW::SwaggerClient::Configuration;
use WWW::SwaggerClient::ThreatModelSubResourcesApi;


my $api_instance = WWW::SwaggerClient::ThreatModelSubResourcesApi->new();
my $body = WWW::SwaggerClient::Object::CreateDiagramRequest->new(); # CreateDiagramRequest | 
my $threatModelId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; # UUID | Unique identifier of the threat model (UUID)

eval { 
    my $result = $api_instance->createThreatModelDiagram(body => $body, threatModelId => $threatModelId);
    print Dumper($result);
};
if ($@) {
    warn "Exception when calling ThreatModelSubResourcesApi->createThreatModelDiagram: $@\n";
}
from __future__ import print_statement
import time
import swagger_client
from swagger_client.rest import ApiException
from pprint import pprint


# create an instance of the API class
api_instance = swagger_client.ThreatModelSubResourcesApi()
body =  # CreateDiagramRequest | 
threatModelId = 38400000-8cf0-11bd-b23e-10b96e4ef00d # UUID | Unique identifier of the threat model (UUID)

try: 
    # Create a new diagram
    api_response = api_instance.create_threat_model_diagram(body, threatModelId)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling ThreatModelSubResourcesApi->createThreatModelDiagram: %s\n" % e)

Parameters

Path parameters
Name Description
threat_model_id*
UUID (uuid)
Unique identifier of the threat model (UUID)
Required
Body parameters
Name Description
body *

Responses

Status: 201 - Diagram created successfully

Status: 400 - Error response

Status: 401 - Error response

Status: 403 - Error response

Status: 404 - Error response

Status: 500 - Error response


createThreatModelDocument

Create a new document

Creates a new document within the specified threat model


/threat_models/{threat_model_id}/documents

Usage and SDK Samples

curl -X POST\
 -H "Authorization: Bearer [[accessToken]]"\
-H "Accept: application/json"\
-H "Content-Type: application/json"\
"http://localhost:8080/threat_models/{threat_model_id}/documents"
import io.swagger.client.*;
import io.swagger.client.auth.*;
import io.swagger.client.model.*;
import io.swagger.client.api.ThreatModelSubResourcesApi;

import java.io.File;
import java.util.*;

public class ThreatModelSubResourcesApiExample {

    public static void main(String[] args) {
        ApiClient defaultClient = Configuration.getDefaultApiClient();


        ThreatModelSubResourcesApi apiInstance = new ThreatModelSubResourcesApi();
        DocumentInput body = {
  "summary" : "Create a new security document",
  "value" : {
    "name" : "Security Requirements Document",
    "description" : "Detailed security requirements and compliance standards",
    "metadata" : [ {
      "key" : "classification",
      "value" : "internal"
    }, {
      "key" : "version",
      "value" : "1.0"
    }, {
      "key" : "owner",
      "value" : "security-team"
    } ],
    "uri" : "https://docs.company.com/security-requirements.pdf"
  }
}; // DocumentInput | 
        UUID threatModelId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // UUID | Unique identifier of the threat model (UUID)
        try {
            Document result = apiInstance.createThreatModelDocument(body, threatModelId);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling ThreatModelSubResourcesApi#createThreatModelDocument");
            e.printStackTrace();
        }
    }
}
import io.swagger.client.api.ThreatModelSubResourcesApi;

public class ThreatModelSubResourcesApiExample {

    public static void main(String[] args) {
        ThreatModelSubResourcesApi apiInstance = new ThreatModelSubResourcesApi();
        DocumentInput body = {
  "summary" : "Create a new security document",
  "value" : {
    "name" : "Security Requirements Document",
    "description" : "Detailed security requirements and compliance standards",
    "metadata" : [ {
      "key" : "classification",
      "value" : "internal"
    }, {
      "key" : "version",
      "value" : "1.0"
    }, {
      "key" : "owner",
      "value" : "security-team"
    } ],
    "uri" : "https://docs.company.com/security-requirements.pdf"
  }
}; // DocumentInput | 
        UUID threatModelId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // UUID | Unique identifier of the threat model (UUID)
        try {
            Document result = apiInstance.createThreatModelDocument(body, threatModelId);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling ThreatModelSubResourcesApi#createThreatModelDocument");
            e.printStackTrace();
        }
    }
}
Configuration *apiConfig = [Configuration sharedConfig];
DocumentInput *body = {
  "summary" : "Create a new security document",
  "value" : {
    "name" : "Security Requirements Document",
    "description" : "Detailed security requirements and compliance standards",
    "metadata" : [ {
      "key" : "classification",
      "value" : "internal"
    }, {
      "key" : "version",
      "value" : "1.0"
    }, {
      "key" : "owner",
      "value" : "security-team"
    } ],
    "uri" : "https://docs.company.com/security-requirements.pdf"
  }
}; // 
UUID *threatModelId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // Unique identifier of the threat model (UUID)

ThreatModelSubResourcesApi *apiInstance = [[ThreatModelSubResourcesApi alloc] init];

// Create a new document
[apiInstance createThreatModelDocumentWith:body
    threatModelId:threatModelId
              completionHandler: ^(Document output, NSError* error) {
                            if (output) {
                                NSLog(@"%@", output);
                            }
                            if (error) {
                                NSLog(@"Error: %@", error);
                            }
                        }];
var TmiThreatModelingImprovedApi = require('tmi__threat_modeling_improved_api');
var defaultClient = TmiThreatModelingImprovedApi.ApiClient.instance;


var api = new TmiThreatModelingImprovedApi.ThreatModelSubResourcesApi()
var body = {
  "summary" : "Create a new security document",
  "value" : {
    "name" : "Security Requirements Document",
    "description" : "Detailed security requirements and compliance standards",
    "metadata" : [ {
      "key" : "classification",
      "value" : "internal"
    }, {
      "key" : "version",
      "value" : "1.0"
    }, {
      "key" : "owner",
      "value" : "security-team"
    } ],
    "uri" : "https://docs.company.com/security-requirements.pdf"
  }
}; // {{DocumentInput}} 
var threatModelId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // {{UUID}} Unique identifier of the threat model (UUID)

var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
};
api.createThreatModelDocument(bodythreatModelId, callback);
using System;
using System.Diagnostics;
using IO.Swagger.Api;
using IO.Swagger.Client;
using IO.Swagger.Model;

namespace Example
{
    public class createThreatModelDocumentExample
    {
        public void main()
        {


            var apiInstance = new ThreatModelSubResourcesApi();
            var body = new DocumentInput(); // DocumentInput | 
            var threatModelId = new UUID(); // UUID | Unique identifier of the threat model (UUID)

            try
            {
                // Create a new document
                Document result = apiInstance.createThreatModelDocument(body, threatModelId);
                Debug.WriteLine(result);
            }
            catch (Exception e)
            {
                Debug.Print("Exception when calling ThreatModelSubResourcesApi.createThreatModelDocument: " + e.Message );
            }
        }
    }
}
<?php
require_once(__DIR__ . '/vendor/autoload.php');


$api_instance = new Swagger\Client\ApiThreatModelSubResourcesApi();
$body = {
  "summary" : "Create a new security document",
  "value" : {
    "name" : "Security Requirements Document",
    "description" : "Detailed security requirements and compliance standards",
    "metadata" : [ {
      "key" : "classification",
      "value" : "internal"
    }, {
      "key" : "version",
      "value" : "1.0"
    }, {
      "key" : "owner",
      "value" : "security-team"
    } ],
    "uri" : "https://docs.company.com/security-requirements.pdf"
  }
}; // DocumentInput | 
$threatModelId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // UUID | Unique identifier of the threat model (UUID)

try {
    $result = $api_instance->createThreatModelDocument($body, $threatModelId);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling ThreatModelSubResourcesApi->createThreatModelDocument: ', $e->getMessage(), PHP_EOL;
}
?>
use Data::Dumper;
use WWW::SwaggerClient::Configuration;
use WWW::SwaggerClient::ThreatModelSubResourcesApi;


my $api_instance = WWW::SwaggerClient::ThreatModelSubResourcesApi->new();
my $body = WWW::SwaggerClient::Object::DocumentInput->new(); # DocumentInput | 
my $threatModelId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; # UUID | Unique identifier of the threat model (UUID)

eval { 
    my $result = $api_instance->createThreatModelDocument(body => $body, threatModelId => $threatModelId);
    print Dumper($result);
};
if ($@) {
    warn "Exception when calling ThreatModelSubResourcesApi->createThreatModelDocument: $@\n";
}
from __future__ import print_statement
import time
import swagger_client
from swagger_client.rest import ApiException
from pprint import pprint


# create an instance of the API class
api_instance = swagger_client.ThreatModelSubResourcesApi()
body = {
  "summary" : "Create a new security document",
  "value" : {
    "name" : "Security Requirements Document",
    "description" : "Detailed security requirements and compliance standards",
    "metadata" : [ {
      "key" : "classification",
      "value" : "internal"
    }, {
      "key" : "version",
      "value" : "1.0"
    }, {
      "key" : "owner",
      "value" : "security-team"
    } ],
    "uri" : "https://docs.company.com/security-requirements.pdf"
  }
} # DocumentInput | 
threatModelId = 38400000-8cf0-11bd-b23e-10b96e4ef00d # UUID | Unique identifier of the threat model (UUID)

try: 
    # Create a new document
    api_response = api_instance.create_threat_model_document(body, threatModelId)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling ThreatModelSubResourcesApi->createThreatModelDocument: %s\n" % e)

Parameters

Path parameters
Name Description
threat_model_id*
UUID (uuid)
Unique identifier of the threat model (UUID)
Required
Body parameters
Name Description
body *

Responses

Status: 201 - Document created successfully

Status: 400 - Error response

Status: 401 - Error response

Status: 403 - Error response

Status: 404 - Error response

Status: 500 - Error response


createThreatModelMetadata

Create threat model metadata

Creates new metadata entry for the specified threat model


/threat_models/{threat_model_id}/metadata

Usage and SDK Samples

curl -X POST\
 -H "Authorization: Bearer [[accessToken]]"\
-H "Accept: application/json"\
-H "Content-Type: application/json"\
"http://localhost:8080/threat_models/{threat_model_id}/metadata"
import io.swagger.client.*;
import io.swagger.client.auth.*;
import io.swagger.client.model.*;
import io.swagger.client.api.ThreatModelSubResourcesApi;

import java.io.File;
import java.util.*;

public class ThreatModelSubResourcesApiExample {

    public static void main(String[] args) {
        ApiClient defaultClient = Configuration.getDefaultApiClient();


        ThreatModelSubResourcesApi apiInstance = new ThreatModelSubResourcesApi();
        Metadata body = ; // Metadata | 
        UUID threatModelId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // UUID | Unique identifier of the threat model (UUID)
        try {
            Metadata result = apiInstance.createThreatModelMetadata(body, threatModelId);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling ThreatModelSubResourcesApi#createThreatModelMetadata");
            e.printStackTrace();
        }
    }
}
import io.swagger.client.api.ThreatModelSubResourcesApi;

public class ThreatModelSubResourcesApiExample {

    public static void main(String[] args) {
        ThreatModelSubResourcesApi apiInstance = new ThreatModelSubResourcesApi();
        Metadata body = ; // Metadata | 
        UUID threatModelId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // UUID | Unique identifier of the threat model (UUID)
        try {
            Metadata result = apiInstance.createThreatModelMetadata(body, threatModelId);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling ThreatModelSubResourcesApi#createThreatModelMetadata");
            e.printStackTrace();
        }
    }
}
Configuration *apiConfig = [Configuration sharedConfig];
Metadata *body = ; // 
UUID *threatModelId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // Unique identifier of the threat model (UUID)

ThreatModelSubResourcesApi *apiInstance = [[ThreatModelSubResourcesApi alloc] init];

// Create threat model metadata
[apiInstance createThreatModelMetadataWith:body
    threatModelId:threatModelId
              completionHandler: ^(Metadata output, NSError* error) {
                            if (output) {
                                NSLog(@"%@", output);
                            }
                            if (error) {
                                NSLog(@"Error: %@", error);
                            }
                        }];
var TmiThreatModelingImprovedApi = require('tmi__threat_modeling_improved_api');
var defaultClient = TmiThreatModelingImprovedApi.ApiClient.instance;


var api = new TmiThreatModelingImprovedApi.ThreatModelSubResourcesApi()
var body = ; // {{Metadata}} 
var threatModelId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // {{UUID}} Unique identifier of the threat model (UUID)

var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
};
api.createThreatModelMetadata(bodythreatModelId, callback);
using System;
using System.Diagnostics;
using IO.Swagger.Api;
using IO.Swagger.Client;
using IO.Swagger.Model;

namespace Example
{
    public class createThreatModelMetadataExample
    {
        public void main()
        {


            var apiInstance = new ThreatModelSubResourcesApi();
            var body = new Metadata(); // Metadata | 
            var threatModelId = new UUID(); // UUID | Unique identifier of the threat model (UUID)

            try
            {
                // Create threat model metadata
                Metadata result = apiInstance.createThreatModelMetadata(body, threatModelId);
                Debug.WriteLine(result);
            }
            catch (Exception e)
            {
                Debug.Print("Exception when calling ThreatModelSubResourcesApi.createThreatModelMetadata: " + e.Message );
            }
        }
    }
}
<?php
require_once(__DIR__ . '/vendor/autoload.php');


$api_instance = new Swagger\Client\ApiThreatModelSubResourcesApi();
$body = ; // Metadata | 
$threatModelId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // UUID | Unique identifier of the threat model (UUID)

try {
    $result = $api_instance->createThreatModelMetadata($body, $threatModelId);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling ThreatModelSubResourcesApi->createThreatModelMetadata: ', $e->getMessage(), PHP_EOL;
}
?>
use Data::Dumper;
use WWW::SwaggerClient::Configuration;
use WWW::SwaggerClient::ThreatModelSubResourcesApi;


my $api_instance = WWW::SwaggerClient::ThreatModelSubResourcesApi->new();
my $body = WWW::SwaggerClient::Object::Metadata->new(); # Metadata | 
my $threatModelId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; # UUID | Unique identifier of the threat model (UUID)

eval { 
    my $result = $api_instance->createThreatModelMetadata(body => $body, threatModelId => $threatModelId);
    print Dumper($result);
};
if ($@) {
    warn "Exception when calling ThreatModelSubResourcesApi->createThreatModelMetadata: $@\n";
}
from __future__ import print_statement
import time
import swagger_client
from swagger_client.rest import ApiException
from pprint import pprint


# create an instance of the API class
api_instance = swagger_client.ThreatModelSubResourcesApi()
body =  # Metadata | 
threatModelId = 38400000-8cf0-11bd-b23e-10b96e4ef00d # UUID | Unique identifier of the threat model (UUID)

try: 
    # Create threat model metadata
    api_response = api_instance.create_threat_model_metadata(body, threatModelId)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling ThreatModelSubResourcesApi->createThreatModelMetadata: %s\n" % e)

Parameters

Path parameters
Name Description
threat_model_id*
UUID (uuid)
Unique identifier of the threat model (UUID)
Required
Body parameters
Name Description
body *

Responses

Status: 201 - Metadata entry created successfully

Status: 400 - Error response

Status: 401 - Error response

Status: 403 - Error response

Status: 404 - Error response

Status: 500 - Error response


createThreatModelNote

Create a new note

Creates a new note within the specified threat model


/threat_models/{threat_model_id}/notes

Usage and SDK Samples

curl -X POST\
 -H "Authorization: Bearer [[accessToken]]"\
-H "Accept: application/json"\
-H "Content-Type: application/json"\
"http://localhost:8080/threat_models/{threat_model_id}/notes"
import io.swagger.client.*;
import io.swagger.client.auth.*;
import io.swagger.client.model.*;
import io.swagger.client.api.ThreatModelSubResourcesApi;

import java.io.File;
import java.util.*;

public class ThreatModelSubResourcesApiExample {

    public static void main(String[] args) {
        ApiClient defaultClient = Configuration.getDefaultApiClient();


        ThreatModelSubResourcesApi apiInstance = new ThreatModelSubResourcesApi();
        NoteInput body = ; // NoteInput | 
        UUID threatModelId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // UUID | Unique identifier of the threat model (UUID)
        try {
            Note result = apiInstance.createThreatModelNote(body, threatModelId);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling ThreatModelSubResourcesApi#createThreatModelNote");
            e.printStackTrace();
        }
    }
}
import io.swagger.client.api.ThreatModelSubResourcesApi;

public class ThreatModelSubResourcesApiExample {

    public static void main(String[] args) {
        ThreatModelSubResourcesApi apiInstance = new ThreatModelSubResourcesApi();
        NoteInput body = ; // NoteInput | 
        UUID threatModelId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // UUID | Unique identifier of the threat model (UUID)
        try {
            Note result = apiInstance.createThreatModelNote(body, threatModelId);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling ThreatModelSubResourcesApi#createThreatModelNote");
            e.printStackTrace();
        }
    }
}
Configuration *apiConfig = [Configuration sharedConfig];
NoteInput *body = ; // 
UUID *threatModelId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // Unique identifier of the threat model (UUID)

ThreatModelSubResourcesApi *apiInstance = [[ThreatModelSubResourcesApi alloc] init];

// Create a new note
[apiInstance createThreatModelNoteWith:body
    threatModelId:threatModelId
              completionHandler: ^(Note output, NSError* error) {
                            if (output) {
                                NSLog(@"%@", output);
                            }
                            if (error) {
                                NSLog(@"Error: %@", error);
                            }
                        }];
var TmiThreatModelingImprovedApi = require('tmi__threat_modeling_improved_api');
var defaultClient = TmiThreatModelingImprovedApi.ApiClient.instance;


var api = new TmiThreatModelingImprovedApi.ThreatModelSubResourcesApi()
var body = ; // {{NoteInput}} 
var threatModelId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // {{UUID}} Unique identifier of the threat model (UUID)

var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
};
api.createThreatModelNote(bodythreatModelId, callback);
using System;
using System.Diagnostics;
using IO.Swagger.Api;
using IO.Swagger.Client;
using IO.Swagger.Model;

namespace Example
{
    public class createThreatModelNoteExample
    {
        public void main()
        {


            var apiInstance = new ThreatModelSubResourcesApi();
            var body = new NoteInput(); // NoteInput | 
            var threatModelId = new UUID(); // UUID | Unique identifier of the threat model (UUID)

            try
            {
                // Create a new note
                Note result = apiInstance.createThreatModelNote(body, threatModelId);
                Debug.WriteLine(result);
            }
            catch (Exception e)
            {
                Debug.Print("Exception when calling ThreatModelSubResourcesApi.createThreatModelNote: " + e.Message );
            }
        }
    }
}
<?php
require_once(__DIR__ . '/vendor/autoload.php');


$api_instance = new Swagger\Client\ApiThreatModelSubResourcesApi();
$body = ; // NoteInput | 
$threatModelId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // UUID | Unique identifier of the threat model (UUID)

try {
    $result = $api_instance->createThreatModelNote($body, $threatModelId);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling ThreatModelSubResourcesApi->createThreatModelNote: ', $e->getMessage(), PHP_EOL;
}
?>
use Data::Dumper;
use WWW::SwaggerClient::Configuration;
use WWW::SwaggerClient::ThreatModelSubResourcesApi;


my $api_instance = WWW::SwaggerClient::ThreatModelSubResourcesApi->new();
my $body = WWW::SwaggerClient::Object::NoteInput->new(); # NoteInput | 
my $threatModelId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; # UUID | Unique identifier of the threat model (UUID)

eval { 
    my $result = $api_instance->createThreatModelNote(body => $body, threatModelId => $threatModelId);
    print Dumper($result);
};
if ($@) {
    warn "Exception when calling ThreatModelSubResourcesApi->createThreatModelNote: $@\n";
}
from __future__ import print_statement
import time
import swagger_client
from swagger_client.rest import ApiException
from pprint import pprint


# create an instance of the API class
api_instance = swagger_client.ThreatModelSubResourcesApi()
body =  # NoteInput | 
threatModelId = 38400000-8cf0-11bd-b23e-10b96e4ef00d # UUID | Unique identifier of the threat model (UUID)

try: 
    # Create a new note
    api_response = api_instance.create_threat_model_note(body, threatModelId)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling ThreatModelSubResourcesApi->createThreatModelNote: %s\n" % e)

Parameters

Path parameters
Name Description
threat_model_id*
UUID (uuid)
Unique identifier of the threat model (UUID)
Required
Body parameters
Name Description
body *

Responses

Status: 201 - Note created successfully

Status: 400 - Error response

Status: 401 - Error response

Status: 403 - Error response

Status: 404 - Error response

Status: 500 - Error response


createThreatModelRepository

Create a new source reference

Creates a new source code reference within the specified threat model


/threat_models/{threat_model_id}/repositories

Usage and SDK Samples

curl -X POST\
 -H "Authorization: Bearer [[accessToken]]"\
-H "Accept: application/json"\
-H "Content-Type: application/json"\
"http://localhost:8080/threat_models/{threat_model_id}/repositories"
import io.swagger.client.*;
import io.swagger.client.auth.*;
import io.swagger.client.model.*;
import io.swagger.client.api.ThreatModelSubResourcesApi;

import java.io.File;
import java.util.*;

public class ThreatModelSubResourcesApiExample {

    public static void main(String[] args) {
        ApiClient defaultClient = Configuration.getDefaultApiClient();


        ThreatModelSubResourcesApi apiInstance = new ThreatModelSubResourcesApi();
        RepositoryInput body = ; // RepositoryInput | 
        UUID threatModelId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // UUID | Unique identifier of the threat model (UUID)
        try {
            Repository result = apiInstance.createThreatModelRepository(body, threatModelId);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling ThreatModelSubResourcesApi#createThreatModelRepository");
            e.printStackTrace();
        }
    }
}
import io.swagger.client.api.ThreatModelSubResourcesApi;

public class ThreatModelSubResourcesApiExample {

    public static void main(String[] args) {
        ThreatModelSubResourcesApi apiInstance = new ThreatModelSubResourcesApi();
        RepositoryInput body = ; // RepositoryInput | 
        UUID threatModelId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // UUID | Unique identifier of the threat model (UUID)
        try {
            Repository result = apiInstance.createThreatModelRepository(body, threatModelId);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling ThreatModelSubResourcesApi#createThreatModelRepository");
            e.printStackTrace();
        }
    }
}
Configuration *apiConfig = [Configuration sharedConfig];
RepositoryInput *body = ; // 
UUID *threatModelId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // Unique identifier of the threat model (UUID)

ThreatModelSubResourcesApi *apiInstance = [[ThreatModelSubResourcesApi alloc] init];

// Create a new source reference
[apiInstance createThreatModelRepositoryWith:body
    threatModelId:threatModelId
              completionHandler: ^(Repository output, NSError* error) {
                            if (output) {
                                NSLog(@"%@", output);
                            }
                            if (error) {
                                NSLog(@"Error: %@", error);
                            }
                        }];
var TmiThreatModelingImprovedApi = require('tmi__threat_modeling_improved_api');
var defaultClient = TmiThreatModelingImprovedApi.ApiClient.instance;


var api = new TmiThreatModelingImprovedApi.ThreatModelSubResourcesApi()
var body = ; // {{RepositoryInput}} 
var threatModelId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // {{UUID}} Unique identifier of the threat model (UUID)

var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
};
api.createThreatModelRepository(bodythreatModelId, callback);
using System;
using System.Diagnostics;
using IO.Swagger.Api;
using IO.Swagger.Client;
using IO.Swagger.Model;

namespace Example
{
    public class createThreatModelRepositoryExample
    {
        public void main()
        {


            var apiInstance = new ThreatModelSubResourcesApi();
            var body = new RepositoryInput(); // RepositoryInput | 
            var threatModelId = new UUID(); // UUID | Unique identifier of the threat model (UUID)

            try
            {
                // Create a new source reference
                Repository result = apiInstance.createThreatModelRepository(body, threatModelId);
                Debug.WriteLine(result);
            }
            catch (Exception e)
            {
                Debug.Print("Exception when calling ThreatModelSubResourcesApi.createThreatModelRepository: " + e.Message );
            }
        }
    }
}
<?php
require_once(__DIR__ . '/vendor/autoload.php');


$api_instance = new Swagger\Client\ApiThreatModelSubResourcesApi();
$body = ; // RepositoryInput | 
$threatModelId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // UUID | Unique identifier of the threat model (UUID)

try {
    $result = $api_instance->createThreatModelRepository($body, $threatModelId);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling ThreatModelSubResourcesApi->createThreatModelRepository: ', $e->getMessage(), PHP_EOL;
}
?>
use Data::Dumper;
use WWW::SwaggerClient::Configuration;
use WWW::SwaggerClient::ThreatModelSubResourcesApi;


my $api_instance = WWW::SwaggerClient::ThreatModelSubResourcesApi->new();
my $body = WWW::SwaggerClient::Object::RepositoryInput->new(); # RepositoryInput | 
my $threatModelId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; # UUID | Unique identifier of the threat model (UUID)

eval { 
    my $result = $api_instance->createThreatModelRepository(body => $body, threatModelId => $threatModelId);
    print Dumper($result);
};
if ($@) {
    warn "Exception when calling ThreatModelSubResourcesApi->createThreatModelRepository: $@\n";
}
from __future__ import print_statement
import time
import swagger_client
from swagger_client.rest import ApiException
from pprint import pprint


# create an instance of the API class
api_instance = swagger_client.ThreatModelSubResourcesApi()
body =  # RepositoryInput | 
threatModelId = 38400000-8cf0-11bd-b23e-10b96e4ef00d # UUID | Unique identifier of the threat model (UUID)

try: 
    # Create a new source reference
    api_response = api_instance.create_threat_model_repository(body, threatModelId)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling ThreatModelSubResourcesApi->createThreatModelRepository: %s\n" % e)

Parameters

Path parameters
Name Description
threat_model_id*
UUID (uuid)
Unique identifier of the threat model (UUID)
Required
Body parameters
Name Description
body *

Responses

Status: 201 - Source reference created successfully

Status: 400 - Error response

Status: 401 - Error response

Status: 403 - Error response

Status: 404 - Error response

Status: 500 - Error response


createThreatModelThreat

Create a new threat

Creates a new threat within the specified threat model


/threat_models/{threat_model_id}/threats

Usage and SDK Samples

curl -X POST\
 -H "Authorization: Bearer [[accessToken]]"\
-H "Accept: application/json"\
-H "Content-Type: application/json"\
"http://localhost:8080/threat_models/{threat_model_id}/threats"
import io.swagger.client.*;
import io.swagger.client.auth.*;
import io.swagger.client.model.*;
import io.swagger.client.api.ThreatModelSubResourcesApi;

import java.io.File;
import java.util.*;

public class ThreatModelSubResourcesApiExample {

    public static void main(String[] args) {
        ApiClient defaultClient = Configuration.getDefaultApiClient();


        ThreatModelSubResourcesApi apiInstance = new ThreatModelSubResourcesApi();
        ThreatInput body = ; // ThreatInput | 
        UUID threatModelId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // UUID | Unique identifier of the threat model (UUID)
        try {
            Threat result = apiInstance.createThreatModelThreat(body, threatModelId);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling ThreatModelSubResourcesApi#createThreatModelThreat");
            e.printStackTrace();
        }
    }
}
import io.swagger.client.api.ThreatModelSubResourcesApi;

public class ThreatModelSubResourcesApiExample {

    public static void main(String[] args) {
        ThreatModelSubResourcesApi apiInstance = new ThreatModelSubResourcesApi();
        ThreatInput body = ; // ThreatInput | 
        UUID threatModelId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // UUID | Unique identifier of the threat model (UUID)
        try {
            Threat result = apiInstance.createThreatModelThreat(body, threatModelId);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling ThreatModelSubResourcesApi#createThreatModelThreat");
            e.printStackTrace();
        }
    }
}
Configuration *apiConfig = [Configuration sharedConfig];
ThreatInput *body = ; // 
UUID *threatModelId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // Unique identifier of the threat model (UUID)

ThreatModelSubResourcesApi *apiInstance = [[ThreatModelSubResourcesApi alloc] init];

// Create a new threat
[apiInstance createThreatModelThreatWith:body
    threatModelId:threatModelId
              completionHandler: ^(Threat output, NSError* error) {
                            if (output) {
                                NSLog(@"%@", output);
                            }
                            if (error) {
                                NSLog(@"Error: %@", error);
                            }
                        }];
var TmiThreatModelingImprovedApi = require('tmi__threat_modeling_improved_api');
var defaultClient = TmiThreatModelingImprovedApi.ApiClient.instance;


var api = new TmiThreatModelingImprovedApi.ThreatModelSubResourcesApi()
var body = ; // {{ThreatInput}} 
var threatModelId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // {{UUID}} Unique identifier of the threat model (UUID)

var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
};
api.createThreatModelThreat(bodythreatModelId, callback);
using System;
using System.Diagnostics;
using IO.Swagger.Api;
using IO.Swagger.Client;
using IO.Swagger.Model;

namespace Example
{
    public class createThreatModelThreatExample
    {
        public void main()
        {


            var apiInstance = new ThreatModelSubResourcesApi();
            var body = new ThreatInput(); // ThreatInput | 
            var threatModelId = new UUID(); // UUID | Unique identifier of the threat model (UUID)

            try
            {
                // Create a new threat
                Threat result = apiInstance.createThreatModelThreat(body, threatModelId);
                Debug.WriteLine(result);
            }
            catch (Exception e)
            {
                Debug.Print("Exception when calling ThreatModelSubResourcesApi.createThreatModelThreat: " + e.Message );
            }
        }
    }
}
<?php
require_once(__DIR__ . '/vendor/autoload.php');


$api_instance = new Swagger\Client\ApiThreatModelSubResourcesApi();
$body = ; // ThreatInput | 
$threatModelId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // UUID | Unique identifier of the threat model (UUID)

try {
    $result = $api_instance->createThreatModelThreat($body, $threatModelId);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling ThreatModelSubResourcesApi->createThreatModelThreat: ', $e->getMessage(), PHP_EOL;
}
?>
use Data::Dumper;
use WWW::SwaggerClient::Configuration;
use WWW::SwaggerClient::ThreatModelSubResourcesApi;


my $api_instance = WWW::SwaggerClient::ThreatModelSubResourcesApi->new();
my $body = WWW::SwaggerClient::Object::ThreatInput->new(); # ThreatInput | 
my $threatModelId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; # UUID | Unique identifier of the threat model (UUID)

eval { 
    my $result = $api_instance->createThreatModelThreat(body => $body, threatModelId => $threatModelId);
    print Dumper($result);
};
if ($@) {
    warn "Exception when calling ThreatModelSubResourcesApi->createThreatModelThreat: $@\n";
}
from __future__ import print_statement
import time
import swagger_client
from swagger_client.rest import ApiException
from pprint import pprint


# create an instance of the API class
api_instance = swagger_client.ThreatModelSubResourcesApi()
body =  # ThreatInput | 
threatModelId = 38400000-8cf0-11bd-b23e-10b96e4ef00d # UUID | Unique identifier of the threat model (UUID)

try: 
    # Create a new threat
    api_response = api_instance.create_threat_model_threat(body, threatModelId)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling ThreatModelSubResourcesApi->createThreatModelThreat: %s\n" % e)

Parameters

Path parameters
Name Description
threat_model_id*
UUID (uuid)
Unique identifier of the threat model (UUID)
Required
Body parameters
Name Description
body *

Responses

Status: 201 - Threat created successfully

Status: 400 - Error response

Status: 401 - Error response

Status: 403 - Error response

Status: 404 - Error response

Status: 500 - Error response


deleteDiagramMetadataByKey

Delete diagram metadata by key

Removes a specific metadata entry for the diagram by key


/threat_models/{threat_model_id}/diagrams/{diagram_id}/metadata/{key}

Usage and SDK Samples

curl -X DELETE\
 -H "Authorization: Bearer [[accessToken]]"\
-H "Accept: application/json"\
"http://localhost:8080/threat_models/{threat_model_id}/diagrams/{diagram_id}/metadata/{key}"
import io.swagger.client.*;
import io.swagger.client.auth.*;
import io.swagger.client.model.*;
import io.swagger.client.api.ThreatModelSubResourcesApi;

import java.io.File;
import java.util.*;

public class ThreatModelSubResourcesApiExample {

    public static void main(String[] args) {
        ApiClient defaultClient = Configuration.getDefaultApiClient();


        ThreatModelSubResourcesApi apiInstance = new ThreatModelSubResourcesApi();
        UUID threatModelId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // UUID | Unique identifier of the threat model (UUID)
        UUID diagramId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // UUID | Unique identifier of the diagram (UUID)
        String key = key_example; // String | Metadata key to delete
        try {
            apiInstance.deleteDiagramMetadataByKey(threatModelId, diagramId, key);
        } catch (ApiException e) {
            System.err.println("Exception when calling ThreatModelSubResourcesApi#deleteDiagramMetadataByKey");
            e.printStackTrace();
        }
    }
}
import io.swagger.client.api.ThreatModelSubResourcesApi;

public class ThreatModelSubResourcesApiExample {

    public static void main(String[] args) {
        ThreatModelSubResourcesApi apiInstance = new ThreatModelSubResourcesApi();
        UUID threatModelId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // UUID | Unique identifier of the threat model (UUID)
        UUID diagramId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // UUID | Unique identifier of the diagram (UUID)
        String key = key_example; // String | Metadata key to delete
        try {
            apiInstance.deleteDiagramMetadataByKey(threatModelId, diagramId, key);
        } catch (ApiException e) {
            System.err.println("Exception when calling ThreatModelSubResourcesApi#deleteDiagramMetadataByKey");
            e.printStackTrace();
        }
    }
}
Configuration *apiConfig = [Configuration sharedConfig];
UUID *threatModelId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // Unique identifier of the threat model (UUID)
UUID *diagramId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // Unique identifier of the diagram (UUID)
String *key = key_example; // Metadata key to delete

ThreatModelSubResourcesApi *apiInstance = [[ThreatModelSubResourcesApi alloc] init];

// Delete diagram metadata by key
[apiInstance deleteDiagramMetadataByKeyWith:threatModelId
    diagramId:diagramId
    key:key
              completionHandler: ^(NSError* error) {
                            if (error) {
                                NSLog(@"Error: %@", error);
                            }
                        }];
var TmiThreatModelingImprovedApi = require('tmi__threat_modeling_improved_api');
var defaultClient = TmiThreatModelingImprovedApi.ApiClient.instance;


var api = new TmiThreatModelingImprovedApi.ThreatModelSubResourcesApi()
var threatModelId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // {{UUID}} Unique identifier of the threat model (UUID)
var diagramId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // {{UUID}} Unique identifier of the diagram (UUID)
var key = key_example; // {{String}} Metadata key to delete

var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully.');
  }
};
api.deleteDiagramMetadataByKey(threatModelId, diagramId, key, callback);
using System;
using System.Diagnostics;
using IO.Swagger.Api;
using IO.Swagger.Client;
using IO.Swagger.Model;

namespace Example
{
    public class deleteDiagramMetadataByKeyExample
    {
        public void main()
        {


            var apiInstance = new ThreatModelSubResourcesApi();
            var threatModelId = new UUID(); // UUID | Unique identifier of the threat model (UUID)
            var diagramId = new UUID(); // UUID | Unique identifier of the diagram (UUID)
            var key = key_example;  // String | Metadata key to delete

            try
            {
                // Delete diagram metadata by key
                apiInstance.deleteDiagramMetadataByKey(threatModelId, diagramId, key);
            }
            catch (Exception e)
            {
                Debug.Print("Exception when calling ThreatModelSubResourcesApi.deleteDiagramMetadataByKey: " + e.Message );
            }
        }
    }
}
<?php
require_once(__DIR__ . '/vendor/autoload.php');


$api_instance = new Swagger\Client\ApiThreatModelSubResourcesApi();
$threatModelId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // UUID | Unique identifier of the threat model (UUID)
$diagramId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // UUID | Unique identifier of the diagram (UUID)
$key = key_example; // String | Metadata key to delete

try {
    $api_instance->deleteDiagramMetadataByKey($threatModelId, $diagramId, $key);
} catch (Exception $e) {
    echo 'Exception when calling ThreatModelSubResourcesApi->deleteDiagramMetadataByKey: ', $e->getMessage(), PHP_EOL;
}
?>
use Data::Dumper;
use WWW::SwaggerClient::Configuration;
use WWW::SwaggerClient::ThreatModelSubResourcesApi;


my $api_instance = WWW::SwaggerClient::ThreatModelSubResourcesApi->new();
my $threatModelId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; # UUID | Unique identifier of the threat model (UUID)
my $diagramId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; # UUID | Unique identifier of the diagram (UUID)
my $key = key_example; # String | Metadata key to delete

eval { 
    $api_instance->deleteDiagramMetadataByKey(threatModelId => $threatModelId, diagramId => $diagramId, key => $key);
};
if ($@) {
    warn "Exception when calling ThreatModelSubResourcesApi->deleteDiagramMetadataByKey: $@\n";
}
from __future__ import print_statement
import time
import swagger_client
from swagger_client.rest import ApiException
from pprint import pprint


# create an instance of the API class
api_instance = swagger_client.ThreatModelSubResourcesApi()
threatModelId = 38400000-8cf0-11bd-b23e-10b96e4ef00d # UUID | Unique identifier of the threat model (UUID)
diagramId = 38400000-8cf0-11bd-b23e-10b96e4ef00d # UUID | Unique identifier of the diagram (UUID)
key = key_example # String | Metadata key to delete

try: 
    # Delete diagram metadata by key
    api_instance.delete_diagram_metadata_by_key(threatModelId, diagramId, key)
except ApiException as e:
    print("Exception when calling ThreatModelSubResourcesApi->deleteDiagramMetadataByKey: %s\n" % e)

Parameters

Path parameters
Name Description
threat_model_id*
UUID (uuid)
Unique identifier of the threat model (UUID)
Required
diagram_id*
UUID (uuid)
Unique identifier of the diagram (UUID)
Required
key*
String
Metadata key to delete
Required

Responses

Status: 204 - Metadata entry deleted successfully

Status: 401 - Error response

Status: 403 - Error response

Status: 404 - Error response

Status: 500 - Error response


deleteDocumentMetadataByKey

Delete document metadata by key

Deletes a specific metadata entry by key for the specified document


/threat_models/{threat_model_id}/documents/{document_id}/metadata/{key}

Usage and SDK Samples

curl -X DELETE\
 -H "Authorization: Bearer [[accessToken]]"\
-H "Accept: application/json"\
"http://localhost:8080/threat_models/{threat_model_id}/documents/{document_id}/metadata/{key}"
import io.swagger.client.*;
import io.swagger.client.auth.*;
import io.swagger.client.model.*;
import io.swagger.client.api.ThreatModelSubResourcesApi;

import java.io.File;
import java.util.*;

public class ThreatModelSubResourcesApiExample {

    public static void main(String[] args) {
        ApiClient defaultClient = Configuration.getDefaultApiClient();


        ThreatModelSubResourcesApi apiInstance = new ThreatModelSubResourcesApi();
        UUID threatModelId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // UUID | Unique identifier of the threat model (UUID)
        UUID documentId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // UUID | Unique identifier of the document (UUID)
        String key = key_example; // String | Metadata key to delete
        try {
            apiInstance.deleteDocumentMetadataByKey(threatModelId, documentId, key);
        } catch (ApiException e) {
            System.err.println("Exception when calling ThreatModelSubResourcesApi#deleteDocumentMetadataByKey");
            e.printStackTrace();
        }
    }
}
import io.swagger.client.api.ThreatModelSubResourcesApi;

public class ThreatModelSubResourcesApiExample {

    public static void main(String[] args) {
        ThreatModelSubResourcesApi apiInstance = new ThreatModelSubResourcesApi();
        UUID threatModelId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // UUID | Unique identifier of the threat model (UUID)
        UUID documentId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // UUID | Unique identifier of the document (UUID)
        String key = key_example; // String | Metadata key to delete
        try {
            apiInstance.deleteDocumentMetadataByKey(threatModelId, documentId, key);
        } catch (ApiException e) {
            System.err.println("Exception when calling ThreatModelSubResourcesApi#deleteDocumentMetadataByKey");
            e.printStackTrace();
        }
    }
}
Configuration *apiConfig = [Configuration sharedConfig];
UUID *threatModelId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // Unique identifier of the threat model (UUID)
UUID *documentId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // Unique identifier of the document (UUID)
String *key = key_example; // Metadata key to delete

ThreatModelSubResourcesApi *apiInstance = [[ThreatModelSubResourcesApi alloc] init];

// Delete document metadata by key
[apiInstance deleteDocumentMetadataByKeyWith:threatModelId
    documentId:documentId
    key:key
              completionHandler: ^(NSError* error) {
                            if (error) {
                                NSLog(@"Error: %@", error);
                            }
                        }];
var TmiThreatModelingImprovedApi = require('tmi__threat_modeling_improved_api');
var defaultClient = TmiThreatModelingImprovedApi.ApiClient.instance;


var api = new TmiThreatModelingImprovedApi.ThreatModelSubResourcesApi()
var threatModelId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // {{UUID}} Unique identifier of the threat model (UUID)
var documentId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // {{UUID}} Unique identifier of the document (UUID)
var key = key_example; // {{String}} Metadata key to delete

var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully.');
  }
};
api.deleteDocumentMetadataByKey(threatModelId, documentId, key, callback);
using System;
using System.Diagnostics;
using IO.Swagger.Api;
using IO.Swagger.Client;
using IO.Swagger.Model;

namespace Example
{
    public class deleteDocumentMetadataByKeyExample
    {
        public void main()
        {


            var apiInstance = new ThreatModelSubResourcesApi();
            var threatModelId = new UUID(); // UUID | Unique identifier of the threat model (UUID)
            var documentId = new UUID(); // UUID | Unique identifier of the document (UUID)
            var key = key_example;  // String | Metadata key to delete

            try
            {
                // Delete document metadata by key
                apiInstance.deleteDocumentMetadataByKey(threatModelId, documentId, key);
            }
            catch (Exception e)
            {
                Debug.Print("Exception when calling ThreatModelSubResourcesApi.deleteDocumentMetadataByKey: " + e.Message );
            }
        }
    }
}
<?php
require_once(__DIR__ . '/vendor/autoload.php');


$api_instance = new Swagger\Client\ApiThreatModelSubResourcesApi();
$threatModelId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // UUID | Unique identifier of the threat model (UUID)
$documentId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // UUID | Unique identifier of the document (UUID)
$key = key_example; // String | Metadata key to delete

try {
    $api_instance->deleteDocumentMetadataByKey($threatModelId, $documentId, $key);
} catch (Exception $e) {
    echo 'Exception when calling ThreatModelSubResourcesApi->deleteDocumentMetadataByKey: ', $e->getMessage(), PHP_EOL;
}
?>
use Data::Dumper;
use WWW::SwaggerClient::Configuration;
use WWW::SwaggerClient::ThreatModelSubResourcesApi;


my $api_instance = WWW::SwaggerClient::ThreatModelSubResourcesApi->new();
my $threatModelId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; # UUID | Unique identifier of the threat model (UUID)
my $documentId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; # UUID | Unique identifier of the document (UUID)
my $key = key_example; # String | Metadata key to delete

eval { 
    $api_instance->deleteDocumentMetadataByKey(threatModelId => $threatModelId, documentId => $documentId, key => $key);
};
if ($@) {
    warn "Exception when calling ThreatModelSubResourcesApi->deleteDocumentMetadataByKey: $@\n";
}
from __future__ import print_statement
import time
import swagger_client
from swagger_client.rest import ApiException
from pprint import pprint


# create an instance of the API class
api_instance = swagger_client.ThreatModelSubResourcesApi()
threatModelId = 38400000-8cf0-11bd-b23e-10b96e4ef00d # UUID | Unique identifier of the threat model (UUID)
documentId = 38400000-8cf0-11bd-b23e-10b96e4ef00d # UUID | Unique identifier of the document (UUID)
key = key_example # String | Metadata key to delete

try: 
    # Delete document metadata by key
    api_instance.delete_document_metadata_by_key(threatModelId, documentId, key)
except ApiException as e:
    print("Exception when calling ThreatModelSubResourcesApi->deleteDocumentMetadataByKey: %s\n" % e)

Parameters

Path parameters
Name Description
threat_model_id*
UUID (uuid)
Unique identifier of the threat model (UUID)
Required
document_id*
UUID (uuid)
Unique identifier of the document (UUID)
Required
key*
String
Metadata key to delete
Required

Responses

Status: 204 - Metadata entry deleted successfully

Status: 401 - Error response

Status: 403 - Error response

Status: 404 - Error response

Status: 500 - Error response


deleteNoteMetadataByKey

Delete note metadata by key

Deletes a specific metadata entry by key for the specified note


/threat_models/{threat_model_id}/notes/{note_id}/metadata/{key}

Usage and SDK Samples

curl -X DELETE\
 -H "Authorization: Bearer [[accessToken]]"\
-H "Accept: application/json"\
"http://localhost:8080/threat_models/{threat_model_id}/notes/{note_id}/metadata/{key}"
import io.swagger.client.*;
import io.swagger.client.auth.*;
import io.swagger.client.model.*;
import io.swagger.client.api.ThreatModelSubResourcesApi;

import java.io.File;
import java.util.*;

public class ThreatModelSubResourcesApiExample {

    public static void main(String[] args) {
        ApiClient defaultClient = Configuration.getDefaultApiClient();


        ThreatModelSubResourcesApi apiInstance = new ThreatModelSubResourcesApi();
        UUID threatModelId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // UUID | Unique identifier of the threat model (UUID)
        UUID noteId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // UUID | Unique identifier of the note (UUID)
        String key = key_example; // String | Metadata key to delete
        try {
            apiInstance.deleteNoteMetadataByKey(threatModelId, noteId, key);
        } catch (ApiException e) {
            System.err.println("Exception when calling ThreatModelSubResourcesApi#deleteNoteMetadataByKey");
            e.printStackTrace();
        }
    }
}
import io.swagger.client.api.ThreatModelSubResourcesApi;

public class ThreatModelSubResourcesApiExample {

    public static void main(String[] args) {
        ThreatModelSubResourcesApi apiInstance = new ThreatModelSubResourcesApi();
        UUID threatModelId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // UUID | Unique identifier of the threat model (UUID)
        UUID noteId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // UUID | Unique identifier of the note (UUID)
        String key = key_example; // String | Metadata key to delete
        try {
            apiInstance.deleteNoteMetadataByKey(threatModelId, noteId, key);
        } catch (ApiException e) {
            System.err.println("Exception when calling ThreatModelSubResourcesApi#deleteNoteMetadataByKey");
            e.printStackTrace();
        }
    }
}
Configuration *apiConfig = [Configuration sharedConfig];
UUID *threatModelId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // Unique identifier of the threat model (UUID)
UUID *noteId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // Unique identifier of the note (UUID)
String *key = key_example; // Metadata key to delete

ThreatModelSubResourcesApi *apiInstance = [[ThreatModelSubResourcesApi alloc] init];

// Delete note metadata by key
[apiInstance deleteNoteMetadataByKeyWith:threatModelId
    noteId:noteId
    key:key
              completionHandler: ^(NSError* error) {
                            if (error) {
                                NSLog(@"Error: %@", error);
                            }
                        }];
var TmiThreatModelingImprovedApi = require('tmi__threat_modeling_improved_api');
var defaultClient = TmiThreatModelingImprovedApi.ApiClient.instance;


var api = new TmiThreatModelingImprovedApi.ThreatModelSubResourcesApi()
var threatModelId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // {{UUID}} Unique identifier of the threat model (UUID)
var noteId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // {{UUID}} Unique identifier of the note (UUID)
var key = key_example; // {{String}} Metadata key to delete

var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully.');
  }
};
api.deleteNoteMetadataByKey(threatModelId, noteId, key, callback);
using System;
using System.Diagnostics;
using IO.Swagger.Api;
using IO.Swagger.Client;
using IO.Swagger.Model;

namespace Example
{
    public class deleteNoteMetadataByKeyExample
    {
        public void main()
        {


            var apiInstance = new ThreatModelSubResourcesApi();
            var threatModelId = new UUID(); // UUID | Unique identifier of the threat model (UUID)
            var noteId = new UUID(); // UUID | Unique identifier of the note (UUID)
            var key = key_example;  // String | Metadata key to delete

            try
            {
                // Delete note metadata by key
                apiInstance.deleteNoteMetadataByKey(threatModelId, noteId, key);
            }
            catch (Exception e)
            {
                Debug.Print("Exception when calling ThreatModelSubResourcesApi.deleteNoteMetadataByKey: " + e.Message );
            }
        }
    }
}
<?php
require_once(__DIR__ . '/vendor/autoload.php');


$api_instance = new Swagger\Client\ApiThreatModelSubResourcesApi();
$threatModelId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // UUID | Unique identifier of the threat model (UUID)
$noteId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // UUID | Unique identifier of the note (UUID)
$key = key_example; // String | Metadata key to delete

try {
    $api_instance->deleteNoteMetadataByKey($threatModelId, $noteId, $key);
} catch (Exception $e) {
    echo 'Exception when calling ThreatModelSubResourcesApi->deleteNoteMetadataByKey: ', $e->getMessage(), PHP_EOL;
}
?>
use Data::Dumper;
use WWW::SwaggerClient::Configuration;
use WWW::SwaggerClient::ThreatModelSubResourcesApi;


my $api_instance = WWW::SwaggerClient::ThreatModelSubResourcesApi->new();
my $threatModelId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; # UUID | Unique identifier of the threat model (UUID)
my $noteId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; # UUID | Unique identifier of the note (UUID)
my $key = key_example; # String | Metadata key to delete

eval { 
    $api_instance->deleteNoteMetadataByKey(threatModelId => $threatModelId, noteId => $noteId, key => $key);
};
if ($@) {
    warn "Exception when calling ThreatModelSubResourcesApi->deleteNoteMetadataByKey: $@\n";
}
from __future__ import print_statement
import time
import swagger_client
from swagger_client.rest import ApiException
from pprint import pprint


# create an instance of the API class
api_instance = swagger_client.ThreatModelSubResourcesApi()
threatModelId = 38400000-8cf0-11bd-b23e-10b96e4ef00d # UUID | Unique identifier of the threat model (UUID)
noteId = 38400000-8cf0-11bd-b23e-10b96e4ef00d # UUID | Unique identifier of the note (UUID)
key = key_example # String | Metadata key to delete

try: 
    # Delete note metadata by key
    api_instance.delete_note_metadata_by_key(threatModelId, noteId, key)
except ApiException as e:
    print("Exception when calling ThreatModelSubResourcesApi->deleteNoteMetadataByKey: %s\n" % e)

Parameters

Path parameters
Name Description
threat_model_id*
UUID (uuid)
Unique identifier of the threat model (UUID)
Required
note_id*
UUID (uuid)
Unique identifier of the note (UUID)
Required
key*
String
Metadata key to delete
Required

Responses

Status: 204 - Metadata entry deleted successfully

Status: 401 - Error response

Status: 403 - Error response

Status: 404 - Error response

Status: 500 - Error response


deleteRepositoryMetadataByKey

Delete source metadata by key

Deletes a specific metadata entry by key for the specified source reference


/threat_models/{threat_model_id}/repositories/{repository_id}/metadata/{key}

Usage and SDK Samples

curl -X DELETE\
 -H "Authorization: Bearer [[accessToken]]"\
-H "Accept: application/json"\
"http://localhost:8080/threat_models/{threat_model_id}/repositories/{repository_id}/metadata/{key}"
import io.swagger.client.*;
import io.swagger.client.auth.*;
import io.swagger.client.model.*;
import io.swagger.client.api.ThreatModelSubResourcesApi;

import java.io.File;
import java.util.*;

public class ThreatModelSubResourcesApiExample {

    public static void main(String[] args) {
        ApiClient defaultClient = Configuration.getDefaultApiClient();


        ThreatModelSubResourcesApi apiInstance = new ThreatModelSubResourcesApi();
        UUID threatModelId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // UUID | Unique identifier of the threat model (UUID)
        UUID repositoryId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // UUID | Unique identifier of the source reference (UUID)
        String key = key_example; // String | Metadata key to delete
        try {
            apiInstance.deleteRepositoryMetadataByKey(threatModelId, repositoryId, key);
        } catch (ApiException e) {
            System.err.println("Exception when calling ThreatModelSubResourcesApi#deleteRepositoryMetadataByKey");
            e.printStackTrace();
        }
    }
}
import io.swagger.client.api.ThreatModelSubResourcesApi;

public class ThreatModelSubResourcesApiExample {

    public static void main(String[] args) {
        ThreatModelSubResourcesApi apiInstance = new ThreatModelSubResourcesApi();
        UUID threatModelId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // UUID | Unique identifier of the threat model (UUID)
        UUID repositoryId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // UUID | Unique identifier of the source reference (UUID)
        String key = key_example; // String | Metadata key to delete
        try {
            apiInstance.deleteRepositoryMetadataByKey(threatModelId, repositoryId, key);
        } catch (ApiException e) {
            System.err.println("Exception when calling ThreatModelSubResourcesApi#deleteRepositoryMetadataByKey");
            e.printStackTrace();
        }
    }
}
Configuration *apiConfig = [Configuration sharedConfig];
UUID *threatModelId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // Unique identifier of the threat model (UUID)
UUID *repositoryId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // Unique identifier of the source reference (UUID)
String *key = key_example; // Metadata key to delete

ThreatModelSubResourcesApi *apiInstance = [[ThreatModelSubResourcesApi alloc] init];

// Delete source metadata by key
[apiInstance deleteRepositoryMetadataByKeyWith:threatModelId
    repositoryId:repositoryId
    key:key
              completionHandler: ^(NSError* error) {
                            if (error) {
                                NSLog(@"Error: %@", error);
                            }
                        }];
var TmiThreatModelingImprovedApi = require('tmi__threat_modeling_improved_api');
var defaultClient = TmiThreatModelingImprovedApi.ApiClient.instance;


var api = new TmiThreatModelingImprovedApi.ThreatModelSubResourcesApi()
var threatModelId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // {{UUID}} Unique identifier of the threat model (UUID)
var repositoryId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // {{UUID}} Unique identifier of the source reference (UUID)
var key = key_example; // {{String}} Metadata key to delete

var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully.');
  }
};
api.deleteRepositoryMetadataByKey(threatModelId, repositoryId, key, callback);
using System;
using System.Diagnostics;
using IO.Swagger.Api;
using IO.Swagger.Client;
using IO.Swagger.Model;

namespace Example
{
    public class deleteRepositoryMetadataByKeyExample
    {
        public void main()
        {


            var apiInstance = new ThreatModelSubResourcesApi();
            var threatModelId = new UUID(); // UUID | Unique identifier of the threat model (UUID)
            var repositoryId = new UUID(); // UUID | Unique identifier of the source reference (UUID)
            var key = key_example;  // String | Metadata key to delete

            try
            {
                // Delete source metadata by key
                apiInstance.deleteRepositoryMetadataByKey(threatModelId, repositoryId, key);
            }
            catch (Exception e)
            {
                Debug.Print("Exception when calling ThreatModelSubResourcesApi.deleteRepositoryMetadataByKey: " + e.Message );
            }
        }
    }
}
<?php
require_once(__DIR__ . '/vendor/autoload.php');


$api_instance = new Swagger\Client\ApiThreatModelSubResourcesApi();
$threatModelId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // UUID | Unique identifier of the threat model (UUID)
$repositoryId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // UUID | Unique identifier of the source reference (UUID)
$key = key_example; // String | Metadata key to delete

try {
    $api_instance->deleteRepositoryMetadataByKey($threatModelId, $repositoryId, $key);
} catch (Exception $e) {
    echo 'Exception when calling ThreatModelSubResourcesApi->deleteRepositoryMetadataByKey: ', $e->getMessage(), PHP_EOL;
}
?>
use Data::Dumper;
use WWW::SwaggerClient::Configuration;
use WWW::SwaggerClient::ThreatModelSubResourcesApi;


my $api_instance = WWW::SwaggerClient::ThreatModelSubResourcesApi->new();
my $threatModelId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; # UUID | Unique identifier of the threat model (UUID)
my $repositoryId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; # UUID | Unique identifier of the source reference (UUID)
my $key = key_example; # String | Metadata key to delete

eval { 
    $api_instance->deleteRepositoryMetadataByKey(threatModelId => $threatModelId, repositoryId => $repositoryId, key => $key);
};
if ($@) {
    warn "Exception when calling ThreatModelSubResourcesApi->deleteRepositoryMetadataByKey: $@\n";
}
from __future__ import print_statement
import time
import swagger_client
from swagger_client.rest import ApiException
from pprint import pprint


# create an instance of the API class
api_instance = swagger_client.ThreatModelSubResourcesApi()
threatModelId = 38400000-8cf0-11bd-b23e-10b96e4ef00d # UUID | Unique identifier of the threat model (UUID)
repositoryId = 38400000-8cf0-11bd-b23e-10b96e4ef00d # UUID | Unique identifier of the source reference (UUID)
key = key_example # String | Metadata key to delete

try: 
    # Delete source metadata by key
    api_instance.delete_repository_metadata_by_key(threatModelId, repositoryId, key)
except ApiException as e:
    print("Exception when calling ThreatModelSubResourcesApi->deleteRepositoryMetadataByKey: %s\n" % e)

Parameters

Path parameters
Name Description
threat_model_id*
UUID (uuid)
Unique identifier of the threat model (UUID)
Required
repository_id*
UUID (uuid)
Unique identifier of the source reference (UUID)
Required
key*
String
Metadata key to delete
Required

Responses

Status: 204 - Metadata entry deleted successfully

Status: 401 - Error response

Status: 403 - Error response

Status: 404 - Error response

Status: 500 - Error response


deleteThreatMetadataByKey

Delete threat metadata by key

Deletes a specific metadata entry by key for the specified threat


/threat_models/{threat_model_id}/threats/{threat_id}/metadata/{key}

Usage and SDK Samples

curl -X DELETE\
 -H "Authorization: Bearer [[accessToken]]"\
-H "Accept: application/json"\
"http://localhost:8080/threat_models/{threat_model_id}/threats/{threat_id}/metadata/{key}"
import io.swagger.client.*;
import io.swagger.client.auth.*;
import io.swagger.client.model.*;
import io.swagger.client.api.ThreatModelSubResourcesApi;

import java.io.File;
import java.util.*;

public class ThreatModelSubResourcesApiExample {

    public static void main(String[] args) {
        ApiClient defaultClient = Configuration.getDefaultApiClient();


        ThreatModelSubResourcesApi apiInstance = new ThreatModelSubResourcesApi();
        UUID threatModelId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // UUID | Unique identifier of the threat model (UUID)
        UUID threatId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // UUID | Unique identifier of the threat (UUID)
        String key = key_example; // String | Metadata key to delete
        try {
            apiInstance.deleteThreatMetadataByKey(threatModelId, threatId, key);
        } catch (ApiException e) {
            System.err.println("Exception when calling ThreatModelSubResourcesApi#deleteThreatMetadataByKey");
            e.printStackTrace();
        }
    }
}
import io.swagger.client.api.ThreatModelSubResourcesApi;

public class ThreatModelSubResourcesApiExample {

    public static void main(String[] args) {
        ThreatModelSubResourcesApi apiInstance = new ThreatModelSubResourcesApi();
        UUID threatModelId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // UUID | Unique identifier of the threat model (UUID)
        UUID threatId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // UUID | Unique identifier of the threat (UUID)
        String key = key_example; // String | Metadata key to delete
        try {
            apiInstance.deleteThreatMetadataByKey(threatModelId, threatId, key);
        } catch (ApiException e) {
            System.err.println("Exception when calling ThreatModelSubResourcesApi#deleteThreatMetadataByKey");
            e.printStackTrace();
        }
    }
}
Configuration *apiConfig = [Configuration sharedConfig];
UUID *threatModelId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // Unique identifier of the threat model (UUID)
UUID *threatId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // Unique identifier of the threat (UUID)
String *key = key_example; // Metadata key to delete

ThreatModelSubResourcesApi *apiInstance = [[ThreatModelSubResourcesApi alloc] init];

// Delete threat metadata by key
[apiInstance deleteThreatMetadataByKeyWith:threatModelId
    threatId:threatId
    key:key
              completionHandler: ^(NSError* error) {
                            if (error) {
                                NSLog(@"Error: %@", error);
                            }
                        }];
var TmiThreatModelingImprovedApi = require('tmi__threat_modeling_improved_api');
var defaultClient = TmiThreatModelingImprovedApi.ApiClient.instance;


var api = new TmiThreatModelingImprovedApi.ThreatModelSubResourcesApi()
var threatModelId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // {{UUID}} Unique identifier of the threat model (UUID)
var threatId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // {{UUID}} Unique identifier of the threat (UUID)
var key = key_example; // {{String}} Metadata key to delete

var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully.');
  }
};
api.deleteThreatMetadataByKey(threatModelId, threatId, key, callback);
using System;
using System.Diagnostics;
using IO.Swagger.Api;
using IO.Swagger.Client;
using IO.Swagger.Model;

namespace Example
{
    public class deleteThreatMetadataByKeyExample
    {
        public void main()
        {


            var apiInstance = new ThreatModelSubResourcesApi();
            var threatModelId = new UUID(); // UUID | Unique identifier of the threat model (UUID)
            var threatId = new UUID(); // UUID | Unique identifier of the threat (UUID)
            var key = key_example;  // String | Metadata key to delete

            try
            {
                // Delete threat metadata by key
                apiInstance.deleteThreatMetadataByKey(threatModelId, threatId, key);
            }
            catch (Exception e)
            {
                Debug.Print("Exception when calling ThreatModelSubResourcesApi.deleteThreatMetadataByKey: " + e.Message );
            }
        }
    }
}
<?php
require_once(__DIR__ . '/vendor/autoload.php');


$api_instance = new Swagger\Client\ApiThreatModelSubResourcesApi();
$threatModelId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // UUID | Unique identifier of the threat model (UUID)
$threatId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // UUID | Unique identifier of the threat (UUID)
$key = key_example; // String | Metadata key to delete

try {
    $api_instance->deleteThreatMetadataByKey($threatModelId, $threatId, $key);
} catch (Exception $e) {
    echo 'Exception when calling ThreatModelSubResourcesApi->deleteThreatMetadataByKey: ', $e->getMessage(), PHP_EOL;
}
?>
use Data::Dumper;
use WWW::SwaggerClient::Configuration;
use WWW::SwaggerClient::ThreatModelSubResourcesApi;


my $api_instance = WWW::SwaggerClient::ThreatModelSubResourcesApi->new();
my $threatModelId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; # UUID | Unique identifier of the threat model (UUID)
my $threatId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; # UUID | Unique identifier of the threat (UUID)
my $key = key_example; # String | Metadata key to delete

eval { 
    $api_instance->deleteThreatMetadataByKey(threatModelId => $threatModelId, threatId => $threatId, key => $key);
};
if ($@) {
    warn "Exception when calling ThreatModelSubResourcesApi->deleteThreatMetadataByKey: $@\n";
}
from __future__ import print_statement
import time
import swagger_client
from swagger_client.rest import ApiException
from pprint import pprint


# create an instance of the API class
api_instance = swagger_client.ThreatModelSubResourcesApi()
threatModelId = 38400000-8cf0-11bd-b23e-10b96e4ef00d # UUID | Unique identifier of the threat model (UUID)
threatId = 38400000-8cf0-11bd-b23e-10b96e4ef00d # UUID | Unique identifier of the threat (UUID)
key = key_example # String | Metadata key to delete

try: 
    # Delete threat metadata by key
    api_instance.delete_threat_metadata_by_key(threatModelId, threatId, key)
except ApiException as e:
    print("Exception when calling ThreatModelSubResourcesApi->deleteThreatMetadataByKey: %s\n" % e)

Parameters

Path parameters
Name Description
threat_model_id*
UUID (uuid)
Unique identifier of the threat model (UUID)
Required
threat_id*
UUID (uuid)
Unique identifier of the threat (UUID)
Required
key*
String
Metadata key to delete
Required

Responses

Status: 204 - Metadata entry deleted successfully

Status: 401 - Error response

Status: 403 - Error response

Status: 404 - Error response

Status: 500 - Error response


deleteThreatModelAsset

Delete an asset

Deletes an asset from the specified threat model


/threat_models/{threat_model_id}/assets/{asset_id}

Usage and SDK Samples

curl -X DELETE\
 -H "Authorization: Bearer [[accessToken]]"\
-H "Accept: application/json"\
"http://localhost:8080/threat_models/{threat_model_id}/assets/{asset_id}"
import io.swagger.client.*;
import io.swagger.client.auth.*;
import io.swagger.client.model.*;
import io.swagger.client.api.ThreatModelSubResourcesApi;

import java.io.File;
import java.util.*;

public class ThreatModelSubResourcesApiExample {

    public static void main(String[] args) {
        ApiClient defaultClient = Configuration.getDefaultApiClient();


        ThreatModelSubResourcesApi apiInstance = new ThreatModelSubResourcesApi();
        UUID threatModelId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // UUID | Unique identifier of the threat model (UUID)
        UUID assetId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // UUID | Unique identifier of the asset (UUID)
        try {
            apiInstance.deleteThreatModelAsset(threatModelId, assetId);
        } catch (ApiException e) {
            System.err.println("Exception when calling ThreatModelSubResourcesApi#deleteThreatModelAsset");
            e.printStackTrace();
        }
    }
}
import io.swagger.client.api.ThreatModelSubResourcesApi;

public class ThreatModelSubResourcesApiExample {

    public static void main(String[] args) {
        ThreatModelSubResourcesApi apiInstance = new ThreatModelSubResourcesApi();
        UUID threatModelId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // UUID | Unique identifier of the threat model (UUID)
        UUID assetId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // UUID | Unique identifier of the asset (UUID)
        try {
            apiInstance.deleteThreatModelAsset(threatModelId, assetId);
        } catch (ApiException e) {
            System.err.println("Exception when calling ThreatModelSubResourcesApi#deleteThreatModelAsset");
            e.printStackTrace();
        }
    }
}
Configuration *apiConfig = [Configuration sharedConfig];
UUID *threatModelId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // Unique identifier of the threat model (UUID)
UUID *assetId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // Unique identifier of the asset (UUID)

ThreatModelSubResourcesApi *apiInstance = [[ThreatModelSubResourcesApi alloc] init];

// Delete an asset
[apiInstance deleteThreatModelAssetWith:threatModelId
    assetId:assetId
              completionHandler: ^(NSError* error) {
                            if (error) {
                                NSLog(@"Error: %@", error);
                            }
                        }];
var TmiThreatModelingImprovedApi = require('tmi__threat_modeling_improved_api');
var defaultClient = TmiThreatModelingImprovedApi.ApiClient.instance;


var api = new TmiThreatModelingImprovedApi.ThreatModelSubResourcesApi()
var threatModelId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // {{UUID}} Unique identifier of the threat model (UUID)
var assetId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // {{UUID}} Unique identifier of the asset (UUID)

var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully.');
  }
};
api.deleteThreatModelAsset(threatModelId, assetId, callback);
using System;
using System.Diagnostics;
using IO.Swagger.Api;
using IO.Swagger.Client;
using IO.Swagger.Model;

namespace Example
{
    public class deleteThreatModelAssetExample
    {
        public void main()
        {


            var apiInstance = new ThreatModelSubResourcesApi();
            var threatModelId = new UUID(); // UUID | Unique identifier of the threat model (UUID)
            var assetId = new UUID(); // UUID | Unique identifier of the asset (UUID)

            try
            {
                // Delete an asset
                apiInstance.deleteThreatModelAsset(threatModelId, assetId);
            }
            catch (Exception e)
            {
                Debug.Print("Exception when calling ThreatModelSubResourcesApi.deleteThreatModelAsset: " + e.Message );
            }
        }
    }
}
<?php
require_once(__DIR__ . '/vendor/autoload.php');


$api_instance = new Swagger\Client\ApiThreatModelSubResourcesApi();
$threatModelId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // UUID | Unique identifier of the threat model (UUID)
$assetId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // UUID | Unique identifier of the asset (UUID)

try {
    $api_instance->deleteThreatModelAsset($threatModelId, $assetId);
} catch (Exception $e) {
    echo 'Exception when calling ThreatModelSubResourcesApi->deleteThreatModelAsset: ', $e->getMessage(), PHP_EOL;
}
?>
use Data::Dumper;
use WWW::SwaggerClient::Configuration;
use WWW::SwaggerClient::ThreatModelSubResourcesApi;


my $api_instance = WWW::SwaggerClient::ThreatModelSubResourcesApi->new();
my $threatModelId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; # UUID | Unique identifier of the threat model (UUID)
my $assetId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; # UUID | Unique identifier of the asset (UUID)

eval { 
    $api_instance->deleteThreatModelAsset(threatModelId => $threatModelId, assetId => $assetId);
};
if ($@) {
    warn "Exception when calling ThreatModelSubResourcesApi->deleteThreatModelAsset: $@\n";
}
from __future__ import print_statement
import time
import swagger_client
from swagger_client.rest import ApiException
from pprint import pprint


# create an instance of the API class
api_instance = swagger_client.ThreatModelSubResourcesApi()
threatModelId = 38400000-8cf0-11bd-b23e-10b96e4ef00d # UUID | Unique identifier of the threat model (UUID)
assetId = 38400000-8cf0-11bd-b23e-10b96e4ef00d # UUID | Unique identifier of the asset (UUID)

try: 
    # Delete an asset
    api_instance.delete_threat_model_asset(threatModelId, assetId)
except ApiException as e:
    print("Exception when calling ThreatModelSubResourcesApi->deleteThreatModelAsset: %s\n" % e)

Parameters

Path parameters
Name Description
threat_model_id*
UUID (uuid)
Unique identifier of the threat model (UUID)
Required
asset_id*
UUID (uuid)
Unique identifier of the asset (UUID)
Required

Responses

Status: 204 - Asset deleted successfully

Status: 401 - Error response

Status: 403 - Error response

Status: 404 - Error response

Status: 500 - Error response


deleteThreatModelAssetMetadata

Delete asset metadata

Deletes a metadata key-value pair from the specified asset


/threat_models/{threat_model_id}/assets/{asset_id}/metadata/{key}

Usage and SDK Samples

curl -X DELETE\
 -H "Authorization: Bearer [[accessToken]]"\
-H "Accept: application/json"\
"http://localhost:8080/threat_models/{threat_model_id}/assets/{asset_id}/metadata/{key}"
import io.swagger.client.*;
import io.swagger.client.auth.*;
import io.swagger.client.model.*;
import io.swagger.client.api.ThreatModelSubResourcesApi;

import java.io.File;
import java.util.*;

public class ThreatModelSubResourcesApiExample {

    public static void main(String[] args) {
        ApiClient defaultClient = Configuration.getDefaultApiClient();


        ThreatModelSubResourcesApi apiInstance = new ThreatModelSubResourcesApi();
        UUID threatModelId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // UUID | Unique identifier of the threat model (UUID)
        UUID assetId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // UUID | Unique identifier of the asset (UUID)
        String key = key_example; // String | Metadata key
        try {
            apiInstance.deleteThreatModelAssetMetadata(threatModelId, assetId, key);
        } catch (ApiException e) {
            System.err.println("Exception when calling ThreatModelSubResourcesApi#deleteThreatModelAssetMetadata");
            e.printStackTrace();
        }
    }
}
import io.swagger.client.api.ThreatModelSubResourcesApi;

public class ThreatModelSubResourcesApiExample {

    public static void main(String[] args) {
        ThreatModelSubResourcesApi apiInstance = new ThreatModelSubResourcesApi();
        UUID threatModelId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // UUID | Unique identifier of the threat model (UUID)
        UUID assetId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // UUID | Unique identifier of the asset (UUID)
        String key = key_example; // String | Metadata key
        try {
            apiInstance.deleteThreatModelAssetMetadata(threatModelId, assetId, key);
        } catch (ApiException e) {
            System.err.println("Exception when calling ThreatModelSubResourcesApi#deleteThreatModelAssetMetadata");
            e.printStackTrace();
        }
    }
}
Configuration *apiConfig = [Configuration sharedConfig];
UUID *threatModelId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // Unique identifier of the threat model (UUID)
UUID *assetId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // Unique identifier of the asset (UUID)
String *key = key_example; // Metadata key

ThreatModelSubResourcesApi *apiInstance = [[ThreatModelSubResourcesApi alloc] init];

// Delete asset metadata
[apiInstance deleteThreatModelAssetMetadataWith:threatModelId
    assetId:assetId
    key:key
              completionHandler: ^(NSError* error) {
                            if (error) {
                                NSLog(@"Error: %@", error);
                            }
                        }];
var TmiThreatModelingImprovedApi = require('tmi__threat_modeling_improved_api');
var defaultClient = TmiThreatModelingImprovedApi.ApiClient.instance;


var api = new TmiThreatModelingImprovedApi.ThreatModelSubResourcesApi()
var threatModelId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // {{UUID}} Unique identifier of the threat model (UUID)
var assetId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // {{UUID}} Unique identifier of the asset (UUID)
var key = key_example; // {{String}} Metadata key

var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully.');
  }
};
api.deleteThreatModelAssetMetadata(threatModelId, assetId, key, callback);
using System;
using System.Diagnostics;
using IO.Swagger.Api;
using IO.Swagger.Client;
using IO.Swagger.Model;

namespace Example
{
    public class deleteThreatModelAssetMetadataExample
    {
        public void main()
        {


            var apiInstance = new ThreatModelSubResourcesApi();
            var threatModelId = new UUID(); // UUID | Unique identifier of the threat model (UUID)
            var assetId = new UUID(); // UUID | Unique identifier of the asset (UUID)
            var key = key_example;  // String | Metadata key

            try
            {
                // Delete asset metadata
                apiInstance.deleteThreatModelAssetMetadata(threatModelId, assetId, key);
            }
            catch (Exception e)
            {
                Debug.Print("Exception when calling ThreatModelSubResourcesApi.deleteThreatModelAssetMetadata: " + e.Message );
            }
        }
    }
}
<?php
require_once(__DIR__ . '/vendor/autoload.php');


$api_instance = new Swagger\Client\ApiThreatModelSubResourcesApi();
$threatModelId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // UUID | Unique identifier of the threat model (UUID)
$assetId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // UUID | Unique identifier of the asset (UUID)
$key = key_example; // String | Metadata key

try {
    $api_instance->deleteThreatModelAssetMetadata($threatModelId, $assetId, $key);
} catch (Exception $e) {
    echo 'Exception when calling ThreatModelSubResourcesApi->deleteThreatModelAssetMetadata: ', $e->getMessage(), PHP_EOL;
}
?>
use Data::Dumper;
use WWW::SwaggerClient::Configuration;
use WWW::SwaggerClient::ThreatModelSubResourcesApi;


my $api_instance = WWW::SwaggerClient::ThreatModelSubResourcesApi->new();
my $threatModelId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; # UUID | Unique identifier of the threat model (UUID)
my $assetId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; # UUID | Unique identifier of the asset (UUID)
my $key = key_example; # String | Metadata key

eval { 
    $api_instance->deleteThreatModelAssetMetadata(threatModelId => $threatModelId, assetId => $assetId, key => $key);
};
if ($@) {
    warn "Exception when calling ThreatModelSubResourcesApi->deleteThreatModelAssetMetadata: $@\n";
}
from __future__ import print_statement
import time
import swagger_client
from swagger_client.rest import ApiException
from pprint import pprint


# create an instance of the API class
api_instance = swagger_client.ThreatModelSubResourcesApi()
threatModelId = 38400000-8cf0-11bd-b23e-10b96e4ef00d # UUID | Unique identifier of the threat model (UUID)
assetId = 38400000-8cf0-11bd-b23e-10b96e4ef00d # UUID | Unique identifier of the asset (UUID)
key = key_example # String | Metadata key

try: 
    # Delete asset metadata
    api_instance.delete_threat_model_asset_metadata(threatModelId, assetId, key)
except ApiException as e:
    print("Exception when calling ThreatModelSubResourcesApi->deleteThreatModelAssetMetadata: %s\n" % e)

Parameters

Path parameters
Name Description
threat_model_id*
UUID (uuid)
Unique identifier of the threat model (UUID)
Required
asset_id*
UUID (uuid)
Unique identifier of the asset (UUID)
Required
key*
String
Metadata key
Required

Responses

Status: 204 - Metadata deleted successfully

Status: 401 - Error response

Status: 403 - Error response

Status: 404 - Error response

Status: 500 - Error response


deleteThreatModelDiagram

Delete a diagram

Permanently removes a diagram from the threat model


/threat_models/{threat_model_id}/diagrams/{diagram_id}

Usage and SDK Samples

curl -X DELETE\
 -H "Authorization: Bearer [[accessToken]]"\
-H "Accept: application/json"\
"http://localhost:8080/threat_models/{threat_model_id}/diagrams/{diagram_id}"
import io.swagger.client.*;
import io.swagger.client.auth.*;
import io.swagger.client.model.*;
import io.swagger.client.api.ThreatModelSubResourcesApi;

import java.io.File;
import java.util.*;

public class ThreatModelSubResourcesApiExample {

    public static void main(String[] args) {
        ApiClient defaultClient = Configuration.getDefaultApiClient();


        ThreatModelSubResourcesApi apiInstance = new ThreatModelSubResourcesApi();
        UUID threatModelId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // UUID | Unique identifier of the threat model (UUID)
        UUID diagramId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // UUID | Unique identifier of the diagram (UUID)
        try {
            apiInstance.deleteThreatModelDiagram(threatModelId, diagramId);
        } catch (ApiException e) {
            System.err.println("Exception when calling ThreatModelSubResourcesApi#deleteThreatModelDiagram");
            e.printStackTrace();
        }
    }
}
import io.swagger.client.api.ThreatModelSubResourcesApi;

public class ThreatModelSubResourcesApiExample {

    public static void main(String[] args) {
        ThreatModelSubResourcesApi apiInstance = new ThreatModelSubResourcesApi();
        UUID threatModelId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // UUID | Unique identifier of the threat model (UUID)
        UUID diagramId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // UUID | Unique identifier of the diagram (UUID)
        try {
            apiInstance.deleteThreatModelDiagram(threatModelId, diagramId);
        } catch (ApiException e) {
            System.err.println("Exception when calling ThreatModelSubResourcesApi#deleteThreatModelDiagram");
            e.printStackTrace();
        }
    }
}
Configuration *apiConfig = [Configuration sharedConfig];
UUID *threatModelId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // Unique identifier of the threat model (UUID)
UUID *diagramId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // Unique identifier of the diagram (UUID)

ThreatModelSubResourcesApi *apiInstance = [[ThreatModelSubResourcesApi alloc] init];

// Delete a diagram
[apiInstance deleteThreatModelDiagramWith:threatModelId
    diagramId:diagramId
              completionHandler: ^(NSError* error) {
                            if (error) {
                                NSLog(@"Error: %@", error);
                            }
                        }];
var TmiThreatModelingImprovedApi = require('tmi__threat_modeling_improved_api');
var defaultClient = TmiThreatModelingImprovedApi.ApiClient.instance;


var api = new TmiThreatModelingImprovedApi.ThreatModelSubResourcesApi()
var threatModelId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // {{UUID}} Unique identifier of the threat model (UUID)
var diagramId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // {{UUID}} Unique identifier of the diagram (UUID)

var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully.');
  }
};
api.deleteThreatModelDiagram(threatModelId, diagramId, callback);
using System;
using System.Diagnostics;
using IO.Swagger.Api;
using IO.Swagger.Client;
using IO.Swagger.Model;

namespace Example
{
    public class deleteThreatModelDiagramExample
    {
        public void main()
        {


            var apiInstance = new ThreatModelSubResourcesApi();
            var threatModelId = new UUID(); // UUID | Unique identifier of the threat model (UUID)
            var diagramId = new UUID(); // UUID | Unique identifier of the diagram (UUID)

            try
            {
                // Delete a diagram
                apiInstance.deleteThreatModelDiagram(threatModelId, diagramId);
            }
            catch (Exception e)
            {
                Debug.Print("Exception when calling ThreatModelSubResourcesApi.deleteThreatModelDiagram: " + e.Message );
            }
        }
    }
}
<?php
require_once(__DIR__ . '/vendor/autoload.php');


$api_instance = new Swagger\Client\ApiThreatModelSubResourcesApi();
$threatModelId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // UUID | Unique identifier of the threat model (UUID)
$diagramId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // UUID | Unique identifier of the diagram (UUID)

try {
    $api_instance->deleteThreatModelDiagram($threatModelId, $diagramId);
} catch (Exception $e) {
    echo 'Exception when calling ThreatModelSubResourcesApi->deleteThreatModelDiagram: ', $e->getMessage(), PHP_EOL;
}
?>
use Data::Dumper;
use WWW::SwaggerClient::Configuration;
use WWW::SwaggerClient::ThreatModelSubResourcesApi;


my $api_instance = WWW::SwaggerClient::ThreatModelSubResourcesApi->new();
my $threatModelId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; # UUID | Unique identifier of the threat model (UUID)
my $diagramId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; # UUID | Unique identifier of the diagram (UUID)

eval { 
    $api_instance->deleteThreatModelDiagram(threatModelId => $threatModelId, diagramId => $diagramId);
};
if ($@) {
    warn "Exception when calling ThreatModelSubResourcesApi->deleteThreatModelDiagram: $@\n";
}
from __future__ import print_statement
import time
import swagger_client
from swagger_client.rest import ApiException
from pprint import pprint


# create an instance of the API class
api_instance = swagger_client.ThreatModelSubResourcesApi()
threatModelId = 38400000-8cf0-11bd-b23e-10b96e4ef00d # UUID | Unique identifier of the threat model (UUID)
diagramId = 38400000-8cf0-11bd-b23e-10b96e4ef00d # UUID | Unique identifier of the diagram (UUID)

try: 
    # Delete a diagram
    api_instance.delete_threat_model_diagram(threatModelId, diagramId)
except ApiException as e:
    print("Exception when calling ThreatModelSubResourcesApi->deleteThreatModelDiagram: %s\n" % e)

Parameters

Path parameters
Name Description
threat_model_id*
UUID (uuid)
Unique identifier of the threat model (UUID)
Required
diagram_id*
UUID (uuid)
Unique identifier of the diagram (UUID)
Required

Responses

Status: 204 - Diagram deleted successfully

Status: 401 - Error response

Status: 403 - Error response

Status: 404 - Error response

Status: 500 - Error response


deleteThreatModelDocument

Delete a document

Deletes a specific document from the threat model


/threat_models/{threat_model_id}/documents/{document_id}

Usage and SDK Samples

curl -X DELETE\
 -H "Authorization: Bearer [[accessToken]]"\
-H "Accept: application/json"\
"http://localhost:8080/threat_models/{threat_model_id}/documents/{document_id}"
import io.swagger.client.*;
import io.swagger.client.auth.*;
import io.swagger.client.model.*;
import io.swagger.client.api.ThreatModelSubResourcesApi;

import java.io.File;
import java.util.*;

public class ThreatModelSubResourcesApiExample {

    public static void main(String[] args) {
        ApiClient defaultClient = Configuration.getDefaultApiClient();


        ThreatModelSubResourcesApi apiInstance = new ThreatModelSubResourcesApi();
        UUID threatModelId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // UUID | Unique identifier of the threat model (UUID)
        UUID documentId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // UUID | Unique identifier of the document (UUID)
        try {
            apiInstance.deleteThreatModelDocument(threatModelId, documentId);
        } catch (ApiException e) {
            System.err.println("Exception when calling ThreatModelSubResourcesApi#deleteThreatModelDocument");
            e.printStackTrace();
        }
    }
}
import io.swagger.client.api.ThreatModelSubResourcesApi;

public class ThreatModelSubResourcesApiExample {

    public static void main(String[] args) {
        ThreatModelSubResourcesApi apiInstance = new ThreatModelSubResourcesApi();
        UUID threatModelId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // UUID | Unique identifier of the threat model (UUID)
        UUID documentId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // UUID | Unique identifier of the document (UUID)
        try {
            apiInstance.deleteThreatModelDocument(threatModelId, documentId);
        } catch (ApiException e) {
            System.err.println("Exception when calling ThreatModelSubResourcesApi#deleteThreatModelDocument");
            e.printStackTrace();
        }
    }
}
Configuration *apiConfig = [Configuration sharedConfig];
UUID *threatModelId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // Unique identifier of the threat model (UUID)
UUID *documentId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // Unique identifier of the document (UUID)

ThreatModelSubResourcesApi *apiInstance = [[ThreatModelSubResourcesApi alloc] init];

// Delete a document
[apiInstance deleteThreatModelDocumentWith:threatModelId
    documentId:documentId
              completionHandler: ^(NSError* error) {
                            if (error) {
                                NSLog(@"Error: %@", error);
                            }
                        }];
var TmiThreatModelingImprovedApi = require('tmi__threat_modeling_improved_api');
var defaultClient = TmiThreatModelingImprovedApi.ApiClient.instance;


var api = new TmiThreatModelingImprovedApi.ThreatModelSubResourcesApi()
var threatModelId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // {{UUID}} Unique identifier of the threat model (UUID)
var documentId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // {{UUID}} Unique identifier of the document (UUID)

var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully.');
  }
};
api.deleteThreatModelDocument(threatModelId, documentId, callback);
using System;
using System.Diagnostics;
using IO.Swagger.Api;
using IO.Swagger.Client;
using IO.Swagger.Model;

namespace Example
{
    public class deleteThreatModelDocumentExample
    {
        public void main()
        {


            var apiInstance = new ThreatModelSubResourcesApi();
            var threatModelId = new UUID(); // UUID | Unique identifier of the threat model (UUID)
            var documentId = new UUID(); // UUID | Unique identifier of the document (UUID)

            try
            {
                // Delete a document
                apiInstance.deleteThreatModelDocument(threatModelId, documentId);
            }
            catch (Exception e)
            {
                Debug.Print("Exception when calling ThreatModelSubResourcesApi.deleteThreatModelDocument: " + e.Message );
            }
        }
    }
}
<?php
require_once(__DIR__ . '/vendor/autoload.php');


$api_instance = new Swagger\Client\ApiThreatModelSubResourcesApi();
$threatModelId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // UUID | Unique identifier of the threat model (UUID)
$documentId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // UUID | Unique identifier of the document (UUID)

try {
    $api_instance->deleteThreatModelDocument($threatModelId, $documentId);
} catch (Exception $e) {
    echo 'Exception when calling ThreatModelSubResourcesApi->deleteThreatModelDocument: ', $e->getMessage(), PHP_EOL;
}
?>
use Data::Dumper;
use WWW::SwaggerClient::Configuration;
use WWW::SwaggerClient::ThreatModelSubResourcesApi;


my $api_instance = WWW::SwaggerClient::ThreatModelSubResourcesApi->new();
my $threatModelId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; # UUID | Unique identifier of the threat model (UUID)
my $documentId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; # UUID | Unique identifier of the document (UUID)

eval { 
    $api_instance->deleteThreatModelDocument(threatModelId => $threatModelId, documentId => $documentId);
};
if ($@) {
    warn "Exception when calling ThreatModelSubResourcesApi->deleteThreatModelDocument: $@\n";
}
from __future__ import print_statement
import time
import swagger_client
from swagger_client.rest import ApiException
from pprint import pprint


# create an instance of the API class
api_instance = swagger_client.ThreatModelSubResourcesApi()
threatModelId = 38400000-8cf0-11bd-b23e-10b96e4ef00d # UUID | Unique identifier of the threat model (UUID)
documentId = 38400000-8cf0-11bd-b23e-10b96e4ef00d # UUID | Unique identifier of the document (UUID)

try: 
    # Delete a document
    api_instance.delete_threat_model_document(threatModelId, documentId)
except ApiException as e:
    print("Exception when calling ThreatModelSubResourcesApi->deleteThreatModelDocument: %s\n" % e)

Parameters

Path parameters
Name Description
threat_model_id*
UUID (uuid)
Unique identifier of the threat model (UUID)
Required
document_id*
UUID (uuid)
Unique identifier of the document (UUID)
Required

Responses

Status: 204 - Document deleted successfully

Status: 401 - Error response

Status: 403 - Error response

Status: 404 - Error response

Status: 500 - Error response


deleteThreatModelMetadataByKey

Delete threat model metadata by key

Deletes a specific metadata entry by key for the specified threat model


/threat_models/{threat_model_id}/metadata/{key}

Usage and SDK Samples

curl -X DELETE\
 -H "Authorization: Bearer [[accessToken]]"\
-H "Accept: application/json"\
"http://localhost:8080/threat_models/{threat_model_id}/metadata/{key}"
import io.swagger.client.*;
import io.swagger.client.auth.*;
import io.swagger.client.model.*;
import io.swagger.client.api.ThreatModelSubResourcesApi;

import java.io.File;
import java.util.*;

public class ThreatModelSubResourcesApiExample {

    public static void main(String[] args) {
        ApiClient defaultClient = Configuration.getDefaultApiClient();


        ThreatModelSubResourcesApi apiInstance = new ThreatModelSubResourcesApi();
        UUID threatModelId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // UUID | Unique identifier of the threat model (UUID)
        String key = key_example; // String | Metadata key to delete
        try {
            apiInstance.deleteThreatModelMetadataByKey(threatModelId, key);
        } catch (ApiException e) {
            System.err.println("Exception when calling ThreatModelSubResourcesApi#deleteThreatModelMetadataByKey");
            e.printStackTrace();
        }
    }
}
import io.swagger.client.api.ThreatModelSubResourcesApi;

public class ThreatModelSubResourcesApiExample {

    public static void main(String[] args) {
        ThreatModelSubResourcesApi apiInstance = new ThreatModelSubResourcesApi();
        UUID threatModelId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // UUID | Unique identifier of the threat model (UUID)
        String key = key_example; // String | Metadata key to delete
        try {
            apiInstance.deleteThreatModelMetadataByKey(threatModelId, key);
        } catch (ApiException e) {
            System.err.println("Exception when calling ThreatModelSubResourcesApi#deleteThreatModelMetadataByKey");
            e.printStackTrace();
        }
    }
}
Configuration *apiConfig = [Configuration sharedConfig];
UUID *threatModelId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // Unique identifier of the threat model (UUID)
String *key = key_example; // Metadata key to delete

ThreatModelSubResourcesApi *apiInstance = [[ThreatModelSubResourcesApi alloc] init];

// Delete threat model metadata by key
[apiInstance deleteThreatModelMetadataByKeyWith:threatModelId
    key:key
              completionHandler: ^(NSError* error) {
                            if (error) {
                                NSLog(@"Error: %@", error);
                            }
                        }];
var TmiThreatModelingImprovedApi = require('tmi__threat_modeling_improved_api');
var defaultClient = TmiThreatModelingImprovedApi.ApiClient.instance;


var api = new TmiThreatModelingImprovedApi.ThreatModelSubResourcesApi()
var threatModelId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // {{UUID}} Unique identifier of the threat model (UUID)
var key = key_example; // {{String}} Metadata key to delete

var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully.');
  }
};
api.deleteThreatModelMetadataByKey(threatModelId, key, callback);
using System;
using System.Diagnostics;
using IO.Swagger.Api;
using IO.Swagger.Client;
using IO.Swagger.Model;

namespace Example
{
    public class deleteThreatModelMetadataByKeyExample
    {
        public void main()
        {


            var apiInstance = new ThreatModelSubResourcesApi();
            var threatModelId = new UUID(); // UUID | Unique identifier of the threat model (UUID)
            var key = key_example;  // String | Metadata key to delete

            try
            {
                // Delete threat model metadata by key
                apiInstance.deleteThreatModelMetadataByKey(threatModelId, key);
            }
            catch (Exception e)
            {
                Debug.Print("Exception when calling ThreatModelSubResourcesApi.deleteThreatModelMetadataByKey: " + e.Message );
            }
        }
    }
}
<?php
require_once(__DIR__ . '/vendor/autoload.php');


$api_instance = new Swagger\Client\ApiThreatModelSubResourcesApi();
$threatModelId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // UUID | Unique identifier of the threat model (UUID)
$key = key_example; // String | Metadata key to delete

try {
    $api_instance->deleteThreatModelMetadataByKey($threatModelId, $key);
} catch (Exception $e) {
    echo 'Exception when calling ThreatModelSubResourcesApi->deleteThreatModelMetadataByKey: ', $e->getMessage(), PHP_EOL;
}
?>
use Data::Dumper;
use WWW::SwaggerClient::Configuration;
use WWW::SwaggerClient::ThreatModelSubResourcesApi;


my $api_instance = WWW::SwaggerClient::ThreatModelSubResourcesApi->new();
my $threatModelId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; # UUID | Unique identifier of the threat model (UUID)
my $key = key_example; # String | Metadata key to delete

eval { 
    $api_instance->deleteThreatModelMetadataByKey(threatModelId => $threatModelId, key => $key);
};
if ($@) {
    warn "Exception when calling ThreatModelSubResourcesApi->deleteThreatModelMetadataByKey: $@\n";
}
from __future__ import print_statement
import time
import swagger_client
from swagger_client.rest import ApiException
from pprint import pprint


# create an instance of the API class
api_instance = swagger_client.ThreatModelSubResourcesApi()
threatModelId = 38400000-8cf0-11bd-b23e-10b96e4ef00d # UUID | Unique identifier of the threat model (UUID)
key = key_example # String | Metadata key to delete

try: 
    # Delete threat model metadata by key
    api_instance.delete_threat_model_metadata_by_key(threatModelId, key)
except ApiException as e:
    print("Exception when calling ThreatModelSubResourcesApi->deleteThreatModelMetadataByKey: %s\n" % e)

Parameters

Path parameters
Name Description
threat_model_id*
UUID (uuid)
Unique identifier of the threat model (UUID)
Required
key*
String
Metadata key to delete
Required

Responses

Status: 204 - Metadata entry deleted successfully

Status: 401 - Error response

Status: 403 - Error response

Status: 404 - Error response

Status: 500 - Error response


deleteThreatModelNote

Delete a note

Deletes a specific note from the threat model


/threat_models/{threat_model_id}/notes/{note_id}

Usage and SDK Samples

curl -X DELETE\
 -H "Authorization: Bearer [[accessToken]]"\
-H "Accept: application/json"\
"http://localhost:8080/threat_models/{threat_model_id}/notes/{note_id}"
import io.swagger.client.*;
import io.swagger.client.auth.*;
import io.swagger.client.model.*;
import io.swagger.client.api.ThreatModelSubResourcesApi;

import java.io.File;
import java.util.*;

public class ThreatModelSubResourcesApiExample {

    public static void main(String[] args) {
        ApiClient defaultClient = Configuration.getDefaultApiClient();


        ThreatModelSubResourcesApi apiInstance = new ThreatModelSubResourcesApi();
        UUID threatModelId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // UUID | Unique identifier of the threat model (UUID)
        UUID noteId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // UUID | Unique identifier of the note (UUID)
        try {
            apiInstance.deleteThreatModelNote(threatModelId, noteId);
        } catch (ApiException e) {
            System.err.println("Exception when calling ThreatModelSubResourcesApi#deleteThreatModelNote");
            e.printStackTrace();
        }
    }
}
import io.swagger.client.api.ThreatModelSubResourcesApi;

public class ThreatModelSubResourcesApiExample {

    public static void main(String[] args) {
        ThreatModelSubResourcesApi apiInstance = new ThreatModelSubResourcesApi();
        UUID threatModelId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // UUID | Unique identifier of the threat model (UUID)
        UUID noteId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // UUID | Unique identifier of the note (UUID)
        try {
            apiInstance.deleteThreatModelNote(threatModelId, noteId);
        } catch (ApiException e) {
            System.err.println("Exception when calling ThreatModelSubResourcesApi#deleteThreatModelNote");
            e.printStackTrace();
        }
    }
}
Configuration *apiConfig = [Configuration sharedConfig];
UUID *threatModelId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // Unique identifier of the threat model (UUID)
UUID *noteId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // Unique identifier of the note (UUID)

ThreatModelSubResourcesApi *apiInstance = [[ThreatModelSubResourcesApi alloc] init];

// Delete a note
[apiInstance deleteThreatModelNoteWith:threatModelId
    noteId:noteId
              completionHandler: ^(NSError* error) {
                            if (error) {
                                NSLog(@"Error: %@", error);
                            }
                        }];
var TmiThreatModelingImprovedApi = require('tmi__threat_modeling_improved_api');
var defaultClient = TmiThreatModelingImprovedApi.ApiClient.instance;


var api = new TmiThreatModelingImprovedApi.ThreatModelSubResourcesApi()
var threatModelId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // {{UUID}} Unique identifier of the threat model (UUID)
var noteId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // {{UUID}} Unique identifier of the note (UUID)

var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully.');
  }
};
api.deleteThreatModelNote(threatModelId, noteId, callback);
using System;
using System.Diagnostics;
using IO.Swagger.Api;
using IO.Swagger.Client;
using IO.Swagger.Model;

namespace Example
{
    public class deleteThreatModelNoteExample
    {
        public void main()
        {


            var apiInstance = new ThreatModelSubResourcesApi();
            var threatModelId = new UUID(); // UUID | Unique identifier of the threat model (UUID)
            var noteId = new UUID(); // UUID | Unique identifier of the note (UUID)

            try
            {
                // Delete a note
                apiInstance.deleteThreatModelNote(threatModelId, noteId);
            }
            catch (Exception e)
            {
                Debug.Print("Exception when calling ThreatModelSubResourcesApi.deleteThreatModelNote: " + e.Message );
            }
        }
    }
}
<?php
require_once(__DIR__ . '/vendor/autoload.php');


$api_instance = new Swagger\Client\ApiThreatModelSubResourcesApi();
$threatModelId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // UUID | Unique identifier of the threat model (UUID)
$noteId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // UUID | Unique identifier of the note (UUID)

try {
    $api_instance->deleteThreatModelNote($threatModelId, $noteId);
} catch (Exception $e) {
    echo 'Exception when calling ThreatModelSubResourcesApi->deleteThreatModelNote: ', $e->getMessage(), PHP_EOL;
}
?>
use Data::Dumper;
use WWW::SwaggerClient::Configuration;
use WWW::SwaggerClient::ThreatModelSubResourcesApi;


my $api_instance = WWW::SwaggerClient::ThreatModelSubResourcesApi->new();
my $threatModelId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; # UUID | Unique identifier of the threat model (UUID)
my $noteId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; # UUID | Unique identifier of the note (UUID)

eval { 
    $api_instance->deleteThreatModelNote(threatModelId => $threatModelId, noteId => $noteId);
};
if ($@) {
    warn "Exception when calling ThreatModelSubResourcesApi->deleteThreatModelNote: $@\n";
}
from __future__ import print_statement
import time
import swagger_client
from swagger_client.rest import ApiException
from pprint import pprint


# create an instance of the API class
api_instance = swagger_client.ThreatModelSubResourcesApi()
threatModelId = 38400000-8cf0-11bd-b23e-10b96e4ef00d # UUID | Unique identifier of the threat model (UUID)
noteId = 38400000-8cf0-11bd-b23e-10b96e4ef00d # UUID | Unique identifier of the note (UUID)

try: 
    # Delete a note
    api_instance.delete_threat_model_note(threatModelId, noteId)
except ApiException as e:
    print("Exception when calling ThreatModelSubResourcesApi->deleteThreatModelNote: %s\n" % e)

Parameters

Path parameters
Name Description
threat_model_id*
UUID (uuid)
Unique identifier of the threat model (UUID)
Required
note_id*
UUID (uuid)
Unique identifier of the note (UUID)
Required

Responses

Status: 204 - Note deleted successfully

Status: 401 - Error response

Status: 403 - Error response

Status: 404 - Error response

Status: 500 - Error response


deleteThreatModelRepository

Delete a source reference

Deletes a specific source code reference from the threat model


/threat_models/{threat_model_id}/repositories/{repository_id}

Usage and SDK Samples

curl -X DELETE\
 -H "Authorization: Bearer [[accessToken]]"\
-H "Accept: application/json"\
"http://localhost:8080/threat_models/{threat_model_id}/repositories/{repository_id}"
import io.swagger.client.*;
import io.swagger.client.auth.*;
import io.swagger.client.model.*;
import io.swagger.client.api.ThreatModelSubResourcesApi;

import java.io.File;
import java.util.*;

public class ThreatModelSubResourcesApiExample {

    public static void main(String[] args) {
        ApiClient defaultClient = Configuration.getDefaultApiClient();


        ThreatModelSubResourcesApi apiInstance = new ThreatModelSubResourcesApi();
        UUID threatModelId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // UUID | Unique identifier of the threat model (UUID)
        UUID repositoryId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // UUID | Unique identifier of the source reference (UUID)
        try {
            apiInstance.deleteThreatModelRepository(threatModelId, repositoryId);
        } catch (ApiException e) {
            System.err.println("Exception when calling ThreatModelSubResourcesApi#deleteThreatModelRepository");
            e.printStackTrace();
        }
    }
}
import io.swagger.client.api.ThreatModelSubResourcesApi;

public class ThreatModelSubResourcesApiExample {

    public static void main(String[] args) {
        ThreatModelSubResourcesApi apiInstance = new ThreatModelSubResourcesApi();
        UUID threatModelId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // UUID | Unique identifier of the threat model (UUID)
        UUID repositoryId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // UUID | Unique identifier of the source reference (UUID)
        try {
            apiInstance.deleteThreatModelRepository(threatModelId, repositoryId);
        } catch (ApiException e) {
            System.err.println("Exception when calling ThreatModelSubResourcesApi#deleteThreatModelRepository");
            e.printStackTrace();
        }
    }
}
Configuration *apiConfig = [Configuration sharedConfig];
UUID *threatModelId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // Unique identifier of the threat model (UUID)
UUID *repositoryId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // Unique identifier of the source reference (UUID)

ThreatModelSubResourcesApi *apiInstance = [[ThreatModelSubResourcesApi alloc] init];

// Delete a source reference
[apiInstance deleteThreatModelRepositoryWith:threatModelId
    repositoryId:repositoryId
              completionHandler: ^(NSError* error) {
                            if (error) {
                                NSLog(@"Error: %@", error);
                            }
                        }];
var TmiThreatModelingImprovedApi = require('tmi__threat_modeling_improved_api');
var defaultClient = TmiThreatModelingImprovedApi.ApiClient.instance;


var api = new TmiThreatModelingImprovedApi.ThreatModelSubResourcesApi()
var threatModelId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // {{UUID}} Unique identifier of the threat model (UUID)
var repositoryId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // {{UUID}} Unique identifier of the source reference (UUID)

var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully.');
  }
};
api.deleteThreatModelRepository(threatModelId, repositoryId, callback);
using System;
using System.Diagnostics;
using IO.Swagger.Api;
using IO.Swagger.Client;
using IO.Swagger.Model;

namespace Example
{
    public class deleteThreatModelRepositoryExample
    {
        public void main()
        {


            var apiInstance = new ThreatModelSubResourcesApi();
            var threatModelId = new UUID(); // UUID | Unique identifier of the threat model (UUID)
            var repositoryId = new UUID(); // UUID | Unique identifier of the source reference (UUID)

            try
            {
                // Delete a source reference
                apiInstance.deleteThreatModelRepository(threatModelId, repositoryId);
            }
            catch (Exception e)
            {
                Debug.Print("Exception when calling ThreatModelSubResourcesApi.deleteThreatModelRepository: " + e.Message );
            }
        }
    }
}
<?php
require_once(__DIR__ . '/vendor/autoload.php');


$api_instance = new Swagger\Client\ApiThreatModelSubResourcesApi();
$threatModelId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // UUID | Unique identifier of the threat model (UUID)
$repositoryId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // UUID | Unique identifier of the source reference (UUID)

try {
    $api_instance->deleteThreatModelRepository($threatModelId, $repositoryId);
} catch (Exception $e) {
    echo 'Exception when calling ThreatModelSubResourcesApi->deleteThreatModelRepository: ', $e->getMessage(), PHP_EOL;
}
?>
use Data::Dumper;
use WWW::SwaggerClient::Configuration;
use WWW::SwaggerClient::ThreatModelSubResourcesApi;


my $api_instance = WWW::SwaggerClient::ThreatModelSubResourcesApi->new();
my $threatModelId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; # UUID | Unique identifier of the threat model (UUID)
my $repositoryId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; # UUID | Unique identifier of the source reference (UUID)

eval { 
    $api_instance->deleteThreatModelRepository(threatModelId => $threatModelId, repositoryId => $repositoryId);
};
if ($@) {
    warn "Exception when calling ThreatModelSubResourcesApi->deleteThreatModelRepository: $@\n";
}
from __future__ import print_statement
import time
import swagger_client
from swagger_client.rest import ApiException
from pprint import pprint


# create an instance of the API class
api_instance = swagger_client.ThreatModelSubResourcesApi()
threatModelId = 38400000-8cf0-11bd-b23e-10b96e4ef00d # UUID | Unique identifier of the threat model (UUID)
repositoryId = 38400000-8cf0-11bd-b23e-10b96e4ef00d # UUID | Unique identifier of the source reference (UUID)

try: 
    # Delete a source reference
    api_instance.delete_threat_model_repository(threatModelId, repositoryId)
except ApiException as e:
    print("Exception when calling ThreatModelSubResourcesApi->deleteThreatModelRepository: %s\n" % e)

Parameters

Path parameters
Name Description
threat_model_id*
UUID (uuid)
Unique identifier of the threat model (UUID)
Required
repository_id*
UUID (uuid)
Unique identifier of the source reference (UUID)
Required

Responses

Status: 204 - Source reference deleted successfully

Status: 401 - Error response

Status: 403 - Error response

Status: 404 - Error response

Status: 500 - Error response


deleteThreatModelThreat

Delete a threat

Deletes a specific threat from the threat model


/threat_models/{threat_model_id}/threats/{threat_id}

Usage and SDK Samples

curl -X DELETE\
 -H "Authorization: Bearer [[accessToken]]"\
-H "Accept: application/json"\
"http://localhost:8080/threat_models/{threat_model_id}/threats/{threat_id}"
import io.swagger.client.*;
import io.swagger.client.auth.*;
import io.swagger.client.model.*;
import io.swagger.client.api.ThreatModelSubResourcesApi;

import java.io.File;
import java.util.*;

public class ThreatModelSubResourcesApiExample {

    public static void main(String[] args) {
        ApiClient defaultClient = Configuration.getDefaultApiClient();


        ThreatModelSubResourcesApi apiInstance = new ThreatModelSubResourcesApi();
        UUID threatModelId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // UUID | Unique identifier of the threat model (UUID)
        UUID threatId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // UUID | Unique identifier of the threat (UUID)
        try {
            apiInstance.deleteThreatModelThreat(threatModelId, threatId);
        } catch (ApiException e) {
            System.err.println("Exception when calling ThreatModelSubResourcesApi#deleteThreatModelThreat");
            e.printStackTrace();
        }
    }
}
import io.swagger.client.api.ThreatModelSubResourcesApi;

public class ThreatModelSubResourcesApiExample {

    public static void main(String[] args) {
        ThreatModelSubResourcesApi apiInstance = new ThreatModelSubResourcesApi();
        UUID threatModelId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // UUID | Unique identifier of the threat model (UUID)
        UUID threatId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // UUID | Unique identifier of the threat (UUID)
        try {
            apiInstance.deleteThreatModelThreat(threatModelId, threatId);
        } catch (ApiException e) {
            System.err.println("Exception when calling ThreatModelSubResourcesApi#deleteThreatModelThreat");
            e.printStackTrace();
        }
    }
}
Configuration *apiConfig = [Configuration sharedConfig];
UUID *threatModelId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // Unique identifier of the threat model (UUID)
UUID *threatId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // Unique identifier of the threat (UUID)

ThreatModelSubResourcesApi *apiInstance = [[ThreatModelSubResourcesApi alloc] init];

// Delete a threat
[apiInstance deleteThreatModelThreatWith:threatModelId
    threatId:threatId
              completionHandler: ^(NSError* error) {
                            if (error) {
                                NSLog(@"Error: %@", error);
                            }
                        }];
var TmiThreatModelingImprovedApi = require('tmi__threat_modeling_improved_api');
var defaultClient = TmiThreatModelingImprovedApi.ApiClient.instance;


var api = new TmiThreatModelingImprovedApi.ThreatModelSubResourcesApi()
var threatModelId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // {{UUID}} Unique identifier of the threat model (UUID)
var threatId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // {{UUID}} Unique identifier of the threat (UUID)

var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully.');
  }
};
api.deleteThreatModelThreat(threatModelId, threatId, callback);
using System;
using System.Diagnostics;
using IO.Swagger.Api;
using IO.Swagger.Client;
using IO.Swagger.Model;

namespace Example
{
    public class deleteThreatModelThreatExample
    {
        public void main()
        {


            var apiInstance = new ThreatModelSubResourcesApi();
            var threatModelId = new UUID(); // UUID | Unique identifier of the threat model (UUID)
            var threatId = new UUID(); // UUID | Unique identifier of the threat (UUID)

            try
            {
                // Delete a threat
                apiInstance.deleteThreatModelThreat(threatModelId, threatId);
            }
            catch (Exception e)
            {
                Debug.Print("Exception when calling ThreatModelSubResourcesApi.deleteThreatModelThreat: " + e.Message );
            }
        }
    }
}
<?php
require_once(__DIR__ . '/vendor/autoload.php');


$api_instance = new Swagger\Client\ApiThreatModelSubResourcesApi();
$threatModelId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // UUID | Unique identifier of the threat model (UUID)
$threatId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // UUID | Unique identifier of the threat (UUID)

try {
    $api_instance->deleteThreatModelThreat($threatModelId, $threatId);
} catch (Exception $e) {
    echo 'Exception when calling ThreatModelSubResourcesApi->deleteThreatModelThreat: ', $e->getMessage(), PHP_EOL;
}
?>
use Data::Dumper;
use WWW::SwaggerClient::Configuration;
use WWW::SwaggerClient::ThreatModelSubResourcesApi;


my $api_instance = WWW::SwaggerClient::ThreatModelSubResourcesApi->new();
my $threatModelId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; # UUID | Unique identifier of the threat model (UUID)
my $threatId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; # UUID | Unique identifier of the threat (UUID)

eval { 
    $api_instance->deleteThreatModelThreat(threatModelId => $threatModelId, threatId => $threatId);
};
if ($@) {
    warn "Exception when calling ThreatModelSubResourcesApi->deleteThreatModelThreat: $@\n";
}
from __future__ import print_statement
import time
import swagger_client
from swagger_client.rest import ApiException
from pprint import pprint


# create an instance of the API class
api_instance = swagger_client.ThreatModelSubResourcesApi()
threatModelId = 38400000-8cf0-11bd-b23e-10b96e4ef00d # UUID | Unique identifier of the threat model (UUID)
threatId = 38400000-8cf0-11bd-b23e-10b96e4ef00d # UUID | Unique identifier of the threat (UUID)

try: 
    # Delete a threat
    api_instance.delete_threat_model_threat(threatModelId, threatId)
except ApiException as e:
    print("Exception when calling ThreatModelSubResourcesApi->deleteThreatModelThreat: %s\n" % e)

Parameters

Path parameters
Name Description
threat_model_id*
UUID (uuid)
Unique identifier of the threat model (UUID)
Required
threat_id*
UUID (uuid)
Unique identifier of the threat (UUID)
Required

Responses

Status: 204 - Threat deleted successfully

Status: 401 - Error response

Status: 403 - Error response

Status: 404 - Error response

Status: 500 - Error response


getDiagramMetadata

Get diagram metadata

Retrieves all metadata entries for the specified diagram


/threat_models/{threat_model_id}/diagrams/{diagram_id}/metadata

Usage and SDK Samples

curl -X GET\
 -H "Authorization: Bearer [[accessToken]]"\
-H "Accept: application/json"\
"http://localhost:8080/threat_models/{threat_model_id}/diagrams/{diagram_id}/metadata"
import io.swagger.client.*;
import io.swagger.client.auth.*;
import io.swagger.client.model.*;
import io.swagger.client.api.ThreatModelSubResourcesApi;

import java.io.File;
import java.util.*;

public class ThreatModelSubResourcesApiExample {

    public static void main(String[] args) {
        ApiClient defaultClient = Configuration.getDefaultApiClient();


        ThreatModelSubResourcesApi apiInstance = new ThreatModelSubResourcesApi();
        UUID threatModelId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // UUID | Unique identifier of the threat model (UUID)
        UUID diagramId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // UUID | Unique identifier of the diagram (UUID)
        try {
            array[Metadata] result = apiInstance.getDiagramMetadata(threatModelId, diagramId);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling ThreatModelSubResourcesApi#getDiagramMetadata");
            e.printStackTrace();
        }
    }
}
import io.swagger.client.api.ThreatModelSubResourcesApi;

public class ThreatModelSubResourcesApiExample {

    public static void main(String[] args) {
        ThreatModelSubResourcesApi apiInstance = new ThreatModelSubResourcesApi();
        UUID threatModelId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // UUID | Unique identifier of the threat model (UUID)
        UUID diagramId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // UUID | Unique identifier of the diagram (UUID)
        try {
            array[Metadata] result = apiInstance.getDiagramMetadata(threatModelId, diagramId);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling ThreatModelSubResourcesApi#getDiagramMetadata");
            e.printStackTrace();
        }
    }
}
Configuration *apiConfig = [Configuration sharedConfig];
UUID *threatModelId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // Unique identifier of the threat model (UUID)
UUID *diagramId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // Unique identifier of the diagram (UUID)

ThreatModelSubResourcesApi *apiInstance = [[ThreatModelSubResourcesApi alloc] init];

// Get diagram metadata
[apiInstance getDiagramMetadataWith:threatModelId
    diagramId:diagramId
              completionHandler: ^(array[Metadata] output, NSError* error) {
                            if (output) {
                                NSLog(@"%@", output);
                            }
                            if (error) {
                                NSLog(@"Error: %@", error);
                            }
                        }];
var TmiThreatModelingImprovedApi = require('tmi__threat_modeling_improved_api');
var defaultClient = TmiThreatModelingImprovedApi.ApiClient.instance;


var api = new TmiThreatModelingImprovedApi.ThreatModelSubResourcesApi()
var threatModelId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // {{UUID}} Unique identifier of the threat model (UUID)
var diagramId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // {{UUID}} Unique identifier of the diagram (UUID)

var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
};
api.getDiagramMetadata(threatModelId, diagramId, callback);
using System;
using System.Diagnostics;
using IO.Swagger.Api;
using IO.Swagger.Client;
using IO.Swagger.Model;

namespace Example
{
    public class getDiagramMetadataExample
    {
        public void main()
        {


            var apiInstance = new ThreatModelSubResourcesApi();
            var threatModelId = new UUID(); // UUID | Unique identifier of the threat model (UUID)
            var diagramId = new UUID(); // UUID | Unique identifier of the diagram (UUID)

            try
            {
                // Get diagram metadata
                array[Metadata] result = apiInstance.getDiagramMetadata(threatModelId, diagramId);
                Debug.WriteLine(result);
            }
            catch (Exception e)
            {
                Debug.Print("Exception when calling ThreatModelSubResourcesApi.getDiagramMetadata: " + e.Message );
            }
        }
    }
}
<?php
require_once(__DIR__ . '/vendor/autoload.php');


$api_instance = new Swagger\Client\ApiThreatModelSubResourcesApi();
$threatModelId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // UUID | Unique identifier of the threat model (UUID)
$diagramId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // UUID | Unique identifier of the diagram (UUID)

try {
    $result = $api_instance->getDiagramMetadata($threatModelId, $diagramId);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling ThreatModelSubResourcesApi->getDiagramMetadata: ', $e->getMessage(), PHP_EOL;
}
?>
use Data::Dumper;
use WWW::SwaggerClient::Configuration;
use WWW::SwaggerClient::ThreatModelSubResourcesApi;


my $api_instance = WWW::SwaggerClient::ThreatModelSubResourcesApi->new();
my $threatModelId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; # UUID | Unique identifier of the threat model (UUID)
my $diagramId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; # UUID | Unique identifier of the diagram (UUID)

eval { 
    my $result = $api_instance->getDiagramMetadata(threatModelId => $threatModelId, diagramId => $diagramId);
    print Dumper($result);
};
if ($@) {
    warn "Exception when calling ThreatModelSubResourcesApi->getDiagramMetadata: $@\n";
}
from __future__ import print_statement
import time
import swagger_client
from swagger_client.rest import ApiException
from pprint import pprint


# create an instance of the API class
api_instance = swagger_client.ThreatModelSubResourcesApi()
threatModelId = 38400000-8cf0-11bd-b23e-10b96e4ef00d # UUID | Unique identifier of the threat model (UUID)
diagramId = 38400000-8cf0-11bd-b23e-10b96e4ef00d # UUID | Unique identifier of the diagram (UUID)

try: 
    # Get diagram metadata
    api_response = api_instance.get_diagram_metadata(threatModelId, diagramId)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling ThreatModelSubResourcesApi->getDiagramMetadata: %s\n" % e)

Parameters

Path parameters
Name Description
threat_model_id*
UUID (uuid)
Unique identifier of the threat model (UUID)
Required
diagram_id*
UUID (uuid)
Unique identifier of the diagram (UUID)
Required

Responses

Status: 200 - List of metadata entries

Status: 401 - Error response

Status: 403 - Error response

Status: 404 - Error response

Status: 500 - Error response


getDiagramMetadataByKey

Get diagram metadata by key

Retrieves a specific metadata entry for the diagram by key


/threat_models/{threat_model_id}/diagrams/{diagram_id}/metadata/{key}

Usage and SDK Samples

curl -X GET\
 -H "Authorization: Bearer [[accessToken]]"\
-H "Accept: application/json"\
"http://localhost:8080/threat_models/{threat_model_id}/diagrams/{diagram_id}/metadata/{key}"
import io.swagger.client.*;
import io.swagger.client.auth.*;
import io.swagger.client.model.*;
import io.swagger.client.api.ThreatModelSubResourcesApi;

import java.io.File;
import java.util.*;

public class ThreatModelSubResourcesApiExample {

    public static void main(String[] args) {
        ApiClient defaultClient = Configuration.getDefaultApiClient();


        ThreatModelSubResourcesApi apiInstance = new ThreatModelSubResourcesApi();
        UUID threatModelId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // UUID | Unique identifier of the threat model (UUID)
        UUID diagramId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // UUID | Unique identifier of the diagram (UUID)
        String key = key_example; // String | Metadata key to retrieve
        try {
            Metadata result = apiInstance.getDiagramMetadataByKey(threatModelId, diagramId, key);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling ThreatModelSubResourcesApi#getDiagramMetadataByKey");
            e.printStackTrace();
        }
    }
}
import io.swagger.client.api.ThreatModelSubResourcesApi;

public class ThreatModelSubResourcesApiExample {

    public static void main(String[] args) {
        ThreatModelSubResourcesApi apiInstance = new ThreatModelSubResourcesApi();
        UUID threatModelId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // UUID | Unique identifier of the threat model (UUID)
        UUID diagramId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // UUID | Unique identifier of the diagram (UUID)
        String key = key_example; // String | Metadata key to retrieve
        try {
            Metadata result = apiInstance.getDiagramMetadataByKey(threatModelId, diagramId, key);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling ThreatModelSubResourcesApi#getDiagramMetadataByKey");
            e.printStackTrace();
        }
    }
}
Configuration *apiConfig = [Configuration sharedConfig];
UUID *threatModelId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // Unique identifier of the threat model (UUID)
UUID *diagramId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // Unique identifier of the diagram (UUID)
String *key = key_example; // Metadata key to retrieve

ThreatModelSubResourcesApi *apiInstance = [[ThreatModelSubResourcesApi alloc] init];

// Get diagram metadata by key
[apiInstance getDiagramMetadataByKeyWith:threatModelId
    diagramId:diagramId
    key:key
              completionHandler: ^(Metadata output, NSError* error) {
                            if (output) {
                                NSLog(@"%@", output);
                            }
                            if (error) {
                                NSLog(@"Error: %@", error);
                            }
                        }];
var TmiThreatModelingImprovedApi = require('tmi__threat_modeling_improved_api');
var defaultClient = TmiThreatModelingImprovedApi.ApiClient.instance;


var api = new TmiThreatModelingImprovedApi.ThreatModelSubResourcesApi()
var threatModelId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // {{UUID}} Unique identifier of the threat model (UUID)
var diagramId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // {{UUID}} Unique identifier of the diagram (UUID)
var key = key_example; // {{String}} Metadata key to retrieve

var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
};
api.getDiagramMetadataByKey(threatModelId, diagramId, key, callback);
using System;
using System.Diagnostics;
using IO.Swagger.Api;
using IO.Swagger.Client;
using IO.Swagger.Model;

namespace Example
{
    public class getDiagramMetadataByKeyExample
    {
        public void main()
        {


            var apiInstance = new ThreatModelSubResourcesApi();
            var threatModelId = new UUID(); // UUID | Unique identifier of the threat model (UUID)
            var diagramId = new UUID(); // UUID | Unique identifier of the diagram (UUID)
            var key = key_example;  // String | Metadata key to retrieve

            try
            {
                // Get diagram metadata by key
                Metadata result = apiInstance.getDiagramMetadataByKey(threatModelId, diagramId, key);
                Debug.WriteLine(result);
            }
            catch (Exception e)
            {
                Debug.Print("Exception when calling ThreatModelSubResourcesApi.getDiagramMetadataByKey: " + e.Message );
            }
        }
    }
}
<?php
require_once(__DIR__ . '/vendor/autoload.php');


$api_instance = new Swagger\Client\ApiThreatModelSubResourcesApi();
$threatModelId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // UUID | Unique identifier of the threat model (UUID)
$diagramId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // UUID | Unique identifier of the diagram (UUID)
$key = key_example; // String | Metadata key to retrieve

try {
    $result = $api_instance->getDiagramMetadataByKey($threatModelId, $diagramId, $key);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling ThreatModelSubResourcesApi->getDiagramMetadataByKey: ', $e->getMessage(), PHP_EOL;
}
?>
use Data::Dumper;
use WWW::SwaggerClient::Configuration;
use WWW::SwaggerClient::ThreatModelSubResourcesApi;


my $api_instance = WWW::SwaggerClient::ThreatModelSubResourcesApi->new();
my $threatModelId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; # UUID | Unique identifier of the threat model (UUID)
my $diagramId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; # UUID | Unique identifier of the diagram (UUID)
my $key = key_example; # String | Metadata key to retrieve

eval { 
    my $result = $api_instance->getDiagramMetadataByKey(threatModelId => $threatModelId, diagramId => $diagramId, key => $key);
    print Dumper($result);
};
if ($@) {
    warn "Exception when calling ThreatModelSubResourcesApi->getDiagramMetadataByKey: $@\n";
}
from __future__ import print_statement
import time
import swagger_client
from swagger_client.rest import ApiException
from pprint import pprint


# create an instance of the API class
api_instance = swagger_client.ThreatModelSubResourcesApi()
threatModelId = 38400000-8cf0-11bd-b23e-10b96e4ef00d # UUID | Unique identifier of the threat model (UUID)
diagramId = 38400000-8cf0-11bd-b23e-10b96e4ef00d # UUID | Unique identifier of the diagram (UUID)
key = key_example # String | Metadata key to retrieve

try: 
    # Get diagram metadata by key
    api_response = api_instance.get_diagram_metadata_by_key(threatModelId, diagramId, key)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling ThreatModelSubResourcesApi->getDiagramMetadataByKey: %s\n" % e)

Parameters

Path parameters
Name Description
threat_model_id*
UUID (uuid)
Unique identifier of the threat model (UUID)
Required
diagram_id*
UUID (uuid)
Unique identifier of the diagram (UUID)
Required
key*
String
Metadata key to retrieve
Required

Responses

Status: 200 - Metadata entry

Status: 401 - Error response

Status: 403 - Error response

Status: 404 - Error response

Status: 500 - Error response


getDocumentMetadata

Get document metadata

Returns all metadata key-value pairs for the specified document


/threat_models/{threat_model_id}/documents/{document_id}/metadata

Usage and SDK Samples

curl -X GET\
 -H "Authorization: Bearer [[accessToken]]"\
-H "Accept: application/json"\
"http://localhost:8080/threat_models/{threat_model_id}/documents/{document_id}/metadata"
import io.swagger.client.*;
import io.swagger.client.auth.*;
import io.swagger.client.model.*;
import io.swagger.client.api.ThreatModelSubResourcesApi;

import java.io.File;
import java.util.*;

public class ThreatModelSubResourcesApiExample {

    public static void main(String[] args) {
        ApiClient defaultClient = Configuration.getDefaultApiClient();


        ThreatModelSubResourcesApi apiInstance = new ThreatModelSubResourcesApi();
        UUID threatModelId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // UUID | Unique identifier of the threat model (UUID)
        UUID documentId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // UUID | Unique identifier of the document (UUID)
        try {
            array[Metadata] result = apiInstance.getDocumentMetadata(threatModelId, documentId);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling ThreatModelSubResourcesApi#getDocumentMetadata");
            e.printStackTrace();
        }
    }
}
import io.swagger.client.api.ThreatModelSubResourcesApi;

public class ThreatModelSubResourcesApiExample {

    public static void main(String[] args) {
        ThreatModelSubResourcesApi apiInstance = new ThreatModelSubResourcesApi();
        UUID threatModelId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // UUID | Unique identifier of the threat model (UUID)
        UUID documentId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // UUID | Unique identifier of the document (UUID)
        try {
            array[Metadata] result = apiInstance.getDocumentMetadata(threatModelId, documentId);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling ThreatModelSubResourcesApi#getDocumentMetadata");
            e.printStackTrace();
        }
    }
}
Configuration *apiConfig = [Configuration sharedConfig];
UUID *threatModelId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // Unique identifier of the threat model (UUID)
UUID *documentId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // Unique identifier of the document (UUID)

ThreatModelSubResourcesApi *apiInstance = [[ThreatModelSubResourcesApi alloc] init];

// Get document metadata
[apiInstance getDocumentMetadataWith:threatModelId
    documentId:documentId
              completionHandler: ^(array[Metadata] output, NSError* error) {
                            if (output) {
                                NSLog(@"%@", output);
                            }
                            if (error) {
                                NSLog(@"Error: %@", error);
                            }
                        }];
var TmiThreatModelingImprovedApi = require('tmi__threat_modeling_improved_api');
var defaultClient = TmiThreatModelingImprovedApi.ApiClient.instance;


var api = new TmiThreatModelingImprovedApi.ThreatModelSubResourcesApi()
var threatModelId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // {{UUID}} Unique identifier of the threat model (UUID)
var documentId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // {{UUID}} Unique identifier of the document (UUID)

var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
};
api.getDocumentMetadata(threatModelId, documentId, callback);
using System;
using System.Diagnostics;
using IO.Swagger.Api;
using IO.Swagger.Client;
using IO.Swagger.Model;

namespace Example
{
    public class getDocumentMetadataExample
    {
        public void main()
        {


            var apiInstance = new ThreatModelSubResourcesApi();
            var threatModelId = new UUID(); // UUID | Unique identifier of the threat model (UUID)
            var documentId = new UUID(); // UUID | Unique identifier of the document (UUID)

            try
            {
                // Get document metadata
                array[Metadata] result = apiInstance.getDocumentMetadata(threatModelId, documentId);
                Debug.WriteLine(result);
            }
            catch (Exception e)
            {
                Debug.Print("Exception when calling ThreatModelSubResourcesApi.getDocumentMetadata: " + e.Message );
            }
        }
    }
}
<?php
require_once(__DIR__ . '/vendor/autoload.php');


$api_instance = new Swagger\Client\ApiThreatModelSubResourcesApi();
$threatModelId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // UUID | Unique identifier of the threat model (UUID)
$documentId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // UUID | Unique identifier of the document (UUID)

try {
    $result = $api_instance->getDocumentMetadata($threatModelId, $documentId);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling ThreatModelSubResourcesApi->getDocumentMetadata: ', $e->getMessage(), PHP_EOL;
}
?>
use Data::Dumper;
use WWW::SwaggerClient::Configuration;
use WWW::SwaggerClient::ThreatModelSubResourcesApi;


my $api_instance = WWW::SwaggerClient::ThreatModelSubResourcesApi->new();
my $threatModelId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; # UUID | Unique identifier of the threat model (UUID)
my $documentId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; # UUID | Unique identifier of the document (UUID)

eval { 
    my $result = $api_instance->getDocumentMetadata(threatModelId => $threatModelId, documentId => $documentId);
    print Dumper($result);
};
if ($@) {
    warn "Exception when calling ThreatModelSubResourcesApi->getDocumentMetadata: $@\n";
}
from __future__ import print_statement
import time
import swagger_client
from swagger_client.rest import ApiException
from pprint import pprint


# create an instance of the API class
api_instance = swagger_client.ThreatModelSubResourcesApi()
threatModelId = 38400000-8cf0-11bd-b23e-10b96e4ef00d # UUID | Unique identifier of the threat model (UUID)
documentId = 38400000-8cf0-11bd-b23e-10b96e4ef00d # UUID | Unique identifier of the document (UUID)

try: 
    # Get document metadata
    api_response = api_instance.get_document_metadata(threatModelId, documentId)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling ThreatModelSubResourcesApi->getDocumentMetadata: %s\n" % e)

Parameters

Path parameters
Name Description
threat_model_id*
UUID (uuid)
Unique identifier of the threat model (UUID)
Required
document_id*
UUID (uuid)
Unique identifier of the document (UUID)
Required

Responses

Status: 200 - Document metadata list

Status: 401 - Error response

Status: 403 - Error response

Status: 404 - Error response

Status: 500 - Error response


getDocumentMetadataByKey

Get document metadata by key

Returns a specific metadata entry by key for the specified document


/threat_models/{threat_model_id}/documents/{document_id}/metadata/{key}

Usage and SDK Samples

curl -X GET\
 -H "Authorization: Bearer [[accessToken]]"\
-H "Accept: application/json"\
"http://localhost:8080/threat_models/{threat_model_id}/documents/{document_id}/metadata/{key}"
import io.swagger.client.*;
import io.swagger.client.auth.*;
import io.swagger.client.model.*;
import io.swagger.client.api.ThreatModelSubResourcesApi;

import java.io.File;
import java.util.*;

public class ThreatModelSubResourcesApiExample {

    public static void main(String[] args) {
        ApiClient defaultClient = Configuration.getDefaultApiClient();


        ThreatModelSubResourcesApi apiInstance = new ThreatModelSubResourcesApi();
        UUID threatModelId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // UUID | Unique identifier of the threat model (UUID)
        UUID documentId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // UUID | Unique identifier of the document (UUID)
        String key = key_example; // String | Metadata key to retrieve
        try {
            Metadata result = apiInstance.getDocumentMetadataByKey(threatModelId, documentId, key);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling ThreatModelSubResourcesApi#getDocumentMetadataByKey");
            e.printStackTrace();
        }
    }
}
import io.swagger.client.api.ThreatModelSubResourcesApi;

public class ThreatModelSubResourcesApiExample {

    public static void main(String[] args) {
        ThreatModelSubResourcesApi apiInstance = new ThreatModelSubResourcesApi();
        UUID threatModelId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // UUID | Unique identifier of the threat model (UUID)
        UUID documentId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // UUID | Unique identifier of the document (UUID)
        String key = key_example; // String | Metadata key to retrieve
        try {
            Metadata result = apiInstance.getDocumentMetadataByKey(threatModelId, documentId, key);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling ThreatModelSubResourcesApi#getDocumentMetadataByKey");
            e.printStackTrace();
        }
    }
}
Configuration *apiConfig = [Configuration sharedConfig];
UUID *threatModelId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // Unique identifier of the threat model (UUID)
UUID *documentId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // Unique identifier of the document (UUID)
String *key = key_example; // Metadata key to retrieve

ThreatModelSubResourcesApi *apiInstance = [[ThreatModelSubResourcesApi alloc] init];

// Get document metadata by key
[apiInstance getDocumentMetadataByKeyWith:threatModelId
    documentId:documentId
    key:key
              completionHandler: ^(Metadata output, NSError* error) {
                            if (output) {
                                NSLog(@"%@", output);
                            }
                            if (error) {
                                NSLog(@"Error: %@", error);
                            }
                        }];
var TmiThreatModelingImprovedApi = require('tmi__threat_modeling_improved_api');
var defaultClient = TmiThreatModelingImprovedApi.ApiClient.instance;


var api = new TmiThreatModelingImprovedApi.ThreatModelSubResourcesApi()
var threatModelId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // {{UUID}} Unique identifier of the threat model (UUID)
var documentId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // {{UUID}} Unique identifier of the document (UUID)
var key = key_example; // {{String}} Metadata key to retrieve

var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
};
api.getDocumentMetadataByKey(threatModelId, documentId, key, callback);
using System;
using System.Diagnostics;
using IO.Swagger.Api;
using IO.Swagger.Client;
using IO.Swagger.Model;

namespace Example
{
    public class getDocumentMetadataByKeyExample
    {
        public void main()
        {


            var apiInstance = new ThreatModelSubResourcesApi();
            var threatModelId = new UUID(); // UUID | Unique identifier of the threat model (UUID)
            var documentId = new UUID(); // UUID | Unique identifier of the document (UUID)
            var key = key_example;  // String | Metadata key to retrieve

            try
            {
                // Get document metadata by key
                Metadata result = apiInstance.getDocumentMetadataByKey(threatModelId, documentId, key);
                Debug.WriteLine(result);
            }
            catch (Exception e)
            {
                Debug.Print("Exception when calling ThreatModelSubResourcesApi.getDocumentMetadataByKey: " + e.Message );
            }
        }
    }
}
<?php
require_once(__DIR__ . '/vendor/autoload.php');


$api_instance = new Swagger\Client\ApiThreatModelSubResourcesApi();
$threatModelId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // UUID | Unique identifier of the threat model (UUID)
$documentId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // UUID | Unique identifier of the document (UUID)
$key = key_example; // String | Metadata key to retrieve

try {
    $result = $api_instance->getDocumentMetadataByKey($threatModelId, $documentId, $key);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling ThreatModelSubResourcesApi->getDocumentMetadataByKey: ', $e->getMessage(), PHP_EOL;
}
?>
use Data::Dumper;
use WWW::SwaggerClient::Configuration;
use WWW::SwaggerClient::ThreatModelSubResourcesApi;


my $api_instance = WWW::SwaggerClient::ThreatModelSubResourcesApi->new();
my $threatModelId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; # UUID | Unique identifier of the threat model (UUID)
my $documentId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; # UUID | Unique identifier of the document (UUID)
my $key = key_example; # String | Metadata key to retrieve

eval { 
    my $result = $api_instance->getDocumentMetadataByKey(threatModelId => $threatModelId, documentId => $documentId, key => $key);
    print Dumper($result);
};
if ($@) {
    warn "Exception when calling ThreatModelSubResourcesApi->getDocumentMetadataByKey: $@\n";
}
from __future__ import print_statement
import time
import swagger_client
from swagger_client.rest import ApiException
from pprint import pprint


# create an instance of the API class
api_instance = swagger_client.ThreatModelSubResourcesApi()
threatModelId = 38400000-8cf0-11bd-b23e-10b96e4ef00d # UUID | Unique identifier of the threat model (UUID)
documentId = 38400000-8cf0-11bd-b23e-10b96e4ef00d # UUID | Unique identifier of the document (UUID)
key = key_example # String | Metadata key to retrieve

try: 
    # Get document metadata by key
    api_response = api_instance.get_document_metadata_by_key(threatModelId, documentId, key)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling ThreatModelSubResourcesApi->getDocumentMetadataByKey: %s\n" % e)

Parameters

Path parameters
Name Description
threat_model_id*
UUID (uuid)
Unique identifier of the threat model (UUID)
Required
document_id*
UUID (uuid)
Unique identifier of the document (UUID)
Required
key*
String
Metadata key to retrieve
Required

Responses

Status: 200 - Metadata entry

Status: 401 - Error response

Status: 403 - Error response

Status: 404 - Error response

Status: 500 - Error response


getNoteMetadata

Get note metadata

Returns all metadata key-value pairs for the specified note


/threat_models/{threat_model_id}/notes/{note_id}/metadata

Usage and SDK Samples

curl -X GET\
 -H "Authorization: Bearer [[accessToken]]"\
-H "Accept: application/json"\
"http://localhost:8080/threat_models/{threat_model_id}/notes/{note_id}/metadata"
import io.swagger.client.*;
import io.swagger.client.auth.*;
import io.swagger.client.model.*;
import io.swagger.client.api.ThreatModelSubResourcesApi;

import java.io.File;
import java.util.*;

public class ThreatModelSubResourcesApiExample {

    public static void main(String[] args) {
        ApiClient defaultClient = Configuration.getDefaultApiClient();


        ThreatModelSubResourcesApi apiInstance = new ThreatModelSubResourcesApi();
        UUID threatModelId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // UUID | Unique identifier of the threat model (UUID)
        UUID noteId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // UUID | Unique identifier of the note (UUID)
        try {
            array[Metadata] result = apiInstance.getNoteMetadata(threatModelId, noteId);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling ThreatModelSubResourcesApi#getNoteMetadata");
            e.printStackTrace();
        }
    }
}
import io.swagger.client.api.ThreatModelSubResourcesApi;

public class ThreatModelSubResourcesApiExample {

    public static void main(String[] args) {
        ThreatModelSubResourcesApi apiInstance = new ThreatModelSubResourcesApi();
        UUID threatModelId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // UUID | Unique identifier of the threat model (UUID)
        UUID noteId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // UUID | Unique identifier of the note (UUID)
        try {
            array[Metadata] result = apiInstance.getNoteMetadata(threatModelId, noteId);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling ThreatModelSubResourcesApi#getNoteMetadata");
            e.printStackTrace();
        }
    }
}
Configuration *apiConfig = [Configuration sharedConfig];
UUID *threatModelId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // Unique identifier of the threat model (UUID)
UUID *noteId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // Unique identifier of the note (UUID)

ThreatModelSubResourcesApi *apiInstance = [[ThreatModelSubResourcesApi alloc] init];

// Get note metadata
[apiInstance getNoteMetadataWith:threatModelId
    noteId:noteId
              completionHandler: ^(array[Metadata] output, NSError* error) {
                            if (output) {
                                NSLog(@"%@", output);
                            }
                            if (error) {
                                NSLog(@"Error: %@", error);
                            }
                        }];
var TmiThreatModelingImprovedApi = require('tmi__threat_modeling_improved_api');
var defaultClient = TmiThreatModelingImprovedApi.ApiClient.instance;


var api = new TmiThreatModelingImprovedApi.ThreatModelSubResourcesApi()
var threatModelId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // {{UUID}} Unique identifier of the threat model (UUID)
var noteId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // {{UUID}} Unique identifier of the note (UUID)

var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
};
api.getNoteMetadata(threatModelId, noteId, callback);
using System;
using System.Diagnostics;
using IO.Swagger.Api;
using IO.Swagger.Client;
using IO.Swagger.Model;

namespace Example
{
    public class getNoteMetadataExample
    {
        public void main()
        {


            var apiInstance = new ThreatModelSubResourcesApi();
            var threatModelId = new UUID(); // UUID | Unique identifier of the threat model (UUID)
            var noteId = new UUID(); // UUID | Unique identifier of the note (UUID)

            try
            {
                // Get note metadata
                array[Metadata] result = apiInstance.getNoteMetadata(threatModelId, noteId);
                Debug.WriteLine(result);
            }
            catch (Exception e)
            {
                Debug.Print("Exception when calling ThreatModelSubResourcesApi.getNoteMetadata: " + e.Message );
            }
        }
    }
}
<?php
require_once(__DIR__ . '/vendor/autoload.php');


$api_instance = new Swagger\Client\ApiThreatModelSubResourcesApi();
$threatModelId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // UUID | Unique identifier of the threat model (UUID)
$noteId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // UUID | Unique identifier of the note (UUID)

try {
    $result = $api_instance->getNoteMetadata($threatModelId, $noteId);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling ThreatModelSubResourcesApi->getNoteMetadata: ', $e->getMessage(), PHP_EOL;
}
?>
use Data::Dumper;
use WWW::SwaggerClient::Configuration;
use WWW::SwaggerClient::ThreatModelSubResourcesApi;


my $api_instance = WWW::SwaggerClient::ThreatModelSubResourcesApi->new();
my $threatModelId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; # UUID | Unique identifier of the threat model (UUID)
my $noteId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; # UUID | Unique identifier of the note (UUID)

eval { 
    my $result = $api_instance->getNoteMetadata(threatModelId => $threatModelId, noteId => $noteId);
    print Dumper($result);
};
if ($@) {
    warn "Exception when calling ThreatModelSubResourcesApi->getNoteMetadata: $@\n";
}
from __future__ import print_statement
import time
import swagger_client
from swagger_client.rest import ApiException
from pprint import pprint


# create an instance of the API class
api_instance = swagger_client.ThreatModelSubResourcesApi()
threatModelId = 38400000-8cf0-11bd-b23e-10b96e4ef00d # UUID | Unique identifier of the threat model (UUID)
noteId = 38400000-8cf0-11bd-b23e-10b96e4ef00d # UUID | Unique identifier of the note (UUID)

try: 
    # Get note metadata
    api_response = api_instance.get_note_metadata(threatModelId, noteId)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling ThreatModelSubResourcesApi->getNoteMetadata: %s\n" % e)

Parameters

Path parameters
Name Description
threat_model_id*
UUID (uuid)
Unique identifier of the threat model (UUID)
Required
note_id*
UUID (uuid)
Unique identifier of the note (UUID)
Required

Responses

Status: 200 - Note metadata list

Status: 401 - Error response

Status: 403 - Error response

Status: 404 - Error response

Status: 500 - Error response


getNoteMetadataByKey

Get note metadata by key

Returns a specific metadata entry by key for the specified note


/threat_models/{threat_model_id}/notes/{note_id}/metadata/{key}

Usage and SDK Samples

curl -X GET\
 -H "Authorization: Bearer [[accessToken]]"\
-H "Accept: application/json"\
"http://localhost:8080/threat_models/{threat_model_id}/notes/{note_id}/metadata/{key}"
import io.swagger.client.*;
import io.swagger.client.auth.*;
import io.swagger.client.model.*;
import io.swagger.client.api.ThreatModelSubResourcesApi;

import java.io.File;
import java.util.*;

public class ThreatModelSubResourcesApiExample {

    public static void main(String[] args) {
        ApiClient defaultClient = Configuration.getDefaultApiClient();


        ThreatModelSubResourcesApi apiInstance = new ThreatModelSubResourcesApi();
        UUID threatModelId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // UUID | Unique identifier of the threat model (UUID)
        UUID noteId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // UUID | Unique identifier of the note (UUID)
        String key = key_example; // String | Metadata key to retrieve
        try {
            Metadata result = apiInstance.getNoteMetadataByKey(threatModelId, noteId, key);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling ThreatModelSubResourcesApi#getNoteMetadataByKey");
            e.printStackTrace();
        }
    }
}
import io.swagger.client.api.ThreatModelSubResourcesApi;

public class ThreatModelSubResourcesApiExample {

    public static void main(String[] args) {
        ThreatModelSubResourcesApi apiInstance = new ThreatModelSubResourcesApi();
        UUID threatModelId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // UUID | Unique identifier of the threat model (UUID)
        UUID noteId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // UUID | Unique identifier of the note (UUID)
        String key = key_example; // String | Metadata key to retrieve
        try {
            Metadata result = apiInstance.getNoteMetadataByKey(threatModelId, noteId, key);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling ThreatModelSubResourcesApi#getNoteMetadataByKey");
            e.printStackTrace();
        }
    }
}
Configuration *apiConfig = [Configuration sharedConfig];
UUID *threatModelId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // Unique identifier of the threat model (UUID)
UUID *noteId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // Unique identifier of the note (UUID)
String *key = key_example; // Metadata key to retrieve

ThreatModelSubResourcesApi *apiInstance = [[ThreatModelSubResourcesApi alloc] init];

// Get note metadata by key
[apiInstance getNoteMetadataByKeyWith:threatModelId
    noteId:noteId
    key:key
              completionHandler: ^(Metadata output, NSError* error) {
                            if (output) {
                                NSLog(@"%@", output);
                            }
                            if (error) {
                                NSLog(@"Error: %@", error);
                            }
                        }];
var TmiThreatModelingImprovedApi = require('tmi__threat_modeling_improved_api');
var defaultClient = TmiThreatModelingImprovedApi.ApiClient.instance;


var api = new TmiThreatModelingImprovedApi.ThreatModelSubResourcesApi()
var threatModelId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // {{UUID}} Unique identifier of the threat model (UUID)
var noteId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // {{UUID}} Unique identifier of the note (UUID)
var key = key_example; // {{String}} Metadata key to retrieve

var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
};
api.getNoteMetadataByKey(threatModelId, noteId, key, callback);
using System;
using System.Diagnostics;
using IO.Swagger.Api;
using IO.Swagger.Client;
using IO.Swagger.Model;

namespace Example
{
    public class getNoteMetadataByKeyExample
    {
        public void main()
        {


            var apiInstance = new ThreatModelSubResourcesApi();
            var threatModelId = new UUID(); // UUID | Unique identifier of the threat model (UUID)
            var noteId = new UUID(); // UUID | Unique identifier of the note (UUID)
            var key = key_example;  // String | Metadata key to retrieve

            try
            {
                // Get note metadata by key
                Metadata result = apiInstance.getNoteMetadataByKey(threatModelId, noteId, key);
                Debug.WriteLine(result);
            }
            catch (Exception e)
            {
                Debug.Print("Exception when calling ThreatModelSubResourcesApi.getNoteMetadataByKey: " + e.Message );
            }
        }
    }
}
<?php
require_once(__DIR__ . '/vendor/autoload.php');


$api_instance = new Swagger\Client\ApiThreatModelSubResourcesApi();
$threatModelId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // UUID | Unique identifier of the threat model (UUID)
$noteId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // UUID | Unique identifier of the note (UUID)
$key = key_example; // String | Metadata key to retrieve

try {
    $result = $api_instance->getNoteMetadataByKey($threatModelId, $noteId, $key);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling ThreatModelSubResourcesApi->getNoteMetadataByKey: ', $e->getMessage(), PHP_EOL;
}
?>
use Data::Dumper;
use WWW::SwaggerClient::Configuration;
use WWW::SwaggerClient::ThreatModelSubResourcesApi;


my $api_instance = WWW::SwaggerClient::ThreatModelSubResourcesApi->new();
my $threatModelId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; # UUID | Unique identifier of the threat model (UUID)
my $noteId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; # UUID | Unique identifier of the note (UUID)
my $key = key_example; # String | Metadata key to retrieve

eval { 
    my $result = $api_instance->getNoteMetadataByKey(threatModelId => $threatModelId, noteId => $noteId, key => $key);
    print Dumper($result);
};
if ($@) {
    warn "Exception when calling ThreatModelSubResourcesApi->getNoteMetadataByKey: $@\n";
}
from __future__ import print_statement
import time
import swagger_client
from swagger_client.rest import ApiException
from pprint import pprint


# create an instance of the API class
api_instance = swagger_client.ThreatModelSubResourcesApi()
threatModelId = 38400000-8cf0-11bd-b23e-10b96e4ef00d # UUID | Unique identifier of the threat model (UUID)
noteId = 38400000-8cf0-11bd-b23e-10b96e4ef00d # UUID | Unique identifier of the note (UUID)
key = key_example # String | Metadata key to retrieve

try: 
    # Get note metadata by key
    api_response = api_instance.get_note_metadata_by_key(threatModelId, noteId, key)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling ThreatModelSubResourcesApi->getNoteMetadataByKey: %s\n" % e)

Parameters

Path parameters
Name Description
threat_model_id*
UUID (uuid)
Unique identifier of the threat model (UUID)
Required
note_id*
UUID (uuid)
Unique identifier of the note (UUID)
Required
key*
String
Metadata key to retrieve
Required

Responses

Status: 200 - Metadata entry

Status: 401 - Error response

Status: 403 - Error response

Status: 404 - Error response

Status: 500 - Error response


getRepositoryMetadata

Get source metadata

Returns all metadata key-value pairs for the specified source reference


/threat_models/{threat_model_id}/repositories/{repository_id}/metadata

Usage and SDK Samples

curl -X GET\
 -H "Authorization: Bearer [[accessToken]]"\
-H "Accept: application/json"\
"http://localhost:8080/threat_models/{threat_model_id}/repositories/{repository_id}/metadata"
import io.swagger.client.*;
import io.swagger.client.auth.*;
import io.swagger.client.model.*;
import io.swagger.client.api.ThreatModelSubResourcesApi;

import java.io.File;
import java.util.*;

public class ThreatModelSubResourcesApiExample {

    public static void main(String[] args) {
        ApiClient defaultClient = Configuration.getDefaultApiClient();


        ThreatModelSubResourcesApi apiInstance = new ThreatModelSubResourcesApi();
        UUID threatModelId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // UUID | Unique identifier of the threat model (UUID)
        UUID repositoryId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // UUID | Unique identifier of the source reference (UUID)
        try {
            array[Metadata] result = apiInstance.getRepositoryMetadata(threatModelId, repositoryId);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling ThreatModelSubResourcesApi#getRepositoryMetadata");
            e.printStackTrace();
        }
    }
}
import io.swagger.client.api.ThreatModelSubResourcesApi;

public class ThreatModelSubResourcesApiExample {

    public static void main(String[] args) {
        ThreatModelSubResourcesApi apiInstance = new ThreatModelSubResourcesApi();
        UUID threatModelId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // UUID | Unique identifier of the threat model (UUID)
        UUID repositoryId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // UUID | Unique identifier of the source reference (UUID)
        try {
            array[Metadata] result = apiInstance.getRepositoryMetadata(threatModelId, repositoryId);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling ThreatModelSubResourcesApi#getRepositoryMetadata");
            e.printStackTrace();
        }
    }
}
Configuration *apiConfig = [Configuration sharedConfig];
UUID *threatModelId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // Unique identifier of the threat model (UUID)
UUID *repositoryId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // Unique identifier of the source reference (UUID)

ThreatModelSubResourcesApi *apiInstance = [[ThreatModelSubResourcesApi alloc] init];

// Get source metadata
[apiInstance getRepositoryMetadataWith:threatModelId
    repositoryId:repositoryId
              completionHandler: ^(array[Metadata] output, NSError* error) {
                            if (output) {
                                NSLog(@"%@", output);
                            }
                            if (error) {
                                NSLog(@"Error: %@", error);
                            }
                        }];
var TmiThreatModelingImprovedApi = require('tmi__threat_modeling_improved_api');
var defaultClient = TmiThreatModelingImprovedApi.ApiClient.instance;


var api = new TmiThreatModelingImprovedApi.ThreatModelSubResourcesApi()
var threatModelId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // {{UUID}} Unique identifier of the threat model (UUID)
var repositoryId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // {{UUID}} Unique identifier of the source reference (UUID)

var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
};
api.getRepositoryMetadata(threatModelId, repositoryId, callback);
using System;
using System.Diagnostics;
using IO.Swagger.Api;
using IO.Swagger.Client;
using IO.Swagger.Model;

namespace Example
{
    public class getRepositoryMetadataExample
    {
        public void main()
        {


            var apiInstance = new ThreatModelSubResourcesApi();
            var threatModelId = new UUID(); // UUID | Unique identifier of the threat model (UUID)
            var repositoryId = new UUID(); // UUID | Unique identifier of the source reference (UUID)

            try
            {
                // Get source metadata
                array[Metadata] result = apiInstance.getRepositoryMetadata(threatModelId, repositoryId);
                Debug.WriteLine(result);
            }
            catch (Exception e)
            {
                Debug.Print("Exception when calling ThreatModelSubResourcesApi.getRepositoryMetadata: " + e.Message );
            }
        }
    }
}
<?php
require_once(__DIR__ . '/vendor/autoload.php');


$api_instance = new Swagger\Client\ApiThreatModelSubResourcesApi();
$threatModelId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // UUID | Unique identifier of the threat model (UUID)
$repositoryId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // UUID | Unique identifier of the source reference (UUID)

try {
    $result = $api_instance->getRepositoryMetadata($threatModelId, $repositoryId);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling ThreatModelSubResourcesApi->getRepositoryMetadata: ', $e->getMessage(), PHP_EOL;
}
?>
use Data::Dumper;
use WWW::SwaggerClient::Configuration;
use WWW::SwaggerClient::ThreatModelSubResourcesApi;


my $api_instance = WWW::SwaggerClient::ThreatModelSubResourcesApi->new();
my $threatModelId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; # UUID | Unique identifier of the threat model (UUID)
my $repositoryId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; # UUID | Unique identifier of the source reference (UUID)

eval { 
    my $result = $api_instance->getRepositoryMetadata(threatModelId => $threatModelId, repositoryId => $repositoryId);
    print Dumper($result);
};
if ($@) {
    warn "Exception when calling ThreatModelSubResourcesApi->getRepositoryMetadata: $@\n";
}
from __future__ import print_statement
import time
import swagger_client
from swagger_client.rest import ApiException
from pprint import pprint


# create an instance of the API class
api_instance = swagger_client.ThreatModelSubResourcesApi()
threatModelId = 38400000-8cf0-11bd-b23e-10b96e4ef00d # UUID | Unique identifier of the threat model (UUID)
repositoryId = 38400000-8cf0-11bd-b23e-10b96e4ef00d # UUID | Unique identifier of the source reference (UUID)

try: 
    # Get source metadata
    api_response = api_instance.get_repository_metadata(threatModelId, repositoryId)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling ThreatModelSubResourcesApi->getRepositoryMetadata: %s\n" % e)

Parameters

Path parameters
Name Description
threat_model_id*
UUID (uuid)
Unique identifier of the threat model (UUID)
Required
repository_id*
UUID (uuid)
Unique identifier of the source reference (UUID)
Required

Responses

Status: 200 - Source metadata list

Status: 401 - Error response

Status: 403 - Error response

Status: 404 - Error response

Status: 500 - Error response


getRepositoryMetadataByKey

Get source metadata by key

Returns a specific metadata entry by key for the specified source reference


/threat_models/{threat_model_id}/repositories/{repository_id}/metadata/{key}

Usage and SDK Samples

curl -X GET\
 -H "Authorization: Bearer [[accessToken]]"\
-H "Accept: application/json"\
"http://localhost:8080/threat_models/{threat_model_id}/repositories/{repository_id}/metadata/{key}"
import io.swagger.client.*;
import io.swagger.client.auth.*;
import io.swagger.client.model.*;
import io.swagger.client.api.ThreatModelSubResourcesApi;

import java.io.File;
import java.util.*;

public class ThreatModelSubResourcesApiExample {

    public static void main(String[] args) {
        ApiClient defaultClient = Configuration.getDefaultApiClient();


        ThreatModelSubResourcesApi apiInstance = new ThreatModelSubResourcesApi();
        UUID threatModelId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // UUID | Unique identifier of the threat model (UUID)
        UUID repositoryId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // UUID | Unique identifier of the source reference (UUID)
        String key = key_example; // String | Metadata key to retrieve
        try {
            Metadata result = apiInstance.getRepositoryMetadataByKey(threatModelId, repositoryId, key);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling ThreatModelSubResourcesApi#getRepositoryMetadataByKey");
            e.printStackTrace();
        }
    }
}
import io.swagger.client.api.ThreatModelSubResourcesApi;

public class ThreatModelSubResourcesApiExample {

    public static void main(String[] args) {
        ThreatModelSubResourcesApi apiInstance = new ThreatModelSubResourcesApi();
        UUID threatModelId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // UUID | Unique identifier of the threat model (UUID)
        UUID repositoryId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // UUID | Unique identifier of the source reference (UUID)
        String key = key_example; // String | Metadata key to retrieve
        try {
            Metadata result = apiInstance.getRepositoryMetadataByKey(threatModelId, repositoryId, key);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling ThreatModelSubResourcesApi#getRepositoryMetadataByKey");
            e.printStackTrace();
        }
    }
}
Configuration *apiConfig = [Configuration sharedConfig];
UUID *threatModelId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // Unique identifier of the threat model (UUID)
UUID *repositoryId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // Unique identifier of the source reference (UUID)
String *key = key_example; // Metadata key to retrieve

ThreatModelSubResourcesApi *apiInstance = [[ThreatModelSubResourcesApi alloc] init];

// Get source metadata by key
[apiInstance getRepositoryMetadataByKeyWith:threatModelId
    repositoryId:repositoryId
    key:key
              completionHandler: ^(Metadata output, NSError* error) {
                            if (output) {
                                NSLog(@"%@", output);
                            }
                            if (error) {
                                NSLog(@"Error: %@", error);
                            }
                        }];
var TmiThreatModelingImprovedApi = require('tmi__threat_modeling_improved_api');
var defaultClient = TmiThreatModelingImprovedApi.ApiClient.instance;


var api = new TmiThreatModelingImprovedApi.ThreatModelSubResourcesApi()
var threatModelId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // {{UUID}} Unique identifier of the threat model (UUID)
var repositoryId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // {{UUID}} Unique identifier of the source reference (UUID)
var key = key_example; // {{String}} Metadata key to retrieve

var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
};
api.getRepositoryMetadataByKey(threatModelId, repositoryId, key, callback);
using System;
using System.Diagnostics;
using IO.Swagger.Api;
using IO.Swagger.Client;
using IO.Swagger.Model;

namespace Example
{
    public class getRepositoryMetadataByKeyExample
    {
        public void main()
        {


            var apiInstance = new ThreatModelSubResourcesApi();
            var threatModelId = new UUID(); // UUID | Unique identifier of the threat model (UUID)
            var repositoryId = new UUID(); // UUID | Unique identifier of the source reference (UUID)
            var key = key_example;  // String | Metadata key to retrieve

            try
            {
                // Get source metadata by key
                Metadata result = apiInstance.getRepositoryMetadataByKey(threatModelId, repositoryId, key);
                Debug.WriteLine(result);
            }
            catch (Exception e)
            {
                Debug.Print("Exception when calling ThreatModelSubResourcesApi.getRepositoryMetadataByKey: " + e.Message );
            }
        }
    }
}
<?php
require_once(__DIR__ . '/vendor/autoload.php');


$api_instance = new Swagger\Client\ApiThreatModelSubResourcesApi();
$threatModelId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // UUID | Unique identifier of the threat model (UUID)
$repositoryId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // UUID | Unique identifier of the source reference (UUID)
$key = key_example; // String | Metadata key to retrieve

try {
    $result = $api_instance->getRepositoryMetadataByKey($threatModelId, $repositoryId, $key);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling ThreatModelSubResourcesApi->getRepositoryMetadataByKey: ', $e->getMessage(), PHP_EOL;
}
?>
use Data::Dumper;
use WWW::SwaggerClient::Configuration;
use WWW::SwaggerClient::ThreatModelSubResourcesApi;


my $api_instance = WWW::SwaggerClient::ThreatModelSubResourcesApi->new();
my $threatModelId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; # UUID | Unique identifier of the threat model (UUID)
my $repositoryId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; # UUID | Unique identifier of the source reference (UUID)
my $key = key_example; # String | Metadata key to retrieve

eval { 
    my $result = $api_instance->getRepositoryMetadataByKey(threatModelId => $threatModelId, repositoryId => $repositoryId, key => $key);
    print Dumper($result);
};
if ($@) {
    warn "Exception when calling ThreatModelSubResourcesApi->getRepositoryMetadataByKey: $@\n";
}
from __future__ import print_statement
import time
import swagger_client
from swagger_client.rest import ApiException
from pprint import pprint


# create an instance of the API class
api_instance = swagger_client.ThreatModelSubResourcesApi()
threatModelId = 38400000-8cf0-11bd-b23e-10b96e4ef00d # UUID | Unique identifier of the threat model (UUID)
repositoryId = 38400000-8cf0-11bd-b23e-10b96e4ef00d # UUID | Unique identifier of the source reference (UUID)
key = key_example # String | Metadata key to retrieve

try: 
    # Get source metadata by key
    api_response = api_instance.get_repository_metadata_by_key(threatModelId, repositoryId, key)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling ThreatModelSubResourcesApi->getRepositoryMetadataByKey: %s\n" % e)

Parameters

Path parameters
Name Description
threat_model_id*
UUID (uuid)
Unique identifier of the threat model (UUID)
Required
repository_id*
UUID (uuid)
Unique identifier of the source reference (UUID)
Required
key*
String
Metadata key to retrieve
Required

Responses

Status: 200 - Metadata entry

Status: 401 - Error response

Status: 403 - Error response

Status: 404 - Error response

Status: 500 - Error response


getThreatMetadata

Get threat metadata

Returns all metadata key-value pairs for the specified threat


/threat_models/{threat_model_id}/threats/{threat_id}/metadata

Usage and SDK Samples

curl -X GET\
 -H "Authorization: Bearer [[accessToken]]"\
-H "Accept: application/json"\
"http://localhost:8080/threat_models/{threat_model_id}/threats/{threat_id}/metadata"
import io.swagger.client.*;
import io.swagger.client.auth.*;
import io.swagger.client.model.*;
import io.swagger.client.api.ThreatModelSubResourcesApi;

import java.io.File;
import java.util.*;

public class ThreatModelSubResourcesApiExample {

    public static void main(String[] args) {
        ApiClient defaultClient = Configuration.getDefaultApiClient();


        ThreatModelSubResourcesApi apiInstance = new ThreatModelSubResourcesApi();
        UUID threatModelId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // UUID | Unique identifier of the threat model (UUID)
        UUID threatId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // UUID | Unique identifier of the threat (UUID)
        try {
            array[Metadata] result = apiInstance.getThreatMetadata(threatModelId, threatId);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling ThreatModelSubResourcesApi#getThreatMetadata");
            e.printStackTrace();
        }
    }
}
import io.swagger.client.api.ThreatModelSubResourcesApi;

public class ThreatModelSubResourcesApiExample {

    public static void main(String[] args) {
        ThreatModelSubResourcesApi apiInstance = new ThreatModelSubResourcesApi();
        UUID threatModelId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // UUID | Unique identifier of the threat model (UUID)
        UUID threatId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // UUID | Unique identifier of the threat (UUID)
        try {
            array[Metadata] result = apiInstance.getThreatMetadata(threatModelId, threatId);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling ThreatModelSubResourcesApi#getThreatMetadata");
            e.printStackTrace();
        }
    }
}
Configuration *apiConfig = [Configuration sharedConfig];
UUID *threatModelId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // Unique identifier of the threat model (UUID)
UUID *threatId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // Unique identifier of the threat (UUID)

ThreatModelSubResourcesApi *apiInstance = [[ThreatModelSubResourcesApi alloc] init];

// Get threat metadata
[apiInstance getThreatMetadataWith:threatModelId
    threatId:threatId
              completionHandler: ^(array[Metadata] output, NSError* error) {
                            if (output) {
                                NSLog(@"%@", output);
                            }
                            if (error) {
                                NSLog(@"Error: %@", error);
                            }
                        }];
var TmiThreatModelingImprovedApi = require('tmi__threat_modeling_improved_api');
var defaultClient = TmiThreatModelingImprovedApi.ApiClient.instance;


var api = new TmiThreatModelingImprovedApi.ThreatModelSubResourcesApi()
var threatModelId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // {{UUID}} Unique identifier of the threat model (UUID)
var threatId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // {{UUID}} Unique identifier of the threat (UUID)

var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
};
api.getThreatMetadata(threatModelId, threatId, callback);
using System;
using System.Diagnostics;
using IO.Swagger.Api;
using IO.Swagger.Client;
using IO.Swagger.Model;

namespace Example
{
    public class getThreatMetadataExample
    {
        public void main()
        {


            var apiInstance = new ThreatModelSubResourcesApi();
            var threatModelId = new UUID(); // UUID | Unique identifier of the threat model (UUID)
            var threatId = new UUID(); // UUID | Unique identifier of the threat (UUID)

            try
            {
                // Get threat metadata
                array[Metadata] result = apiInstance.getThreatMetadata(threatModelId, threatId);
                Debug.WriteLine(result);
            }
            catch (Exception e)
            {
                Debug.Print("Exception when calling ThreatModelSubResourcesApi.getThreatMetadata: " + e.Message );
            }
        }
    }
}
<?php
require_once(__DIR__ . '/vendor/autoload.php');


$api_instance = new Swagger\Client\ApiThreatModelSubResourcesApi();
$threatModelId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // UUID | Unique identifier of the threat model (UUID)
$threatId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // UUID | Unique identifier of the threat (UUID)

try {
    $result = $api_instance->getThreatMetadata($threatModelId, $threatId);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling ThreatModelSubResourcesApi->getThreatMetadata: ', $e->getMessage(), PHP_EOL;
}
?>
use Data::Dumper;
use WWW::SwaggerClient::Configuration;
use WWW::SwaggerClient::ThreatModelSubResourcesApi;


my $api_instance = WWW::SwaggerClient::ThreatModelSubResourcesApi->new();
my $threatModelId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; # UUID | Unique identifier of the threat model (UUID)
my $threatId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; # UUID | Unique identifier of the threat (UUID)

eval { 
    my $result = $api_instance->getThreatMetadata(threatModelId => $threatModelId, threatId => $threatId);
    print Dumper($result);
};
if ($@) {
    warn "Exception when calling ThreatModelSubResourcesApi->getThreatMetadata: $@\n";
}
from __future__ import print_statement
import time
import swagger_client
from swagger_client.rest import ApiException
from pprint import pprint


# create an instance of the API class
api_instance = swagger_client.ThreatModelSubResourcesApi()
threatModelId = 38400000-8cf0-11bd-b23e-10b96e4ef00d # UUID | Unique identifier of the threat model (UUID)
threatId = 38400000-8cf0-11bd-b23e-10b96e4ef00d # UUID | Unique identifier of the threat (UUID)

try: 
    # Get threat metadata
    api_response = api_instance.get_threat_metadata(threatModelId, threatId)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling ThreatModelSubResourcesApi->getThreatMetadata: %s\n" % e)

Parameters

Path parameters
Name Description
threat_model_id*
UUID (uuid)
Unique identifier of the threat model (UUID)
Required
threat_id*
UUID (uuid)
Unique identifier of the threat (UUID)
Required

Responses

Status: 200 - Threat metadata list

Status: 401 - Error response

Status: 403 - Error response

Status: 404 - Error response

Status: 500 - Error response


getThreatMetadataByKey

Get threat metadata by key

Returns a specific metadata entry by key for the specified threat


/threat_models/{threat_model_id}/threats/{threat_id}/metadata/{key}

Usage and SDK Samples

curl -X GET\
 -H "Authorization: Bearer [[accessToken]]"\
-H "Accept: application/json"\
"http://localhost:8080/threat_models/{threat_model_id}/threats/{threat_id}/metadata/{key}"
import io.swagger.client.*;
import io.swagger.client.auth.*;
import io.swagger.client.model.*;
import io.swagger.client.api.ThreatModelSubResourcesApi;

import java.io.File;
import java.util.*;

public class ThreatModelSubResourcesApiExample {

    public static void main(String[] args) {
        ApiClient defaultClient = Configuration.getDefaultApiClient();


        ThreatModelSubResourcesApi apiInstance = new ThreatModelSubResourcesApi();
        UUID threatModelId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // UUID | Unique identifier of the threat model (UUID)
        UUID threatId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // UUID | Unique identifier of the threat (UUID)
        String key = key_example; // String | Metadata key to retrieve
        try {
            Metadata result = apiInstance.getThreatMetadataByKey(threatModelId, threatId, key);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling ThreatModelSubResourcesApi#getThreatMetadataByKey");
            e.printStackTrace();
        }
    }
}
import io.swagger.client.api.ThreatModelSubResourcesApi;

public class ThreatModelSubResourcesApiExample {

    public static void main(String[] args) {
        ThreatModelSubResourcesApi apiInstance = new ThreatModelSubResourcesApi();
        UUID threatModelId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // UUID | Unique identifier of the threat model (UUID)
        UUID threatId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // UUID | Unique identifier of the threat (UUID)
        String key = key_example; // String | Metadata key to retrieve
        try {
            Metadata result = apiInstance.getThreatMetadataByKey(threatModelId, threatId, key);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling ThreatModelSubResourcesApi#getThreatMetadataByKey");
            e.printStackTrace();
        }
    }
}
Configuration *apiConfig = [Configuration sharedConfig];
UUID *threatModelId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // Unique identifier of the threat model (UUID)
UUID *threatId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // Unique identifier of the threat (UUID)
String *key = key_example; // Metadata key to retrieve

ThreatModelSubResourcesApi *apiInstance = [[ThreatModelSubResourcesApi alloc] init];

// Get threat metadata by key
[apiInstance getThreatMetadataByKeyWith:threatModelId
    threatId:threatId
    key:key
              completionHandler: ^(Metadata output, NSError* error) {
                            if (output) {
                                NSLog(@"%@", output);
                            }
                            if (error) {
                                NSLog(@"Error: %@", error);
                            }
                        }];
var TmiThreatModelingImprovedApi = require('tmi__threat_modeling_improved_api');
var defaultClient = TmiThreatModelingImprovedApi.ApiClient.instance;


var api = new TmiThreatModelingImprovedApi.ThreatModelSubResourcesApi()
var threatModelId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // {{UUID}} Unique identifier of the threat model (UUID)
var threatId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // {{UUID}} Unique identifier of the threat (UUID)
var key = key_example; // {{String}} Metadata key to retrieve

var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
};
api.getThreatMetadataByKey(threatModelId, threatId, key, callback);
using System;
using System.Diagnostics;
using IO.Swagger.Api;
using IO.Swagger.Client;
using IO.Swagger.Model;

namespace Example
{
    public class getThreatMetadataByKeyExample
    {
        public void main()
        {


            var apiInstance = new ThreatModelSubResourcesApi();
            var threatModelId = new UUID(); // UUID | Unique identifier of the threat model (UUID)
            var threatId = new UUID(); // UUID | Unique identifier of the threat (UUID)
            var key = key_example;  // String | Metadata key to retrieve

            try
            {
                // Get threat metadata by key
                Metadata result = apiInstance.getThreatMetadataByKey(threatModelId, threatId, key);
                Debug.WriteLine(result);
            }
            catch (Exception e)
            {
                Debug.Print("Exception when calling ThreatModelSubResourcesApi.getThreatMetadataByKey: " + e.Message );
            }
        }
    }
}
<?php
require_once(__DIR__ . '/vendor/autoload.php');


$api_instance = new Swagger\Client\ApiThreatModelSubResourcesApi();
$threatModelId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // UUID | Unique identifier of the threat model (UUID)
$threatId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // UUID | Unique identifier of the threat (UUID)
$key = key_example; // String | Metadata key to retrieve

try {
    $result = $api_instance->getThreatMetadataByKey($threatModelId, $threatId, $key);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling ThreatModelSubResourcesApi->getThreatMetadataByKey: ', $e->getMessage(), PHP_EOL;
}
?>
use Data::Dumper;
use WWW::SwaggerClient::Configuration;
use WWW::SwaggerClient::ThreatModelSubResourcesApi;


my $api_instance = WWW::SwaggerClient::ThreatModelSubResourcesApi->new();
my $threatModelId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; # UUID | Unique identifier of the threat model (UUID)
my $threatId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; # UUID | Unique identifier of the threat (UUID)
my $key = key_example; # String | Metadata key to retrieve

eval { 
    my $result = $api_instance->getThreatMetadataByKey(threatModelId => $threatModelId, threatId => $threatId, key => $key);
    print Dumper($result);
};
if ($@) {
    warn "Exception when calling ThreatModelSubResourcesApi->getThreatMetadataByKey: $@\n";
}
from __future__ import print_statement
import time
import swagger_client
from swagger_client.rest import ApiException
from pprint import pprint


# create an instance of the API class
api_instance = swagger_client.ThreatModelSubResourcesApi()
threatModelId = 38400000-8cf0-11bd-b23e-10b96e4ef00d # UUID | Unique identifier of the threat model (UUID)
threatId = 38400000-8cf0-11bd-b23e-10b96e4ef00d # UUID | Unique identifier of the threat (UUID)
key = key_example # String | Metadata key to retrieve

try: 
    # Get threat metadata by key
    api_response = api_instance.get_threat_metadata_by_key(threatModelId, threatId, key)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling ThreatModelSubResourcesApi->getThreatMetadataByKey: %s\n" % e)

Parameters

Path parameters
Name Description
threat_model_id*
UUID (uuid)
Unique identifier of the threat model (UUID)
Required
threat_id*
UUID (uuid)
Unique identifier of the threat (UUID)
Required
key*
String
Metadata key to retrieve
Required

Responses

Status: 200 - Metadata entry

Status: 401 - Error response

Status: 403 - Error response

Status: 404 - Error response

Status: 500 - Error response


getThreatModelAsset

Get a specific asset

Returns a single asset by its ID


/threat_models/{threat_model_id}/assets/{asset_id}

Usage and SDK Samples

curl -X GET\
 -H "Authorization: Bearer [[accessToken]]"\
-H "Accept: application/json"\
"http://localhost:8080/threat_models/{threat_model_id}/assets/{asset_id}"
import io.swagger.client.*;
import io.swagger.client.auth.*;
import io.swagger.client.model.*;
import io.swagger.client.api.ThreatModelSubResourcesApi;

import java.io.File;
import java.util.*;

public class ThreatModelSubResourcesApiExample {

    public static void main(String[] args) {
        ApiClient defaultClient = Configuration.getDefaultApiClient();


        ThreatModelSubResourcesApi apiInstance = new ThreatModelSubResourcesApi();
        UUID threatModelId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // UUID | Unique identifier of the threat model (UUID)
        UUID assetId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // UUID | Unique identifier of the asset (UUID)
        try {
            Asset result = apiInstance.getThreatModelAsset(threatModelId, assetId);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling ThreatModelSubResourcesApi#getThreatModelAsset");
            e.printStackTrace();
        }
    }
}
import io.swagger.client.api.ThreatModelSubResourcesApi;

public class ThreatModelSubResourcesApiExample {

    public static void main(String[] args) {
        ThreatModelSubResourcesApi apiInstance = new ThreatModelSubResourcesApi();
        UUID threatModelId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // UUID | Unique identifier of the threat model (UUID)
        UUID assetId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // UUID | Unique identifier of the asset (UUID)
        try {
            Asset result = apiInstance.getThreatModelAsset(threatModelId, assetId);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling ThreatModelSubResourcesApi#getThreatModelAsset");
            e.printStackTrace();
        }
    }
}
Configuration *apiConfig = [Configuration sharedConfig];
UUID *threatModelId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // Unique identifier of the threat model (UUID)
UUID *assetId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // Unique identifier of the asset (UUID)

ThreatModelSubResourcesApi *apiInstance = [[ThreatModelSubResourcesApi alloc] init];

// Get a specific asset
[apiInstance getThreatModelAssetWith:threatModelId
    assetId:assetId
              completionHandler: ^(Asset output, NSError* error) {
                            if (output) {
                                NSLog(@"%@", output);
                            }
                            if (error) {
                                NSLog(@"Error: %@", error);
                            }
                        }];
var TmiThreatModelingImprovedApi = require('tmi__threat_modeling_improved_api');
var defaultClient = TmiThreatModelingImprovedApi.ApiClient.instance;


var api = new TmiThreatModelingImprovedApi.ThreatModelSubResourcesApi()
var threatModelId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // {{UUID}} Unique identifier of the threat model (UUID)
var assetId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // {{UUID}} Unique identifier of the asset (UUID)

var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
};
api.getThreatModelAsset(threatModelId, assetId, callback);
using System;
using System.Diagnostics;
using IO.Swagger.Api;
using IO.Swagger.Client;
using IO.Swagger.Model;

namespace Example
{
    public class getThreatModelAssetExample
    {
        public void main()
        {


            var apiInstance = new ThreatModelSubResourcesApi();
            var threatModelId = new UUID(); // UUID | Unique identifier of the threat model (UUID)
            var assetId = new UUID(); // UUID | Unique identifier of the asset (UUID)

            try
            {
                // Get a specific asset
                Asset result = apiInstance.getThreatModelAsset(threatModelId, assetId);
                Debug.WriteLine(result);
            }
            catch (Exception e)
            {
                Debug.Print("Exception when calling ThreatModelSubResourcesApi.getThreatModelAsset: " + e.Message );
            }
        }
    }
}
<?php
require_once(__DIR__ . '/vendor/autoload.php');


$api_instance = new Swagger\Client\ApiThreatModelSubResourcesApi();
$threatModelId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // UUID | Unique identifier of the threat model (UUID)
$assetId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // UUID | Unique identifier of the asset (UUID)

try {
    $result = $api_instance->getThreatModelAsset($threatModelId, $assetId);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling ThreatModelSubResourcesApi->getThreatModelAsset: ', $e->getMessage(), PHP_EOL;
}
?>
use Data::Dumper;
use WWW::SwaggerClient::Configuration;
use WWW::SwaggerClient::ThreatModelSubResourcesApi;


my $api_instance = WWW::SwaggerClient::ThreatModelSubResourcesApi->new();
my $threatModelId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; # UUID | Unique identifier of the threat model (UUID)
my $assetId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; # UUID | Unique identifier of the asset (UUID)

eval { 
    my $result = $api_instance->getThreatModelAsset(threatModelId => $threatModelId, assetId => $assetId);
    print Dumper($result);
};
if ($@) {
    warn "Exception when calling ThreatModelSubResourcesApi->getThreatModelAsset: $@\n";
}
from __future__ import print_statement
import time
import swagger_client
from swagger_client.rest import ApiException
from pprint import pprint


# create an instance of the API class
api_instance = swagger_client.ThreatModelSubResourcesApi()
threatModelId = 38400000-8cf0-11bd-b23e-10b96e4ef00d # UUID | Unique identifier of the threat model (UUID)
assetId = 38400000-8cf0-11bd-b23e-10b96e4ef00d # UUID | Unique identifier of the asset (UUID)

try: 
    # Get a specific asset
    api_response = api_instance.get_threat_model_asset(threatModelId, assetId)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling ThreatModelSubResourcesApi->getThreatModelAsset: %s\n" % e)

Parameters

Path parameters
Name Description
threat_model_id*
UUID (uuid)
Unique identifier of the threat model (UUID)
Required
asset_id*
UUID (uuid)
Unique identifier of the asset (UUID)
Required

Responses

Status: 200 - Asset details

Status: 401 - Error response

Status: 403 - Error response

Status: 404 - Error response

Status: 500 - Error response


getThreatModelAssetMetadata

Get all metadata for an asset

Returns all metadata key-value pairs for the specified asset


/threat_models/{threat_model_id}/assets/{asset_id}/metadata

Usage and SDK Samples

curl -X GET\
 -H "Authorization: Bearer [[accessToken]]"\
-H "Accept: application/json"\
"http://localhost:8080/threat_models/{threat_model_id}/assets/{asset_id}/metadata"
import io.swagger.client.*;
import io.swagger.client.auth.*;
import io.swagger.client.model.*;
import io.swagger.client.api.ThreatModelSubResourcesApi;

import java.io.File;
import java.util.*;

public class ThreatModelSubResourcesApiExample {

    public static void main(String[] args) {
        ApiClient defaultClient = Configuration.getDefaultApiClient();


        ThreatModelSubResourcesApi apiInstance = new ThreatModelSubResourcesApi();
        UUID threatModelId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // UUID | Unique identifier of the threat model (UUID)
        UUID assetId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // UUID | Unique identifier of the asset (UUID)
        try {
            array[Metadata] result = apiInstance.getThreatModelAssetMetadata(threatModelId, assetId);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling ThreatModelSubResourcesApi#getThreatModelAssetMetadata");
            e.printStackTrace();
        }
    }
}
import io.swagger.client.api.ThreatModelSubResourcesApi;

public class ThreatModelSubResourcesApiExample {

    public static void main(String[] args) {
        ThreatModelSubResourcesApi apiInstance = new ThreatModelSubResourcesApi();
        UUID threatModelId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // UUID | Unique identifier of the threat model (UUID)
        UUID assetId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // UUID | Unique identifier of the asset (UUID)
        try {
            array[Metadata] result = apiInstance.getThreatModelAssetMetadata(threatModelId, assetId);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling ThreatModelSubResourcesApi#getThreatModelAssetMetadata");
            e.printStackTrace();
        }
    }
}
Configuration *apiConfig = [Configuration sharedConfig];
UUID *threatModelId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // Unique identifier of the threat model (UUID)
UUID *assetId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // Unique identifier of the asset (UUID)

ThreatModelSubResourcesApi *apiInstance = [[ThreatModelSubResourcesApi alloc] init];

// Get all metadata for an asset
[apiInstance getThreatModelAssetMetadataWith:threatModelId
    assetId:assetId
              completionHandler: ^(array[Metadata] output, NSError* error) {
                            if (output) {
                                NSLog(@"%@", output);
                            }
                            if (error) {
                                NSLog(@"Error: %@", error);
                            }
                        }];
var TmiThreatModelingImprovedApi = require('tmi__threat_modeling_improved_api');
var defaultClient = TmiThreatModelingImprovedApi.ApiClient.instance;


var api = new TmiThreatModelingImprovedApi.ThreatModelSubResourcesApi()
var threatModelId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // {{UUID}} Unique identifier of the threat model (UUID)
var assetId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // {{UUID}} Unique identifier of the asset (UUID)

var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
};
api.getThreatModelAssetMetadata(threatModelId, assetId, callback);
using System;
using System.Diagnostics;
using IO.Swagger.Api;
using IO.Swagger.Client;
using IO.Swagger.Model;

namespace Example
{
    public class getThreatModelAssetMetadataExample
    {
        public void main()
        {


            var apiInstance = new ThreatModelSubResourcesApi();
            var threatModelId = new UUID(); // UUID | Unique identifier of the threat model (UUID)
            var assetId = new UUID(); // UUID | Unique identifier of the asset (UUID)

            try
            {
                // Get all metadata for an asset
                array[Metadata] result = apiInstance.getThreatModelAssetMetadata(threatModelId, assetId);
                Debug.WriteLine(result);
            }
            catch (Exception e)
            {
                Debug.Print("Exception when calling ThreatModelSubResourcesApi.getThreatModelAssetMetadata: " + e.Message );
            }
        }
    }
}
<?php
require_once(__DIR__ . '/vendor/autoload.php');


$api_instance = new Swagger\Client\ApiThreatModelSubResourcesApi();
$threatModelId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // UUID | Unique identifier of the threat model (UUID)
$assetId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // UUID | Unique identifier of the asset (UUID)

try {
    $result = $api_instance->getThreatModelAssetMetadata($threatModelId, $assetId);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling ThreatModelSubResourcesApi->getThreatModelAssetMetadata: ', $e->getMessage(), PHP_EOL;
}
?>
use Data::Dumper;
use WWW::SwaggerClient::Configuration;
use WWW::SwaggerClient::ThreatModelSubResourcesApi;


my $api_instance = WWW::SwaggerClient::ThreatModelSubResourcesApi->new();
my $threatModelId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; # UUID | Unique identifier of the threat model (UUID)
my $assetId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; # UUID | Unique identifier of the asset (UUID)

eval { 
    my $result = $api_instance->getThreatModelAssetMetadata(threatModelId => $threatModelId, assetId => $assetId);
    print Dumper($result);
};
if ($@) {
    warn "Exception when calling ThreatModelSubResourcesApi->getThreatModelAssetMetadata: $@\n";
}
from __future__ import print_statement
import time
import swagger_client
from swagger_client.rest import ApiException
from pprint import pprint


# create an instance of the API class
api_instance = swagger_client.ThreatModelSubResourcesApi()
threatModelId = 38400000-8cf0-11bd-b23e-10b96e4ef00d # UUID | Unique identifier of the threat model (UUID)
assetId = 38400000-8cf0-11bd-b23e-10b96e4ef00d # UUID | Unique identifier of the asset (UUID)

try: 
    # Get all metadata for an asset
    api_response = api_instance.get_threat_model_asset_metadata(threatModelId, assetId)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling ThreatModelSubResourcesApi->getThreatModelAssetMetadata: %s\n" % e)

Parameters

Path parameters
Name Description
threat_model_id*
UUID (uuid)
Unique identifier of the threat model (UUID)
Required
asset_id*
UUID (uuid)
Unique identifier of the asset (UUID)
Required

Responses

Status: 200 - Asset metadata

Status: 401 - Error response

Status: 403 - Error response

Status: 404 - Error response

Status: 500 - Error response


getThreatModelAssetMetadataByKey

Get specific metadata for an asset

Returns a single metadata value by its key


/threat_models/{threat_model_id}/assets/{asset_id}/metadata/{key}

Usage and SDK Samples

curl -X GET\
 -H "Authorization: Bearer [[accessToken]]"\
-H "Accept: application/json"\
"http://localhost:8080/threat_models/{threat_model_id}/assets/{asset_id}/metadata/{key}"
import io.swagger.client.*;
import io.swagger.client.auth.*;
import io.swagger.client.model.*;
import io.swagger.client.api.ThreatModelSubResourcesApi;

import java.io.File;
import java.util.*;

public class ThreatModelSubResourcesApiExample {

    public static void main(String[] args) {
        ApiClient defaultClient = Configuration.getDefaultApiClient();


        ThreatModelSubResourcesApi apiInstance = new ThreatModelSubResourcesApi();
        UUID threatModelId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // UUID | Unique identifier of the threat model (UUID)
        UUID assetId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // UUID | Unique identifier of the asset (UUID)
        String key = key_example; // String | Metadata key
        try {
            Metadata result = apiInstance.getThreatModelAssetMetadataByKey(threatModelId, assetId, key);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling ThreatModelSubResourcesApi#getThreatModelAssetMetadataByKey");
            e.printStackTrace();
        }
    }
}
import io.swagger.client.api.ThreatModelSubResourcesApi;

public class ThreatModelSubResourcesApiExample {

    public static void main(String[] args) {
        ThreatModelSubResourcesApi apiInstance = new ThreatModelSubResourcesApi();
        UUID threatModelId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // UUID | Unique identifier of the threat model (UUID)
        UUID assetId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // UUID | Unique identifier of the asset (UUID)
        String key = key_example; // String | Metadata key
        try {
            Metadata result = apiInstance.getThreatModelAssetMetadataByKey(threatModelId, assetId, key);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling ThreatModelSubResourcesApi#getThreatModelAssetMetadataByKey");
            e.printStackTrace();
        }
    }
}
Configuration *apiConfig = [Configuration sharedConfig];
UUID *threatModelId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // Unique identifier of the threat model (UUID)
UUID *assetId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // Unique identifier of the asset (UUID)
String *key = key_example; // Metadata key

ThreatModelSubResourcesApi *apiInstance = [[ThreatModelSubResourcesApi alloc] init];

// Get specific metadata for an asset
[apiInstance getThreatModelAssetMetadataByKeyWith:threatModelId
    assetId:assetId
    key:key
              completionHandler: ^(Metadata output, NSError* error) {
                            if (output) {
                                NSLog(@"%@", output);
                            }
                            if (error) {
                                NSLog(@"Error: %@", error);
                            }
                        }];
var TmiThreatModelingImprovedApi = require('tmi__threat_modeling_improved_api');
var defaultClient = TmiThreatModelingImprovedApi.ApiClient.instance;


var api = new TmiThreatModelingImprovedApi.ThreatModelSubResourcesApi()
var threatModelId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // {{UUID}} Unique identifier of the threat model (UUID)
var assetId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // {{UUID}} Unique identifier of the asset (UUID)
var key = key_example; // {{String}} Metadata key

var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
};
api.getThreatModelAssetMetadataByKey(threatModelId, assetId, key, callback);
using System;
using System.Diagnostics;
using IO.Swagger.Api;
using IO.Swagger.Client;
using IO.Swagger.Model;

namespace Example
{
    public class getThreatModelAssetMetadataByKeyExample
    {
        public void main()
        {


            var apiInstance = new ThreatModelSubResourcesApi();
            var threatModelId = new UUID(); // UUID | Unique identifier of the threat model (UUID)
            var assetId = new UUID(); // UUID | Unique identifier of the asset (UUID)
            var key = key_example;  // String | Metadata key

            try
            {
                // Get specific metadata for an asset
                Metadata result = apiInstance.getThreatModelAssetMetadataByKey(threatModelId, assetId, key);
                Debug.WriteLine(result);
            }
            catch (Exception e)
            {
                Debug.Print("Exception when calling ThreatModelSubResourcesApi.getThreatModelAssetMetadataByKey: " + e.Message );
            }
        }
    }
}
<?php
require_once(__DIR__ . '/vendor/autoload.php');


$api_instance = new Swagger\Client\ApiThreatModelSubResourcesApi();
$threatModelId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // UUID | Unique identifier of the threat model (UUID)
$assetId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // UUID | Unique identifier of the asset (UUID)
$key = key_example; // String | Metadata key

try {
    $result = $api_instance->getThreatModelAssetMetadataByKey($threatModelId, $assetId, $key);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling ThreatModelSubResourcesApi->getThreatModelAssetMetadataByKey: ', $e->getMessage(), PHP_EOL;
}
?>
use Data::Dumper;
use WWW::SwaggerClient::Configuration;
use WWW::SwaggerClient::ThreatModelSubResourcesApi;


my $api_instance = WWW::SwaggerClient::ThreatModelSubResourcesApi->new();
my $threatModelId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; # UUID | Unique identifier of the threat model (UUID)
my $assetId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; # UUID | Unique identifier of the asset (UUID)
my $key = key_example; # String | Metadata key

eval { 
    my $result = $api_instance->getThreatModelAssetMetadataByKey(threatModelId => $threatModelId, assetId => $assetId, key => $key);
    print Dumper($result);
};
if ($@) {
    warn "Exception when calling ThreatModelSubResourcesApi->getThreatModelAssetMetadataByKey: $@\n";
}
from __future__ import print_statement
import time
import swagger_client
from swagger_client.rest import ApiException
from pprint import pprint


# create an instance of the API class
api_instance = swagger_client.ThreatModelSubResourcesApi()
threatModelId = 38400000-8cf0-11bd-b23e-10b96e4ef00d # UUID | Unique identifier of the threat model (UUID)
assetId = 38400000-8cf0-11bd-b23e-10b96e4ef00d # UUID | Unique identifier of the asset (UUID)
key = key_example # String | Metadata key

try: 
    # Get specific metadata for an asset
    api_response = api_instance.get_threat_model_asset_metadata_by_key(threatModelId, assetId, key)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling ThreatModelSubResourcesApi->getThreatModelAssetMetadataByKey: %s\n" % e)

Parameters

Path parameters
Name Description
threat_model_id*
UUID (uuid)
Unique identifier of the threat model (UUID)
Required
asset_id*
UUID (uuid)
Unique identifier of the asset (UUID)
Required
key*
String
Metadata key
Required

Responses

Status: 200 - Metadata value

Status: 401 - Error response

Status: 403 - Error response

Status: 404 - Error response

Status: 500 - Error response


getThreatModelAssets

List assets in a threat model

Returns a paginated list of assets within the specified threat model


/threat_models/{threat_model_id}/assets

Usage and SDK Samples

curl -X GET\
 -H "Authorization: Bearer [[accessToken]]"\
-H "Accept: application/json"\
"http://localhost:8080/threat_models/{threat_model_id}/assets?limit=&offset="
import io.swagger.client.*;
import io.swagger.client.auth.*;
import io.swagger.client.model.*;
import io.swagger.client.api.ThreatModelSubResourcesApi;

import java.io.File;
import java.util.*;

public class ThreatModelSubResourcesApiExample {

    public static void main(String[] args) {
        ApiClient defaultClient = Configuration.getDefaultApiClient();


        ThreatModelSubResourcesApi apiInstance = new ThreatModelSubResourcesApi();
        UUID threatModelId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // UUID | Unique identifier of the threat model (UUID)
        Integer limit = 56; // Integer | Maximum number of assets to return
        Integer offset = 56; // Integer | Number of assets to skip
        try {
            array[Asset] result = apiInstance.getThreatModelAssets(threatModelId, limit, offset);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling ThreatModelSubResourcesApi#getThreatModelAssets");
            e.printStackTrace();
        }
    }
}
import io.swagger.client.api.ThreatModelSubResourcesApi;

public class ThreatModelSubResourcesApiExample {

    public static void main(String[] args) {
        ThreatModelSubResourcesApi apiInstance = new ThreatModelSubResourcesApi();
        UUID threatModelId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // UUID | Unique identifier of the threat model (UUID)
        Integer limit = 56; // Integer | Maximum number of assets to return
        Integer offset = 56; // Integer | Number of assets to skip
        try {
            array[Asset] result = apiInstance.getThreatModelAssets(threatModelId, limit, offset);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling ThreatModelSubResourcesApi#getThreatModelAssets");
            e.printStackTrace();
        }
    }
}
Configuration *apiConfig = [Configuration sharedConfig];
UUID *threatModelId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // Unique identifier of the threat model (UUID)
Integer *limit = 56; // Maximum number of assets to return (optional) (default to 20)
Integer *offset = 56; // Number of assets to skip (optional) (default to 0)

ThreatModelSubResourcesApi *apiInstance = [[ThreatModelSubResourcesApi alloc] init];

// List assets in a threat model
[apiInstance getThreatModelAssetsWith:threatModelId
    limit:limit
    offset:offset
              completionHandler: ^(array[Asset] output, NSError* error) {
                            if (output) {
                                NSLog(@"%@", output);
                            }
                            if (error) {
                                NSLog(@"Error: %@", error);
                            }
                        }];
var TmiThreatModelingImprovedApi = require('tmi__threat_modeling_improved_api');
var defaultClient = TmiThreatModelingImprovedApi.ApiClient.instance;


var api = new TmiThreatModelingImprovedApi.ThreatModelSubResourcesApi()
var threatModelId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // {{UUID}} Unique identifier of the threat model (UUID)
var opts = { 
  'limit': 56, // {{Integer}} Maximum number of assets to return
  'offset': 56 // {{Integer}} Number of assets to skip
};
var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
};
api.getThreatModelAssets(threatModelId, opts, callback);
using System;
using System.Diagnostics;
using IO.Swagger.Api;
using IO.Swagger.Client;
using IO.Swagger.Model;

namespace Example
{
    public class getThreatModelAssetsExample
    {
        public void main()
        {


            var apiInstance = new ThreatModelSubResourcesApi();
            var threatModelId = new UUID(); // UUID | Unique identifier of the threat model (UUID)
            var limit = 56;  // Integer | Maximum number of assets to return (optional)  (default to 20)
            var offset = 56;  // Integer | Number of assets to skip (optional)  (default to 0)

            try
            {
                // List assets in a threat model
                array[Asset] result = apiInstance.getThreatModelAssets(threatModelId, limit, offset);
                Debug.WriteLine(result);
            }
            catch (Exception e)
            {
                Debug.Print("Exception when calling ThreatModelSubResourcesApi.getThreatModelAssets: " + e.Message );
            }
        }
    }
}
<?php
require_once(__DIR__ . '/vendor/autoload.php');


$api_instance = new Swagger\Client\ApiThreatModelSubResourcesApi();
$threatModelId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // UUID | Unique identifier of the threat model (UUID)
$limit = 56; // Integer | Maximum number of assets to return
$offset = 56; // Integer | Number of assets to skip

try {
    $result = $api_instance->getThreatModelAssets($threatModelId, $limit, $offset);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling ThreatModelSubResourcesApi->getThreatModelAssets: ', $e->getMessage(), PHP_EOL;
}
?>
use Data::Dumper;
use WWW::SwaggerClient::Configuration;
use WWW::SwaggerClient::ThreatModelSubResourcesApi;


my $api_instance = WWW::SwaggerClient::ThreatModelSubResourcesApi->new();
my $threatModelId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; # UUID | Unique identifier of the threat model (UUID)
my $limit = 56; # Integer | Maximum number of assets to return
my $offset = 56; # Integer | Number of assets to skip

eval { 
    my $result = $api_instance->getThreatModelAssets(threatModelId => $threatModelId, limit => $limit, offset => $offset);
    print Dumper($result);
};
if ($@) {
    warn "Exception when calling ThreatModelSubResourcesApi->getThreatModelAssets: $@\n";
}
from __future__ import print_statement
import time
import swagger_client
from swagger_client.rest import ApiException
from pprint import pprint


# create an instance of the API class
api_instance = swagger_client.ThreatModelSubResourcesApi()
threatModelId = 38400000-8cf0-11bd-b23e-10b96e4ef00d # UUID | Unique identifier of the threat model (UUID)
limit = 56 # Integer | Maximum number of assets to return (optional) (default to 20)
offset = 56 # Integer | Number of assets to skip (optional) (default to 0)

try: 
    # List assets in a threat model
    api_response = api_instance.get_threat_model_assets(threatModelId, limit=limit, offset=offset)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling ThreatModelSubResourcesApi->getThreatModelAssets: %s\n" % e)

Parameters

Path parameters
Name Description
threat_model_id*
UUID (uuid)
Unique identifier of the threat model (UUID)
Required
Query parameters
Name Description
limit
Integer
Maximum number of assets to return
offset
Integer
Number of assets to skip

Responses

Status: 200 - List of assets

Status: 401 - Error response

Status: 403 - Error response

Status: 404 - Error response

Status: 500 - Error response


getThreatModelDiagram

Get a specific diagram

Retrieves a specific diagram from the threat model


/threat_models/{threat_model_id}/diagrams/{diagram_id}

Usage and SDK Samples

curl -X GET\
 -H "Authorization: Bearer [[accessToken]]"\
-H "Accept: application/json"\
"http://localhost:8080/threat_models/{threat_model_id}/diagrams/{diagram_id}"
import io.swagger.client.*;
import io.swagger.client.auth.*;
import io.swagger.client.model.*;
import io.swagger.client.api.ThreatModelSubResourcesApi;

import java.io.File;
import java.util.*;

public class ThreatModelSubResourcesApiExample {

    public static void main(String[] args) {
        ApiClient defaultClient = Configuration.getDefaultApiClient();


        ThreatModelSubResourcesApi apiInstance = new ThreatModelSubResourcesApi();
        UUID threatModelId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // UUID | Unique identifier of the threat model (UUID)
        UUID diagramId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // UUID | Unique identifier of the diagram (UUID)
        try {
            Diagram result = apiInstance.getThreatModelDiagram(threatModelId, diagramId);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling ThreatModelSubResourcesApi#getThreatModelDiagram");
            e.printStackTrace();
        }
    }
}
import io.swagger.client.api.ThreatModelSubResourcesApi;

public class ThreatModelSubResourcesApiExample {

    public static void main(String[] args) {
        ThreatModelSubResourcesApi apiInstance = new ThreatModelSubResourcesApi();
        UUID threatModelId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // UUID | Unique identifier of the threat model (UUID)
        UUID diagramId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // UUID | Unique identifier of the diagram (UUID)
        try {
            Diagram result = apiInstance.getThreatModelDiagram(threatModelId, diagramId);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling ThreatModelSubResourcesApi#getThreatModelDiagram");
            e.printStackTrace();
        }
    }
}
Configuration *apiConfig = [Configuration sharedConfig];
UUID *threatModelId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // Unique identifier of the threat model (UUID)
UUID *diagramId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // Unique identifier of the diagram (UUID)

ThreatModelSubResourcesApi *apiInstance = [[ThreatModelSubResourcesApi alloc] init];

// Get a specific diagram
[apiInstance getThreatModelDiagramWith:threatModelId
    diagramId:diagramId
              completionHandler: ^(Diagram output, NSError* error) {
                            if (output) {
                                NSLog(@"%@", output);
                            }
                            if (error) {
                                NSLog(@"Error: %@", error);
                            }
                        }];
var TmiThreatModelingImprovedApi = require('tmi__threat_modeling_improved_api');
var defaultClient = TmiThreatModelingImprovedApi.ApiClient.instance;


var api = new TmiThreatModelingImprovedApi.ThreatModelSubResourcesApi()
var threatModelId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // {{UUID}} Unique identifier of the threat model (UUID)
var diagramId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // {{UUID}} Unique identifier of the diagram (UUID)

var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
};
api.getThreatModelDiagram(threatModelId, diagramId, callback);
using System;
using System.Diagnostics;
using IO.Swagger.Api;
using IO.Swagger.Client;
using IO.Swagger.Model;

namespace Example
{
    public class getThreatModelDiagramExample
    {
        public void main()
        {


            var apiInstance = new ThreatModelSubResourcesApi();
            var threatModelId = new UUID(); // UUID | Unique identifier of the threat model (UUID)
            var diagramId = new UUID(); // UUID | Unique identifier of the diagram (UUID)

            try
            {
                // Get a specific diagram
                Diagram result = apiInstance.getThreatModelDiagram(threatModelId, diagramId);
                Debug.WriteLine(result);
            }
            catch (Exception e)
            {
                Debug.Print("Exception when calling ThreatModelSubResourcesApi.getThreatModelDiagram: " + e.Message );
            }
        }
    }
}
<?php
require_once(__DIR__ . '/vendor/autoload.php');


$api_instance = new Swagger\Client\ApiThreatModelSubResourcesApi();
$threatModelId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // UUID | Unique identifier of the threat model (UUID)
$diagramId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // UUID | Unique identifier of the diagram (UUID)

try {
    $result = $api_instance->getThreatModelDiagram($threatModelId, $diagramId);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling ThreatModelSubResourcesApi->getThreatModelDiagram: ', $e->getMessage(), PHP_EOL;
}
?>
use Data::Dumper;
use WWW::SwaggerClient::Configuration;
use WWW::SwaggerClient::ThreatModelSubResourcesApi;


my $api_instance = WWW::SwaggerClient::ThreatModelSubResourcesApi->new();
my $threatModelId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; # UUID | Unique identifier of the threat model (UUID)
my $diagramId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; # UUID | Unique identifier of the diagram (UUID)

eval { 
    my $result = $api_instance->getThreatModelDiagram(threatModelId => $threatModelId, diagramId => $diagramId);
    print Dumper($result);
};
if ($@) {
    warn "Exception when calling ThreatModelSubResourcesApi->getThreatModelDiagram: $@\n";
}
from __future__ import print_statement
import time
import swagger_client
from swagger_client.rest import ApiException
from pprint import pprint


# create an instance of the API class
api_instance = swagger_client.ThreatModelSubResourcesApi()
threatModelId = 38400000-8cf0-11bd-b23e-10b96e4ef00d # UUID | Unique identifier of the threat model (UUID)
diagramId = 38400000-8cf0-11bd-b23e-10b96e4ef00d # UUID | Unique identifier of the diagram (UUID)

try: 
    # Get a specific diagram
    api_response = api_instance.get_threat_model_diagram(threatModelId, diagramId)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling ThreatModelSubResourcesApi->getThreatModelDiagram: %s\n" % e)

Parameters

Path parameters
Name Description
threat_model_id*
UUID (uuid)
Unique identifier of the threat model (UUID)
Required
diagram_id*
UUID (uuid)
Unique identifier of the diagram (UUID)
Required

Responses

Status: 200 - Diagram details

Status: 401 - Error response

Status: 403 - Error response

Status: 404 - Error response

Status: 500 - Error response


getThreatModelDiagrams

List threat model diagrams

Returns all diagrams associated with a specific threat model


/threat_models/{threat_model_id}/diagrams

Usage and SDK Samples

curl -X GET\
 -H "Authorization: Bearer [[accessToken]]"\
-H "Accept: application/json"\
"http://localhost:8080/threat_models/{threat_model_id}/diagrams?limit=&offset="
import io.swagger.client.*;
import io.swagger.client.auth.*;
import io.swagger.client.model.*;
import io.swagger.client.api.ThreatModelSubResourcesApi;

import java.io.File;
import java.util.*;

public class ThreatModelSubResourcesApiExample {

    public static void main(String[] args) {
        ApiClient defaultClient = Configuration.getDefaultApiClient();


        ThreatModelSubResourcesApi apiInstance = new ThreatModelSubResourcesApi();
        UUID threatModelId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // UUID | Unique identifier of the threat model (UUID)
        Integer limit = 56; // Integer | Maximum number of items to return
        Integer offset = 56; // Integer | Number of items to skip
        try {
            array[DiagramListItem] result = apiInstance.getThreatModelDiagrams(threatModelId, limit, offset);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling ThreatModelSubResourcesApi#getThreatModelDiagrams");
            e.printStackTrace();
        }
    }
}
import io.swagger.client.api.ThreatModelSubResourcesApi;

public class ThreatModelSubResourcesApiExample {

    public static void main(String[] args) {
        ThreatModelSubResourcesApi apiInstance = new ThreatModelSubResourcesApi();
        UUID threatModelId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // UUID | Unique identifier of the threat model (UUID)
        Integer limit = 56; // Integer | Maximum number of items to return
        Integer offset = 56; // Integer | Number of items to skip
        try {
            array[DiagramListItem] result = apiInstance.getThreatModelDiagrams(threatModelId, limit, offset);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling ThreatModelSubResourcesApi#getThreatModelDiagrams");
            e.printStackTrace();
        }
    }
}
Configuration *apiConfig = [Configuration sharedConfig];
UUID *threatModelId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // Unique identifier of the threat model (UUID)
Integer *limit = 56; // Maximum number of items to return (optional) (default to 20)
Integer *offset = 56; // Number of items to skip (optional) (default to 0)

ThreatModelSubResourcesApi *apiInstance = [[ThreatModelSubResourcesApi alloc] init];

// List threat model diagrams
[apiInstance getThreatModelDiagramsWith:threatModelId
    limit:limit
    offset:offset
              completionHandler: ^(array[DiagramListItem] output, NSError* error) {
                            if (output) {
                                NSLog(@"%@", output);
                            }
                            if (error) {
                                NSLog(@"Error: %@", error);
                            }
                        }];
var TmiThreatModelingImprovedApi = require('tmi__threat_modeling_improved_api');
var defaultClient = TmiThreatModelingImprovedApi.ApiClient.instance;


var api = new TmiThreatModelingImprovedApi.ThreatModelSubResourcesApi()
var threatModelId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // {{UUID}} Unique identifier of the threat model (UUID)
var opts = { 
  'limit': 56, // {{Integer}} Maximum number of items to return
  'offset': 56 // {{Integer}} Number of items to skip
};
var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
};
api.getThreatModelDiagrams(threatModelId, opts, callback);
using System;
using System.Diagnostics;
using IO.Swagger.Api;
using IO.Swagger.Client;
using IO.Swagger.Model;

namespace Example
{
    public class getThreatModelDiagramsExample
    {
        public void main()
        {


            var apiInstance = new ThreatModelSubResourcesApi();
            var threatModelId = new UUID(); // UUID | Unique identifier of the threat model (UUID)
            var limit = 56;  // Integer | Maximum number of items to return (optional)  (default to 20)
            var offset = 56;  // Integer | Number of items to skip (optional)  (default to 0)

            try
            {
                // List threat model diagrams
                array[DiagramListItem] result = apiInstance.getThreatModelDiagrams(threatModelId, limit, offset);
                Debug.WriteLine(result);
            }
            catch (Exception e)
            {
                Debug.Print("Exception when calling ThreatModelSubResourcesApi.getThreatModelDiagrams: " + e.Message );
            }
        }
    }
}
<?php
require_once(__DIR__ . '/vendor/autoload.php');


$api_instance = new Swagger\Client\ApiThreatModelSubResourcesApi();
$threatModelId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // UUID | Unique identifier of the threat model (UUID)
$limit = 56; // Integer | Maximum number of items to return
$offset = 56; // Integer | Number of items to skip

try {
    $result = $api_instance->getThreatModelDiagrams($threatModelId, $limit, $offset);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling ThreatModelSubResourcesApi->getThreatModelDiagrams: ', $e->getMessage(), PHP_EOL;
}
?>
use Data::Dumper;
use WWW::SwaggerClient::Configuration;
use WWW::SwaggerClient::ThreatModelSubResourcesApi;


my $api_instance = WWW::SwaggerClient::ThreatModelSubResourcesApi->new();
my $threatModelId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; # UUID | Unique identifier of the threat model (UUID)
my $limit = 56; # Integer | Maximum number of items to return
my $offset = 56; # Integer | Number of items to skip

eval { 
    my $result = $api_instance->getThreatModelDiagrams(threatModelId => $threatModelId, limit => $limit, offset => $offset);
    print Dumper($result);
};
if ($@) {
    warn "Exception when calling ThreatModelSubResourcesApi->getThreatModelDiagrams: $@\n";
}
from __future__ import print_statement
import time
import swagger_client
from swagger_client.rest import ApiException
from pprint import pprint


# create an instance of the API class
api_instance = swagger_client.ThreatModelSubResourcesApi()
threatModelId = 38400000-8cf0-11bd-b23e-10b96e4ef00d # UUID | Unique identifier of the threat model (UUID)
limit = 56 # Integer | Maximum number of items to return (optional) (default to 20)
offset = 56 # Integer | Number of items to skip (optional) (default to 0)

try: 
    # List threat model diagrams
    api_response = api_instance.get_threat_model_diagrams(threatModelId, limit=limit, offset=offset)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling ThreatModelSubResourcesApi->getThreatModelDiagrams: %s\n" % e)

Parameters

Path parameters
Name Description
threat_model_id*
UUID (uuid)
Unique identifier of the threat model (UUID)
Required
Query parameters
Name Description
limit
Integer
Maximum number of items to return
offset
Integer
Number of items to skip

Responses

Status: 200 - List of diagrams

Status: 401 - Error response

Status: 403 - Error response

Status: 404 - Error response

Status: 500 - Error response


getThreatModelDocument

Get a specific document

Returns details of a specific document within the threat model


/threat_models/{threat_model_id}/documents/{document_id}

Usage and SDK Samples

curl -X GET\
 -H "Authorization: Bearer [[accessToken]]"\
-H "Accept: application/json"\
"http://localhost:8080/threat_models/{threat_model_id}/documents/{document_id}"
import io.swagger.client.*;
import io.swagger.client.auth.*;
import io.swagger.client.model.*;
import io.swagger.client.api.ThreatModelSubResourcesApi;

import java.io.File;
import java.util.*;

public class ThreatModelSubResourcesApiExample {

    public static void main(String[] args) {
        ApiClient defaultClient = Configuration.getDefaultApiClient();


        ThreatModelSubResourcesApi apiInstance = new ThreatModelSubResourcesApi();
        UUID threatModelId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // UUID | Unique identifier of the threat model (UUID)
        UUID documentId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // UUID | Unique identifier of the document (UUID)
        try {
            Document result = apiInstance.getThreatModelDocument(threatModelId, documentId);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling ThreatModelSubResourcesApi#getThreatModelDocument");
            e.printStackTrace();
        }
    }
}
import io.swagger.client.api.ThreatModelSubResourcesApi;

public class ThreatModelSubResourcesApiExample {

    public static void main(String[] args) {
        ThreatModelSubResourcesApi apiInstance = new ThreatModelSubResourcesApi();
        UUID threatModelId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // UUID | Unique identifier of the threat model (UUID)
        UUID documentId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // UUID | Unique identifier of the document (UUID)
        try {
            Document result = apiInstance.getThreatModelDocument(threatModelId, documentId);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling ThreatModelSubResourcesApi#getThreatModelDocument");
            e.printStackTrace();
        }
    }
}
Configuration *apiConfig = [Configuration sharedConfig];
UUID *threatModelId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // Unique identifier of the threat model (UUID)
UUID *documentId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // Unique identifier of the document (UUID)

ThreatModelSubResourcesApi *apiInstance = [[ThreatModelSubResourcesApi alloc] init];

// Get a specific document
[apiInstance getThreatModelDocumentWith:threatModelId
    documentId:documentId
              completionHandler: ^(Document output, NSError* error) {
                            if (output) {
                                NSLog(@"%@", output);
                            }
                            if (error) {
                                NSLog(@"Error: %@", error);
                            }
                        }];
var TmiThreatModelingImprovedApi = require('tmi__threat_modeling_improved_api');
var defaultClient = TmiThreatModelingImprovedApi.ApiClient.instance;


var api = new TmiThreatModelingImprovedApi.ThreatModelSubResourcesApi()
var threatModelId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // {{UUID}} Unique identifier of the threat model (UUID)
var documentId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // {{UUID}} Unique identifier of the document (UUID)

var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
};
api.getThreatModelDocument(threatModelId, documentId, callback);
using System;
using System.Diagnostics;
using IO.Swagger.Api;
using IO.Swagger.Client;
using IO.Swagger.Model;

namespace Example
{
    public class getThreatModelDocumentExample
    {
        public void main()
        {


            var apiInstance = new ThreatModelSubResourcesApi();
            var threatModelId = new UUID(); // UUID | Unique identifier of the threat model (UUID)
            var documentId = new UUID(); // UUID | Unique identifier of the document (UUID)

            try
            {
                // Get a specific document
                Document result = apiInstance.getThreatModelDocument(threatModelId, documentId);
                Debug.WriteLine(result);
            }
            catch (Exception e)
            {
                Debug.Print("Exception when calling ThreatModelSubResourcesApi.getThreatModelDocument: " + e.Message );
            }
        }
    }
}
<?php
require_once(__DIR__ . '/vendor/autoload.php');


$api_instance = new Swagger\Client\ApiThreatModelSubResourcesApi();
$threatModelId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // UUID | Unique identifier of the threat model (UUID)
$documentId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // UUID | Unique identifier of the document (UUID)

try {
    $result = $api_instance->getThreatModelDocument($threatModelId, $documentId);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling ThreatModelSubResourcesApi->getThreatModelDocument: ', $e->getMessage(), PHP_EOL;
}
?>
use Data::Dumper;
use WWW::SwaggerClient::Configuration;
use WWW::SwaggerClient::ThreatModelSubResourcesApi;


my $api_instance = WWW::SwaggerClient::ThreatModelSubResourcesApi->new();
my $threatModelId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; # UUID | Unique identifier of the threat model (UUID)
my $documentId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; # UUID | Unique identifier of the document (UUID)

eval { 
    my $result = $api_instance->getThreatModelDocument(threatModelId => $threatModelId, documentId => $documentId);
    print Dumper($result);
};
if ($@) {
    warn "Exception when calling ThreatModelSubResourcesApi->getThreatModelDocument: $@\n";
}
from __future__ import print_statement
import time
import swagger_client
from swagger_client.rest import ApiException
from pprint import pprint


# create an instance of the API class
api_instance = swagger_client.ThreatModelSubResourcesApi()
threatModelId = 38400000-8cf0-11bd-b23e-10b96e4ef00d # UUID | Unique identifier of the threat model (UUID)
documentId = 38400000-8cf0-11bd-b23e-10b96e4ef00d # UUID | Unique identifier of the document (UUID)

try: 
    # Get a specific document
    api_response = api_instance.get_threat_model_document(threatModelId, documentId)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling ThreatModelSubResourcesApi->getThreatModelDocument: %s\n" % e)

Parameters

Path parameters
Name Description
threat_model_id*
UUID (uuid)
Unique identifier of the threat model (UUID)
Required
document_id*
UUID (uuid)
Unique identifier of the document (UUID)
Required

Responses

Status: 200 - Document details

Status: 401 - Error response

Status: 403 - Error response

Status: 404 - Error response

Status: 500 - Error response


getThreatModelDocuments

List documents in a threat model

Returns a paginated list of documents within the specified threat model


/threat_models/{threat_model_id}/documents

Usage and SDK Samples

curl -X GET\
 -H "Authorization: Bearer [[accessToken]]"\
-H "Accept: application/json"\
"http://localhost:8080/threat_models/{threat_model_id}/documents?limit=&offset="
import io.swagger.client.*;
import io.swagger.client.auth.*;
import io.swagger.client.model.*;
import io.swagger.client.api.ThreatModelSubResourcesApi;

import java.io.File;
import java.util.*;

public class ThreatModelSubResourcesApiExample {

    public static void main(String[] args) {
        ApiClient defaultClient = Configuration.getDefaultApiClient();


        ThreatModelSubResourcesApi apiInstance = new ThreatModelSubResourcesApi();
        UUID threatModelId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // UUID | Unique identifier of the threat model (UUID)
        Integer limit = 56; // Integer | Maximum number of documents to return
        Integer offset = 56; // Integer | Number of documents to skip
        try {
            array[Document] result = apiInstance.getThreatModelDocuments(threatModelId, limit, offset);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling ThreatModelSubResourcesApi#getThreatModelDocuments");
            e.printStackTrace();
        }
    }
}
import io.swagger.client.api.ThreatModelSubResourcesApi;

public class ThreatModelSubResourcesApiExample {

    public static void main(String[] args) {
        ThreatModelSubResourcesApi apiInstance = new ThreatModelSubResourcesApi();
        UUID threatModelId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // UUID | Unique identifier of the threat model (UUID)
        Integer limit = 56; // Integer | Maximum number of documents to return
        Integer offset = 56; // Integer | Number of documents to skip
        try {
            array[Document] result = apiInstance.getThreatModelDocuments(threatModelId, limit, offset);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling ThreatModelSubResourcesApi#getThreatModelDocuments");
            e.printStackTrace();
        }
    }
}
Configuration *apiConfig = [Configuration sharedConfig];
UUID *threatModelId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // Unique identifier of the threat model (UUID)
Integer *limit = 56; // Maximum number of documents to return (optional) (default to 20)
Integer *offset = 56; // Number of documents to skip (optional) (default to 0)

ThreatModelSubResourcesApi *apiInstance = [[ThreatModelSubResourcesApi alloc] init];

// List documents in a threat model
[apiInstance getThreatModelDocumentsWith:threatModelId
    limit:limit
    offset:offset
              completionHandler: ^(array[Document] output, NSError* error) {
                            if (output) {
                                NSLog(@"%@", output);
                            }
                            if (error) {
                                NSLog(@"Error: %@", error);
                            }
                        }];
var TmiThreatModelingImprovedApi = require('tmi__threat_modeling_improved_api');
var defaultClient = TmiThreatModelingImprovedApi.ApiClient.instance;


var api = new TmiThreatModelingImprovedApi.ThreatModelSubResourcesApi()
var threatModelId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // {{UUID}} Unique identifier of the threat model (UUID)
var opts = { 
  'limit': 56, // {{Integer}} Maximum number of documents to return
  'offset': 56 // {{Integer}} Number of documents to skip
};
var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
};
api.getThreatModelDocuments(threatModelId, opts, callback);
using System;
using System.Diagnostics;
using IO.Swagger.Api;
using IO.Swagger.Client;
using IO.Swagger.Model;

namespace Example
{
    public class getThreatModelDocumentsExample
    {
        public void main()
        {


            var apiInstance = new ThreatModelSubResourcesApi();
            var threatModelId = new UUID(); // UUID | Unique identifier of the threat model (UUID)
            var limit = 56;  // Integer | Maximum number of documents to return (optional)  (default to 20)
            var offset = 56;  // Integer | Number of documents to skip (optional)  (default to 0)

            try
            {
                // List documents in a threat model
                array[Document] result = apiInstance.getThreatModelDocuments(threatModelId, limit, offset);
                Debug.WriteLine(result);
            }
            catch (Exception e)
            {
                Debug.Print("Exception when calling ThreatModelSubResourcesApi.getThreatModelDocuments: " + e.Message );
            }
        }
    }
}
<?php
require_once(__DIR__ . '/vendor/autoload.php');


$api_instance = new Swagger\Client\ApiThreatModelSubResourcesApi();
$threatModelId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // UUID | Unique identifier of the threat model (UUID)
$limit = 56; // Integer | Maximum number of documents to return
$offset = 56; // Integer | Number of documents to skip

try {
    $result = $api_instance->getThreatModelDocuments($threatModelId, $limit, $offset);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling ThreatModelSubResourcesApi->getThreatModelDocuments: ', $e->getMessage(), PHP_EOL;
}
?>
use Data::Dumper;
use WWW::SwaggerClient::Configuration;
use WWW::SwaggerClient::ThreatModelSubResourcesApi;


my $api_instance = WWW::SwaggerClient::ThreatModelSubResourcesApi->new();
my $threatModelId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; # UUID | Unique identifier of the threat model (UUID)
my $limit = 56; # Integer | Maximum number of documents to return
my $offset = 56; # Integer | Number of documents to skip

eval { 
    my $result = $api_instance->getThreatModelDocuments(threatModelId => $threatModelId, limit => $limit, offset => $offset);
    print Dumper($result);
};
if ($@) {
    warn "Exception when calling ThreatModelSubResourcesApi->getThreatModelDocuments: $@\n";
}
from __future__ import print_statement
import time
import swagger_client
from swagger_client.rest import ApiException
from pprint import pprint


# create an instance of the API class
api_instance = swagger_client.ThreatModelSubResourcesApi()
threatModelId = 38400000-8cf0-11bd-b23e-10b96e4ef00d # UUID | Unique identifier of the threat model (UUID)
limit = 56 # Integer | Maximum number of documents to return (optional) (default to 20)
offset = 56 # Integer | Number of documents to skip (optional) (default to 0)

try: 
    # List documents in a threat model
    api_response = api_instance.get_threat_model_documents(threatModelId, limit=limit, offset=offset)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling ThreatModelSubResourcesApi->getThreatModelDocuments: %s\n" % e)

Parameters

Path parameters
Name Description
threat_model_id*
UUID (uuid)
Unique identifier of the threat model (UUID)
Required
Query parameters
Name Description
limit
Integer
Maximum number of documents to return
offset
Integer
Number of documents to skip

Responses

Status: 200 - List of documents

Status: 401 - Error response

Status: 403 - Error response

Status: 404 - Error response

Status: 500 - Error response


getThreatModelMetadata

Get threat model metadata

Returns all metadata key-value pairs for the specified threat model


/threat_models/{threat_model_id}/metadata

Usage and SDK Samples

curl -X GET\
 -H "Authorization: Bearer [[accessToken]]"\
-H "Accept: application/json"\
"http://localhost:8080/threat_models/{threat_model_id}/metadata"
import io.swagger.client.*;
import io.swagger.client.auth.*;
import io.swagger.client.model.*;
import io.swagger.client.api.ThreatModelSubResourcesApi;

import java.io.File;
import java.util.*;

public class ThreatModelSubResourcesApiExample {

    public static void main(String[] args) {
        ApiClient defaultClient = Configuration.getDefaultApiClient();


        ThreatModelSubResourcesApi apiInstance = new ThreatModelSubResourcesApi();
        UUID threatModelId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // UUID | Unique identifier of the threat model (UUID)
        try {
            array[Metadata] result = apiInstance.getThreatModelMetadata(threatModelId);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling ThreatModelSubResourcesApi#getThreatModelMetadata");
            e.printStackTrace();
        }
    }
}
import io.swagger.client.api.ThreatModelSubResourcesApi;

public class ThreatModelSubResourcesApiExample {

    public static void main(String[] args) {
        ThreatModelSubResourcesApi apiInstance = new ThreatModelSubResourcesApi();
        UUID threatModelId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // UUID | Unique identifier of the threat model (UUID)
        try {
            array[Metadata] result = apiInstance.getThreatModelMetadata(threatModelId);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling ThreatModelSubResourcesApi#getThreatModelMetadata");
            e.printStackTrace();
        }
    }
}
Configuration *apiConfig = [Configuration sharedConfig];
UUID *threatModelId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // Unique identifier of the threat model (UUID)

ThreatModelSubResourcesApi *apiInstance = [[ThreatModelSubResourcesApi alloc] init];

// Get threat model metadata
[apiInstance getThreatModelMetadataWith:threatModelId
              completionHandler: ^(array[Metadata] output, NSError* error) {
                            if (output) {
                                NSLog(@"%@", output);
                            }
                            if (error) {
                                NSLog(@"Error: %@", error);
                            }
                        }];
var TmiThreatModelingImprovedApi = require('tmi__threat_modeling_improved_api');
var defaultClient = TmiThreatModelingImprovedApi.ApiClient.instance;


var api = new TmiThreatModelingImprovedApi.ThreatModelSubResourcesApi()
var threatModelId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // {{UUID}} Unique identifier of the threat model (UUID)

var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
};
api.getThreatModelMetadata(threatModelId, callback);
using System;
using System.Diagnostics;
using IO.Swagger.Api;
using IO.Swagger.Client;
using IO.Swagger.Model;

namespace Example
{
    public class getThreatModelMetadataExample
    {
        public void main()
        {


            var apiInstance = new ThreatModelSubResourcesApi();
            var threatModelId = new UUID(); // UUID | Unique identifier of the threat model (UUID)

            try
            {
                // Get threat model metadata
                array[Metadata] result = apiInstance.getThreatModelMetadata(threatModelId);
                Debug.WriteLine(result);
            }
            catch (Exception e)
            {
                Debug.Print("Exception when calling ThreatModelSubResourcesApi.getThreatModelMetadata: " + e.Message );
            }
        }
    }
}
<?php
require_once(__DIR__ . '/vendor/autoload.php');


$api_instance = new Swagger\Client\ApiThreatModelSubResourcesApi();
$threatModelId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // UUID | Unique identifier of the threat model (UUID)

try {
    $result = $api_instance->getThreatModelMetadata($threatModelId);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling ThreatModelSubResourcesApi->getThreatModelMetadata: ', $e->getMessage(), PHP_EOL;
}
?>
use Data::Dumper;
use WWW::SwaggerClient::Configuration;
use WWW::SwaggerClient::ThreatModelSubResourcesApi;


my $api_instance = WWW::SwaggerClient::ThreatModelSubResourcesApi->new();
my $threatModelId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; # UUID | Unique identifier of the threat model (UUID)

eval { 
    my $result = $api_instance->getThreatModelMetadata(threatModelId => $threatModelId);
    print Dumper($result);
};
if ($@) {
    warn "Exception when calling ThreatModelSubResourcesApi->getThreatModelMetadata: $@\n";
}
from __future__ import print_statement
import time
import swagger_client
from swagger_client.rest import ApiException
from pprint import pprint


# create an instance of the API class
api_instance = swagger_client.ThreatModelSubResourcesApi()
threatModelId = 38400000-8cf0-11bd-b23e-10b96e4ef00d # UUID | Unique identifier of the threat model (UUID)

try: 
    # Get threat model metadata
    api_response = api_instance.get_threat_model_metadata(threatModelId)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling ThreatModelSubResourcesApi->getThreatModelMetadata: %s\n" % e)

Parameters

Path parameters
Name Description
threat_model_id*
UUID (uuid)
Unique identifier of the threat model (UUID)
Required

Responses

Status: 200 - Threat model metadata list

Status: 401 - Error response

Status: 403 - Error response

Status: 404 - Error response

Status: 500 - Error response


getThreatModelMetadataByKey

Get threat model metadata by key

Returns a specific metadata entry by key for the specified threat model


/threat_models/{threat_model_id}/metadata/{key}

Usage and SDK Samples

curl -X GET\
 -H "Authorization: Bearer [[accessToken]]"\
-H "Accept: application/json"\
"http://localhost:8080/threat_models/{threat_model_id}/metadata/{key}"
import io.swagger.client.*;
import io.swagger.client.auth.*;
import io.swagger.client.model.*;
import io.swagger.client.api.ThreatModelSubResourcesApi;

import java.io.File;
import java.util.*;

public class ThreatModelSubResourcesApiExample {

    public static void main(String[] args) {
        ApiClient defaultClient = Configuration.getDefaultApiClient();


        ThreatModelSubResourcesApi apiInstance = new ThreatModelSubResourcesApi();
        UUID threatModelId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // UUID | Unique identifier of the threat model (UUID)
        String key = key_example; // String | Metadata key to retrieve
        try {
            Metadata result = apiInstance.getThreatModelMetadataByKey(threatModelId, key);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling ThreatModelSubResourcesApi#getThreatModelMetadataByKey");
            e.printStackTrace();
        }
    }
}
import io.swagger.client.api.ThreatModelSubResourcesApi;

public class ThreatModelSubResourcesApiExample {

    public static void main(String[] args) {
        ThreatModelSubResourcesApi apiInstance = new ThreatModelSubResourcesApi();
        UUID threatModelId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // UUID | Unique identifier of the threat model (UUID)
        String key = key_example; // String | Metadata key to retrieve
        try {
            Metadata result = apiInstance.getThreatModelMetadataByKey(threatModelId, key);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling ThreatModelSubResourcesApi#getThreatModelMetadataByKey");
            e.printStackTrace();
        }
    }
}
Configuration *apiConfig = [Configuration sharedConfig];
UUID *threatModelId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // Unique identifier of the threat model (UUID)
String *key = key_example; // Metadata key to retrieve

ThreatModelSubResourcesApi *apiInstance = [[ThreatModelSubResourcesApi alloc] init];

// Get threat model metadata by key
[apiInstance getThreatModelMetadataByKeyWith:threatModelId
    key:key
              completionHandler: ^(Metadata output, NSError* error) {
                            if (output) {
                                NSLog(@"%@", output);
                            }
                            if (error) {
                                NSLog(@"Error: %@", error);
                            }
                        }];
var TmiThreatModelingImprovedApi = require('tmi__threat_modeling_improved_api');
var defaultClient = TmiThreatModelingImprovedApi.ApiClient.instance;


var api = new TmiThreatModelingImprovedApi.ThreatModelSubResourcesApi()
var threatModelId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // {{UUID}} Unique identifier of the threat model (UUID)
var key = key_example; // {{String}} Metadata key to retrieve

var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
};
api.getThreatModelMetadataByKey(threatModelId, key, callback);
using System;
using System.Diagnostics;
using IO.Swagger.Api;
using IO.Swagger.Client;
using IO.Swagger.Model;

namespace Example
{
    public class getThreatModelMetadataByKeyExample
    {
        public void main()
        {


            var apiInstance = new ThreatModelSubResourcesApi();
            var threatModelId = new UUID(); // UUID | Unique identifier of the threat model (UUID)
            var key = key_example;  // String | Metadata key to retrieve

            try
            {
                // Get threat model metadata by key
                Metadata result = apiInstance.getThreatModelMetadataByKey(threatModelId, key);
                Debug.WriteLine(result);
            }
            catch (Exception e)
            {
                Debug.Print("Exception when calling ThreatModelSubResourcesApi.getThreatModelMetadataByKey: " + e.Message );
            }
        }
    }
}
<?php
require_once(__DIR__ . '/vendor/autoload.php');


$api_instance = new Swagger\Client\ApiThreatModelSubResourcesApi();
$threatModelId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // UUID | Unique identifier of the threat model (UUID)
$key = key_example; // String | Metadata key to retrieve

try {
    $result = $api_instance->getThreatModelMetadataByKey($threatModelId, $key);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling ThreatModelSubResourcesApi->getThreatModelMetadataByKey: ', $e->getMessage(), PHP_EOL;
}
?>
use Data::Dumper;
use WWW::SwaggerClient::Configuration;
use WWW::SwaggerClient::ThreatModelSubResourcesApi;


my $api_instance = WWW::SwaggerClient::ThreatModelSubResourcesApi->new();
my $threatModelId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; # UUID | Unique identifier of the threat model (UUID)
my $key = key_example; # String | Metadata key to retrieve

eval { 
    my $result = $api_instance->getThreatModelMetadataByKey(threatModelId => $threatModelId, key => $key);
    print Dumper($result);
};
if ($@) {
    warn "Exception when calling ThreatModelSubResourcesApi->getThreatModelMetadataByKey: $@\n";
}
from __future__ import print_statement
import time
import swagger_client
from swagger_client.rest import ApiException
from pprint import pprint


# create an instance of the API class
api_instance = swagger_client.ThreatModelSubResourcesApi()
threatModelId = 38400000-8cf0-11bd-b23e-10b96e4ef00d # UUID | Unique identifier of the threat model (UUID)
key = key_example # String | Metadata key to retrieve

try: 
    # Get threat model metadata by key
    api_response = api_instance.get_threat_model_metadata_by_key(threatModelId, key)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling ThreatModelSubResourcesApi->getThreatModelMetadataByKey: %s\n" % e)

Parameters

Path parameters
Name Description
threat_model_id*
UUID (uuid)
Unique identifier of the threat model (UUID)
Required
key*
String
Metadata key to retrieve
Required

Responses

Status: 200 - Metadata entry

Status: 401 - Error response

Status: 403 - Error response

Status: 404 - Error response

Status: 500 - Error response


getThreatModelNote

Get a specific note

Returns details of a specific note within the threat model


/threat_models/{threat_model_id}/notes/{note_id}

Usage and SDK Samples

curl -X GET\
 -H "Authorization: Bearer [[accessToken]]"\
-H "Accept: application/json"\
"http://localhost:8080/threat_models/{threat_model_id}/notes/{note_id}"
import io.swagger.client.*;
import io.swagger.client.auth.*;
import io.swagger.client.model.*;
import io.swagger.client.api.ThreatModelSubResourcesApi;

import java.io.File;
import java.util.*;

public class ThreatModelSubResourcesApiExample {

    public static void main(String[] args) {
        ApiClient defaultClient = Configuration.getDefaultApiClient();


        ThreatModelSubResourcesApi apiInstance = new ThreatModelSubResourcesApi();
        UUID threatModelId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // UUID | Unique identifier of the threat model (UUID)
        UUID noteId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // UUID | Unique identifier of the note (UUID)
        try {
            Note result = apiInstance.getThreatModelNote(threatModelId, noteId);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling ThreatModelSubResourcesApi#getThreatModelNote");
            e.printStackTrace();
        }
    }
}
import io.swagger.client.api.ThreatModelSubResourcesApi;

public class ThreatModelSubResourcesApiExample {

    public static void main(String[] args) {
        ThreatModelSubResourcesApi apiInstance = new ThreatModelSubResourcesApi();
        UUID threatModelId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // UUID | Unique identifier of the threat model (UUID)
        UUID noteId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // UUID | Unique identifier of the note (UUID)
        try {
            Note result = apiInstance.getThreatModelNote(threatModelId, noteId);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling ThreatModelSubResourcesApi#getThreatModelNote");
            e.printStackTrace();
        }
    }
}
Configuration *apiConfig = [Configuration sharedConfig];
UUID *threatModelId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // Unique identifier of the threat model (UUID)
UUID *noteId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // Unique identifier of the note (UUID)

ThreatModelSubResourcesApi *apiInstance = [[ThreatModelSubResourcesApi alloc] init];

// Get a specific note
[apiInstance getThreatModelNoteWith:threatModelId
    noteId:noteId
              completionHandler: ^(Note output, NSError* error) {
                            if (output) {
                                NSLog(@"%@", output);
                            }
                            if (error) {
                                NSLog(@"Error: %@", error);
                            }
                        }];
var TmiThreatModelingImprovedApi = require('tmi__threat_modeling_improved_api');
var defaultClient = TmiThreatModelingImprovedApi.ApiClient.instance;


var api = new TmiThreatModelingImprovedApi.ThreatModelSubResourcesApi()
var threatModelId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // {{UUID}} Unique identifier of the threat model (UUID)
var noteId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // {{UUID}} Unique identifier of the note (UUID)

var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
};
api.getThreatModelNote(threatModelId, noteId, callback);
using System;
using System.Diagnostics;
using IO.Swagger.Api;
using IO.Swagger.Client;
using IO.Swagger.Model;

namespace Example
{
    public class getThreatModelNoteExample
    {
        public void main()
        {


            var apiInstance = new ThreatModelSubResourcesApi();
            var threatModelId = new UUID(); // UUID | Unique identifier of the threat model (UUID)
            var noteId = new UUID(); // UUID | Unique identifier of the note (UUID)

            try
            {
                // Get a specific note
                Note result = apiInstance.getThreatModelNote(threatModelId, noteId);
                Debug.WriteLine(result);
            }
            catch (Exception e)
            {
                Debug.Print("Exception when calling ThreatModelSubResourcesApi.getThreatModelNote: " + e.Message );
            }
        }
    }
}
<?php
require_once(__DIR__ . '/vendor/autoload.php');


$api_instance = new Swagger\Client\ApiThreatModelSubResourcesApi();
$threatModelId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // UUID | Unique identifier of the threat model (UUID)
$noteId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // UUID | Unique identifier of the note (UUID)

try {
    $result = $api_instance->getThreatModelNote($threatModelId, $noteId);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling ThreatModelSubResourcesApi->getThreatModelNote: ', $e->getMessage(), PHP_EOL;
}
?>
use Data::Dumper;
use WWW::SwaggerClient::Configuration;
use WWW::SwaggerClient::ThreatModelSubResourcesApi;


my $api_instance = WWW::SwaggerClient::ThreatModelSubResourcesApi->new();
my $threatModelId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; # UUID | Unique identifier of the threat model (UUID)
my $noteId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; # UUID | Unique identifier of the note (UUID)

eval { 
    my $result = $api_instance->getThreatModelNote(threatModelId => $threatModelId, noteId => $noteId);
    print Dumper($result);
};
if ($@) {
    warn "Exception when calling ThreatModelSubResourcesApi->getThreatModelNote: $@\n";
}
from __future__ import print_statement
import time
import swagger_client
from swagger_client.rest import ApiException
from pprint import pprint


# create an instance of the API class
api_instance = swagger_client.ThreatModelSubResourcesApi()
threatModelId = 38400000-8cf0-11bd-b23e-10b96e4ef00d # UUID | Unique identifier of the threat model (UUID)
noteId = 38400000-8cf0-11bd-b23e-10b96e4ef00d # UUID | Unique identifier of the note (UUID)

try: 
    # Get a specific note
    api_response = api_instance.get_threat_model_note(threatModelId, noteId)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling ThreatModelSubResourcesApi->getThreatModelNote: %s\n" % e)

Parameters

Path parameters
Name Description
threat_model_id*
UUID (uuid)
Unique identifier of the threat model (UUID)
Required
note_id*
UUID (uuid)
Unique identifier of the note (UUID)
Required

Responses

Status: 200 - Note details

Status: 401 - Error response

Status: 403 - Error response

Status: 404 - Error response

Status: 500 - Error response


getThreatModelNotes

List notes in a threat model

Returns a paginated list of notes within the specified threat model


/threat_models/{threat_model_id}/notes

Usage and SDK Samples

curl -X GET\
 -H "Authorization: Bearer [[accessToken]]"\
-H "Accept: application/json"\
"http://localhost:8080/threat_models/{threat_model_id}/notes?limit=&offset="
import io.swagger.client.*;
import io.swagger.client.auth.*;
import io.swagger.client.model.*;
import io.swagger.client.api.ThreatModelSubResourcesApi;

import java.io.File;
import java.util.*;

public class ThreatModelSubResourcesApiExample {

    public static void main(String[] args) {
        ApiClient defaultClient = Configuration.getDefaultApiClient();


        ThreatModelSubResourcesApi apiInstance = new ThreatModelSubResourcesApi();
        UUID threatModelId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // UUID | Unique identifier of the threat model (UUID)
        Integer limit = 56; // Integer | Maximum number of notes to return
        Integer offset = 56; // Integer | Number of notes to skip
        try {
            array[NoteListItem] result = apiInstance.getThreatModelNotes(threatModelId, limit, offset);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling ThreatModelSubResourcesApi#getThreatModelNotes");
            e.printStackTrace();
        }
    }
}
import io.swagger.client.api.ThreatModelSubResourcesApi;

public class ThreatModelSubResourcesApiExample {

    public static void main(String[] args) {
        ThreatModelSubResourcesApi apiInstance = new ThreatModelSubResourcesApi();
        UUID threatModelId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // UUID | Unique identifier of the threat model (UUID)
        Integer limit = 56; // Integer | Maximum number of notes to return
        Integer offset = 56; // Integer | Number of notes to skip
        try {
            array[NoteListItem] result = apiInstance.getThreatModelNotes(threatModelId, limit, offset);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling ThreatModelSubResourcesApi#getThreatModelNotes");
            e.printStackTrace();
        }
    }
}
Configuration *apiConfig = [Configuration sharedConfig];
UUID *threatModelId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // Unique identifier of the threat model (UUID)
Integer *limit = 56; // Maximum number of notes to return (optional) (default to 20)
Integer *offset = 56; // Number of notes to skip (optional) (default to 0)

ThreatModelSubResourcesApi *apiInstance = [[ThreatModelSubResourcesApi alloc] init];

// List notes in a threat model
[apiInstance getThreatModelNotesWith:threatModelId
    limit:limit
    offset:offset
              completionHandler: ^(array[NoteListItem] output, NSError* error) {
                            if (output) {
                                NSLog(@"%@", output);
                            }
                            if (error) {
                                NSLog(@"Error: %@", error);
                            }
                        }];
var TmiThreatModelingImprovedApi = require('tmi__threat_modeling_improved_api');
var defaultClient = TmiThreatModelingImprovedApi.ApiClient.instance;


var api = new TmiThreatModelingImprovedApi.ThreatModelSubResourcesApi()
var threatModelId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // {{UUID}} Unique identifier of the threat model (UUID)
var opts = { 
  'limit': 56, // {{Integer}} Maximum number of notes to return
  'offset': 56 // {{Integer}} Number of notes to skip
};
var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
};
api.getThreatModelNotes(threatModelId, opts, callback);
using System;
using System.Diagnostics;
using IO.Swagger.Api;
using IO.Swagger.Client;
using IO.Swagger.Model;

namespace Example
{
    public class getThreatModelNotesExample
    {
        public void main()
        {


            var apiInstance = new ThreatModelSubResourcesApi();
            var threatModelId = new UUID(); // UUID | Unique identifier of the threat model (UUID)
            var limit = 56;  // Integer | Maximum number of notes to return (optional)  (default to 20)
            var offset = 56;  // Integer | Number of notes to skip (optional)  (default to 0)

            try
            {
                // List notes in a threat model
                array[NoteListItem] result = apiInstance.getThreatModelNotes(threatModelId, limit, offset);
                Debug.WriteLine(result);
            }
            catch (Exception e)
            {
                Debug.Print("Exception when calling ThreatModelSubResourcesApi.getThreatModelNotes: " + e.Message );
            }
        }
    }
}
<?php
require_once(__DIR__ . '/vendor/autoload.php');


$api_instance = new Swagger\Client\ApiThreatModelSubResourcesApi();
$threatModelId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // UUID | Unique identifier of the threat model (UUID)
$limit = 56; // Integer | Maximum number of notes to return
$offset = 56; // Integer | Number of notes to skip

try {
    $result = $api_instance->getThreatModelNotes($threatModelId, $limit, $offset);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling ThreatModelSubResourcesApi->getThreatModelNotes: ', $e->getMessage(), PHP_EOL;
}
?>
use Data::Dumper;
use WWW::SwaggerClient::Configuration;
use WWW::SwaggerClient::ThreatModelSubResourcesApi;


my $api_instance = WWW::SwaggerClient::ThreatModelSubResourcesApi->new();
my $threatModelId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; # UUID | Unique identifier of the threat model (UUID)
my $limit = 56; # Integer | Maximum number of notes to return
my $offset = 56; # Integer | Number of notes to skip

eval { 
    my $result = $api_instance->getThreatModelNotes(threatModelId => $threatModelId, limit => $limit, offset => $offset);
    print Dumper($result);
};
if ($@) {
    warn "Exception when calling ThreatModelSubResourcesApi->getThreatModelNotes: $@\n";
}
from __future__ import print_statement
import time
import swagger_client
from swagger_client.rest import ApiException
from pprint import pprint


# create an instance of the API class
api_instance = swagger_client.ThreatModelSubResourcesApi()
threatModelId = 38400000-8cf0-11bd-b23e-10b96e4ef00d # UUID | Unique identifier of the threat model (UUID)
limit = 56 # Integer | Maximum number of notes to return (optional) (default to 20)
offset = 56 # Integer | Number of notes to skip (optional) (default to 0)

try: 
    # List notes in a threat model
    api_response = api_instance.get_threat_model_notes(threatModelId, limit=limit, offset=offset)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling ThreatModelSubResourcesApi->getThreatModelNotes: %s\n" % e)

Parameters

Path parameters
Name Description
threat_model_id*
UUID (uuid)
Unique identifier of the threat model (UUID)
Required
Query parameters
Name Description
limit
Integer
Maximum number of notes to return
offset
Integer
Number of notes to skip

Responses

Status: 200 - List of notes

Status: 401 - Error response

Status: 403 - Error response

Status: 404 - Error response

Status: 500 - Error response


getThreatModelRepositories

List sources in a threat model

Returns a paginated list of source code references within the specified threat model


/threat_models/{threat_model_id}/repositories

Usage and SDK Samples

curl -X GET\
 -H "Authorization: Bearer [[accessToken]]"\
-H "Accept: application/json"\
"http://localhost:8080/threat_models/{threat_model_id}/repositories?limit=&offset="
import io.swagger.client.*;
import io.swagger.client.auth.*;
import io.swagger.client.model.*;
import io.swagger.client.api.ThreatModelSubResourcesApi;

import java.io.File;
import java.util.*;

public class ThreatModelSubResourcesApiExample {

    public static void main(String[] args) {
        ApiClient defaultClient = Configuration.getDefaultApiClient();


        ThreatModelSubResourcesApi apiInstance = new ThreatModelSubResourcesApi();
        UUID threatModelId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // UUID | Unique identifier of the threat model (UUID)
        Integer limit = 56; // Integer | Maximum number of sources to return
        Integer offset = 56; // Integer | Number of sources to skip
        try {
            array[Repository] result = apiInstance.getThreatModelRepositories(threatModelId, limit, offset);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling ThreatModelSubResourcesApi#getThreatModelRepositories");
            e.printStackTrace();
        }
    }
}
import io.swagger.client.api.ThreatModelSubResourcesApi;

public class ThreatModelSubResourcesApiExample {

    public static void main(String[] args) {
        ThreatModelSubResourcesApi apiInstance = new ThreatModelSubResourcesApi();
        UUID threatModelId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // UUID | Unique identifier of the threat model (UUID)
        Integer limit = 56; // Integer | Maximum number of sources to return
        Integer offset = 56; // Integer | Number of sources to skip
        try {
            array[Repository] result = apiInstance.getThreatModelRepositories(threatModelId, limit, offset);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling ThreatModelSubResourcesApi#getThreatModelRepositories");
            e.printStackTrace();
        }
    }
}
Configuration *apiConfig = [Configuration sharedConfig];
UUID *threatModelId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // Unique identifier of the threat model (UUID)
Integer *limit = 56; // Maximum number of sources to return (optional) (default to 20)
Integer *offset = 56; // Number of sources to skip (optional) (default to 0)

ThreatModelSubResourcesApi *apiInstance = [[ThreatModelSubResourcesApi alloc] init];

// List sources in a threat model
[apiInstance getThreatModelRepositoriesWith:threatModelId
    limit:limit
    offset:offset
              completionHandler: ^(array[Repository] output, NSError* error) {
                            if (output) {
                                NSLog(@"%@", output);
                            }
                            if (error) {
                                NSLog(@"Error: %@", error);
                            }
                        }];
var TmiThreatModelingImprovedApi = require('tmi__threat_modeling_improved_api');
var defaultClient = TmiThreatModelingImprovedApi.ApiClient.instance;


var api = new TmiThreatModelingImprovedApi.ThreatModelSubResourcesApi()
var threatModelId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // {{UUID}} Unique identifier of the threat model (UUID)
var opts = { 
  'limit': 56, // {{Integer}} Maximum number of sources to return
  'offset': 56 // {{Integer}} Number of sources to skip
};
var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
};
api.getThreatModelRepositories(threatModelId, opts, callback);
using System;
using System.Diagnostics;
using IO.Swagger.Api;
using IO.Swagger.Client;
using IO.Swagger.Model;

namespace Example
{
    public class getThreatModelRepositoriesExample
    {
        public void main()
        {


            var apiInstance = new ThreatModelSubResourcesApi();
            var threatModelId = new UUID(); // UUID | Unique identifier of the threat model (UUID)
            var limit = 56;  // Integer | Maximum number of sources to return (optional)  (default to 20)
            var offset = 56;  // Integer | Number of sources to skip (optional)  (default to 0)

            try
            {
                // List sources in a threat model
                array[Repository] result = apiInstance.getThreatModelRepositories(threatModelId, limit, offset);
                Debug.WriteLine(result);
            }
            catch (Exception e)
            {
                Debug.Print("Exception when calling ThreatModelSubResourcesApi.getThreatModelRepositories: " + e.Message );
            }
        }
    }
}
<?php
require_once(__DIR__ . '/vendor/autoload.php');


$api_instance = new Swagger\Client\ApiThreatModelSubResourcesApi();
$threatModelId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // UUID | Unique identifier of the threat model (UUID)
$limit = 56; // Integer | Maximum number of sources to return
$offset = 56; // Integer | Number of sources to skip

try {
    $result = $api_instance->getThreatModelRepositories($threatModelId, $limit, $offset);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling ThreatModelSubResourcesApi->getThreatModelRepositories: ', $e->getMessage(), PHP_EOL;
}
?>
use Data::Dumper;
use WWW::SwaggerClient::Configuration;
use WWW::SwaggerClient::ThreatModelSubResourcesApi;


my $api_instance = WWW::SwaggerClient::ThreatModelSubResourcesApi->new();
my $threatModelId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; # UUID | Unique identifier of the threat model (UUID)
my $limit = 56; # Integer | Maximum number of sources to return
my $offset = 56; # Integer | Number of sources to skip

eval { 
    my $result = $api_instance->getThreatModelRepositories(threatModelId => $threatModelId, limit => $limit, offset => $offset);
    print Dumper($result);
};
if ($@) {
    warn "Exception when calling ThreatModelSubResourcesApi->getThreatModelRepositories: $@\n";
}
from __future__ import print_statement
import time
import swagger_client
from swagger_client.rest import ApiException
from pprint import pprint


# create an instance of the API class
api_instance = swagger_client.ThreatModelSubResourcesApi()
threatModelId = 38400000-8cf0-11bd-b23e-10b96e4ef00d # UUID | Unique identifier of the threat model (UUID)
limit = 56 # Integer | Maximum number of sources to return (optional) (default to 20)
offset = 56 # Integer | Number of sources to skip (optional) (default to 0)

try: 
    # List sources in a threat model
    api_response = api_instance.get_threat_model_repositories(threatModelId, limit=limit, offset=offset)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling ThreatModelSubResourcesApi->getThreatModelRepositories: %s\n" % e)

Parameters

Path parameters
Name Description
threat_model_id*
UUID (uuid)
Unique identifier of the threat model (UUID)
Required
Query parameters
Name Description
limit
Integer
Maximum number of sources to return
offset
Integer
Number of sources to skip

Responses

Status: 200 - List of source code references

Status: 401 - Error response

Status: 403 - Error response

Status: 404 - Error response

Status: 500 - Error response


getThreatModelRepository

Get a specific source reference

Returns details of a specific source code reference within the threat model


/threat_models/{threat_model_id}/repositories/{repository_id}

Usage and SDK Samples

curl -X GET\
 -H "Authorization: Bearer [[accessToken]]"\
-H "Accept: application/json"\
"http://localhost:8080/threat_models/{threat_model_id}/repositories/{repository_id}"
import io.swagger.client.*;
import io.swagger.client.auth.*;
import io.swagger.client.model.*;
import io.swagger.client.api.ThreatModelSubResourcesApi;

import java.io.File;
import java.util.*;

public class ThreatModelSubResourcesApiExample {

    public static void main(String[] args) {
        ApiClient defaultClient = Configuration.getDefaultApiClient();


        ThreatModelSubResourcesApi apiInstance = new ThreatModelSubResourcesApi();
        UUID threatModelId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // UUID | Unique identifier of the threat model (UUID)
        UUID repositoryId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // UUID | Unique identifier of the source reference (UUID)
        try {
            Repository result = apiInstance.getThreatModelRepository(threatModelId, repositoryId);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling ThreatModelSubResourcesApi#getThreatModelRepository");
            e.printStackTrace();
        }
    }
}
import io.swagger.client.api.ThreatModelSubResourcesApi;

public class ThreatModelSubResourcesApiExample {

    public static void main(String[] args) {
        ThreatModelSubResourcesApi apiInstance = new ThreatModelSubResourcesApi();
        UUID threatModelId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // UUID | Unique identifier of the threat model (UUID)
        UUID repositoryId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // UUID | Unique identifier of the source reference (UUID)
        try {
            Repository result = apiInstance.getThreatModelRepository(threatModelId, repositoryId);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling ThreatModelSubResourcesApi#getThreatModelRepository");
            e.printStackTrace();
        }
    }
}
Configuration *apiConfig = [Configuration sharedConfig];
UUID *threatModelId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // Unique identifier of the threat model (UUID)
UUID *repositoryId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // Unique identifier of the source reference (UUID)

ThreatModelSubResourcesApi *apiInstance = [[ThreatModelSubResourcesApi alloc] init];

// Get a specific source reference
[apiInstance getThreatModelRepositoryWith:threatModelId
    repositoryId:repositoryId
              completionHandler: ^(Repository output, NSError* error) {
                            if (output) {
                                NSLog(@"%@", output);
                            }
                            if (error) {
                                NSLog(@"Error: %@", error);
                            }
                        }];
var TmiThreatModelingImprovedApi = require('tmi__threat_modeling_improved_api');
var defaultClient = TmiThreatModelingImprovedApi.ApiClient.instance;


var api = new TmiThreatModelingImprovedApi.ThreatModelSubResourcesApi()
var threatModelId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // {{UUID}} Unique identifier of the threat model (UUID)
var repositoryId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // {{UUID}} Unique identifier of the source reference (UUID)

var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
};
api.getThreatModelRepository(threatModelId, repositoryId, callback);
using System;
using System.Diagnostics;
using IO.Swagger.Api;
using IO.Swagger.Client;
using IO.Swagger.Model;

namespace Example
{
    public class getThreatModelRepositoryExample
    {
        public void main()
        {


            var apiInstance = new ThreatModelSubResourcesApi();
            var threatModelId = new UUID(); // UUID | Unique identifier of the threat model (UUID)
            var repositoryId = new UUID(); // UUID | Unique identifier of the source reference (UUID)

            try
            {
                // Get a specific source reference
                Repository result = apiInstance.getThreatModelRepository(threatModelId, repositoryId);
                Debug.WriteLine(result);
            }
            catch (Exception e)
            {
                Debug.Print("Exception when calling ThreatModelSubResourcesApi.getThreatModelRepository: " + e.Message );
            }
        }
    }
}
<?php
require_once(__DIR__ . '/vendor/autoload.php');


$api_instance = new Swagger\Client\ApiThreatModelSubResourcesApi();
$threatModelId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // UUID | Unique identifier of the threat model (UUID)
$repositoryId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // UUID | Unique identifier of the source reference (UUID)

try {
    $result = $api_instance->getThreatModelRepository($threatModelId, $repositoryId);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling ThreatModelSubResourcesApi->getThreatModelRepository: ', $e->getMessage(), PHP_EOL;
}
?>
use Data::Dumper;
use WWW::SwaggerClient::Configuration;
use WWW::SwaggerClient::ThreatModelSubResourcesApi;


my $api_instance = WWW::SwaggerClient::ThreatModelSubResourcesApi->new();
my $threatModelId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; # UUID | Unique identifier of the threat model (UUID)
my $repositoryId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; # UUID | Unique identifier of the source reference (UUID)

eval { 
    my $result = $api_instance->getThreatModelRepository(threatModelId => $threatModelId, repositoryId => $repositoryId);
    print Dumper($result);
};
if ($@) {
    warn "Exception when calling ThreatModelSubResourcesApi->getThreatModelRepository: $@\n";
}
from __future__ import print_statement
import time
import swagger_client
from swagger_client.rest import ApiException
from pprint import pprint


# create an instance of the API class
api_instance = swagger_client.ThreatModelSubResourcesApi()
threatModelId = 38400000-8cf0-11bd-b23e-10b96e4ef00d # UUID | Unique identifier of the threat model (UUID)
repositoryId = 38400000-8cf0-11bd-b23e-10b96e4ef00d # UUID | Unique identifier of the source reference (UUID)

try: 
    # Get a specific source reference
    api_response = api_instance.get_threat_model_repository(threatModelId, repositoryId)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling ThreatModelSubResourcesApi->getThreatModelRepository: %s\n" % e)

Parameters

Path parameters
Name Description
threat_model_id*
UUID (uuid)
Unique identifier of the threat model (UUID)
Required
repository_id*
UUID (uuid)
Unique identifier of the source reference (UUID)
Required

Responses

Status: 200 - Source reference details

Status: 401 - Error response

Status: 403 - Error response

Status: 404 - Error response

Status: 500 - Error response


getThreatModelThreat

Get a specific threat

Returns details of a specific threat within the threat model


/threat_models/{threat_model_id}/threats/{threat_id}

Usage and SDK Samples

curl -X GET\
 -H "Authorization: Bearer [[accessToken]]"\
-H "Accept: application/json"\
"http://localhost:8080/threat_models/{threat_model_id}/threats/{threat_id}"
import io.swagger.client.*;
import io.swagger.client.auth.*;
import io.swagger.client.model.*;
import io.swagger.client.api.ThreatModelSubResourcesApi;

import java.io.File;
import java.util.*;

public class ThreatModelSubResourcesApiExample {

    public static void main(String[] args) {
        ApiClient defaultClient = Configuration.getDefaultApiClient();


        ThreatModelSubResourcesApi apiInstance = new ThreatModelSubResourcesApi();
        UUID threatModelId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // UUID | Unique identifier of the threat model (UUID)
        UUID threatId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // UUID | Unique identifier of the threat (UUID)
        try {
            Threat result = apiInstance.getThreatModelThreat(threatModelId, threatId);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling ThreatModelSubResourcesApi#getThreatModelThreat");
            e.printStackTrace();
        }
    }
}
import io.swagger.client.api.ThreatModelSubResourcesApi;

public class ThreatModelSubResourcesApiExample {

    public static void main(String[] args) {
        ThreatModelSubResourcesApi apiInstance = new ThreatModelSubResourcesApi();
        UUID threatModelId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // UUID | Unique identifier of the threat model (UUID)
        UUID threatId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // UUID | Unique identifier of the threat (UUID)
        try {
            Threat result = apiInstance.getThreatModelThreat(threatModelId, threatId);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling ThreatModelSubResourcesApi#getThreatModelThreat");
            e.printStackTrace();
        }
    }
}
Configuration *apiConfig = [Configuration sharedConfig];
UUID *threatModelId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // Unique identifier of the threat model (UUID)
UUID *threatId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // Unique identifier of the threat (UUID)

ThreatModelSubResourcesApi *apiInstance = [[ThreatModelSubResourcesApi alloc] init];

// Get a specific threat
[apiInstance getThreatModelThreatWith:threatModelId
    threatId:threatId
              completionHandler: ^(Threat output, NSError* error) {
                            if (output) {
                                NSLog(@"%@", output);
                            }
                            if (error) {
                                NSLog(@"Error: %@", error);
                            }
                        }];
var TmiThreatModelingImprovedApi = require('tmi__threat_modeling_improved_api');
var defaultClient = TmiThreatModelingImprovedApi.ApiClient.instance;


var api = new TmiThreatModelingImprovedApi.ThreatModelSubResourcesApi()
var threatModelId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // {{UUID}} Unique identifier of the threat model (UUID)
var threatId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // {{UUID}} Unique identifier of the threat (UUID)

var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
};
api.getThreatModelThreat(threatModelId, threatId, callback);
using System;
using System.Diagnostics;
using IO.Swagger.Api;
using IO.Swagger.Client;
using IO.Swagger.Model;

namespace Example
{
    public class getThreatModelThreatExample
    {
        public void main()
        {


            var apiInstance = new ThreatModelSubResourcesApi();
            var threatModelId = new UUID(); // UUID | Unique identifier of the threat model (UUID)
            var threatId = new UUID(); // UUID | Unique identifier of the threat (UUID)

            try
            {
                // Get a specific threat
                Threat result = apiInstance.getThreatModelThreat(threatModelId, threatId);
                Debug.WriteLine(result);
            }
            catch (Exception e)
            {
                Debug.Print("Exception when calling ThreatModelSubResourcesApi.getThreatModelThreat: " + e.Message );
            }
        }
    }
}
<?php
require_once(__DIR__ . '/vendor/autoload.php');


$api_instance = new Swagger\Client\ApiThreatModelSubResourcesApi();
$threatModelId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // UUID | Unique identifier of the threat model (UUID)
$threatId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // UUID | Unique identifier of the threat (UUID)

try {
    $result = $api_instance->getThreatModelThreat($threatModelId, $threatId);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling ThreatModelSubResourcesApi->getThreatModelThreat: ', $e->getMessage(), PHP_EOL;
}
?>
use Data::Dumper;
use WWW::SwaggerClient::Configuration;
use WWW::SwaggerClient::ThreatModelSubResourcesApi;


my $api_instance = WWW::SwaggerClient::ThreatModelSubResourcesApi->new();
my $threatModelId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; # UUID | Unique identifier of the threat model (UUID)
my $threatId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; # UUID | Unique identifier of the threat (UUID)

eval { 
    my $result = $api_instance->getThreatModelThreat(threatModelId => $threatModelId, threatId => $threatId);
    print Dumper($result);
};
if ($@) {
    warn "Exception when calling ThreatModelSubResourcesApi->getThreatModelThreat: $@\n";
}
from __future__ import print_statement
import time
import swagger_client
from swagger_client.rest import ApiException
from pprint import pprint


# create an instance of the API class
api_instance = swagger_client.ThreatModelSubResourcesApi()
threatModelId = 38400000-8cf0-11bd-b23e-10b96e4ef00d # UUID | Unique identifier of the threat model (UUID)
threatId = 38400000-8cf0-11bd-b23e-10b96e4ef00d # UUID | Unique identifier of the threat (UUID)

try: 
    # Get a specific threat
    api_response = api_instance.get_threat_model_threat(threatModelId, threatId)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling ThreatModelSubResourcesApi->getThreatModelThreat: %s\n" % e)

Parameters

Path parameters
Name Description
threat_model_id*
UUID (uuid)
Unique identifier of the threat model (UUID)
Required
threat_id*
UUID (uuid)
Unique identifier of the threat (UUID)
Required

Responses

Status: 200 - Threat details

Status: 401 - Error response

Status: 403 - Error response

Status: 404 - Error response

Status: 500 - Error response


getThreatModelThreats

List threats in a threat model

Returns a paginated list of threats within the specified threat model


/threat_models/{threat_model_id}/threats

Usage and SDK Samples

curl -X GET\
 -H "Authorization: Bearer [[accessToken]]"\
-H "Accept: application/json"\
"http://localhost:8080/threat_models/{threat_model_id}/threats?limit=&offset=&sort=&name=&description=&threat_type=&severity=&priority=&status=&diagram_id=&cell_id=&score_gt=&score_lt=&score_eq=&score_ge=&score_le=&created_after=&created_before=&modified_after=&modified_before="
import io.swagger.client.*;
import io.swagger.client.auth.*;
import io.swagger.client.model.*;
import io.swagger.client.api.ThreatModelSubResourcesApi;

import java.io.File;
import java.util.*;

public class ThreatModelSubResourcesApiExample {

    public static void main(String[] args) {
        ApiClient defaultClient = Configuration.getDefaultApiClient();


        ThreatModelSubResourcesApi apiInstance = new ThreatModelSubResourcesApi();
        UUID threatModelId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // UUID | Unique identifier of the threat model (UUID)
        Integer limit = 56; // Integer | Maximum number of threats to return
        Integer offset = 56; // Integer | Number of threats to skip
        String sort = sort_example; // String | Sort order (e.g., created_at:desc, name:asc, severity:desc, score:desc)
        String name = name_example; // String | Filter by threat name (partial match)
        String description = description_example; // String | Filter by threat description (partial match)
        String threatType = threatType_example; // String | Filter by threat type (exact match)
        String severity = severity_example; // String | Filter by severity level (exact match)
        String priority = priority_example; // String | Filter by priority (exact match)
        String status = status_example; // String | Filter by status (exact match)
        UUID diagramId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // UUID | Filter by diagram ID (exact match)
        UUID cellId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // UUID | Filter by cell ID (exact match)
        BigDecimal scoreGt = 1.2; // BigDecimal | Filter threats with score greater than this value
        BigDecimal scoreLt = 1.2; // BigDecimal | Filter threats with score less than this value
        BigDecimal scoreEq = 1.2; // BigDecimal | Filter threats with score equal to this value
        BigDecimal scoreGe = 1.2; // BigDecimal | Filter threats with score greater than or equal to this value
        BigDecimal scoreLe = 1.2; // BigDecimal | Filter threats with score less than or equal to this value
        Date createdAfter = 2013-10-20T19:20:30+01:00; // Date | Filter threats created after this date (RFC3339 format)
        Date createdBefore = 2013-10-20T19:20:30+01:00; // Date | Filter threats created before this date (RFC3339 format)
        Date modifiedAfter = 2013-10-20T19:20:30+01:00; // Date | Filter threats modified after this date (RFC3339 format)
        Date modifiedBefore = 2013-10-20T19:20:30+01:00; // Date | Filter threats modified before this date (RFC3339 format)
        try {
            array[Threat] result = apiInstance.getThreatModelThreats(threatModelId, limit, offset, sort, name, description, threatType, severity, priority, status, diagramId, cellId, scoreGt, scoreLt, scoreEq, scoreGe, scoreLe, createdAfter, createdBefore, modifiedAfter, modifiedBefore);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling ThreatModelSubResourcesApi#getThreatModelThreats");
            e.printStackTrace();
        }
    }
}
import io.swagger.client.api.ThreatModelSubResourcesApi;

public class ThreatModelSubResourcesApiExample {

    public static void main(String[] args) {
        ThreatModelSubResourcesApi apiInstance = new ThreatModelSubResourcesApi();
        UUID threatModelId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // UUID | Unique identifier of the threat model (UUID)
        Integer limit = 56; // Integer | Maximum number of threats to return
        Integer offset = 56; // Integer | Number of threats to skip
        String sort = sort_example; // String | Sort order (e.g., created_at:desc, name:asc, severity:desc, score:desc)
        String name = name_example; // String | Filter by threat name (partial match)
        String description = description_example; // String | Filter by threat description (partial match)
        String threatType = threatType_example; // String | Filter by threat type (exact match)
        String severity = severity_example; // String | Filter by severity level (exact match)
        String priority = priority_example; // String | Filter by priority (exact match)
        String status = status_example; // String | Filter by status (exact match)
        UUID diagramId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // UUID | Filter by diagram ID (exact match)
        UUID cellId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // UUID | Filter by cell ID (exact match)
        BigDecimal scoreGt = 1.2; // BigDecimal | Filter threats with score greater than this value
        BigDecimal scoreLt = 1.2; // BigDecimal | Filter threats with score less than this value
        BigDecimal scoreEq = 1.2; // BigDecimal | Filter threats with score equal to this value
        BigDecimal scoreGe = 1.2; // BigDecimal | Filter threats with score greater than or equal to this value
        BigDecimal scoreLe = 1.2; // BigDecimal | Filter threats with score less than or equal to this value
        Date createdAfter = 2013-10-20T19:20:30+01:00; // Date | Filter threats created after this date (RFC3339 format)
        Date createdBefore = 2013-10-20T19:20:30+01:00; // Date | Filter threats created before this date (RFC3339 format)
        Date modifiedAfter = 2013-10-20T19:20:30+01:00; // Date | Filter threats modified after this date (RFC3339 format)
        Date modifiedBefore = 2013-10-20T19:20:30+01:00; // Date | Filter threats modified before this date (RFC3339 format)
        try {
            array[Threat] result = apiInstance.getThreatModelThreats(threatModelId, limit, offset, sort, name, description, threatType, severity, priority, status, diagramId, cellId, scoreGt, scoreLt, scoreEq, scoreGe, scoreLe, createdAfter, createdBefore, modifiedAfter, modifiedBefore);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling ThreatModelSubResourcesApi#getThreatModelThreats");
            e.printStackTrace();
        }
    }
}
Configuration *apiConfig = [Configuration sharedConfig];
UUID *threatModelId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // Unique identifier of the threat model (UUID)
Integer *limit = 56; // Maximum number of threats to return (optional) (default to 20)
Integer *offset = 56; // Number of threats to skip (optional) (default to 0)
String *sort = sort_example; // Sort order (e.g., created_at:desc, name:asc, severity:desc, score:desc) (optional) (default to created_at:desc)
String *name = name_example; // Filter by threat name (partial match) (optional)
String *description = description_example; // Filter by threat description (partial match) (optional)
String *threatType = threatType_example; // Filter by threat type (exact match) (optional)
String *severity = severity_example; // Filter by severity level (exact match) (optional)
String *priority = priority_example; // Filter by priority (exact match) (optional)
String *status = status_example; // Filter by status (exact match) (optional)
UUID *diagramId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // Filter by diagram ID (exact match) (optional)
UUID *cellId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // Filter by cell ID (exact match) (optional)
BigDecimal *scoreGt = 1.2; // Filter threats with score greater than this value (optional)
BigDecimal *scoreLt = 1.2; // Filter threats with score less than this value (optional)
BigDecimal *scoreEq = 1.2; // Filter threats with score equal to this value (optional)
BigDecimal *scoreGe = 1.2; // Filter threats with score greater than or equal to this value (optional)
BigDecimal *scoreLe = 1.2; // Filter threats with score less than or equal to this value (optional)
Date *createdAfter = 2013-10-20T19:20:30+01:00; // Filter threats created after this date (RFC3339 format) (optional)
Date *createdBefore = 2013-10-20T19:20:30+01:00; // Filter threats created before this date (RFC3339 format) (optional)
Date *modifiedAfter = 2013-10-20T19:20:30+01:00; // Filter threats modified after this date (RFC3339 format) (optional)
Date *modifiedBefore = 2013-10-20T19:20:30+01:00; // Filter threats modified before this date (RFC3339 format) (optional)

ThreatModelSubResourcesApi *apiInstance = [[ThreatModelSubResourcesApi alloc] init];

// List threats in a threat model
[apiInstance getThreatModelThreatsWith:threatModelId
    limit:limit
    offset:offset
    sort:sort
    name:name
    description:description
    threatType:threatType
    severity:severity
    priority:priority
    status:status
    diagramId:diagramId
    cellId:cellId
    scoreGt:scoreGt
    scoreLt:scoreLt
    scoreEq:scoreEq
    scoreGe:scoreGe
    scoreLe:scoreLe
    createdAfter:createdAfter
    createdBefore:createdBefore
    modifiedAfter:modifiedAfter
    modifiedBefore:modifiedBefore
              completionHandler: ^(array[Threat] output, NSError* error) {
                            if (output) {
                                NSLog(@"%@", output);
                            }
                            if (error) {
                                NSLog(@"Error: %@", error);
                            }
                        }];
var TmiThreatModelingImprovedApi = require('tmi__threat_modeling_improved_api');
var defaultClient = TmiThreatModelingImprovedApi.ApiClient.instance;


var api = new TmiThreatModelingImprovedApi.ThreatModelSubResourcesApi()
var threatModelId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // {{UUID}} Unique identifier of the threat model (UUID)
var opts = { 
  'limit': 56, // {{Integer}} Maximum number of threats to return
  'offset': 56, // {{Integer}} Number of threats to skip
  'sort': sort_example, // {{String}} Sort order (e.g., created_at:desc, name:asc, severity:desc, score:desc)
  'name': name_example, // {{String}} Filter by threat name (partial match)
  'description': description_example, // {{String}} Filter by threat description (partial match)
  'threatType': threatType_example, // {{String}} Filter by threat type (exact match)
  'severity': severity_example, // {{String}} Filter by severity level (exact match)
  'priority': priority_example, // {{String}} Filter by priority (exact match)
  'status': status_example, // {{String}} Filter by status (exact match)
  'diagramId': 38400000-8cf0-11bd-b23e-10b96e4ef00d, // {{UUID}} Filter by diagram ID (exact match)
  'cellId': 38400000-8cf0-11bd-b23e-10b96e4ef00d, // {{UUID}} Filter by cell ID (exact match)
  'scoreGt': 1.2, // {{BigDecimal}} Filter threats with score greater than this value
  'scoreLt': 1.2, // {{BigDecimal}} Filter threats with score less than this value
  'scoreEq': 1.2, // {{BigDecimal}} Filter threats with score equal to this value
  'scoreGe': 1.2, // {{BigDecimal}} Filter threats with score greater than or equal to this value
  'scoreLe': 1.2, // {{BigDecimal}} Filter threats with score less than or equal to this value
  'createdAfter': 2013-10-20T19:20:30+01:00, // {{Date}} Filter threats created after this date (RFC3339 format)
  'createdBefore': 2013-10-20T19:20:30+01:00, // {{Date}} Filter threats created before this date (RFC3339 format)
  'modifiedAfter': 2013-10-20T19:20:30+01:00, // {{Date}} Filter threats modified after this date (RFC3339 format)
  'modifiedBefore': 2013-10-20T19:20:30+01:00 // {{Date}} Filter threats modified before this date (RFC3339 format)
};
var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
};
api.getThreatModelThreats(threatModelId, opts, callback);
using System;
using System.Diagnostics;
using IO.Swagger.Api;
using IO.Swagger.Client;
using IO.Swagger.Model;

namespace Example
{
    public class getThreatModelThreatsExample
    {
        public void main()
        {


            var apiInstance = new ThreatModelSubResourcesApi();
            var threatModelId = new UUID(); // UUID | Unique identifier of the threat model (UUID)
            var limit = 56;  // Integer | Maximum number of threats to return (optional)  (default to 20)
            var offset = 56;  // Integer | Number of threats to skip (optional)  (default to 0)
            var sort = sort_example;  // String | Sort order (e.g., created_at:desc, name:asc, severity:desc, score:desc) (optional)  (default to created_at:desc)
            var name = name_example;  // String | Filter by threat name (partial match) (optional) 
            var description = description_example;  // String | Filter by threat description (partial match) (optional) 
            var threatType = threatType_example;  // String | Filter by threat type (exact match) (optional) 
            var severity = severity_example;  // String | Filter by severity level (exact match) (optional) 
            var priority = priority_example;  // String | Filter by priority (exact match) (optional) 
            var status = status_example;  // String | Filter by status (exact match) (optional) 
            var diagramId = new UUID(); // UUID | Filter by diagram ID (exact match) (optional) 
            var cellId = new UUID(); // UUID | Filter by cell ID (exact match) (optional) 
            var scoreGt = 1.2;  // BigDecimal | Filter threats with score greater than this value (optional) 
            var scoreLt = 1.2;  // BigDecimal | Filter threats with score less than this value (optional) 
            var scoreEq = 1.2;  // BigDecimal | Filter threats with score equal to this value (optional) 
            var scoreGe = 1.2;  // BigDecimal | Filter threats with score greater than or equal to this value (optional) 
            var scoreLe = 1.2;  // BigDecimal | Filter threats with score less than or equal to this value (optional) 
            var createdAfter = 2013-10-20T19:20:30+01:00;  // Date | Filter threats created after this date (RFC3339 format) (optional) 
            var createdBefore = 2013-10-20T19:20:30+01:00;  // Date | Filter threats created before this date (RFC3339 format) (optional) 
            var modifiedAfter = 2013-10-20T19:20:30+01:00;  // Date | Filter threats modified after this date (RFC3339 format) (optional) 
            var modifiedBefore = 2013-10-20T19:20:30+01:00;  // Date | Filter threats modified before this date (RFC3339 format) (optional) 

            try
            {
                // List threats in a threat model
                array[Threat] result = apiInstance.getThreatModelThreats(threatModelId, limit, offset, sort, name, description, threatType, severity, priority, status, diagramId, cellId, scoreGt, scoreLt, scoreEq, scoreGe, scoreLe, createdAfter, createdBefore, modifiedAfter, modifiedBefore);
                Debug.WriteLine(result);
            }
            catch (Exception e)
            {
                Debug.Print("Exception when calling ThreatModelSubResourcesApi.getThreatModelThreats: " + e.Message );
            }
        }
    }
}
<?php
require_once(__DIR__ . '/vendor/autoload.php');


$api_instance = new Swagger\Client\ApiThreatModelSubResourcesApi();
$threatModelId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // UUID | Unique identifier of the threat model (UUID)
$limit = 56; // Integer | Maximum number of threats to return
$offset = 56; // Integer | Number of threats to skip
$sort = sort_example; // String | Sort order (e.g., created_at:desc, name:asc, severity:desc, score:desc)
$name = name_example; // String | Filter by threat name (partial match)
$description = description_example; // String | Filter by threat description (partial match)
$threatType = threatType_example; // String | Filter by threat type (exact match)
$severity = severity_example; // String | Filter by severity level (exact match)
$priority = priority_example; // String | Filter by priority (exact match)
$status = status_example; // String | Filter by status (exact match)
$diagramId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // UUID | Filter by diagram ID (exact match)
$cellId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // UUID | Filter by cell ID (exact match)
$scoreGt = 1.2; // BigDecimal | Filter threats with score greater than this value
$scoreLt = 1.2; // BigDecimal | Filter threats with score less than this value
$scoreEq = 1.2; // BigDecimal | Filter threats with score equal to this value
$scoreGe = 1.2; // BigDecimal | Filter threats with score greater than or equal to this value
$scoreLe = 1.2; // BigDecimal | Filter threats with score less than or equal to this value
$createdAfter = 2013-10-20T19:20:30+01:00; // Date | Filter threats created after this date (RFC3339 format)
$createdBefore = 2013-10-20T19:20:30+01:00; // Date | Filter threats created before this date (RFC3339 format)
$modifiedAfter = 2013-10-20T19:20:30+01:00; // Date | Filter threats modified after this date (RFC3339 format)
$modifiedBefore = 2013-10-20T19:20:30+01:00; // Date | Filter threats modified before this date (RFC3339 format)

try {
    $result = $api_instance->getThreatModelThreats($threatModelId, $limit, $offset, $sort, $name, $description, $threatType, $severity, $priority, $status, $diagramId, $cellId, $scoreGt, $scoreLt, $scoreEq, $scoreGe, $scoreLe, $createdAfter, $createdBefore, $modifiedAfter, $modifiedBefore);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling ThreatModelSubResourcesApi->getThreatModelThreats: ', $e->getMessage(), PHP_EOL;
}
?>
use Data::Dumper;
use WWW::SwaggerClient::Configuration;
use WWW::SwaggerClient::ThreatModelSubResourcesApi;


my $api_instance = WWW::SwaggerClient::ThreatModelSubResourcesApi->new();
my $threatModelId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; # UUID | Unique identifier of the threat model (UUID)
my $limit = 56; # Integer | Maximum number of threats to return
my $offset = 56; # Integer | Number of threats to skip
my $sort = sort_example; # String | Sort order (e.g., created_at:desc, name:asc, severity:desc, score:desc)
my $name = name_example; # String | Filter by threat name (partial match)
my $description = description_example; # String | Filter by threat description (partial match)
my $threatType = threatType_example; # String | Filter by threat type (exact match)
my $severity = severity_example; # String | Filter by severity level (exact match)
my $priority = priority_example; # String | Filter by priority (exact match)
my $status = status_example; # String | Filter by status (exact match)
my $diagramId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; # UUID | Filter by diagram ID (exact match)
my $cellId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; # UUID | Filter by cell ID (exact match)
my $scoreGt = 1.2; # BigDecimal | Filter threats with score greater than this value
my $scoreLt = 1.2; # BigDecimal | Filter threats with score less than this value
my $scoreEq = 1.2; # BigDecimal | Filter threats with score equal to this value
my $scoreGe = 1.2; # BigDecimal | Filter threats with score greater than or equal to this value
my $scoreLe = 1.2; # BigDecimal | Filter threats with score less than or equal to this value
my $createdAfter = 2013-10-20T19:20:30+01:00; # Date | Filter threats created after this date (RFC3339 format)
my $createdBefore = 2013-10-20T19:20:30+01:00; # Date | Filter threats created before this date (RFC3339 format)
my $modifiedAfter = 2013-10-20T19:20:30+01:00; # Date | Filter threats modified after this date (RFC3339 format)
my $modifiedBefore = 2013-10-20T19:20:30+01:00; # Date | Filter threats modified before this date (RFC3339 format)

eval { 
    my $result = $api_instance->getThreatModelThreats(threatModelId => $threatModelId, limit => $limit, offset => $offset, sort => $sort, name => $name, description => $description, threatType => $threatType, severity => $severity, priority => $priority, status => $status, diagramId => $diagramId, cellId => $cellId, scoreGt => $scoreGt, scoreLt => $scoreLt, scoreEq => $scoreEq, scoreGe => $scoreGe, scoreLe => $scoreLe, createdAfter => $createdAfter, createdBefore => $createdBefore, modifiedAfter => $modifiedAfter, modifiedBefore => $modifiedBefore);
    print Dumper($result);
};
if ($@) {
    warn "Exception when calling ThreatModelSubResourcesApi->getThreatModelThreats: $@\n";
}
from __future__ import print_statement
import time
import swagger_client
from swagger_client.rest import ApiException
from pprint import pprint


# create an instance of the API class
api_instance = swagger_client.ThreatModelSubResourcesApi()
threatModelId = 38400000-8cf0-11bd-b23e-10b96e4ef00d # UUID | Unique identifier of the threat model (UUID)
limit = 56 # Integer | Maximum number of threats to return (optional) (default to 20)
offset = 56 # Integer | Number of threats to skip (optional) (default to 0)
sort = sort_example # String | Sort order (e.g., created_at:desc, name:asc, severity:desc, score:desc) (optional) (default to created_at:desc)
name = name_example # String | Filter by threat name (partial match) (optional)
description = description_example # String | Filter by threat description (partial match) (optional)
threatType = threatType_example # String | Filter by threat type (exact match) (optional)
severity = severity_example # String | Filter by severity level (exact match) (optional)
priority = priority_example # String | Filter by priority (exact match) (optional)
status = status_example # String | Filter by status (exact match) (optional)
diagramId = 38400000-8cf0-11bd-b23e-10b96e4ef00d # UUID | Filter by diagram ID (exact match) (optional)
cellId = 38400000-8cf0-11bd-b23e-10b96e4ef00d # UUID | Filter by cell ID (exact match) (optional)
scoreGt = 1.2 # BigDecimal | Filter threats with score greater than this value (optional)
scoreLt = 1.2 # BigDecimal | Filter threats with score less than this value (optional)
scoreEq = 1.2 # BigDecimal | Filter threats with score equal to this value (optional)
scoreGe = 1.2 # BigDecimal | Filter threats with score greater than or equal to this value (optional)
scoreLe = 1.2 # BigDecimal | Filter threats with score less than or equal to this value (optional)
createdAfter = 2013-10-20T19:20:30+01:00 # Date | Filter threats created after this date (RFC3339 format) (optional)
createdBefore = 2013-10-20T19:20:30+01:00 # Date | Filter threats created before this date (RFC3339 format) (optional)
modifiedAfter = 2013-10-20T19:20:30+01:00 # Date | Filter threats modified after this date (RFC3339 format) (optional)
modifiedBefore = 2013-10-20T19:20:30+01:00 # Date | Filter threats modified before this date (RFC3339 format) (optional)

try: 
    # List threats in a threat model
    api_response = api_instance.get_threat_model_threats(threatModelId, limit=limit, offset=offset, sort=sort, name=name, description=description, threatType=threatType, severity=severity, priority=priority, status=status, diagramId=diagramId, cellId=cellId, scoreGt=scoreGt, scoreLt=scoreLt, scoreEq=scoreEq, scoreGe=scoreGe, scoreLe=scoreLe, createdAfter=createdAfter, createdBefore=createdBefore, modifiedAfter=modifiedAfter, modifiedBefore=modifiedBefore)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling ThreatModelSubResourcesApi->getThreatModelThreats: %s\n" % e)

Parameters

Path parameters
Name Description
threat_model_id*
UUID (uuid)
Unique identifier of the threat model (UUID)
Required
Query parameters
Name Description
limit
Integer
Maximum number of threats to return
offset
Integer
Number of threats to skip
sort
String
Sort order (e.g., created_at:desc, name:asc, severity:desc, score:desc)
name
String
Filter by threat name (partial match)
description
String
Filter by threat description (partial match)
threat_type
String
Filter by threat type (exact match)
severity
String
Filter by severity level (exact match)
priority
String
Filter by priority (exact match)
status
String
Filter by status (exact match)
diagram_id
UUID (uuid)
Filter by diagram ID (exact match)
cell_id
UUID (uuid)
Filter by cell ID (exact match)
score_gt
BigDecimal
Filter threats with score greater than this value
score_lt
BigDecimal
Filter threats with score less than this value
score_eq
BigDecimal
Filter threats with score equal to this value
score_ge
BigDecimal
Filter threats with score greater than or equal to this value
score_le
BigDecimal
Filter threats with score less than or equal to this value
created_after
Date (date-time)
Filter threats created after this date (RFC3339 format)
created_before
Date (date-time)
Filter threats created before this date (RFC3339 format)
modified_after
Date (date-time)
Filter threats modified after this date (RFC3339 format)
modified_before
Date (date-time)
Filter threats modified before this date (RFC3339 format)

Responses

Status: 200 - List of threats

Status: 401 - Error response

Status: 403 - Error response

Status: 404 - Error response

Status: 500 - Error response


patchThreatModelDiagram

Partially update a diagram

Apply JSON Patch operations to update specific parts of a diagram


/threat_models/{threat_model_id}/diagrams/{diagram_id}

Usage and SDK Samples

curl -X PATCH\
 -H "Authorization: Bearer [[accessToken]]"\
-H "Accept: application/json"\
-H "Content-Type: application/json-patch+json"\
"http://localhost:8080/threat_models/{threat_model_id}/diagrams/{diagram_id}"
import io.swagger.client.*;
import io.swagger.client.auth.*;
import io.swagger.client.model.*;
import io.swagger.client.api.ThreatModelSubResourcesApi;

import java.io.File;
import java.util.*;

public class ThreatModelSubResourcesApiExample {

    public static void main(String[] args) {
        ApiClient defaultClient = Configuration.getDefaultApiClient();


        ThreatModelSubResourcesApi apiInstance = new ThreatModelSubResourcesApi();
        array[threats_threat_id_body] body = {
  "summary" : "Update diagram name",
  "value" : [ {
    "op" : "replace",
    "path" : "/name",
    "value" : "Updated Diagram Name"
  } ]
}; // array[threats_threat_id_body] | 
        UUID threatModelId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // UUID | Unique identifier of the threat model (UUID)
        UUID diagramId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // UUID | Unique identifier of the diagram (UUID)
        try {
            Diagram result = apiInstance.patchThreatModelDiagram(body, threatModelId, diagramId);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling ThreatModelSubResourcesApi#patchThreatModelDiagram");
            e.printStackTrace();
        }
    }
}
import io.swagger.client.api.ThreatModelSubResourcesApi;

public class ThreatModelSubResourcesApiExample {

    public static void main(String[] args) {
        ThreatModelSubResourcesApi apiInstance = new ThreatModelSubResourcesApi();
        array[threats_threat_id_body] body = {
  "summary" : "Update diagram name",
  "value" : [ {
    "op" : "replace",
    "path" : "/name",
    "value" : "Updated Diagram Name"
  } ]
}; // array[threats_threat_id_body] | 
        UUID threatModelId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // UUID | Unique identifier of the threat model (UUID)
        UUID diagramId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // UUID | Unique identifier of the diagram (UUID)
        try {
            Diagram result = apiInstance.patchThreatModelDiagram(body, threatModelId, diagramId);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling ThreatModelSubResourcesApi#patchThreatModelDiagram");
            e.printStackTrace();
        }
    }
}
Configuration *apiConfig = [Configuration sharedConfig];
array[threats_threat_id_body] *body = {
  "summary" : "Update diagram name",
  "value" : [ {
    "op" : "replace",
    "path" : "/name",
    "value" : "Updated Diagram Name"
  } ]
}; // 
UUID *threatModelId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // Unique identifier of the threat model (UUID)
UUID *diagramId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // Unique identifier of the diagram (UUID)

ThreatModelSubResourcesApi *apiInstance = [[ThreatModelSubResourcesApi alloc] init];

// Partially update a diagram
[apiInstance patchThreatModelDiagramWith:body
    threatModelId:threatModelId
    diagramId:diagramId
              completionHandler: ^(Diagram output, NSError* error) {
                            if (output) {
                                NSLog(@"%@", output);
                            }
                            if (error) {
                                NSLog(@"Error: %@", error);
                            }
                        }];
var TmiThreatModelingImprovedApi = require('tmi__threat_modeling_improved_api');
var defaultClient = TmiThreatModelingImprovedApi.ApiClient.instance;


var api = new TmiThreatModelingImprovedApi.ThreatModelSubResourcesApi()
var body = {
  "summary" : "Update diagram name",
  "value" : [ {
    "op" : "replace",
    "path" : "/name",
    "value" : "Updated Diagram Name"
  } ]
}; // {{array[threats_threat_id_body]}} 
var threatModelId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // {{UUID}} Unique identifier of the threat model (UUID)
var diagramId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // {{UUID}} Unique identifier of the diagram (UUID)

var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
};
api.patchThreatModelDiagram(bodythreatModelIddiagramId, callback);
using System;
using System.Diagnostics;
using IO.Swagger.Api;
using IO.Swagger.Client;
using IO.Swagger.Model;

namespace Example
{
    public class patchThreatModelDiagramExample
    {
        public void main()
        {


            var apiInstance = new ThreatModelSubResourcesApi();
            var body = new array[threats_threat_id_body](); // array[threats_threat_id_body] | 
            var threatModelId = new UUID(); // UUID | Unique identifier of the threat model (UUID)
            var diagramId = new UUID(); // UUID | Unique identifier of the diagram (UUID)

            try
            {
                // Partially update a diagram
                Diagram result = apiInstance.patchThreatModelDiagram(body, threatModelId, diagramId);
                Debug.WriteLine(result);
            }
            catch (Exception e)
            {
                Debug.Print("Exception when calling ThreatModelSubResourcesApi.patchThreatModelDiagram: " + e.Message );
            }
        }
    }
}
<?php
require_once(__DIR__ . '/vendor/autoload.php');


$api_instance = new Swagger\Client\ApiThreatModelSubResourcesApi();
$body = {
  "summary" : "Update diagram name",
  "value" : [ {
    "op" : "replace",
    "path" : "/name",
    "value" : "Updated Diagram Name"
  } ]
}; // array[threats_threat_id_body] | 
$threatModelId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // UUID | Unique identifier of the threat model (UUID)
$diagramId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // UUID | Unique identifier of the diagram (UUID)

try {
    $result = $api_instance->patchThreatModelDiagram($body, $threatModelId, $diagramId);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling ThreatModelSubResourcesApi->patchThreatModelDiagram: ', $e->getMessage(), PHP_EOL;
}
?>
use Data::Dumper;
use WWW::SwaggerClient::Configuration;
use WWW::SwaggerClient::ThreatModelSubResourcesApi;


my $api_instance = WWW::SwaggerClient::ThreatModelSubResourcesApi->new();
my $body = [WWW::SwaggerClient::Object::array[threats_threat_id_body]->new()]; # array[threats_threat_id_body] | 
my $threatModelId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; # UUID | Unique identifier of the threat model (UUID)
my $diagramId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; # UUID | Unique identifier of the diagram (UUID)

eval { 
    my $result = $api_instance->patchThreatModelDiagram(body => $body, threatModelId => $threatModelId, diagramId => $diagramId);
    print Dumper($result);
};
if ($@) {
    warn "Exception when calling ThreatModelSubResourcesApi->patchThreatModelDiagram: $@\n";
}
from __future__ import print_statement
import time
import swagger_client
from swagger_client.rest import ApiException
from pprint import pprint


# create an instance of the API class
api_instance = swagger_client.ThreatModelSubResourcesApi()
body = {
  "summary" : "Update diagram name",
  "value" : [ {
    "op" : "replace",
    "path" : "/name",
    "value" : "Updated Diagram Name"
  } ]
} # array[threats_threat_id_body] | 
threatModelId = 38400000-8cf0-11bd-b23e-10b96e4ef00d # UUID | Unique identifier of the threat model (UUID)
diagramId = 38400000-8cf0-11bd-b23e-10b96e4ef00d # UUID | Unique identifier of the diagram (UUID)

try: 
    # Partially update a diagram
    api_response = api_instance.patch_threat_model_diagram(body, threatModelId, diagramId)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling ThreatModelSubResourcesApi->patchThreatModelDiagram: %s\n" % e)

Parameters

Path parameters
Name Description
threat_model_id*
UUID (uuid)
Unique identifier of the threat model (UUID)
Required
diagram_id*
UUID (uuid)
Unique identifier of the diagram (UUID)
Required
Body parameters
Name Description
body *

Responses

Status: 200 - Diagram updated successfully

Status: 400 - Error response

Status: 401 - Error response

Status: 403 - Error response

Status: 404 - Error response

Status: 422 - Error response

Status: 500 - Error response


patchThreatModelThreat

Partially update a threat

Applies JSON patch operations to a specific threat within the threat model


/threat_models/{threat_model_id}/threats/{threat_id}

Usage and SDK Samples

curl -X PATCH\
 -H "Authorization: Bearer [[accessToken]]"\
-H "Accept: application/json"\
-H "Content-Type: application/json-patch+json"\
"http://localhost:8080/threat_models/{threat_model_id}/threats/{threat_id}"
import io.swagger.client.*;
import io.swagger.client.auth.*;
import io.swagger.client.model.*;
import io.swagger.client.api.ThreatModelSubResourcesApi;

import java.io.File;
import java.util.*;

public class ThreatModelSubResourcesApiExample {

    public static void main(String[] args) {
        ApiClient defaultClient = Configuration.getDefaultApiClient();


        ThreatModelSubResourcesApi apiInstance = new ThreatModelSubResourcesApi();
        array[threats_threat_id_body] body = {
  "summary" : "Update threat name and severity",
  "value" : [ {
    "op" : "replace",
    "path" : "/name",
    "value" : "Updated SQL Injection Threat"
  }, {
    "op" : "replace",
    "path" : "/severity",
    "value" : "Critical"
  }, {
    "op" : "replace",
    "path" : "/description",
    "value" : "Updated description with more details"
  } ]
}; // array[threats_threat_id_body] | 
        UUID threatModelId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // UUID | Unique identifier of the threat model (UUID)
        UUID threatId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // UUID | Unique identifier of the threat (UUID)
        try {
            Threat result = apiInstance.patchThreatModelThreat(body, threatModelId, threatId);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling ThreatModelSubResourcesApi#patchThreatModelThreat");
            e.printStackTrace();
        }
    }
}
import io.swagger.client.api.ThreatModelSubResourcesApi;

public class ThreatModelSubResourcesApiExample {

    public static void main(String[] args) {
        ThreatModelSubResourcesApi apiInstance = new ThreatModelSubResourcesApi();
        array[threats_threat_id_body] body = {
  "summary" : "Update threat name and severity",
  "value" : [ {
    "op" : "replace",
    "path" : "/name",
    "value" : "Updated SQL Injection Threat"
  }, {
    "op" : "replace",
    "path" : "/severity",
    "value" : "Critical"
  }, {
    "op" : "replace",
    "path" : "/description",
    "value" : "Updated description with more details"
  } ]
}; // array[threats_threat_id_body] | 
        UUID threatModelId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // UUID | Unique identifier of the threat model (UUID)
        UUID threatId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // UUID | Unique identifier of the threat (UUID)
        try {
            Threat result = apiInstance.patchThreatModelThreat(body, threatModelId, threatId);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling ThreatModelSubResourcesApi#patchThreatModelThreat");
            e.printStackTrace();
        }
    }
}
Configuration *apiConfig = [Configuration sharedConfig];
array[threats_threat_id_body] *body = {
  "summary" : "Update threat name and severity",
  "value" : [ {
    "op" : "replace",
    "path" : "/name",
    "value" : "Updated SQL Injection Threat"
  }, {
    "op" : "replace",
    "path" : "/severity",
    "value" : "Critical"
  }, {
    "op" : "replace",
    "path" : "/description",
    "value" : "Updated description with more details"
  } ]
}; // 
UUID *threatModelId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // Unique identifier of the threat model (UUID)
UUID *threatId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // Unique identifier of the threat (UUID)

ThreatModelSubResourcesApi *apiInstance = [[ThreatModelSubResourcesApi alloc] init];

// Partially update a threat
[apiInstance patchThreatModelThreatWith:body
    threatModelId:threatModelId
    threatId:threatId
              completionHandler: ^(Threat output, NSError* error) {
                            if (output) {
                                NSLog(@"%@", output);
                            }
                            if (error) {
                                NSLog(@"Error: %@", error);
                            }
                        }];
var TmiThreatModelingImprovedApi = require('tmi__threat_modeling_improved_api');
var defaultClient = TmiThreatModelingImprovedApi.ApiClient.instance;


var api = new TmiThreatModelingImprovedApi.ThreatModelSubResourcesApi()
var body = {
  "summary" : "Update threat name and severity",
  "value" : [ {
    "op" : "replace",
    "path" : "/name",
    "value" : "Updated SQL Injection Threat"
  }, {
    "op" : "replace",
    "path" : "/severity",
    "value" : "Critical"
  }, {
    "op" : "replace",
    "path" : "/description",
    "value" : "Updated description with more details"
  } ]
}; // {{array[threats_threat_id_body]}} 
var threatModelId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // {{UUID}} Unique identifier of the threat model (UUID)
var threatId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // {{UUID}} Unique identifier of the threat (UUID)

var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
};
api.patchThreatModelThreat(bodythreatModelIdthreatId, callback);
using System;
using System.Diagnostics;
using IO.Swagger.Api;
using IO.Swagger.Client;
using IO.Swagger.Model;

namespace Example
{
    public class patchThreatModelThreatExample
    {
        public void main()
        {


            var apiInstance = new ThreatModelSubResourcesApi();
            var body = new array[threats_threat_id_body](); // array[threats_threat_id_body] | 
            var threatModelId = new UUID(); // UUID | Unique identifier of the threat model (UUID)
            var threatId = new UUID(); // UUID | Unique identifier of the threat (UUID)

            try
            {
                // Partially update a threat
                Threat result = apiInstance.patchThreatModelThreat(body, threatModelId, threatId);
                Debug.WriteLine(result);
            }
            catch (Exception e)
            {
                Debug.Print("Exception when calling ThreatModelSubResourcesApi.patchThreatModelThreat: " + e.Message );
            }
        }
    }
}
<?php
require_once(__DIR__ . '/vendor/autoload.php');


$api_instance = new Swagger\Client\ApiThreatModelSubResourcesApi();
$body = {
  "summary" : "Update threat name and severity",
  "value" : [ {
    "op" : "replace",
    "path" : "/name",
    "value" : "Updated SQL Injection Threat"
  }, {
    "op" : "replace",
    "path" : "/severity",
    "value" : "Critical"
  }, {
    "op" : "replace",
    "path" : "/description",
    "value" : "Updated description with more details"
  } ]
}; // array[threats_threat_id_body] | 
$threatModelId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // UUID | Unique identifier of the threat model (UUID)
$threatId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // UUID | Unique identifier of the threat (UUID)

try {
    $result = $api_instance->patchThreatModelThreat($body, $threatModelId, $threatId);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling ThreatModelSubResourcesApi->patchThreatModelThreat: ', $e->getMessage(), PHP_EOL;
}
?>
use Data::Dumper;
use WWW::SwaggerClient::Configuration;
use WWW::SwaggerClient::ThreatModelSubResourcesApi;


my $api_instance = WWW::SwaggerClient::ThreatModelSubResourcesApi->new();
my $body = [WWW::SwaggerClient::Object::array[threats_threat_id_body]->new()]; # array[threats_threat_id_body] | 
my $threatModelId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; # UUID | Unique identifier of the threat model (UUID)
my $threatId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; # UUID | Unique identifier of the threat (UUID)

eval { 
    my $result = $api_instance->patchThreatModelThreat(body => $body, threatModelId => $threatModelId, threatId => $threatId);
    print Dumper($result);
};
if ($@) {
    warn "Exception when calling ThreatModelSubResourcesApi->patchThreatModelThreat: $@\n";
}
from __future__ import print_statement
import time
import swagger_client
from swagger_client.rest import ApiException
from pprint import pprint


# create an instance of the API class
api_instance = swagger_client.ThreatModelSubResourcesApi()
body = {
  "summary" : "Update threat name and severity",
  "value" : [ {
    "op" : "replace",
    "path" : "/name",
    "value" : "Updated SQL Injection Threat"
  }, {
    "op" : "replace",
    "path" : "/severity",
    "value" : "Critical"
  }, {
    "op" : "replace",
    "path" : "/description",
    "value" : "Updated description with more details"
  } ]
} # array[threats_threat_id_body] | 
threatModelId = 38400000-8cf0-11bd-b23e-10b96e4ef00d # UUID | Unique identifier of the threat model (UUID)
threatId = 38400000-8cf0-11bd-b23e-10b96e4ef00d # UUID | Unique identifier of the threat (UUID)

try: 
    # Partially update a threat
    api_response = api_instance.patch_threat_model_threat(body, threatModelId, threatId)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling ThreatModelSubResourcesApi->patchThreatModelThreat: %s\n" % e)

Parameters

Path parameters
Name Description
threat_model_id*
UUID (uuid)
Unique identifier of the threat model (UUID)
Required
threat_id*
UUID (uuid)
Unique identifier of the threat (UUID)
Required
Body parameters
Name Description
body *

Responses

Status: 200 - Threat patched successfully

Status: 400 - Error response

Status: 401 - Error response

Status: 403 - Error response

Status: 404 - Error response

Status: 500 - Error response


updateDiagramMetadataByKey

Update diagram metadata by key

Updates or creates a metadata entry for the diagram with the specified key


/threat_models/{threat_model_id}/diagrams/{diagram_id}/metadata/{key}

Usage and SDK Samples

curl -X PUT\
 -H "Authorization: Bearer [[accessToken]]"\
-H "Accept: application/json"\
-H "Content-Type: application/json"\
"http://localhost:8080/threat_models/{threat_model_id}/diagrams/{diagram_id}/metadata/{key}"
import io.swagger.client.*;
import io.swagger.client.auth.*;
import io.swagger.client.model.*;
import io.swagger.client.api.ThreatModelSubResourcesApi;

import java.io.File;
import java.util.*;

public class ThreatModelSubResourcesApiExample {

    public static void main(String[] args) {
        ApiClient defaultClient = Configuration.getDefaultApiClient();


        ThreatModelSubResourcesApi apiInstance = new ThreatModelSubResourcesApi();
        Metadata_key_body_4 body = ; // Metadata_key_body_4 | 
        UUID threatModelId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // UUID | Unique identifier of the threat model (UUID)
        UUID diagramId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // UUID | Unique identifier of the diagram (UUID)
        String key = key_example; // String | Metadata key to update
        try {
            Metadata result = apiInstance.updateDiagramMetadataByKey(body, threatModelId, diagramId, key);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling ThreatModelSubResourcesApi#updateDiagramMetadataByKey");
            e.printStackTrace();
        }
    }
}
import io.swagger.client.api.ThreatModelSubResourcesApi;

public class ThreatModelSubResourcesApiExample {

    public static void main(String[] args) {
        ThreatModelSubResourcesApi apiInstance = new ThreatModelSubResourcesApi();
        Metadata_key_body_4 body = ; // Metadata_key_body_4 | 
        UUID threatModelId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // UUID | Unique identifier of the threat model (UUID)
        UUID diagramId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // UUID | Unique identifier of the diagram (UUID)
        String key = key_example; // String | Metadata key to update
        try {
            Metadata result = apiInstance.updateDiagramMetadataByKey(body, threatModelId, diagramId, key);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling ThreatModelSubResourcesApi#updateDiagramMetadataByKey");
            e.printStackTrace();
        }
    }
}
Configuration *apiConfig = [Configuration sharedConfig];
Metadata_key_body_4 *body = ; // 
UUID *threatModelId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // Unique identifier of the threat model (UUID)
UUID *diagramId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // Unique identifier of the diagram (UUID)
String *key = key_example; // Metadata key to update

ThreatModelSubResourcesApi *apiInstance = [[ThreatModelSubResourcesApi alloc] init];

// Update diagram metadata by key
[apiInstance updateDiagramMetadataByKeyWith:body
    threatModelId:threatModelId
    diagramId:diagramId
    key:key
              completionHandler: ^(Metadata output, NSError* error) {
                            if (output) {
                                NSLog(@"%@", output);
                            }
                            if (error) {
                                NSLog(@"Error: %@", error);
                            }
                        }];
var TmiThreatModelingImprovedApi = require('tmi__threat_modeling_improved_api');
var defaultClient = TmiThreatModelingImprovedApi.ApiClient.instance;


var api = new TmiThreatModelingImprovedApi.ThreatModelSubResourcesApi()
var body = ; // {{Metadata_key_body_4}} 
var threatModelId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // {{UUID}} Unique identifier of the threat model (UUID)
var diagramId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // {{UUID}} Unique identifier of the diagram (UUID)
var key = key_example; // {{String}} Metadata key to update

var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
};
api.updateDiagramMetadataByKey(bodythreatModelIddiagramIdkey, callback);
using System;
using System.Diagnostics;
using IO.Swagger.Api;
using IO.Swagger.Client;
using IO.Swagger.Model;

namespace Example
{
    public class updateDiagramMetadataByKeyExample
    {
        public void main()
        {


            var apiInstance = new ThreatModelSubResourcesApi();
            var body = new Metadata_key_body_4(); // Metadata_key_body_4 | 
            var threatModelId = new UUID(); // UUID | Unique identifier of the threat model (UUID)
            var diagramId = new UUID(); // UUID | Unique identifier of the diagram (UUID)
            var key = key_example;  // String | Metadata key to update

            try
            {
                // Update diagram metadata by key
                Metadata result = apiInstance.updateDiagramMetadataByKey(body, threatModelId, diagramId, key);
                Debug.WriteLine(result);
            }
            catch (Exception e)
            {
                Debug.Print("Exception when calling ThreatModelSubResourcesApi.updateDiagramMetadataByKey: " + e.Message );
            }
        }
    }
}
<?php
require_once(__DIR__ . '/vendor/autoload.php');


$api_instance = new Swagger\Client\ApiThreatModelSubResourcesApi();
$body = ; // Metadata_key_body_4 | 
$threatModelId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // UUID | Unique identifier of the threat model (UUID)
$diagramId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // UUID | Unique identifier of the diagram (UUID)
$key = key_example; // String | Metadata key to update

try {
    $result = $api_instance->updateDiagramMetadataByKey($body, $threatModelId, $diagramId, $key);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling ThreatModelSubResourcesApi->updateDiagramMetadataByKey: ', $e->getMessage(), PHP_EOL;
}
?>
use Data::Dumper;
use WWW::SwaggerClient::Configuration;
use WWW::SwaggerClient::ThreatModelSubResourcesApi;


my $api_instance = WWW::SwaggerClient::ThreatModelSubResourcesApi->new();
my $body = WWW::SwaggerClient::Object::Metadata_key_body_4->new(); # Metadata_key_body_4 | 
my $threatModelId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; # UUID | Unique identifier of the threat model (UUID)
my $diagramId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; # UUID | Unique identifier of the diagram (UUID)
my $key = key_example; # String | Metadata key to update

eval { 
    my $result = $api_instance->updateDiagramMetadataByKey(body => $body, threatModelId => $threatModelId, diagramId => $diagramId, key => $key);
    print Dumper($result);
};
if ($@) {
    warn "Exception when calling ThreatModelSubResourcesApi->updateDiagramMetadataByKey: $@\n";
}
from __future__ import print_statement
import time
import swagger_client
from swagger_client.rest import ApiException
from pprint import pprint


# create an instance of the API class
api_instance = swagger_client.ThreatModelSubResourcesApi()
body =  # Metadata_key_body_4 | 
threatModelId = 38400000-8cf0-11bd-b23e-10b96e4ef00d # UUID | Unique identifier of the threat model (UUID)
diagramId = 38400000-8cf0-11bd-b23e-10b96e4ef00d # UUID | Unique identifier of the diagram (UUID)
key = key_example # String | Metadata key to update

try: 
    # Update diagram metadata by key
    api_response = api_instance.update_diagram_metadata_by_key(body, threatModelId, diagramId, key)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling ThreatModelSubResourcesApi->updateDiagramMetadataByKey: %s\n" % e)

Parameters

Path parameters
Name Description
threat_model_id*
UUID (uuid)
Unique identifier of the threat model (UUID)
Required
diagram_id*
UUID (uuid)
Unique identifier of the diagram (UUID)
Required
key*
String
Metadata key to update
Required
Body parameters
Name Description
body *

Responses

Status: 200 - Metadata entry updated successfully

Status: 400 - Error response

Status: 401 - Error response

Status: 403 - Error response

Status: 404 - Error response

Status: 500 - Error response


updateDocumentMetadataByKey

Update document metadata by key

Updates a specific metadata entry by key for the specified document


/threat_models/{threat_model_id}/documents/{document_id}/metadata/{key}

Usage and SDK Samples

curl -X PUT\
 -H "Authorization: Bearer [[accessToken]]"\
-H "Accept: application/json"\
-H "Content-Type: application/json"\
"http://localhost:8080/threat_models/{threat_model_id}/documents/{document_id}/metadata/{key}"
import io.swagger.client.*;
import io.swagger.client.auth.*;
import io.swagger.client.model.*;
import io.swagger.client.api.ThreatModelSubResourcesApi;

import java.io.File;
import java.util.*;

public class ThreatModelSubResourcesApiExample {

    public static void main(String[] args) {
        ApiClient defaultClient = Configuration.getDefaultApiClient();


        ThreatModelSubResourcesApi apiInstance = new ThreatModelSubResourcesApi();
        Metadata_key_body_1 body = ; // Metadata_key_body_1 | 
        UUID threatModelId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // UUID | Unique identifier of the threat model (UUID)
        UUID documentId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // UUID | Unique identifier of the document (UUID)
        String key = key_example; // String | Metadata key to update
        try {
            Metadata result = apiInstance.updateDocumentMetadataByKey(body, threatModelId, documentId, key);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling ThreatModelSubResourcesApi#updateDocumentMetadataByKey");
            e.printStackTrace();
        }
    }
}
import io.swagger.client.api.ThreatModelSubResourcesApi;

public class ThreatModelSubResourcesApiExample {

    public static void main(String[] args) {
        ThreatModelSubResourcesApi apiInstance = new ThreatModelSubResourcesApi();
        Metadata_key_body_1 body = ; // Metadata_key_body_1 | 
        UUID threatModelId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // UUID | Unique identifier of the threat model (UUID)
        UUID documentId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // UUID | Unique identifier of the document (UUID)
        String key = key_example; // String | Metadata key to update
        try {
            Metadata result = apiInstance.updateDocumentMetadataByKey(body, threatModelId, documentId, key);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling ThreatModelSubResourcesApi#updateDocumentMetadataByKey");
            e.printStackTrace();
        }
    }
}
Configuration *apiConfig = [Configuration sharedConfig];
Metadata_key_body_1 *body = ; // 
UUID *threatModelId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // Unique identifier of the threat model (UUID)
UUID *documentId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // Unique identifier of the document (UUID)
String *key = key_example; // Metadata key to update

ThreatModelSubResourcesApi *apiInstance = [[ThreatModelSubResourcesApi alloc] init];

// Update document metadata by key
[apiInstance updateDocumentMetadataByKeyWith:body
    threatModelId:threatModelId
    documentId:documentId
    key:key
              completionHandler: ^(Metadata output, NSError* error) {
                            if (output) {
                                NSLog(@"%@", output);
                            }
                            if (error) {
                                NSLog(@"Error: %@", error);
                            }
                        }];
var TmiThreatModelingImprovedApi = require('tmi__threat_modeling_improved_api');
var defaultClient = TmiThreatModelingImprovedApi.ApiClient.instance;


var api = new TmiThreatModelingImprovedApi.ThreatModelSubResourcesApi()
var body = ; // {{Metadata_key_body_1}} 
var threatModelId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // {{UUID}} Unique identifier of the threat model (UUID)
var documentId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // {{UUID}} Unique identifier of the document (UUID)
var key = key_example; // {{String}} Metadata key to update

var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
};
api.updateDocumentMetadataByKey(bodythreatModelIddocumentIdkey, callback);
using System;
using System.Diagnostics;
using IO.Swagger.Api;
using IO.Swagger.Client;
using IO.Swagger.Model;

namespace Example
{
    public class updateDocumentMetadataByKeyExample
    {
        public void main()
        {


            var apiInstance = new ThreatModelSubResourcesApi();
            var body = new Metadata_key_body_1(); // Metadata_key_body_1 | 
            var threatModelId = new UUID(); // UUID | Unique identifier of the threat model (UUID)
            var documentId = new UUID(); // UUID | Unique identifier of the document (UUID)
            var key = key_example;  // String | Metadata key to update

            try
            {
                // Update document metadata by key
                Metadata result = apiInstance.updateDocumentMetadataByKey(body, threatModelId, documentId, key);
                Debug.WriteLine(result);
            }
            catch (Exception e)
            {
                Debug.Print("Exception when calling ThreatModelSubResourcesApi.updateDocumentMetadataByKey: " + e.Message );
            }
        }
    }
}
<?php
require_once(__DIR__ . '/vendor/autoload.php');


$api_instance = new Swagger\Client\ApiThreatModelSubResourcesApi();
$body = ; // Metadata_key_body_1 | 
$threatModelId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // UUID | Unique identifier of the threat model (UUID)
$documentId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // UUID | Unique identifier of the document (UUID)
$key = key_example; // String | Metadata key to update

try {
    $result = $api_instance->updateDocumentMetadataByKey($body, $threatModelId, $documentId, $key);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling ThreatModelSubResourcesApi->updateDocumentMetadataByKey: ', $e->getMessage(), PHP_EOL;
}
?>
use Data::Dumper;
use WWW::SwaggerClient::Configuration;
use WWW::SwaggerClient::ThreatModelSubResourcesApi;


my $api_instance = WWW::SwaggerClient::ThreatModelSubResourcesApi->new();
my $body = WWW::SwaggerClient::Object::Metadata_key_body_1->new(); # Metadata_key_body_1 | 
my $threatModelId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; # UUID | Unique identifier of the threat model (UUID)
my $documentId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; # UUID | Unique identifier of the document (UUID)
my $key = key_example; # String | Metadata key to update

eval { 
    my $result = $api_instance->updateDocumentMetadataByKey(body => $body, threatModelId => $threatModelId, documentId => $documentId, key => $key);
    print Dumper($result);
};
if ($@) {
    warn "Exception when calling ThreatModelSubResourcesApi->updateDocumentMetadataByKey: $@\n";
}
from __future__ import print_statement
import time
import swagger_client
from swagger_client.rest import ApiException
from pprint import pprint


# create an instance of the API class
api_instance = swagger_client.ThreatModelSubResourcesApi()
body =  # Metadata_key_body_1 | 
threatModelId = 38400000-8cf0-11bd-b23e-10b96e4ef00d # UUID | Unique identifier of the threat model (UUID)
documentId = 38400000-8cf0-11bd-b23e-10b96e4ef00d # UUID | Unique identifier of the document (UUID)
key = key_example # String | Metadata key to update

try: 
    # Update document metadata by key
    api_response = api_instance.update_document_metadata_by_key(body, threatModelId, documentId, key)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling ThreatModelSubResourcesApi->updateDocumentMetadataByKey: %s\n" % e)

Parameters

Path parameters
Name Description
threat_model_id*
UUID (uuid)
Unique identifier of the threat model (UUID)
Required
document_id*
UUID (uuid)
Unique identifier of the document (UUID)
Required
key*
String
Metadata key to update
Required
Body parameters
Name Description
body *

Responses

Status: 200 - Metadata entry updated successfully

Status: 400 - Error response

Status: 401 - Error response

Status: 403 - Error response

Status: 404 - Error response

Status: 500 - Error response


updateNoteMetadataByKey

Update note metadata by key

Updates a specific metadata entry by key for the specified note


/threat_models/{threat_model_id}/notes/{note_id}/metadata/{key}

Usage and SDK Samples

curl -X PUT\
 -H "Authorization: Bearer [[accessToken]]"\
-H "Accept: application/json"\
-H "Content-Type: application/json"\
"http://localhost:8080/threat_models/{threat_model_id}/notes/{note_id}/metadata/{key}"
import io.swagger.client.*;
import io.swagger.client.auth.*;
import io.swagger.client.model.*;
import io.swagger.client.api.ThreatModelSubResourcesApi;

import java.io.File;
import java.util.*;

public class ThreatModelSubResourcesApiExample {

    public static void main(String[] args) {
        ApiClient defaultClient = Configuration.getDefaultApiClient();


        ThreatModelSubResourcesApi apiInstance = new ThreatModelSubResourcesApi();
        Metadata_key_body_5 body = ; // Metadata_key_body_5 | 
        UUID threatModelId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // UUID | Unique identifier of the threat model (UUID)
        UUID noteId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // UUID | Unique identifier of the note (UUID)
        String key = key_example; // String | Metadata key to update
        try {
            Metadata result = apiInstance.updateNoteMetadataByKey(body, threatModelId, noteId, key);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling ThreatModelSubResourcesApi#updateNoteMetadataByKey");
            e.printStackTrace();
        }
    }
}
import io.swagger.client.api.ThreatModelSubResourcesApi;

public class ThreatModelSubResourcesApiExample {

    public static void main(String[] args) {
        ThreatModelSubResourcesApi apiInstance = new ThreatModelSubResourcesApi();
        Metadata_key_body_5 body = ; // Metadata_key_body_5 | 
        UUID threatModelId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // UUID | Unique identifier of the threat model (UUID)
        UUID noteId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // UUID | Unique identifier of the note (UUID)
        String key = key_example; // String | Metadata key to update
        try {
            Metadata result = apiInstance.updateNoteMetadataByKey(body, threatModelId, noteId, key);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling ThreatModelSubResourcesApi#updateNoteMetadataByKey");
            e.printStackTrace();
        }
    }
}
Configuration *apiConfig = [Configuration sharedConfig];
Metadata_key_body_5 *body = ; // 
UUID *threatModelId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // Unique identifier of the threat model (UUID)
UUID *noteId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // Unique identifier of the note (UUID)
String *key = key_example; // Metadata key to update

ThreatModelSubResourcesApi *apiInstance = [[ThreatModelSubResourcesApi alloc] init];

// Update note metadata by key
[apiInstance updateNoteMetadataByKeyWith:body
    threatModelId:threatModelId
    noteId:noteId
    key:key
              completionHandler: ^(Metadata output, NSError* error) {
                            if (output) {
                                NSLog(@"%@", output);
                            }
                            if (error) {
                                NSLog(@"Error: %@", error);
                            }
                        }];
var TmiThreatModelingImprovedApi = require('tmi__threat_modeling_improved_api');
var defaultClient = TmiThreatModelingImprovedApi.ApiClient.instance;


var api = new TmiThreatModelingImprovedApi.ThreatModelSubResourcesApi()
var body = ; // {{Metadata_key_body_5}} 
var threatModelId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // {{UUID}} Unique identifier of the threat model (UUID)
var noteId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // {{UUID}} Unique identifier of the note (UUID)
var key = key_example; // {{String}} Metadata key to update

var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
};
api.updateNoteMetadataByKey(bodythreatModelIdnoteIdkey, callback);
using System;
using System.Diagnostics;
using IO.Swagger.Api;
using IO.Swagger.Client;
using IO.Swagger.Model;

namespace Example
{
    public class updateNoteMetadataByKeyExample
    {
        public void main()
        {


            var apiInstance = new ThreatModelSubResourcesApi();
            var body = new Metadata_key_body_5(); // Metadata_key_body_5 | 
            var threatModelId = new UUID(); // UUID | Unique identifier of the threat model (UUID)
            var noteId = new UUID(); // UUID | Unique identifier of the note (UUID)
            var key = key_example;  // String | Metadata key to update

            try
            {
                // Update note metadata by key
                Metadata result = apiInstance.updateNoteMetadataByKey(body, threatModelId, noteId, key);
                Debug.WriteLine(result);
            }
            catch (Exception e)
            {
                Debug.Print("Exception when calling ThreatModelSubResourcesApi.updateNoteMetadataByKey: " + e.Message );
            }
        }
    }
}
<?php
require_once(__DIR__ . '/vendor/autoload.php');


$api_instance = new Swagger\Client\ApiThreatModelSubResourcesApi();
$body = ; // Metadata_key_body_5 | 
$threatModelId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // UUID | Unique identifier of the threat model (UUID)
$noteId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // UUID | Unique identifier of the note (UUID)
$key = key_example; // String | Metadata key to update

try {
    $result = $api_instance->updateNoteMetadataByKey($body, $threatModelId, $noteId, $key);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling ThreatModelSubResourcesApi->updateNoteMetadataByKey: ', $e->getMessage(), PHP_EOL;
}
?>
use Data::Dumper;
use WWW::SwaggerClient::Configuration;
use WWW::SwaggerClient::ThreatModelSubResourcesApi;


my $api_instance = WWW::SwaggerClient::ThreatModelSubResourcesApi->new();
my $body = WWW::SwaggerClient::Object::Metadata_key_body_5->new(); # Metadata_key_body_5 | 
my $threatModelId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; # UUID | Unique identifier of the threat model (UUID)
my $noteId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; # UUID | Unique identifier of the note (UUID)
my $key = key_example; # String | Metadata key to update

eval { 
    my $result = $api_instance->updateNoteMetadataByKey(body => $body, threatModelId => $threatModelId, noteId => $noteId, key => $key);
    print Dumper($result);
};
if ($@) {
    warn "Exception when calling ThreatModelSubResourcesApi->updateNoteMetadataByKey: $@\n";
}
from __future__ import print_statement
import time
import swagger_client
from swagger_client.rest import ApiException
from pprint import pprint


# create an instance of the API class
api_instance = swagger_client.ThreatModelSubResourcesApi()
body =  # Metadata_key_body_5 | 
threatModelId = 38400000-8cf0-11bd-b23e-10b96e4ef00d # UUID | Unique identifier of the threat model (UUID)
noteId = 38400000-8cf0-11bd-b23e-10b96e4ef00d # UUID | Unique identifier of the note (UUID)
key = key_example # String | Metadata key to update

try: 
    # Update note metadata by key
    api_response = api_instance.update_note_metadata_by_key(body, threatModelId, noteId, key)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling ThreatModelSubResourcesApi->updateNoteMetadataByKey: %s\n" % e)

Parameters

Path parameters
Name Description
threat_model_id*
UUID (uuid)
Unique identifier of the threat model (UUID)
Required
note_id*
UUID (uuid)
Unique identifier of the note (UUID)
Required
key*
String
Metadata key to update
Required
Body parameters
Name Description
body *

Responses

Status: 200 - Metadata entry updated successfully

Status: 400 - Error response

Status: 401 - Error response

Status: 403 - Error response

Status: 404 - Error response

Status: 500 - Error response


updateRepositoryMetadataByKey

Update source metadata by key

Updates a specific metadata entry by key for the specified source reference


/threat_models/{threat_model_id}/repositories/{repository_id}/metadata/{key}

Usage and SDK Samples

curl -X PUT\
 -H "Authorization: Bearer [[accessToken]]"\
-H "Accept: application/json"\
-H "Content-Type: application/json"\
"http://localhost:8080/threat_models/{threat_model_id}/repositories/{repository_id}/metadata/{key}"
import io.swagger.client.*;
import io.swagger.client.auth.*;
import io.swagger.client.model.*;
import io.swagger.client.api.ThreatModelSubResourcesApi;

import java.io.File;
import java.util.*;

public class ThreatModelSubResourcesApiExample {

    public static void main(String[] args) {
        ApiClient defaultClient = Configuration.getDefaultApiClient();


        ThreatModelSubResourcesApi apiInstance = new ThreatModelSubResourcesApi();
        Metadata_key_body_2 body = ; // Metadata_key_body_2 | 
        UUID threatModelId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // UUID | Unique identifier of the threat model (UUID)
        UUID repositoryId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // UUID | Unique identifier of the source reference (UUID)
        String key = key_example; // String | Metadata key to update
        try {
            Metadata result = apiInstance.updateRepositoryMetadataByKey(body, threatModelId, repositoryId, key);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling ThreatModelSubResourcesApi#updateRepositoryMetadataByKey");
            e.printStackTrace();
        }
    }
}
import io.swagger.client.api.ThreatModelSubResourcesApi;

public class ThreatModelSubResourcesApiExample {

    public static void main(String[] args) {
        ThreatModelSubResourcesApi apiInstance = new ThreatModelSubResourcesApi();
        Metadata_key_body_2 body = ; // Metadata_key_body_2 | 
        UUID threatModelId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // UUID | Unique identifier of the threat model (UUID)
        UUID repositoryId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // UUID | Unique identifier of the source reference (UUID)
        String key = key_example; // String | Metadata key to update
        try {
            Metadata result = apiInstance.updateRepositoryMetadataByKey(body, threatModelId, repositoryId, key);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling ThreatModelSubResourcesApi#updateRepositoryMetadataByKey");
            e.printStackTrace();
        }
    }
}
Configuration *apiConfig = [Configuration sharedConfig];
Metadata_key_body_2 *body = ; // 
UUID *threatModelId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // Unique identifier of the threat model (UUID)
UUID *repositoryId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // Unique identifier of the source reference (UUID)
String *key = key_example; // Metadata key to update

ThreatModelSubResourcesApi *apiInstance = [[ThreatModelSubResourcesApi alloc] init];

// Update source metadata by key
[apiInstance updateRepositoryMetadataByKeyWith:body
    threatModelId:threatModelId
    repositoryId:repositoryId
    key:key
              completionHandler: ^(Metadata output, NSError* error) {
                            if (output) {
                                NSLog(@"%@", output);
                            }
                            if (error) {
                                NSLog(@"Error: %@", error);
                            }
                        }];
var TmiThreatModelingImprovedApi = require('tmi__threat_modeling_improved_api');
var defaultClient = TmiThreatModelingImprovedApi.ApiClient.instance;


var api = new TmiThreatModelingImprovedApi.ThreatModelSubResourcesApi()
var body = ; // {{Metadata_key_body_2}} 
var threatModelId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // {{UUID}} Unique identifier of the threat model (UUID)
var repositoryId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // {{UUID}} Unique identifier of the source reference (UUID)
var key = key_example; // {{String}} Metadata key to update

var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
};
api.updateRepositoryMetadataByKey(bodythreatModelIdrepositoryIdkey, callback);
using System;
using System.Diagnostics;
using IO.Swagger.Api;
using IO.Swagger.Client;
using IO.Swagger.Model;

namespace Example
{
    public class updateRepositoryMetadataByKeyExample
    {
        public void main()
        {


            var apiInstance = new ThreatModelSubResourcesApi();
            var body = new Metadata_key_body_2(); // Metadata_key_body_2 | 
            var threatModelId = new UUID(); // UUID | Unique identifier of the threat model (UUID)
            var repositoryId = new UUID(); // UUID | Unique identifier of the source reference (UUID)
            var key = key_example;  // String | Metadata key to update

            try
            {
                // Update source metadata by key
                Metadata result = apiInstance.updateRepositoryMetadataByKey(body, threatModelId, repositoryId, key);
                Debug.WriteLine(result);
            }
            catch (Exception e)
            {
                Debug.Print("Exception when calling ThreatModelSubResourcesApi.updateRepositoryMetadataByKey: " + e.Message );
            }
        }
    }
}
<?php
require_once(__DIR__ . '/vendor/autoload.php');


$api_instance = new Swagger\Client\ApiThreatModelSubResourcesApi();
$body = ; // Metadata_key_body_2 | 
$threatModelId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // UUID | Unique identifier of the threat model (UUID)
$repositoryId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // UUID | Unique identifier of the source reference (UUID)
$key = key_example; // String | Metadata key to update

try {
    $result = $api_instance->updateRepositoryMetadataByKey($body, $threatModelId, $repositoryId, $key);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling ThreatModelSubResourcesApi->updateRepositoryMetadataByKey: ', $e->getMessage(), PHP_EOL;
}
?>
use Data::Dumper;
use WWW::SwaggerClient::Configuration;
use WWW::SwaggerClient::ThreatModelSubResourcesApi;


my $api_instance = WWW::SwaggerClient::ThreatModelSubResourcesApi->new();
my $body = WWW::SwaggerClient::Object::Metadata_key_body_2->new(); # Metadata_key_body_2 | 
my $threatModelId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; # UUID | Unique identifier of the threat model (UUID)
my $repositoryId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; # UUID | Unique identifier of the source reference (UUID)
my $key = key_example; # String | Metadata key to update

eval { 
    my $result = $api_instance->updateRepositoryMetadataByKey(body => $body, threatModelId => $threatModelId, repositoryId => $repositoryId, key => $key);
    print Dumper($result);
};
if ($@) {
    warn "Exception when calling ThreatModelSubResourcesApi->updateRepositoryMetadataByKey: $@\n";
}
from __future__ import print_statement
import time
import swagger_client
from swagger_client.rest import ApiException
from pprint import pprint


# create an instance of the API class
api_instance = swagger_client.ThreatModelSubResourcesApi()
body =  # Metadata_key_body_2 | 
threatModelId = 38400000-8cf0-11bd-b23e-10b96e4ef00d # UUID | Unique identifier of the threat model (UUID)
repositoryId = 38400000-8cf0-11bd-b23e-10b96e4ef00d # UUID | Unique identifier of the source reference (UUID)
key = key_example # String | Metadata key to update

try: 
    # Update source metadata by key
    api_response = api_instance.update_repository_metadata_by_key(body, threatModelId, repositoryId, key)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling ThreatModelSubResourcesApi->updateRepositoryMetadataByKey: %s\n" % e)

Parameters

Path parameters
Name Description
threat_model_id*
UUID (uuid)
Unique identifier of the threat model (UUID)
Required
repository_id*
UUID (uuid)
Unique identifier of the source reference (UUID)
Required
key*
String
Metadata key to update
Required
Body parameters
Name Description
body *

Responses

Status: 200 - Metadata entry updated successfully

Status: 400 - Error response

Status: 401 - Error response

Status: 403 - Error response

Status: 404 - Error response

Status: 500 - Error response


updateThreatMetadataByKey

Update threat metadata by key

Updates a specific metadata entry by key for the specified threat


/threat_models/{threat_model_id}/threats/{threat_id}/metadata/{key}

Usage and SDK Samples

curl -X PUT\
 -H "Authorization: Bearer [[accessToken]]"\
-H "Accept: application/json"\
-H "Content-Type: application/json"\
"http://localhost:8080/threat_models/{threat_model_id}/threats/{threat_id}/metadata/{key}"
import io.swagger.client.*;
import io.swagger.client.auth.*;
import io.swagger.client.model.*;
import io.swagger.client.api.ThreatModelSubResourcesApi;

import java.io.File;
import java.util.*;

public class ThreatModelSubResourcesApiExample {

    public static void main(String[] args) {
        ApiClient defaultClient = Configuration.getDefaultApiClient();


        ThreatModelSubResourcesApi apiInstance = new ThreatModelSubResourcesApi();
        Metadata_key_body body = ; // Metadata_key_body | 
        UUID threatModelId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // UUID | Unique identifier of the threat model (UUID)
        UUID threatId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // UUID | Unique identifier of the threat (UUID)
        String key = key_example; // String | Metadata key to update
        try {
            Metadata result = apiInstance.updateThreatMetadataByKey(body, threatModelId, threatId, key);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling ThreatModelSubResourcesApi#updateThreatMetadataByKey");
            e.printStackTrace();
        }
    }
}
import io.swagger.client.api.ThreatModelSubResourcesApi;

public class ThreatModelSubResourcesApiExample {

    public static void main(String[] args) {
        ThreatModelSubResourcesApi apiInstance = new ThreatModelSubResourcesApi();
        Metadata_key_body body = ; // Metadata_key_body | 
        UUID threatModelId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // UUID | Unique identifier of the threat model (UUID)
        UUID threatId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // UUID | Unique identifier of the threat (UUID)
        String key = key_example; // String | Metadata key to update
        try {
            Metadata result = apiInstance.updateThreatMetadataByKey(body, threatModelId, threatId, key);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling ThreatModelSubResourcesApi#updateThreatMetadataByKey");
            e.printStackTrace();
        }
    }
}
Configuration *apiConfig = [Configuration sharedConfig];
Metadata_key_body *body = ; // 
UUID *threatModelId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // Unique identifier of the threat model (UUID)
UUID *threatId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // Unique identifier of the threat (UUID)
String *key = key_example; // Metadata key to update

ThreatModelSubResourcesApi *apiInstance = [[ThreatModelSubResourcesApi alloc] init];

// Update threat metadata by key
[apiInstance updateThreatMetadataByKeyWith:body
    threatModelId:threatModelId
    threatId:threatId
    key:key
              completionHandler: ^(Metadata output, NSError* error) {
                            if (output) {
                                NSLog(@"%@", output);
                            }
                            if (error) {
                                NSLog(@"Error: %@", error);
                            }
                        }];
var TmiThreatModelingImprovedApi = require('tmi__threat_modeling_improved_api');
var defaultClient = TmiThreatModelingImprovedApi.ApiClient.instance;


var api = new TmiThreatModelingImprovedApi.ThreatModelSubResourcesApi()
var body = ; // {{Metadata_key_body}} 
var threatModelId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // {{UUID}} Unique identifier of the threat model (UUID)
var threatId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // {{UUID}} Unique identifier of the threat (UUID)
var key = key_example; // {{String}} Metadata key to update

var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
};
api.updateThreatMetadataByKey(bodythreatModelIdthreatIdkey, callback);
using System;
using System.Diagnostics;
using IO.Swagger.Api;
using IO.Swagger.Client;
using IO.Swagger.Model;

namespace Example
{
    public class updateThreatMetadataByKeyExample
    {
        public void main()
        {


            var apiInstance = new ThreatModelSubResourcesApi();
            var body = new Metadata_key_body(); // Metadata_key_body | 
            var threatModelId = new UUID(); // UUID | Unique identifier of the threat model (UUID)
            var threatId = new UUID(); // UUID | Unique identifier of the threat (UUID)
            var key = key_example;  // String | Metadata key to update

            try
            {
                // Update threat metadata by key
                Metadata result = apiInstance.updateThreatMetadataByKey(body, threatModelId, threatId, key);
                Debug.WriteLine(result);
            }
            catch (Exception e)
            {
                Debug.Print("Exception when calling ThreatModelSubResourcesApi.updateThreatMetadataByKey: " + e.Message );
            }
        }
    }
}
<?php
require_once(__DIR__ . '/vendor/autoload.php');


$api_instance = new Swagger\Client\ApiThreatModelSubResourcesApi();
$body = ; // Metadata_key_body | 
$threatModelId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // UUID | Unique identifier of the threat model (UUID)
$threatId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // UUID | Unique identifier of the threat (UUID)
$key = key_example; // String | Metadata key to update

try {
    $result = $api_instance->updateThreatMetadataByKey($body, $threatModelId, $threatId, $key);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling ThreatModelSubResourcesApi->updateThreatMetadataByKey: ', $e->getMessage(), PHP_EOL;
}
?>
use Data::Dumper;
use WWW::SwaggerClient::Configuration;
use WWW::SwaggerClient::ThreatModelSubResourcesApi;


my $api_instance = WWW::SwaggerClient::ThreatModelSubResourcesApi->new();
my $body = WWW::SwaggerClient::Object::Metadata_key_body->new(); # Metadata_key_body | 
my $threatModelId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; # UUID | Unique identifier of the threat model (UUID)
my $threatId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; # UUID | Unique identifier of the threat (UUID)
my $key = key_example; # String | Metadata key to update

eval { 
    my $result = $api_instance->updateThreatMetadataByKey(body => $body, threatModelId => $threatModelId, threatId => $threatId, key => $key);
    print Dumper($result);
};
if ($@) {
    warn "Exception when calling ThreatModelSubResourcesApi->updateThreatMetadataByKey: $@\n";
}
from __future__ import print_statement
import time
import swagger_client
from swagger_client.rest import ApiException
from pprint import pprint


# create an instance of the API class
api_instance = swagger_client.ThreatModelSubResourcesApi()
body =  # Metadata_key_body | 
threatModelId = 38400000-8cf0-11bd-b23e-10b96e4ef00d # UUID | Unique identifier of the threat model (UUID)
threatId = 38400000-8cf0-11bd-b23e-10b96e4ef00d # UUID | Unique identifier of the threat (UUID)
key = key_example # String | Metadata key to update

try: 
    # Update threat metadata by key
    api_response = api_instance.update_threat_metadata_by_key(body, threatModelId, threatId, key)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling ThreatModelSubResourcesApi->updateThreatMetadataByKey: %s\n" % e)

Parameters

Path parameters
Name Description
threat_model_id*
UUID (uuid)
Unique identifier of the threat model (UUID)
Required
threat_id*
UUID (uuid)
Unique identifier of the threat (UUID)
Required
key*
String
Metadata key to update
Required
Body parameters
Name Description
body *

Responses

Status: 200 - Metadata entry updated successfully

Status: 400 - Error response

Status: 401 - Error response

Status: 403 - Error response

Status: 404 - Error response

Status: 500 - Error response


updateThreatModelAsset

Update an asset

Updates an existing asset within the specified threat model


/threat_models/{threat_model_id}/assets/{asset_id}

Usage and SDK Samples

curl -X PUT\
 -H "Authorization: Bearer [[accessToken]]"\
-H "Accept: application/json"\
-H "Content-Type: application/json"\
"http://localhost:8080/threat_models/{threat_model_id}/assets/{asset_id}"
import io.swagger.client.*;
import io.swagger.client.auth.*;
import io.swagger.client.model.*;
import io.swagger.client.api.ThreatModelSubResourcesApi;

import java.io.File;
import java.util.*;

public class ThreatModelSubResourcesApiExample {

    public static void main(String[] args) {
        ApiClient defaultClient = Configuration.getDefaultApiClient();


        ThreatModelSubResourcesApi apiInstance = new ThreatModelSubResourcesApi();
        AssetInput body = ; // AssetInput | 
        UUID threatModelId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // UUID | Unique identifier of the threat model (UUID)
        UUID assetId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // UUID | Unique identifier of the asset (UUID)
        try {
            Asset result = apiInstance.updateThreatModelAsset(body, threatModelId, assetId);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling ThreatModelSubResourcesApi#updateThreatModelAsset");
            e.printStackTrace();
        }
    }
}
import io.swagger.client.api.ThreatModelSubResourcesApi;

public class ThreatModelSubResourcesApiExample {

    public static void main(String[] args) {
        ThreatModelSubResourcesApi apiInstance = new ThreatModelSubResourcesApi();
        AssetInput body = ; // AssetInput | 
        UUID threatModelId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // UUID | Unique identifier of the threat model (UUID)
        UUID assetId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // UUID | Unique identifier of the asset (UUID)
        try {
            Asset result = apiInstance.updateThreatModelAsset(body, threatModelId, assetId);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling ThreatModelSubResourcesApi#updateThreatModelAsset");
            e.printStackTrace();
        }
    }
}
Configuration *apiConfig = [Configuration sharedConfig];
AssetInput *body = ; // 
UUID *threatModelId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // Unique identifier of the threat model (UUID)
UUID *assetId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // Unique identifier of the asset (UUID)

ThreatModelSubResourcesApi *apiInstance = [[ThreatModelSubResourcesApi alloc] init];

// Update an asset
[apiInstance updateThreatModelAssetWith:body
    threatModelId:threatModelId
    assetId:assetId
              completionHandler: ^(Asset output, NSError* error) {
                            if (output) {
                                NSLog(@"%@", output);
                            }
                            if (error) {
                                NSLog(@"Error: %@", error);
                            }
                        }];
var TmiThreatModelingImprovedApi = require('tmi__threat_modeling_improved_api');
var defaultClient = TmiThreatModelingImprovedApi.ApiClient.instance;


var api = new TmiThreatModelingImprovedApi.ThreatModelSubResourcesApi()
var body = ; // {{AssetInput}} 
var threatModelId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // {{UUID}} Unique identifier of the threat model (UUID)
var assetId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // {{UUID}} Unique identifier of the asset (UUID)

var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
};
api.updateThreatModelAsset(bodythreatModelIdassetId, callback);
using System;
using System.Diagnostics;
using IO.Swagger.Api;
using IO.Swagger.Client;
using IO.Swagger.Model;

namespace Example
{
    public class updateThreatModelAssetExample
    {
        public void main()
        {


            var apiInstance = new ThreatModelSubResourcesApi();
            var body = new AssetInput(); // AssetInput | 
            var threatModelId = new UUID(); // UUID | Unique identifier of the threat model (UUID)
            var assetId = new UUID(); // UUID | Unique identifier of the asset (UUID)

            try
            {
                // Update an asset
                Asset result = apiInstance.updateThreatModelAsset(body, threatModelId, assetId);
                Debug.WriteLine(result);
            }
            catch (Exception e)
            {
                Debug.Print("Exception when calling ThreatModelSubResourcesApi.updateThreatModelAsset: " + e.Message );
            }
        }
    }
}
<?php
require_once(__DIR__ . '/vendor/autoload.php');


$api_instance = new Swagger\Client\ApiThreatModelSubResourcesApi();
$body = ; // AssetInput | 
$threatModelId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // UUID | Unique identifier of the threat model (UUID)
$assetId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // UUID | Unique identifier of the asset (UUID)

try {
    $result = $api_instance->updateThreatModelAsset($body, $threatModelId, $assetId);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling ThreatModelSubResourcesApi->updateThreatModelAsset: ', $e->getMessage(), PHP_EOL;
}
?>
use Data::Dumper;
use WWW::SwaggerClient::Configuration;
use WWW::SwaggerClient::ThreatModelSubResourcesApi;


my $api_instance = WWW::SwaggerClient::ThreatModelSubResourcesApi->new();
my $body = WWW::SwaggerClient::Object::AssetInput->new(); # AssetInput | 
my $threatModelId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; # UUID | Unique identifier of the threat model (UUID)
my $assetId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; # UUID | Unique identifier of the asset (UUID)

eval { 
    my $result = $api_instance->updateThreatModelAsset(body => $body, threatModelId => $threatModelId, assetId => $assetId);
    print Dumper($result);
};
if ($@) {
    warn "Exception when calling ThreatModelSubResourcesApi->updateThreatModelAsset: $@\n";
}
from __future__ import print_statement
import time
import swagger_client
from swagger_client.rest import ApiException
from pprint import pprint


# create an instance of the API class
api_instance = swagger_client.ThreatModelSubResourcesApi()
body =  # AssetInput | 
threatModelId = 38400000-8cf0-11bd-b23e-10b96e4ef00d # UUID | Unique identifier of the threat model (UUID)
assetId = 38400000-8cf0-11bd-b23e-10b96e4ef00d # UUID | Unique identifier of the asset (UUID)

try: 
    # Update an asset
    api_response = api_instance.update_threat_model_asset(body, threatModelId, assetId)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling ThreatModelSubResourcesApi->updateThreatModelAsset: %s\n" % e)

Parameters

Path parameters
Name Description
threat_model_id*
UUID (uuid)
Unique identifier of the threat model (UUID)
Required
asset_id*
UUID (uuid)
Unique identifier of the asset (UUID)
Required
Body parameters
Name Description
body *

Responses

Status: 200 - Asset updated successfully

Status: 400 - Error response

Status: 401 - Error response

Status: 403 - Error response

Status: 404 - Error response

Status: 500 - Error response


updateThreatModelAssetMetadata

Update asset metadata

Updates an existing metadata value by its key


/threat_models/{threat_model_id}/assets/{asset_id}/metadata/{key}

Usage and SDK Samples

curl -X PUT\
 -H "Authorization: Bearer [[accessToken]]"\
-H "Accept: application/json"\
-H "Content-Type: application/json"\
"http://localhost:8080/threat_models/{threat_model_id}/assets/{asset_id}/metadata/{key}"
import io.swagger.client.*;
import io.swagger.client.auth.*;
import io.swagger.client.model.*;
import io.swagger.client.api.ThreatModelSubResourcesApi;

import java.io.File;
import java.util.*;

public class ThreatModelSubResourcesApiExample {

    public static void main(String[] args) {
        ApiClient defaultClient = Configuration.getDefaultApiClient();


        ThreatModelSubResourcesApi apiInstance = new ThreatModelSubResourcesApi();
        Metadata body = ; // Metadata | 
        UUID threatModelId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // UUID | Unique identifier of the threat model (UUID)
        UUID assetId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // UUID | Unique identifier of the asset (UUID)
        String key = key_example; // String | Metadata key
        try {
            Metadata result = apiInstance.updateThreatModelAssetMetadata(body, threatModelId, assetId, key);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling ThreatModelSubResourcesApi#updateThreatModelAssetMetadata");
            e.printStackTrace();
        }
    }
}
import io.swagger.client.api.ThreatModelSubResourcesApi;

public class ThreatModelSubResourcesApiExample {

    public static void main(String[] args) {
        ThreatModelSubResourcesApi apiInstance = new ThreatModelSubResourcesApi();
        Metadata body = ; // Metadata | 
        UUID threatModelId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // UUID | Unique identifier of the threat model (UUID)
        UUID assetId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // UUID | Unique identifier of the asset (UUID)
        String key = key_example; // String | Metadata key
        try {
            Metadata result = apiInstance.updateThreatModelAssetMetadata(body, threatModelId, assetId, key);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling ThreatModelSubResourcesApi#updateThreatModelAssetMetadata");
            e.printStackTrace();
        }
    }
}
Configuration *apiConfig = [Configuration sharedConfig];
Metadata *body = ; // 
UUID *threatModelId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // Unique identifier of the threat model (UUID)
UUID *assetId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // Unique identifier of the asset (UUID)
String *key = key_example; // Metadata key

ThreatModelSubResourcesApi *apiInstance = [[ThreatModelSubResourcesApi alloc] init];

// Update asset metadata
[apiInstance updateThreatModelAssetMetadataWith:body
    threatModelId:threatModelId
    assetId:assetId
    key:key
              completionHandler: ^(Metadata output, NSError* error) {
                            if (output) {
                                NSLog(@"%@", output);
                            }
                            if (error) {
                                NSLog(@"Error: %@", error);
                            }
                        }];
var TmiThreatModelingImprovedApi = require('tmi__threat_modeling_improved_api');
var defaultClient = TmiThreatModelingImprovedApi.ApiClient.instance;


var api = new TmiThreatModelingImprovedApi.ThreatModelSubResourcesApi()
var body = ; // {{Metadata}} 
var threatModelId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // {{UUID}} Unique identifier of the threat model (UUID)
var assetId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // {{UUID}} Unique identifier of the asset (UUID)
var key = key_example; // {{String}} Metadata key

var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
};
api.updateThreatModelAssetMetadata(bodythreatModelIdassetIdkey, callback);
using System;
using System.Diagnostics;
using IO.Swagger.Api;
using IO.Swagger.Client;
using IO.Swagger.Model;

namespace Example
{
    public class updateThreatModelAssetMetadataExample
    {
        public void main()
        {


            var apiInstance = new ThreatModelSubResourcesApi();
            var body = new Metadata(); // Metadata | 
            var threatModelId = new UUID(); // UUID | Unique identifier of the threat model (UUID)
            var assetId = new UUID(); // UUID | Unique identifier of the asset (UUID)
            var key = key_example;  // String | Metadata key

            try
            {
                // Update asset metadata
                Metadata result = apiInstance.updateThreatModelAssetMetadata(body, threatModelId, assetId, key);
                Debug.WriteLine(result);
            }
            catch (Exception e)
            {
                Debug.Print("Exception when calling ThreatModelSubResourcesApi.updateThreatModelAssetMetadata: " + e.Message );
            }
        }
    }
}
<?php
require_once(__DIR__ . '/vendor/autoload.php');


$api_instance = new Swagger\Client\ApiThreatModelSubResourcesApi();
$body = ; // Metadata | 
$threatModelId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // UUID | Unique identifier of the threat model (UUID)
$assetId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // UUID | Unique identifier of the asset (UUID)
$key = key_example; // String | Metadata key

try {
    $result = $api_instance->updateThreatModelAssetMetadata($body, $threatModelId, $assetId, $key);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling ThreatModelSubResourcesApi->updateThreatModelAssetMetadata: ', $e->getMessage(), PHP_EOL;
}
?>
use Data::Dumper;
use WWW::SwaggerClient::Configuration;
use WWW::SwaggerClient::ThreatModelSubResourcesApi;


my $api_instance = WWW::SwaggerClient::ThreatModelSubResourcesApi->new();
my $body = WWW::SwaggerClient::Object::Metadata->new(); # Metadata | 
my $threatModelId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; # UUID | Unique identifier of the threat model (UUID)
my $assetId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; # UUID | Unique identifier of the asset (UUID)
my $key = key_example; # String | Metadata key

eval { 
    my $result = $api_instance->updateThreatModelAssetMetadata(body => $body, threatModelId => $threatModelId, assetId => $assetId, key => $key);
    print Dumper($result);
};
if ($@) {
    warn "Exception when calling ThreatModelSubResourcesApi->updateThreatModelAssetMetadata: $@\n";
}
from __future__ import print_statement
import time
import swagger_client
from swagger_client.rest import ApiException
from pprint import pprint


# create an instance of the API class
api_instance = swagger_client.ThreatModelSubResourcesApi()
body =  # Metadata | 
threatModelId = 38400000-8cf0-11bd-b23e-10b96e4ef00d # UUID | Unique identifier of the threat model (UUID)
assetId = 38400000-8cf0-11bd-b23e-10b96e4ef00d # UUID | Unique identifier of the asset (UUID)
key = key_example # String | Metadata key

try: 
    # Update asset metadata
    api_response = api_instance.update_threat_model_asset_metadata(body, threatModelId, assetId, key)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling ThreatModelSubResourcesApi->updateThreatModelAssetMetadata: %s\n" % e)

Parameters

Path parameters
Name Description
threat_model_id*
UUID (uuid)
Unique identifier of the threat model (UUID)
Required
asset_id*
UUID (uuid)
Unique identifier of the asset (UUID)
Required
key*
String
Metadata key
Required
Body parameters
Name Description
body *

Responses

Status: 200 - Metadata updated successfully

Status: 400 - Error response

Status: 401 - Error response

Status: 403 - Error response

Status: 404 - Error response

Status: 500 - Error response


updateThreatModelDiagram

Update a diagram

Completely replaces a diagram with new data


/threat_models/{threat_model_id}/diagrams/{diagram_id}

Usage and SDK Samples

curl -X PUT\
 -H "Authorization: Bearer [[accessToken]]"\
-H "Accept: application/json"\
-H "Content-Type: application/json"\
"http://localhost:8080/threat_models/{threat_model_id}/diagrams/{diagram_id}"
import io.swagger.client.*;
import io.swagger.client.auth.*;
import io.swagger.client.model.*;
import io.swagger.client.api.ThreatModelSubResourcesApi;

import java.io.File;
import java.util.*;

public class ThreatModelSubResourcesApiExample {

    public static void main(String[] args) {
        ApiClient defaultClient = Configuration.getDefaultApiClient();


        ThreatModelSubResourcesApi apiInstance = new ThreatModelSubResourcesApi();
        Diagram body = ; // Diagram | 
        UUID threatModelId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // UUID | Unique identifier of the threat model (UUID)
        UUID diagramId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // UUID | Unique identifier of the diagram (UUID)
        try {
            Diagram result = apiInstance.updateThreatModelDiagram(body, threatModelId, diagramId);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling ThreatModelSubResourcesApi#updateThreatModelDiagram");
            e.printStackTrace();
        }
    }
}
import io.swagger.client.api.ThreatModelSubResourcesApi;

public class ThreatModelSubResourcesApiExample {

    public static void main(String[] args) {
        ThreatModelSubResourcesApi apiInstance = new ThreatModelSubResourcesApi();
        Diagram body = ; // Diagram | 
        UUID threatModelId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // UUID | Unique identifier of the threat model (UUID)
        UUID diagramId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // UUID | Unique identifier of the diagram (UUID)
        try {
            Diagram result = apiInstance.updateThreatModelDiagram(body, threatModelId, diagramId);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling ThreatModelSubResourcesApi#updateThreatModelDiagram");
            e.printStackTrace();
        }
    }
}
Configuration *apiConfig = [Configuration sharedConfig];
Diagram *body = ; // 
UUID *threatModelId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // Unique identifier of the threat model (UUID)
UUID *diagramId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // Unique identifier of the diagram (UUID)

ThreatModelSubResourcesApi *apiInstance = [[ThreatModelSubResourcesApi alloc] init];

// Update a diagram
[apiInstance updateThreatModelDiagramWith:body
    threatModelId:threatModelId
    diagramId:diagramId
              completionHandler: ^(Diagram output, NSError* error) {
                            if (output) {
                                NSLog(@"%@", output);
                            }
                            if (error) {
                                NSLog(@"Error: %@", error);
                            }
                        }];
var TmiThreatModelingImprovedApi = require('tmi__threat_modeling_improved_api');
var defaultClient = TmiThreatModelingImprovedApi.ApiClient.instance;


var api = new TmiThreatModelingImprovedApi.ThreatModelSubResourcesApi()
var body = ; // {{Diagram}} 
var threatModelId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // {{UUID}} Unique identifier of the threat model (UUID)
var diagramId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // {{UUID}} Unique identifier of the diagram (UUID)

var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
};
api.updateThreatModelDiagram(bodythreatModelIddiagramId, callback);
using System;
using System.Diagnostics;
using IO.Swagger.Api;
using IO.Swagger.Client;
using IO.Swagger.Model;

namespace Example
{
    public class updateThreatModelDiagramExample
    {
        public void main()
        {


            var apiInstance = new ThreatModelSubResourcesApi();
            var body = new Diagram(); // Diagram | 
            var threatModelId = new UUID(); // UUID | Unique identifier of the threat model (UUID)
            var diagramId = new UUID(); // UUID | Unique identifier of the diagram (UUID)

            try
            {
                // Update a diagram
                Diagram result = apiInstance.updateThreatModelDiagram(body, threatModelId, diagramId);
                Debug.WriteLine(result);
            }
            catch (Exception e)
            {
                Debug.Print("Exception when calling ThreatModelSubResourcesApi.updateThreatModelDiagram: " + e.Message );
            }
        }
    }
}
<?php
require_once(__DIR__ . '/vendor/autoload.php');


$api_instance = new Swagger\Client\ApiThreatModelSubResourcesApi();
$body = ; // Diagram | 
$threatModelId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // UUID | Unique identifier of the threat model (UUID)
$diagramId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // UUID | Unique identifier of the diagram (UUID)

try {
    $result = $api_instance->updateThreatModelDiagram($body, $threatModelId, $diagramId);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling ThreatModelSubResourcesApi->updateThreatModelDiagram: ', $e->getMessage(), PHP_EOL;
}
?>
use Data::Dumper;
use WWW::SwaggerClient::Configuration;
use WWW::SwaggerClient::ThreatModelSubResourcesApi;


my $api_instance = WWW::SwaggerClient::ThreatModelSubResourcesApi->new();
my $body = WWW::SwaggerClient::Object::Diagram->new(); # Diagram | 
my $threatModelId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; # UUID | Unique identifier of the threat model (UUID)
my $diagramId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; # UUID | Unique identifier of the diagram (UUID)

eval { 
    my $result = $api_instance->updateThreatModelDiagram(body => $body, threatModelId => $threatModelId, diagramId => $diagramId);
    print Dumper($result);
};
if ($@) {
    warn "Exception when calling ThreatModelSubResourcesApi->updateThreatModelDiagram: $@\n";
}
from __future__ import print_statement
import time
import swagger_client
from swagger_client.rest import ApiException
from pprint import pprint


# create an instance of the API class
api_instance = swagger_client.ThreatModelSubResourcesApi()
body =  # Diagram | 
threatModelId = 38400000-8cf0-11bd-b23e-10b96e4ef00d # UUID | Unique identifier of the threat model (UUID)
diagramId = 38400000-8cf0-11bd-b23e-10b96e4ef00d # UUID | Unique identifier of the diagram (UUID)

try: 
    # Update a diagram
    api_response = api_instance.update_threat_model_diagram(body, threatModelId, diagramId)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling ThreatModelSubResourcesApi->updateThreatModelDiagram: %s\n" % e)

Parameters

Path parameters
Name Description
threat_model_id*
UUID (uuid)
Unique identifier of the threat model (UUID)
Required
diagram_id*
UUID (uuid)
Unique identifier of the diagram (UUID)
Required
Body parameters
Name Description
body *

Responses

Status: 200 - Diagram updated successfully

Status: 400 - Error response

Status: 401 - Error response

Status: 403 - Error response

Status: 404 - Error response

Status: 500 - Error response


updateThreatModelDocument

Update a document

Updates a specific document within the threat model


/threat_models/{threat_model_id}/documents/{document_id}

Usage and SDK Samples

curl -X PUT\
 -H "Authorization: Bearer [[accessToken]]"\
-H "Accept: application/json"\
-H "Content-Type: application/json"\
"http://localhost:8080/threat_models/{threat_model_id}/documents/{document_id}"
import io.swagger.client.*;
import io.swagger.client.auth.*;
import io.swagger.client.model.*;
import io.swagger.client.api.ThreatModelSubResourcesApi;

import java.io.File;
import java.util.*;

public class ThreatModelSubResourcesApiExample {

    public static void main(String[] args) {
        ApiClient defaultClient = Configuration.getDefaultApiClient();


        ThreatModelSubResourcesApi apiInstance = new ThreatModelSubResourcesApi();
        DocumentInput body = ; // DocumentInput | 
        UUID threatModelId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // UUID | Unique identifier of the threat model (UUID)
        UUID documentId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // UUID | Unique identifier of the document (UUID)
        try {
            Document result = apiInstance.updateThreatModelDocument(body, threatModelId, documentId);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling ThreatModelSubResourcesApi#updateThreatModelDocument");
            e.printStackTrace();
        }
    }
}
import io.swagger.client.api.ThreatModelSubResourcesApi;

public class ThreatModelSubResourcesApiExample {

    public static void main(String[] args) {
        ThreatModelSubResourcesApi apiInstance = new ThreatModelSubResourcesApi();
        DocumentInput body = ; // DocumentInput | 
        UUID threatModelId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // UUID | Unique identifier of the threat model (UUID)
        UUID documentId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // UUID | Unique identifier of the document (UUID)
        try {
            Document result = apiInstance.updateThreatModelDocument(body, threatModelId, documentId);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling ThreatModelSubResourcesApi#updateThreatModelDocument");
            e.printStackTrace();
        }
    }
}
Configuration *apiConfig = [Configuration sharedConfig];
DocumentInput *body = ; // 
UUID *threatModelId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // Unique identifier of the threat model (UUID)
UUID *documentId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // Unique identifier of the document (UUID)

ThreatModelSubResourcesApi *apiInstance = [[ThreatModelSubResourcesApi alloc] init];

// Update a document
[apiInstance updateThreatModelDocumentWith:body
    threatModelId:threatModelId
    documentId:documentId
              completionHandler: ^(Document output, NSError* error) {
                            if (output) {
                                NSLog(@"%@", output);
                            }
                            if (error) {
                                NSLog(@"Error: %@", error);
                            }
                        }];
var TmiThreatModelingImprovedApi = require('tmi__threat_modeling_improved_api');
var defaultClient = TmiThreatModelingImprovedApi.ApiClient.instance;


var api = new TmiThreatModelingImprovedApi.ThreatModelSubResourcesApi()
var body = ; // {{DocumentInput}} 
var threatModelId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // {{UUID}} Unique identifier of the threat model (UUID)
var documentId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // {{UUID}} Unique identifier of the document (UUID)

var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
};
api.updateThreatModelDocument(bodythreatModelIddocumentId, callback);
using System;
using System.Diagnostics;
using IO.Swagger.Api;
using IO.Swagger.Client;
using IO.Swagger.Model;

namespace Example
{
    public class updateThreatModelDocumentExample
    {
        public void main()
        {


            var apiInstance = new ThreatModelSubResourcesApi();
            var body = new DocumentInput(); // DocumentInput | 
            var threatModelId = new UUID(); // UUID | Unique identifier of the threat model (UUID)
            var documentId = new UUID(); // UUID | Unique identifier of the document (UUID)

            try
            {
                // Update a document
                Document result = apiInstance.updateThreatModelDocument(body, threatModelId, documentId);
                Debug.WriteLine(result);
            }
            catch (Exception e)
            {
                Debug.Print("Exception when calling ThreatModelSubResourcesApi.updateThreatModelDocument: " + e.Message );
            }
        }
    }
}
<?php
require_once(__DIR__ . '/vendor/autoload.php');


$api_instance = new Swagger\Client\ApiThreatModelSubResourcesApi();
$body = ; // DocumentInput | 
$threatModelId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // UUID | Unique identifier of the threat model (UUID)
$documentId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // UUID | Unique identifier of the document (UUID)

try {
    $result = $api_instance->updateThreatModelDocument($body, $threatModelId, $documentId);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling ThreatModelSubResourcesApi->updateThreatModelDocument: ', $e->getMessage(), PHP_EOL;
}
?>
use Data::Dumper;
use WWW::SwaggerClient::Configuration;
use WWW::SwaggerClient::ThreatModelSubResourcesApi;


my $api_instance = WWW::SwaggerClient::ThreatModelSubResourcesApi->new();
my $body = WWW::SwaggerClient::Object::DocumentInput->new(); # DocumentInput | 
my $threatModelId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; # UUID | Unique identifier of the threat model (UUID)
my $documentId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; # UUID | Unique identifier of the document (UUID)

eval { 
    my $result = $api_instance->updateThreatModelDocument(body => $body, threatModelId => $threatModelId, documentId => $documentId);
    print Dumper($result);
};
if ($@) {
    warn "Exception when calling ThreatModelSubResourcesApi->updateThreatModelDocument: $@\n";
}
from __future__ import print_statement
import time
import swagger_client
from swagger_client.rest import ApiException
from pprint import pprint


# create an instance of the API class
api_instance = swagger_client.ThreatModelSubResourcesApi()
body =  # DocumentInput | 
threatModelId = 38400000-8cf0-11bd-b23e-10b96e4ef00d # UUID | Unique identifier of the threat model (UUID)
documentId = 38400000-8cf0-11bd-b23e-10b96e4ef00d # UUID | Unique identifier of the document (UUID)

try: 
    # Update a document
    api_response = api_instance.update_threat_model_document(body, threatModelId, documentId)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling ThreatModelSubResourcesApi->updateThreatModelDocument: %s\n" % e)

Parameters

Path parameters
Name Description
threat_model_id*
UUID (uuid)
Unique identifier of the threat model (UUID)
Required
document_id*
UUID (uuid)
Unique identifier of the document (UUID)
Required
Body parameters
Name Description
body *

Responses

Status: 200 - Document updated successfully

Status: 400 - Error response

Status: 401 - Error response

Status: 403 - Error response

Status: 404 - Error response

Status: 500 - Error response


updateThreatModelMetadataByKey

Update threat model metadata by key

Updates a specific metadata entry by key for the specified threat model


/threat_models/{threat_model_id}/metadata/{key}

Usage and SDK Samples

curl -X PUT\
 -H "Authorization: Bearer [[accessToken]]"\
-H "Accept: application/json"\
-H "Content-Type: application/json"\
"http://localhost:8080/threat_models/{threat_model_id}/metadata/{key}"
import io.swagger.client.*;
import io.swagger.client.auth.*;
import io.swagger.client.model.*;
import io.swagger.client.api.ThreatModelSubResourcesApi;

import java.io.File;
import java.util.*;

public class ThreatModelSubResourcesApiExample {

    public static void main(String[] args) {
        ApiClient defaultClient = Configuration.getDefaultApiClient();


        ThreatModelSubResourcesApi apiInstance = new ThreatModelSubResourcesApi();
        Metadata_key_body_3 body = ; // Metadata_key_body_3 | 
        UUID threatModelId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // UUID | Unique identifier of the threat model (UUID)
        String key = key_example; // String | Metadata key to update
        try {
            Metadata result = apiInstance.updateThreatModelMetadataByKey(body, threatModelId, key);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling ThreatModelSubResourcesApi#updateThreatModelMetadataByKey");
            e.printStackTrace();
        }
    }
}
import io.swagger.client.api.ThreatModelSubResourcesApi;

public class ThreatModelSubResourcesApiExample {

    public static void main(String[] args) {
        ThreatModelSubResourcesApi apiInstance = new ThreatModelSubResourcesApi();
        Metadata_key_body_3 body = ; // Metadata_key_body_3 | 
        UUID threatModelId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // UUID | Unique identifier of the threat model (UUID)
        String key = key_example; // String | Metadata key to update
        try {
            Metadata result = apiInstance.updateThreatModelMetadataByKey(body, threatModelId, key);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling ThreatModelSubResourcesApi#updateThreatModelMetadataByKey");
            e.printStackTrace();
        }
    }
}
Configuration *apiConfig = [Configuration sharedConfig];
Metadata_key_body_3 *body = ; // 
UUID *threatModelId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // Unique identifier of the threat model (UUID)
String *key = key_example; // Metadata key to update

ThreatModelSubResourcesApi *apiInstance = [[ThreatModelSubResourcesApi alloc] init];

// Update threat model metadata by key
[apiInstance updateThreatModelMetadataByKeyWith:body
    threatModelId:threatModelId
    key:key
              completionHandler: ^(Metadata output, NSError* error) {
                            if (output) {
                                NSLog(@"%@", output);
                            }
                            if (error) {
                                NSLog(@"Error: %@", error);
                            }
                        }];
var TmiThreatModelingImprovedApi = require('tmi__threat_modeling_improved_api');
var defaultClient = TmiThreatModelingImprovedApi.ApiClient.instance;


var api = new TmiThreatModelingImprovedApi.ThreatModelSubResourcesApi()
var body = ; // {{Metadata_key_body_3}} 
var threatModelId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // {{UUID}} Unique identifier of the threat model (UUID)
var key = key_example; // {{String}} Metadata key to update

var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
};
api.updateThreatModelMetadataByKey(bodythreatModelIdkey, callback);
using System;
using System.Diagnostics;
using IO.Swagger.Api;
using IO.Swagger.Client;
using IO.Swagger.Model;

namespace Example
{
    public class updateThreatModelMetadataByKeyExample
    {
        public void main()
        {


            var apiInstance = new ThreatModelSubResourcesApi();
            var body = new Metadata_key_body_3(); // Metadata_key_body_3 | 
            var threatModelId = new UUID(); // UUID | Unique identifier of the threat model (UUID)
            var key = key_example;  // String | Metadata key to update

            try
            {
                // Update threat model metadata by key
                Metadata result = apiInstance.updateThreatModelMetadataByKey(body, threatModelId, key);
                Debug.WriteLine(result);
            }
            catch (Exception e)
            {
                Debug.Print("Exception when calling ThreatModelSubResourcesApi.updateThreatModelMetadataByKey: " + e.Message );
            }
        }
    }
}
<?php
require_once(__DIR__ . '/vendor/autoload.php');


$api_instance = new Swagger\Client\ApiThreatModelSubResourcesApi();
$body = ; // Metadata_key_body_3 | 
$threatModelId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // UUID | Unique identifier of the threat model (UUID)
$key = key_example; // String | Metadata key to update

try {
    $result = $api_instance->updateThreatModelMetadataByKey($body, $threatModelId, $key);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling ThreatModelSubResourcesApi->updateThreatModelMetadataByKey: ', $e->getMessage(), PHP_EOL;
}
?>
use Data::Dumper;
use WWW::SwaggerClient::Configuration;
use WWW::SwaggerClient::ThreatModelSubResourcesApi;


my $api_instance = WWW::SwaggerClient::ThreatModelSubResourcesApi->new();
my $body = WWW::SwaggerClient::Object::Metadata_key_body_3->new(); # Metadata_key_body_3 | 
my $threatModelId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; # UUID | Unique identifier of the threat model (UUID)
my $key = key_example; # String | Metadata key to update

eval { 
    my $result = $api_instance->updateThreatModelMetadataByKey(body => $body, threatModelId => $threatModelId, key => $key);
    print Dumper($result);
};
if ($@) {
    warn "Exception when calling ThreatModelSubResourcesApi->updateThreatModelMetadataByKey: $@\n";
}
from __future__ import print_statement
import time
import swagger_client
from swagger_client.rest import ApiException
from pprint import pprint


# create an instance of the API class
api_instance = swagger_client.ThreatModelSubResourcesApi()
body =  # Metadata_key_body_3 | 
threatModelId = 38400000-8cf0-11bd-b23e-10b96e4ef00d # UUID | Unique identifier of the threat model (UUID)
key = key_example # String | Metadata key to update

try: 
    # Update threat model metadata by key
    api_response = api_instance.update_threat_model_metadata_by_key(body, threatModelId, key)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling ThreatModelSubResourcesApi->updateThreatModelMetadataByKey: %s\n" % e)

Parameters

Path parameters
Name Description
threat_model_id*
UUID (uuid)
Unique identifier of the threat model (UUID)
Required
key*
String
Metadata key to update
Required
Body parameters
Name Description
body *

Responses

Status: 200 - Metadata entry updated successfully

Status: 400 - Error response

Status: 401 - Error response

Status: 403 - Error response

Status: 404 - Error response

Status: 500 - Error response


updateThreatModelNote

Update a note

Updates a specific note within the threat model


/threat_models/{threat_model_id}/notes/{note_id}

Usage and SDK Samples

curl -X PUT\
 -H "Authorization: Bearer [[accessToken]]"\
-H "Accept: application/json"\
-H "Content-Type: application/json"\
"http://localhost:8080/threat_models/{threat_model_id}/notes/{note_id}"
import io.swagger.client.*;
import io.swagger.client.auth.*;
import io.swagger.client.model.*;
import io.swagger.client.api.ThreatModelSubResourcesApi;

import java.io.File;
import java.util.*;

public class ThreatModelSubResourcesApiExample {

    public static void main(String[] args) {
        ApiClient defaultClient = Configuration.getDefaultApiClient();


        ThreatModelSubResourcesApi apiInstance = new ThreatModelSubResourcesApi();
        NoteInput body = ; // NoteInput | 
        UUID threatModelId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // UUID | Unique identifier of the threat model (UUID)
        UUID noteId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // UUID | Unique identifier of the note (UUID)
        try {
            Note result = apiInstance.updateThreatModelNote(body, threatModelId, noteId);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling ThreatModelSubResourcesApi#updateThreatModelNote");
            e.printStackTrace();
        }
    }
}
import io.swagger.client.api.ThreatModelSubResourcesApi;

public class ThreatModelSubResourcesApiExample {

    public static void main(String[] args) {
        ThreatModelSubResourcesApi apiInstance = new ThreatModelSubResourcesApi();
        NoteInput body = ; // NoteInput | 
        UUID threatModelId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // UUID | Unique identifier of the threat model (UUID)
        UUID noteId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // UUID | Unique identifier of the note (UUID)
        try {
            Note result = apiInstance.updateThreatModelNote(body, threatModelId, noteId);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling ThreatModelSubResourcesApi#updateThreatModelNote");
            e.printStackTrace();
        }
    }
}
Configuration *apiConfig = [Configuration sharedConfig];
NoteInput *body = ; // 
UUID *threatModelId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // Unique identifier of the threat model (UUID)
UUID *noteId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // Unique identifier of the note (UUID)

ThreatModelSubResourcesApi *apiInstance = [[ThreatModelSubResourcesApi alloc] init];

// Update a note
[apiInstance updateThreatModelNoteWith:body
    threatModelId:threatModelId
    noteId:noteId
              completionHandler: ^(Note output, NSError* error) {
                            if (output) {
                                NSLog(@"%@", output);
                            }
                            if (error) {
                                NSLog(@"Error: %@", error);
                            }
                        }];
var TmiThreatModelingImprovedApi = require('tmi__threat_modeling_improved_api');
var defaultClient = TmiThreatModelingImprovedApi.ApiClient.instance;


var api = new TmiThreatModelingImprovedApi.ThreatModelSubResourcesApi()
var body = ; // {{NoteInput}} 
var threatModelId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // {{UUID}} Unique identifier of the threat model (UUID)
var noteId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // {{UUID}} Unique identifier of the note (UUID)

var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
};
api.updateThreatModelNote(bodythreatModelIdnoteId, callback);
using System;
using System.Diagnostics;
using IO.Swagger.Api;
using IO.Swagger.Client;
using IO.Swagger.Model;

namespace Example
{
    public class updateThreatModelNoteExample
    {
        public void main()
        {


            var apiInstance = new ThreatModelSubResourcesApi();
            var body = new NoteInput(); // NoteInput | 
            var threatModelId = new UUID(); // UUID | Unique identifier of the threat model (UUID)
            var noteId = new UUID(); // UUID | Unique identifier of the note (UUID)

            try
            {
                // Update a note
                Note result = apiInstance.updateThreatModelNote(body, threatModelId, noteId);
                Debug.WriteLine(result);
            }
            catch (Exception e)
            {
                Debug.Print("Exception when calling ThreatModelSubResourcesApi.updateThreatModelNote: " + e.Message );
            }
        }
    }
}
<?php
require_once(__DIR__ . '/vendor/autoload.php');


$api_instance = new Swagger\Client\ApiThreatModelSubResourcesApi();
$body = ; // NoteInput | 
$threatModelId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // UUID | Unique identifier of the threat model (UUID)
$noteId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // UUID | Unique identifier of the note (UUID)

try {
    $result = $api_instance->updateThreatModelNote($body, $threatModelId, $noteId);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling ThreatModelSubResourcesApi->updateThreatModelNote: ', $e->getMessage(), PHP_EOL;
}
?>
use Data::Dumper;
use WWW::SwaggerClient::Configuration;
use WWW::SwaggerClient::ThreatModelSubResourcesApi;


my $api_instance = WWW::SwaggerClient::ThreatModelSubResourcesApi->new();
my $body = WWW::SwaggerClient::Object::NoteInput->new(); # NoteInput | 
my $threatModelId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; # UUID | Unique identifier of the threat model (UUID)
my $noteId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; # UUID | Unique identifier of the note (UUID)

eval { 
    my $result = $api_instance->updateThreatModelNote(body => $body, threatModelId => $threatModelId, noteId => $noteId);
    print Dumper($result);
};
if ($@) {
    warn "Exception when calling ThreatModelSubResourcesApi->updateThreatModelNote: $@\n";
}
from __future__ import print_statement
import time
import swagger_client
from swagger_client.rest import ApiException
from pprint import pprint


# create an instance of the API class
api_instance = swagger_client.ThreatModelSubResourcesApi()
body =  # NoteInput | 
threatModelId = 38400000-8cf0-11bd-b23e-10b96e4ef00d # UUID | Unique identifier of the threat model (UUID)
noteId = 38400000-8cf0-11bd-b23e-10b96e4ef00d # UUID | Unique identifier of the note (UUID)

try: 
    # Update a note
    api_response = api_instance.update_threat_model_note(body, threatModelId, noteId)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling ThreatModelSubResourcesApi->updateThreatModelNote: %s\n" % e)

Parameters

Path parameters
Name Description
threat_model_id*
UUID (uuid)
Unique identifier of the threat model (UUID)
Required
note_id*
UUID (uuid)
Unique identifier of the note (UUID)
Required
Body parameters
Name Description
body *

Responses

Status: 200 - Note updated successfully

Status: 400 - Error response

Status: 401 - Error response

Status: 403 - Error response

Status: 404 - Error response

Status: 500 - Error response


updateThreatModelRepository

Update a source reference

Updates a specific source code reference within the threat model


/threat_models/{threat_model_id}/repositories/{repository_id}

Usage and SDK Samples

curl -X PUT\
 -H "Authorization: Bearer [[accessToken]]"\
-H "Accept: application/json"\
-H "Content-Type: application/json"\
"http://localhost:8080/threat_models/{threat_model_id}/repositories/{repository_id}"
import io.swagger.client.*;
import io.swagger.client.auth.*;
import io.swagger.client.model.*;
import io.swagger.client.api.ThreatModelSubResourcesApi;

import java.io.File;
import java.util.*;

public class ThreatModelSubResourcesApiExample {

    public static void main(String[] args) {
        ApiClient defaultClient = Configuration.getDefaultApiClient();


        ThreatModelSubResourcesApi apiInstance = new ThreatModelSubResourcesApi();
        RepositoryInput body = ; // RepositoryInput | 
        UUID threatModelId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // UUID | Unique identifier of the threat model (UUID)
        UUID repositoryId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // UUID | Unique identifier of the source reference (UUID)
        try {
            Repository result = apiInstance.updateThreatModelRepository(body, threatModelId, repositoryId);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling ThreatModelSubResourcesApi#updateThreatModelRepository");
            e.printStackTrace();
        }
    }
}
import io.swagger.client.api.ThreatModelSubResourcesApi;

public class ThreatModelSubResourcesApiExample {

    public static void main(String[] args) {
        ThreatModelSubResourcesApi apiInstance = new ThreatModelSubResourcesApi();
        RepositoryInput body = ; // RepositoryInput | 
        UUID threatModelId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // UUID | Unique identifier of the threat model (UUID)
        UUID repositoryId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // UUID | Unique identifier of the source reference (UUID)
        try {
            Repository result = apiInstance.updateThreatModelRepository(body, threatModelId, repositoryId);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling ThreatModelSubResourcesApi#updateThreatModelRepository");
            e.printStackTrace();
        }
    }
}
Configuration *apiConfig = [Configuration sharedConfig];
RepositoryInput *body = ; // 
UUID *threatModelId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // Unique identifier of the threat model (UUID)
UUID *repositoryId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // Unique identifier of the source reference (UUID)

ThreatModelSubResourcesApi *apiInstance = [[ThreatModelSubResourcesApi alloc] init];

// Update a source reference
[apiInstance updateThreatModelRepositoryWith:body
    threatModelId:threatModelId
    repositoryId:repositoryId
              completionHandler: ^(Repository output, NSError* error) {
                            if (output) {
                                NSLog(@"%@", output);
                            }
                            if (error) {
                                NSLog(@"Error: %@", error);
                            }
                        }];
var TmiThreatModelingImprovedApi = require('tmi__threat_modeling_improved_api');
var defaultClient = TmiThreatModelingImprovedApi.ApiClient.instance;


var api = new TmiThreatModelingImprovedApi.ThreatModelSubResourcesApi()
var body = ; // {{RepositoryInput}} 
var threatModelId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // {{UUID}} Unique identifier of the threat model (UUID)
var repositoryId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // {{UUID}} Unique identifier of the source reference (UUID)

var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
};
api.updateThreatModelRepository(bodythreatModelIdrepositoryId, callback);
using System;
using System.Diagnostics;
using IO.Swagger.Api;
using IO.Swagger.Client;
using IO.Swagger.Model;

namespace Example
{
    public class updateThreatModelRepositoryExample
    {
        public void main()
        {


            var apiInstance = new ThreatModelSubResourcesApi();
            var body = new RepositoryInput(); // RepositoryInput | 
            var threatModelId = new UUID(); // UUID | Unique identifier of the threat model (UUID)
            var repositoryId = new UUID(); // UUID | Unique identifier of the source reference (UUID)

            try
            {
                // Update a source reference
                Repository result = apiInstance.updateThreatModelRepository(body, threatModelId, repositoryId);
                Debug.WriteLine(result);
            }
            catch (Exception e)
            {
                Debug.Print("Exception when calling ThreatModelSubResourcesApi.updateThreatModelRepository: " + e.Message );
            }
        }
    }
}
<?php
require_once(__DIR__ . '/vendor/autoload.php');


$api_instance = new Swagger\Client\ApiThreatModelSubResourcesApi();
$body = ; // RepositoryInput | 
$threatModelId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // UUID | Unique identifier of the threat model (UUID)
$repositoryId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // UUID | Unique identifier of the source reference (UUID)

try {
    $result = $api_instance->updateThreatModelRepository($body, $threatModelId, $repositoryId);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling ThreatModelSubResourcesApi->updateThreatModelRepository: ', $e->getMessage(), PHP_EOL;
}
?>
use Data::Dumper;
use WWW::SwaggerClient::Configuration;
use WWW::SwaggerClient::ThreatModelSubResourcesApi;


my $api_instance = WWW::SwaggerClient::ThreatModelSubResourcesApi->new();
my $body = WWW::SwaggerClient::Object::RepositoryInput->new(); # RepositoryInput | 
my $threatModelId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; # UUID | Unique identifier of the threat model (UUID)
my $repositoryId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; # UUID | Unique identifier of the source reference (UUID)

eval { 
    my $result = $api_instance->updateThreatModelRepository(body => $body, threatModelId => $threatModelId, repositoryId => $repositoryId);
    print Dumper($result);
};
if ($@) {
    warn "Exception when calling ThreatModelSubResourcesApi->updateThreatModelRepository: $@\n";
}
from __future__ import print_statement
import time
import swagger_client
from swagger_client.rest import ApiException
from pprint import pprint


# create an instance of the API class
api_instance = swagger_client.ThreatModelSubResourcesApi()
body =  # RepositoryInput | 
threatModelId = 38400000-8cf0-11bd-b23e-10b96e4ef00d # UUID | Unique identifier of the threat model (UUID)
repositoryId = 38400000-8cf0-11bd-b23e-10b96e4ef00d # UUID | Unique identifier of the source reference (UUID)

try: 
    # Update a source reference
    api_response = api_instance.update_threat_model_repository(body, threatModelId, repositoryId)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling ThreatModelSubResourcesApi->updateThreatModelRepository: %s\n" % e)

Parameters

Path parameters
Name Description
threat_model_id*
UUID (uuid)
Unique identifier of the threat model (UUID)
Required
repository_id*
UUID (uuid)
Unique identifier of the source reference (UUID)
Required
Body parameters
Name Description
body *

Responses

Status: 200 - Source reference updated successfully

Status: 400 - Error response

Status: 401 - Error response

Status: 403 - Error response

Status: 404 - Error response

Status: 500 - Error response


updateThreatModelThreat

Update a threat

Updates a specific threat within the threat model


/threat_models/{threat_model_id}/threats/{threat_id}

Usage and SDK Samples

curl -X PUT\
 -H "Authorization: Bearer [[accessToken]]"\
-H "Accept: application/json"\
-H "Content-Type: application/json"\
"http://localhost:8080/threat_models/{threat_model_id}/threats/{threat_id}"
import io.swagger.client.*;
import io.swagger.client.auth.*;
import io.swagger.client.model.*;
import io.swagger.client.api.ThreatModelSubResourcesApi;

import java.io.File;
import java.util.*;

public class ThreatModelSubResourcesApiExample {

    public static void main(String[] args) {
        ApiClient defaultClient = Configuration.getDefaultApiClient();


        ThreatModelSubResourcesApi apiInstance = new ThreatModelSubResourcesApi();
        ThreatInput body = ; // ThreatInput | 
        UUID threatModelId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // UUID | Unique identifier of the threat model (UUID)
        UUID threatId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // UUID | Unique identifier of the threat (UUID)
        try {
            Threat result = apiInstance.updateThreatModelThreat(body, threatModelId, threatId);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling ThreatModelSubResourcesApi#updateThreatModelThreat");
            e.printStackTrace();
        }
    }
}
import io.swagger.client.api.ThreatModelSubResourcesApi;

public class ThreatModelSubResourcesApiExample {

    public static void main(String[] args) {
        ThreatModelSubResourcesApi apiInstance = new ThreatModelSubResourcesApi();
        ThreatInput body = ; // ThreatInput | 
        UUID threatModelId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // UUID | Unique identifier of the threat model (UUID)
        UUID threatId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // UUID | Unique identifier of the threat (UUID)
        try {
            Threat result = apiInstance.updateThreatModelThreat(body, threatModelId, threatId);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling ThreatModelSubResourcesApi#updateThreatModelThreat");
            e.printStackTrace();
        }
    }
}
Configuration *apiConfig = [Configuration sharedConfig];
ThreatInput *body = ; // 
UUID *threatModelId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // Unique identifier of the threat model (UUID)
UUID *threatId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // Unique identifier of the threat (UUID)

ThreatModelSubResourcesApi *apiInstance = [[ThreatModelSubResourcesApi alloc] init];

// Update a threat
[apiInstance updateThreatModelThreatWith:body
    threatModelId:threatModelId
    threatId:threatId
              completionHandler: ^(Threat output, NSError* error) {
                            if (output) {
                                NSLog(@"%@", output);
                            }
                            if (error) {
                                NSLog(@"Error: %@", error);
                            }
                        }];
var TmiThreatModelingImprovedApi = require('tmi__threat_modeling_improved_api');
var defaultClient = TmiThreatModelingImprovedApi.ApiClient.instance;


var api = new TmiThreatModelingImprovedApi.ThreatModelSubResourcesApi()
var body = ; // {{ThreatInput}} 
var threatModelId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // {{UUID}} Unique identifier of the threat model (UUID)
var threatId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // {{UUID}} Unique identifier of the threat (UUID)

var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
};
api.updateThreatModelThreat(bodythreatModelIdthreatId, callback);
using System;
using System.Diagnostics;
using IO.Swagger.Api;
using IO.Swagger.Client;
using IO.Swagger.Model;

namespace Example
{
    public class updateThreatModelThreatExample
    {
        public void main()
        {


            var apiInstance = new ThreatModelSubResourcesApi();
            var body = new ThreatInput(); // ThreatInput | 
            var threatModelId = new UUID(); // UUID | Unique identifier of the threat model (UUID)
            var threatId = new UUID(); // UUID | Unique identifier of the threat (UUID)

            try
            {
                // Update a threat
                Threat result = apiInstance.updateThreatModelThreat(body, threatModelId, threatId);
                Debug.WriteLine(result);
            }
            catch (Exception e)
            {
                Debug.Print("Exception when calling ThreatModelSubResourcesApi.updateThreatModelThreat: " + e.Message );
            }
        }
    }
}
<?php
require_once(__DIR__ . '/vendor/autoload.php');


$api_instance = new Swagger\Client\ApiThreatModelSubResourcesApi();
$body = ; // ThreatInput | 
$threatModelId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // UUID | Unique identifier of the threat model (UUID)
$threatId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // UUID | Unique identifier of the threat (UUID)

try {
    $result = $api_instance->updateThreatModelThreat($body, $threatModelId, $threatId);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling ThreatModelSubResourcesApi->updateThreatModelThreat: ', $e->getMessage(), PHP_EOL;
}
?>
use Data::Dumper;
use WWW::SwaggerClient::Configuration;
use WWW::SwaggerClient::ThreatModelSubResourcesApi;


my $api_instance = WWW::SwaggerClient::ThreatModelSubResourcesApi->new();
my $body = WWW::SwaggerClient::Object::ThreatInput->new(); # ThreatInput | 
my $threatModelId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; # UUID | Unique identifier of the threat model (UUID)
my $threatId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; # UUID | Unique identifier of the threat (UUID)

eval { 
    my $result = $api_instance->updateThreatModelThreat(body => $body, threatModelId => $threatModelId, threatId => $threatId);
    print Dumper($result);
};
if ($@) {
    warn "Exception when calling ThreatModelSubResourcesApi->updateThreatModelThreat: $@\n";
}
from __future__ import print_statement
import time
import swagger_client
from swagger_client.rest import ApiException
from pprint import pprint


# create an instance of the API class
api_instance = swagger_client.ThreatModelSubResourcesApi()
body =  # ThreatInput | 
threatModelId = 38400000-8cf0-11bd-b23e-10b96e4ef00d # UUID | Unique identifier of the threat model (UUID)
threatId = 38400000-8cf0-11bd-b23e-10b96e4ef00d # UUID | Unique identifier of the threat (UUID)

try: 
    # Update a threat
    api_response = api_instance.update_threat_model_threat(body, threatModelId, threatId)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling ThreatModelSubResourcesApi->updateThreatModelThreat: %s\n" % e)

Parameters

Path parameters
Name Description
threat_model_id*
UUID (uuid)
Unique identifier of the threat model (UUID)
Required
threat_id*
UUID (uuid)
Unique identifier of the threat (UUID)
Required
Body parameters
Name Description
body *

Responses

Status: 200 - Threat updated successfully

Status: 400 - Error response

Status: 401 - Error response

Status: 403 - Error response

Status: 404 - Error response

Status: 500 - Error response


ThreatModels

createThreatModel

Create a threat model

Creates a new threat model with the authenticated user as owner


/threat_models

Usage and SDK Samples

curl -X POST\
 -H "Authorization: Bearer [[accessToken]]"\
-H "Accept: application/json"\
-H "Content-Type: application/json"\
"http://localhost:8080/threat_models"
import io.swagger.client.*;
import io.swagger.client.auth.*;
import io.swagger.client.model.*;
import io.swagger.client.api.ThreatModelsApi;

import java.io.File;
import java.util.*;

public class ThreatModelsApiExample {

    public static void main(String[] args) {
        ApiClient defaultClient = Configuration.getDefaultApiClient();


        ThreatModelsApi apiInstance = new ThreatModelsApi();
        ThreatModelInput body = ; // ThreatModelInput | 
        try {
            ThreatModel result = apiInstance.createThreatModel(body);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling ThreatModelsApi#createThreatModel");
            e.printStackTrace();
        }
    }
}
import io.swagger.client.api.ThreatModelsApi;

public class ThreatModelsApiExample {

    public static void main(String[] args) {
        ThreatModelsApi apiInstance = new ThreatModelsApi();
        ThreatModelInput body = ; // ThreatModelInput | 
        try {
            ThreatModel result = apiInstance.createThreatModel(body);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling ThreatModelsApi#createThreatModel");
            e.printStackTrace();
        }
    }
}
Configuration *apiConfig = [Configuration sharedConfig];
ThreatModelInput *body = ; // 

ThreatModelsApi *apiInstance = [[ThreatModelsApi alloc] init];

// Create a threat model
[apiInstance createThreatModelWith:body
              completionHandler: ^(ThreatModel output, NSError* error) {
                            if (output) {
                                NSLog(@"%@", output);
                            }
                            if (error) {
                                NSLog(@"Error: %@", error);
                            }
                        }];
var TmiThreatModelingImprovedApi = require('tmi__threat_modeling_improved_api');
var defaultClient = TmiThreatModelingImprovedApi.ApiClient.instance;


var api = new TmiThreatModelingImprovedApi.ThreatModelsApi()
var body = ; // {{ThreatModelInput}} 

var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
};
api.createThreatModel(body, callback);
using System;
using System.Diagnostics;
using IO.Swagger.Api;
using IO.Swagger.Client;
using IO.Swagger.Model;

namespace Example
{
    public class createThreatModelExample
    {
        public void main()
        {


            var apiInstance = new ThreatModelsApi();
            var body = new ThreatModelInput(); // ThreatModelInput | 

            try
            {
                // Create a threat model
                ThreatModel result = apiInstance.createThreatModel(body);
                Debug.WriteLine(result);
            }
            catch (Exception e)
            {
                Debug.Print("Exception when calling ThreatModelsApi.createThreatModel: " + e.Message );
            }
        }
    }
}
<?php
require_once(__DIR__ . '/vendor/autoload.php');


$api_instance = new Swagger\Client\ApiThreatModelsApi();
$body = ; // ThreatModelInput | 

try {
    $result = $api_instance->createThreatModel($body);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling ThreatModelsApi->createThreatModel: ', $e->getMessage(), PHP_EOL;
}
?>
use Data::Dumper;
use WWW::SwaggerClient::Configuration;
use WWW::SwaggerClient::ThreatModelsApi;


my $api_instance = WWW::SwaggerClient::ThreatModelsApi->new();
my $body = WWW::SwaggerClient::Object::ThreatModelInput->new(); # ThreatModelInput | 

eval { 
    my $result = $api_instance->createThreatModel(body => $body);
    print Dumper($result);
};
if ($@) {
    warn "Exception when calling ThreatModelsApi->createThreatModel: $@\n";
}
from __future__ import print_statement
import time
import swagger_client
from swagger_client.rest import ApiException
from pprint import pprint


# create an instance of the API class
api_instance = swagger_client.ThreatModelsApi()
body =  # ThreatModelInput | 

try: 
    # Create a threat model
    api_response = api_instance.create_threat_model(body)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling ThreatModelsApi->createThreatModel: %s\n" % e)

Parameters

Body parameters
Name Description
body *

Responses

Status: 201 - Threat model created successfully

Name Type Format Description
Location String

Status: 400 - Error response

Status: 401 - Error response

Status: 500 - Error response


deleteThreatModel

Delete a threat model

Deletes a threat model; restricted to owner role


/threat_models/{threat_model_id}

Usage and SDK Samples

curl -X DELETE\
 -H "Authorization: Bearer [[accessToken]]"\
-H "Accept: application/json"\
"http://localhost:8080/threat_models/{threat_model_id}"
import io.swagger.client.*;
import io.swagger.client.auth.*;
import io.swagger.client.model.*;
import io.swagger.client.api.ThreatModelsApi;

import java.io.File;
import java.util.*;

public class ThreatModelsApiExample {

    public static void main(String[] args) {
        ApiClient defaultClient = Configuration.getDefaultApiClient();


        ThreatModelsApi apiInstance = new ThreatModelsApi();
        UUID threatModelId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // UUID | Unique identifier of the threat model to delete (UUID)
        try {
            apiInstance.deleteThreatModel(threatModelId);
        } catch (ApiException e) {
            System.err.println("Exception when calling ThreatModelsApi#deleteThreatModel");
            e.printStackTrace();
        }
    }
}
import io.swagger.client.api.ThreatModelsApi;

public class ThreatModelsApiExample {

    public static void main(String[] args) {
        ThreatModelsApi apiInstance = new ThreatModelsApi();
        UUID threatModelId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // UUID | Unique identifier of the threat model to delete (UUID)
        try {
            apiInstance.deleteThreatModel(threatModelId);
        } catch (ApiException e) {
            System.err.println("Exception when calling ThreatModelsApi#deleteThreatModel");
            e.printStackTrace();
        }
    }
}
Configuration *apiConfig = [Configuration sharedConfig];
UUID *threatModelId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // Unique identifier of the threat model to delete (UUID)

ThreatModelsApi *apiInstance = [[ThreatModelsApi alloc] init];

// Delete a threat model
[apiInstance deleteThreatModelWith:threatModelId
              completionHandler: ^(NSError* error) {
                            if (error) {
                                NSLog(@"Error: %@", error);
                            }
                        }];
var TmiThreatModelingImprovedApi = require('tmi__threat_modeling_improved_api');
var defaultClient = TmiThreatModelingImprovedApi.ApiClient.instance;


var api = new TmiThreatModelingImprovedApi.ThreatModelsApi()
var threatModelId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // {{UUID}} Unique identifier of the threat model to delete (UUID)

var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully.');
  }
};
api.deleteThreatModel(threatModelId, callback);
using System;
using System.Diagnostics;
using IO.Swagger.Api;
using IO.Swagger.Client;
using IO.Swagger.Model;

namespace Example
{
    public class deleteThreatModelExample
    {
        public void main()
        {


            var apiInstance = new ThreatModelsApi();
            var threatModelId = new UUID(); // UUID | Unique identifier of the threat model to delete (UUID)

            try
            {
                // Delete a threat model
                apiInstance.deleteThreatModel(threatModelId);
            }
            catch (Exception e)
            {
                Debug.Print("Exception when calling ThreatModelsApi.deleteThreatModel: " + e.Message );
            }
        }
    }
}
<?php
require_once(__DIR__ . '/vendor/autoload.php');


$api_instance = new Swagger\Client\ApiThreatModelsApi();
$threatModelId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // UUID | Unique identifier of the threat model to delete (UUID)

try {
    $api_instance->deleteThreatModel($threatModelId);
} catch (Exception $e) {
    echo 'Exception when calling ThreatModelsApi->deleteThreatModel: ', $e->getMessage(), PHP_EOL;
}
?>
use Data::Dumper;
use WWW::SwaggerClient::Configuration;
use WWW::SwaggerClient::ThreatModelsApi;


my $api_instance = WWW::SwaggerClient::ThreatModelsApi->new();
my $threatModelId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; # UUID | Unique identifier of the threat model to delete (UUID)

eval { 
    $api_instance->deleteThreatModel(threatModelId => $threatModelId);
};
if ($@) {
    warn "Exception when calling ThreatModelsApi->deleteThreatModel: $@\n";
}
from __future__ import print_statement
import time
import swagger_client
from swagger_client.rest import ApiException
from pprint import pprint


# create an instance of the API class
api_instance = swagger_client.ThreatModelsApi()
threatModelId = 38400000-8cf0-11bd-b23e-10b96e4ef00d # UUID | Unique identifier of the threat model to delete (UUID)

try: 
    # Delete a threat model
    api_instance.delete_threat_model(threatModelId)
except ApiException as e:
    print("Exception when calling ThreatModelsApi->deleteThreatModel: %s\n" % e)

Parameters

Path parameters
Name Description
threat_model_id*
UUID (uuid)
Unique identifier of the threat model to delete (UUID)
Required

Responses

Status: 204 - Threat model deleted successfully

Status: 401 - Error response

Status: 403 - Error response

Status: 404 - Error response

Status: 500 - Error response


getThreatModel

Retrieve a threat model

Retrieves the full details of a specific threat model if the user has access


/threat_models/{threat_model_id}

Usage and SDK Samples

curl -X GET\
 -H "Authorization: Bearer [[accessToken]]"\
-H "Accept: application/json"\
"http://localhost:8080/threat_models/{threat_model_id}"
import io.swagger.client.*;
import io.swagger.client.auth.*;
import io.swagger.client.model.*;
import io.swagger.client.api.ThreatModelsApi;

import java.io.File;
import java.util.*;

public class ThreatModelsApiExample {

    public static void main(String[] args) {
        ApiClient defaultClient = Configuration.getDefaultApiClient();


        ThreatModelsApi apiInstance = new ThreatModelsApi();
        UUID threatModelId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // UUID | Unique identifier of the threat model to retrieve (UUID)
        try {
            ThreatModel result = apiInstance.getThreatModel(threatModelId);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling ThreatModelsApi#getThreatModel");
            e.printStackTrace();
        }
    }
}
import io.swagger.client.api.ThreatModelsApi;

public class ThreatModelsApiExample {

    public static void main(String[] args) {
        ThreatModelsApi apiInstance = new ThreatModelsApi();
        UUID threatModelId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // UUID | Unique identifier of the threat model to retrieve (UUID)
        try {
            ThreatModel result = apiInstance.getThreatModel(threatModelId);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling ThreatModelsApi#getThreatModel");
            e.printStackTrace();
        }
    }
}
Configuration *apiConfig = [Configuration sharedConfig];
UUID *threatModelId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // Unique identifier of the threat model to retrieve (UUID)

ThreatModelsApi *apiInstance = [[ThreatModelsApi alloc] init];

// Retrieve a threat model
[apiInstance getThreatModelWith:threatModelId
              completionHandler: ^(ThreatModel output, NSError* error) {
                            if (output) {
                                NSLog(@"%@", output);
                            }
                            if (error) {
                                NSLog(@"Error: %@", error);
                            }
                        }];
var TmiThreatModelingImprovedApi = require('tmi__threat_modeling_improved_api');
var defaultClient = TmiThreatModelingImprovedApi.ApiClient.instance;


var api = new TmiThreatModelingImprovedApi.ThreatModelsApi()
var threatModelId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // {{UUID}} Unique identifier of the threat model to retrieve (UUID)

var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
};
api.getThreatModel(threatModelId, callback);
using System;
using System.Diagnostics;
using IO.Swagger.Api;
using IO.Swagger.Client;
using IO.Swagger.Model;

namespace Example
{
    public class getThreatModelExample
    {
        public void main()
        {


            var apiInstance = new ThreatModelsApi();
            var threatModelId = new UUID(); // UUID | Unique identifier of the threat model to retrieve (UUID)

            try
            {
                // Retrieve a threat model
                ThreatModel result = apiInstance.getThreatModel(threatModelId);
                Debug.WriteLine(result);
            }
            catch (Exception e)
            {
                Debug.Print("Exception when calling ThreatModelsApi.getThreatModel: " + e.Message );
            }
        }
    }
}
<?php
require_once(__DIR__ . '/vendor/autoload.php');


$api_instance = new Swagger\Client\ApiThreatModelsApi();
$threatModelId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // UUID | Unique identifier of the threat model to retrieve (UUID)

try {
    $result = $api_instance->getThreatModel($threatModelId);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling ThreatModelsApi->getThreatModel: ', $e->getMessage(), PHP_EOL;
}
?>
use Data::Dumper;
use WWW::SwaggerClient::Configuration;
use WWW::SwaggerClient::ThreatModelsApi;


my $api_instance = WWW::SwaggerClient::ThreatModelsApi->new();
my $threatModelId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; # UUID | Unique identifier of the threat model to retrieve (UUID)

eval { 
    my $result = $api_instance->getThreatModel(threatModelId => $threatModelId);
    print Dumper($result);
};
if ($@) {
    warn "Exception when calling ThreatModelsApi->getThreatModel: $@\n";
}
from __future__ import print_statement
import time
import swagger_client
from swagger_client.rest import ApiException
from pprint import pprint


# create an instance of the API class
api_instance = swagger_client.ThreatModelsApi()
threatModelId = 38400000-8cf0-11bd-b23e-10b96e4ef00d # UUID | Unique identifier of the threat model to retrieve (UUID)

try: 
    # Retrieve a threat model
    api_response = api_instance.get_threat_model(threatModelId)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling ThreatModelsApi->getThreatModel: %s\n" % e)

Parameters

Path parameters
Name Description
threat_model_id*
UUID (uuid)
Unique identifier of the threat model to retrieve (UUID)
Required

Responses

Status: 200 - Full threat model details

Status: 401 - Error response

Status: 403 - Error response

Status: 404 - Error response

Status: 500 - Error response


listThreatModels

List threat models

Returns a list of threat models accessible to the authenticated user with enhanced metadata and entity counts


/threat_models

Usage and SDK Samples

curl -X GET\
 -H "Authorization: Bearer [[accessToken]]"\
-H "Accept: application/json"\
"http://localhost:8080/threat_models?limit=&offset=&owner=&name=&description=&issue_uri=&created_after=&created_before=&modified_after=&modified_before=&status=&status_updated_after=&status_updated_before="
import io.swagger.client.*;
import io.swagger.client.auth.*;
import io.swagger.client.model.*;
import io.swagger.client.api.ThreatModelsApi;

import java.io.File;
import java.util.*;

public class ThreatModelsApiExample {

    public static void main(String[] args) {
        ApiClient defaultClient = Configuration.getDefaultApiClient();


        ThreatModelsApi apiInstance = new ThreatModelsApi();
        Integer limit = 56; // Integer | Number of threat models to return
        Integer offset = 56; // Integer | Pagination offset
        String owner = owner_example; // String | Filter by owner name or email
        String name = name_example; // String | Filter by threat model name (partial match)
        String description = description_example; // String | Filter by threat model description (partial match)
        String issueUri = issueUri_example; // String | Filter by issue URI (partial match)
        Date createdAfter = 2013-10-20T19:20:30+01:00; // Date | Filter threat models created after this date (RFC3339 format)
        Date createdBefore = 2013-10-20T19:20:30+01:00; // Date | Filter threat models created before this date (RFC3339 format)
        Date modifiedAfter = 2013-10-20T19:20:30+01:00; // Date | Filter threat models modified after this date (RFC3339 format)
        Date modifiedBefore = 2013-10-20T19:20:30+01:00; // Date | Filter threat models modified before this date (RFC3339 format)
        String status = status_example; // String | Filter by status value (exact match). To filter by multiple statuses, use multiple status parameters or comma-separated values.
        Date statusUpdatedAfter = 2013-10-20T19:20:30+01:00; // Date | Filter threat models where status was updated after this timestamp (RFC3339)
        Date statusUpdatedBefore = 2013-10-20T19:20:30+01:00; // Date | Filter threat models where status was updated before this timestamp (RFC3339)
        try {
            array[TMListItem] result = apiInstance.listThreatModels(limit, offset, owner, name, description, issueUri, createdAfter, createdBefore, modifiedAfter, modifiedBefore, status, statusUpdatedAfter, statusUpdatedBefore);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling ThreatModelsApi#listThreatModels");
            e.printStackTrace();
        }
    }
}
import io.swagger.client.api.ThreatModelsApi;

public class ThreatModelsApiExample {

    public static void main(String[] args) {
        ThreatModelsApi apiInstance = new ThreatModelsApi();
        Integer limit = 56; // Integer | Number of threat models to return
        Integer offset = 56; // Integer | Pagination offset
        String owner = owner_example; // String | Filter by owner name or email
        String name = name_example; // String | Filter by threat model name (partial match)
        String description = description_example; // String | Filter by threat model description (partial match)
        String issueUri = issueUri_example; // String | Filter by issue URI (partial match)
        Date createdAfter = 2013-10-20T19:20:30+01:00; // Date | Filter threat models created after this date (RFC3339 format)
        Date createdBefore = 2013-10-20T19:20:30+01:00; // Date | Filter threat models created before this date (RFC3339 format)
        Date modifiedAfter = 2013-10-20T19:20:30+01:00; // Date | Filter threat models modified after this date (RFC3339 format)
        Date modifiedBefore = 2013-10-20T19:20:30+01:00; // Date | Filter threat models modified before this date (RFC3339 format)
        String status = status_example; // String | Filter by status value (exact match). To filter by multiple statuses, use multiple status parameters or comma-separated values.
        Date statusUpdatedAfter = 2013-10-20T19:20:30+01:00; // Date | Filter threat models where status was updated after this timestamp (RFC3339)
        Date statusUpdatedBefore = 2013-10-20T19:20:30+01:00; // Date | Filter threat models where status was updated before this timestamp (RFC3339)
        try {
            array[TMListItem] result = apiInstance.listThreatModels(limit, offset, owner, name, description, issueUri, createdAfter, createdBefore, modifiedAfter, modifiedBefore, status, statusUpdatedAfter, statusUpdatedBefore);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling ThreatModelsApi#listThreatModels");
            e.printStackTrace();
        }
    }
}
Configuration *apiConfig = [Configuration sharedConfig];
Integer *limit = 56; // Number of threat models to return (optional) (default to 20)
Integer *offset = 56; // Pagination offset (optional) (default to 0)
String *owner = owner_example; // Filter by owner name or email (optional)
String *name = name_example; // Filter by threat model name (partial match) (optional)
String *description = description_example; // Filter by threat model description (partial match) (optional)
String *issueUri = issueUri_example; // Filter by issue URI (partial match) (optional)
Date *createdAfter = 2013-10-20T19:20:30+01:00; // Filter threat models created after this date (RFC3339 format) (optional)
Date *createdBefore = 2013-10-20T19:20:30+01:00; // Filter threat models created before this date (RFC3339 format) (optional)
Date *modifiedAfter = 2013-10-20T19:20:30+01:00; // Filter threat models modified after this date (RFC3339 format) (optional)
Date *modifiedBefore = 2013-10-20T19:20:30+01:00; // Filter threat models modified before this date (RFC3339 format) (optional)
String *status = status_example; // Filter by status value (exact match). To filter by multiple statuses, use multiple status parameters or comma-separated values. (optional)
Date *statusUpdatedAfter = 2013-10-20T19:20:30+01:00; // Filter threat models where status was updated after this timestamp (RFC3339) (optional)
Date *statusUpdatedBefore = 2013-10-20T19:20:30+01:00; // Filter threat models where status was updated before this timestamp (RFC3339) (optional)

ThreatModelsApi *apiInstance = [[ThreatModelsApi alloc] init];

// List threat models
[apiInstance listThreatModelsWith:limit
    offset:offset
    owner:owner
    name:name
    description:description
    issueUri:issueUri
    createdAfter:createdAfter
    createdBefore:createdBefore
    modifiedAfter:modifiedAfter
    modifiedBefore:modifiedBefore
    status:status
    statusUpdatedAfter:statusUpdatedAfter
    statusUpdatedBefore:statusUpdatedBefore
              completionHandler: ^(array[TMListItem] output, NSError* error) {
                            if (output) {
                                NSLog(@"%@", output);
                            }
                            if (error) {
                                NSLog(@"Error: %@", error);
                            }
                        }];
var TmiThreatModelingImprovedApi = require('tmi__threat_modeling_improved_api');
var defaultClient = TmiThreatModelingImprovedApi.ApiClient.instance;


var api = new TmiThreatModelingImprovedApi.ThreatModelsApi()
var opts = { 
  'limit': 56, // {{Integer}} Number of threat models to return
  'offset': 56, // {{Integer}} Pagination offset
  'owner': owner_example, // {{String}} Filter by owner name or email
  'name': name_example, // {{String}} Filter by threat model name (partial match)
  'description': description_example, // {{String}} Filter by threat model description (partial match)
  'issueUri': issueUri_example, // {{String}} Filter by issue URI (partial match)
  'createdAfter': 2013-10-20T19:20:30+01:00, // {{Date}} Filter threat models created after this date (RFC3339 format)
  'createdBefore': 2013-10-20T19:20:30+01:00, // {{Date}} Filter threat models created before this date (RFC3339 format)
  'modifiedAfter': 2013-10-20T19:20:30+01:00, // {{Date}} Filter threat models modified after this date (RFC3339 format)
  'modifiedBefore': 2013-10-20T19:20:30+01:00, // {{Date}} Filter threat models modified before this date (RFC3339 format)
  'status': status_example, // {{String}} Filter by status value (exact match). To filter by multiple statuses, use multiple status parameters or comma-separated values.
  'statusUpdatedAfter': 2013-10-20T19:20:30+01:00, // {{Date}} Filter threat models where status was updated after this timestamp (RFC3339)
  'statusUpdatedBefore': 2013-10-20T19:20:30+01:00 // {{Date}} Filter threat models where status was updated before this timestamp (RFC3339)
};
var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
};
api.listThreatModels(opts, callback);
using System;
using System.Diagnostics;
using IO.Swagger.Api;
using IO.Swagger.Client;
using IO.Swagger.Model;

namespace Example
{
    public class listThreatModelsExample
    {
        public void main()
        {


            var apiInstance = new ThreatModelsApi();
            var limit = 56;  // Integer | Number of threat models to return (optional)  (default to 20)
            var offset = 56;  // Integer | Pagination offset (optional)  (default to 0)
            var owner = owner_example;  // String | Filter by owner name or email (optional) 
            var name = name_example;  // String | Filter by threat model name (partial match) (optional) 
            var description = description_example;  // String | Filter by threat model description (partial match) (optional) 
            var issueUri = issueUri_example;  // String | Filter by issue URI (partial match) (optional) 
            var createdAfter = 2013-10-20T19:20:30+01:00;  // Date | Filter threat models created after this date (RFC3339 format) (optional) 
            var createdBefore = 2013-10-20T19:20:30+01:00;  // Date | Filter threat models created before this date (RFC3339 format) (optional) 
            var modifiedAfter = 2013-10-20T19:20:30+01:00;  // Date | Filter threat models modified after this date (RFC3339 format) (optional) 
            var modifiedBefore = 2013-10-20T19:20:30+01:00;  // Date | Filter threat models modified before this date (RFC3339 format) (optional) 
            var status = status_example;  // String | Filter by status value (exact match). To filter by multiple statuses, use multiple status parameters or comma-separated values. (optional) 
            var statusUpdatedAfter = 2013-10-20T19:20:30+01:00;  // Date | Filter threat models where status was updated after this timestamp (RFC3339) (optional) 
            var statusUpdatedBefore = 2013-10-20T19:20:30+01:00;  // Date | Filter threat models where status was updated before this timestamp (RFC3339) (optional) 

            try
            {
                // List threat models
                array[TMListItem] result = apiInstance.listThreatModels(limit, offset, owner, name, description, issueUri, createdAfter, createdBefore, modifiedAfter, modifiedBefore, status, statusUpdatedAfter, statusUpdatedBefore);
                Debug.WriteLine(result);
            }
            catch (Exception e)
            {
                Debug.Print("Exception when calling ThreatModelsApi.listThreatModels: " + e.Message );
            }
        }
    }
}
<?php
require_once(__DIR__ . '/vendor/autoload.php');


$api_instance = new Swagger\Client\ApiThreatModelsApi();
$limit = 56; // Integer | Number of threat models to return
$offset = 56; // Integer | Pagination offset
$owner = owner_example; // String | Filter by owner name or email
$name = name_example; // String | Filter by threat model name (partial match)
$description = description_example; // String | Filter by threat model description (partial match)
$issueUri = issueUri_example; // String | Filter by issue URI (partial match)
$createdAfter = 2013-10-20T19:20:30+01:00; // Date | Filter threat models created after this date (RFC3339 format)
$createdBefore = 2013-10-20T19:20:30+01:00; // Date | Filter threat models created before this date (RFC3339 format)
$modifiedAfter = 2013-10-20T19:20:30+01:00; // Date | Filter threat models modified after this date (RFC3339 format)
$modifiedBefore = 2013-10-20T19:20:30+01:00; // Date | Filter threat models modified before this date (RFC3339 format)
$status = status_example; // String | Filter by status value (exact match). To filter by multiple statuses, use multiple status parameters or comma-separated values.
$statusUpdatedAfter = 2013-10-20T19:20:30+01:00; // Date | Filter threat models where status was updated after this timestamp (RFC3339)
$statusUpdatedBefore = 2013-10-20T19:20:30+01:00; // Date | Filter threat models where status was updated before this timestamp (RFC3339)

try {
    $result = $api_instance->listThreatModels($limit, $offset, $owner, $name, $description, $issueUri, $createdAfter, $createdBefore, $modifiedAfter, $modifiedBefore, $status, $statusUpdatedAfter, $statusUpdatedBefore);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling ThreatModelsApi->listThreatModels: ', $e->getMessage(), PHP_EOL;
}
?>
use Data::Dumper;
use WWW::SwaggerClient::Configuration;
use WWW::SwaggerClient::ThreatModelsApi;


my $api_instance = WWW::SwaggerClient::ThreatModelsApi->new();
my $limit = 56; # Integer | Number of threat models to return
my $offset = 56; # Integer | Pagination offset
my $owner = owner_example; # String | Filter by owner name or email
my $name = name_example; # String | Filter by threat model name (partial match)
my $description = description_example; # String | Filter by threat model description (partial match)
my $issueUri = issueUri_example; # String | Filter by issue URI (partial match)
my $createdAfter = 2013-10-20T19:20:30+01:00; # Date | Filter threat models created after this date (RFC3339 format)
my $createdBefore = 2013-10-20T19:20:30+01:00; # Date | Filter threat models created before this date (RFC3339 format)
my $modifiedAfter = 2013-10-20T19:20:30+01:00; # Date | Filter threat models modified after this date (RFC3339 format)
my $modifiedBefore = 2013-10-20T19:20:30+01:00; # Date | Filter threat models modified before this date (RFC3339 format)
my $status = status_example; # String | Filter by status value (exact match). To filter by multiple statuses, use multiple status parameters or comma-separated values.
my $statusUpdatedAfter = 2013-10-20T19:20:30+01:00; # Date | Filter threat models where status was updated after this timestamp (RFC3339)
my $statusUpdatedBefore = 2013-10-20T19:20:30+01:00; # Date | Filter threat models where status was updated before this timestamp (RFC3339)

eval { 
    my $result = $api_instance->listThreatModels(limit => $limit, offset => $offset, owner => $owner, name => $name, description => $description, issueUri => $issueUri, createdAfter => $createdAfter, createdBefore => $createdBefore, modifiedAfter => $modifiedAfter, modifiedBefore => $modifiedBefore, status => $status, statusUpdatedAfter => $statusUpdatedAfter, statusUpdatedBefore => $statusUpdatedBefore);
    print Dumper($result);
};
if ($@) {
    warn "Exception when calling ThreatModelsApi->listThreatModels: $@\n";
}
from __future__ import print_statement
import time
import swagger_client
from swagger_client.rest import ApiException
from pprint import pprint


# create an instance of the API class
api_instance = swagger_client.ThreatModelsApi()
limit = 56 # Integer | Number of threat models to return (optional) (default to 20)
offset = 56 # Integer | Pagination offset (optional) (default to 0)
owner = owner_example # String | Filter by owner name or email (optional)
name = name_example # String | Filter by threat model name (partial match) (optional)
description = description_example # String | Filter by threat model description (partial match) (optional)
issueUri = issueUri_example # String | Filter by issue URI (partial match) (optional)
createdAfter = 2013-10-20T19:20:30+01:00 # Date | Filter threat models created after this date (RFC3339 format) (optional)
createdBefore = 2013-10-20T19:20:30+01:00 # Date | Filter threat models created before this date (RFC3339 format) (optional)
modifiedAfter = 2013-10-20T19:20:30+01:00 # Date | Filter threat models modified after this date (RFC3339 format) (optional)
modifiedBefore = 2013-10-20T19:20:30+01:00 # Date | Filter threat models modified before this date (RFC3339 format) (optional)
status = status_example # String | Filter by status value (exact match). To filter by multiple statuses, use multiple status parameters or comma-separated values. (optional)
statusUpdatedAfter = 2013-10-20T19:20:30+01:00 # Date | Filter threat models where status was updated after this timestamp (RFC3339) (optional)
statusUpdatedBefore = 2013-10-20T19:20:30+01:00 # Date | Filter threat models where status was updated before this timestamp (RFC3339) (optional)

try: 
    # List threat models
    api_response = api_instance.list_threat_models(limit=limit, offset=offset, owner=owner, name=name, description=description, issueUri=issueUri, createdAfter=createdAfter, createdBefore=createdBefore, modifiedAfter=modifiedAfter, modifiedBefore=modifiedBefore, status=status, statusUpdatedAfter=statusUpdatedAfter, statusUpdatedBefore=statusUpdatedBefore)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling ThreatModelsApi->listThreatModels: %s\n" % e)

Parameters

Query parameters
Name Description
limit
Integer
Number of threat models to return
offset
Integer
Pagination offset
owner
String
Filter by owner name or email
name
String
Filter by threat model name (partial match)
description
String
Filter by threat model description (partial match)
issue_uri
String
Filter by issue URI (partial match)
created_after
Date (date-time)
Filter threat models created after this date (RFC3339 format)
created_before
Date (date-time)
Filter threat models created before this date (RFC3339 format)
modified_after
Date (date-time)
Filter threat models modified after this date (RFC3339 format)
modified_before
Date (date-time)
Filter threat models modified before this date (RFC3339 format)
status
String
Filter by status value (exact match). To filter by multiple statuses, use multiple status parameters or comma-separated values.
status_updated_after
Date (date-time)
Filter threat models where status was updated after this timestamp (RFC3339)
status_updated_before
Date (date-time)
Filter threat models where status was updated before this timestamp (RFC3339)

Responses

Status: 200 - Paginated list of threat models with enhanced metadata and entity counts

Status: 401 - Error response

Status: 500 - Error response


patchThreatModel

Partially update a threat model

Applies JSON Patch operations to a threat model; restricted to writer/owner roles


/threat_models/{threat_model_id}

Usage and SDK Samples

curl -X PATCH\
 -H "Authorization: Bearer [[accessToken]]"\
-H "Accept: application/json"\
-H "Content-Type: application/json-patch+json"\
"http://localhost:8080/threat_models/{threat_model_id}"
import io.swagger.client.*;
import io.swagger.client.auth.*;
import io.swagger.client.model.*;
import io.swagger.client.api.ThreatModelsApi;

import java.io.File;
import java.util.*;

public class ThreatModelsApiExample {

    public static void main(String[] args) {
        ApiClient defaultClient = Configuration.getDefaultApiClient();


        ThreatModelsApi apiInstance = new ThreatModelsApi();
        UUID threatModelId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // UUID | Unique identifier of the threat model to update (UUID)
        array[threat_models_threat_model_id_body] body = ; // array[threat_models_threat_model_id_body] | 
        try {
            ThreatModel result = apiInstance.patchThreatModel(threatModelId, body);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling ThreatModelsApi#patchThreatModel");
            e.printStackTrace();
        }
    }
}
import io.swagger.client.api.ThreatModelsApi;

public class ThreatModelsApiExample {

    public static void main(String[] args) {
        ThreatModelsApi apiInstance = new ThreatModelsApi();
        UUID threatModelId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // UUID | Unique identifier of the threat model to update (UUID)
        array[threat_models_threat_model_id_body] body = ; // array[threat_models_threat_model_id_body] | 
        try {
            ThreatModel result = apiInstance.patchThreatModel(threatModelId, body);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling ThreatModelsApi#patchThreatModel");
            e.printStackTrace();
        }
    }
}
Configuration *apiConfig = [Configuration sharedConfig];
UUID *threatModelId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // Unique identifier of the threat model to update (UUID)
array[threat_models_threat_model_id_body] *body = ; //  (optional)

ThreatModelsApi *apiInstance = [[ThreatModelsApi alloc] init];

// Partially update a threat model
[apiInstance patchThreatModelWith:threatModelId
    body:body
              completionHandler: ^(ThreatModel output, NSError* error) {
                            if (output) {
                                NSLog(@"%@", output);
                            }
                            if (error) {
                                NSLog(@"Error: %@", error);
                            }
                        }];
var TmiThreatModelingImprovedApi = require('tmi__threat_modeling_improved_api');
var defaultClient = TmiThreatModelingImprovedApi.ApiClient.instance;


var api = new TmiThreatModelingImprovedApi.ThreatModelsApi()
var threatModelId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // {{UUID}} Unique identifier of the threat model to update (UUID)
var opts = { 
  'body':  // {{array[threat_models_threat_model_id_body]}} 
};
var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
};
api.patchThreatModel(threatModelId, opts, callback);
using System;
using System.Diagnostics;
using IO.Swagger.Api;
using IO.Swagger.Client;
using IO.Swagger.Model;

namespace Example
{
    public class patchThreatModelExample
    {
        public void main()
        {


            var apiInstance = new ThreatModelsApi();
            var threatModelId = new UUID(); // UUID | Unique identifier of the threat model to update (UUID)
            var body = new array[threat_models_threat_model_id_body](); // array[threat_models_threat_model_id_body] |  (optional) 

            try
            {
                // Partially update a threat model
                ThreatModel result = apiInstance.patchThreatModel(threatModelId, body);
                Debug.WriteLine(result);
            }
            catch (Exception e)
            {
                Debug.Print("Exception when calling ThreatModelsApi.patchThreatModel: " + e.Message );
            }
        }
    }
}
<?php
require_once(__DIR__ . '/vendor/autoload.php');


$api_instance = new Swagger\Client\ApiThreatModelsApi();
$threatModelId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // UUID | Unique identifier of the threat model to update (UUID)
$body = ; // array[threat_models_threat_model_id_body] | 

try {
    $result = $api_instance->patchThreatModel($threatModelId, $body);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling ThreatModelsApi->patchThreatModel: ', $e->getMessage(), PHP_EOL;
}
?>
use Data::Dumper;
use WWW::SwaggerClient::Configuration;
use WWW::SwaggerClient::ThreatModelsApi;


my $api_instance = WWW::SwaggerClient::ThreatModelsApi->new();
my $threatModelId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; # UUID | Unique identifier of the threat model to update (UUID)
my $body = [WWW::SwaggerClient::Object::array[threat_models_threat_model_id_body]->new()]; # array[threat_models_threat_model_id_body] | 

eval { 
    my $result = $api_instance->patchThreatModel(threatModelId => $threatModelId, body => $body);
    print Dumper($result);
};
if ($@) {
    warn "Exception when calling ThreatModelsApi->patchThreatModel: $@\n";
}
from __future__ import print_statement
import time
import swagger_client
from swagger_client.rest import ApiException
from pprint import pprint


# create an instance of the API class
api_instance = swagger_client.ThreatModelsApi()
threatModelId = 38400000-8cf0-11bd-b23e-10b96e4ef00d # UUID | Unique identifier of the threat model to update (UUID)
body =  # array[threat_models_threat_model_id_body] |  (optional)

try: 
    # Partially update a threat model
    api_response = api_instance.patch_threat_model(threatModelId, body=body)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling ThreatModelsApi->patchThreatModel: %s\n" % e)

Parameters

Path parameters
Name Description
threat_model_id*
UUID (uuid)
Unique identifier of the threat model to update (UUID)
Required
Body parameters
Name Description
body

Responses

Status: 200 - Threat model updated successfully

Status: 400 - Error response

Status: 401 - Error response

Status: 403 - Error response

Status: 404 - Error response

Status: 500 - Error response


updateThreatModel

Update a threat model

Fully updates a threat model; restricted to writer/owner roles


/threat_models/{threat_model_id}

Usage and SDK Samples

curl -X PUT\
 -H "Authorization: Bearer [[accessToken]]"\
-H "Accept: application/json"\
-H "Content-Type: application/json"\
"http://localhost:8080/threat_models/{threat_model_id}"
import io.swagger.client.*;
import io.swagger.client.auth.*;
import io.swagger.client.model.*;
import io.swagger.client.api.ThreatModelsApi;

import java.io.File;
import java.util.*;

public class ThreatModelsApiExample {

    public static void main(String[] args) {
        ApiClient defaultClient = Configuration.getDefaultApiClient();


        ThreatModelsApi apiInstance = new ThreatModelsApi();
        ThreatModelInput body = ; // ThreatModelInput | 
        UUID threatModelId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // UUID | Unique identifier of the threat model to update (UUID)
        try {
            ThreatModel result = apiInstance.updateThreatModel(body, threatModelId);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling ThreatModelsApi#updateThreatModel");
            e.printStackTrace();
        }
    }
}
import io.swagger.client.api.ThreatModelsApi;

public class ThreatModelsApiExample {

    public static void main(String[] args) {
        ThreatModelsApi apiInstance = new ThreatModelsApi();
        ThreatModelInput body = ; // ThreatModelInput | 
        UUID threatModelId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // UUID | Unique identifier of the threat model to update (UUID)
        try {
            ThreatModel result = apiInstance.updateThreatModel(body, threatModelId);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling ThreatModelsApi#updateThreatModel");
            e.printStackTrace();
        }
    }
}
Configuration *apiConfig = [Configuration sharedConfig];
ThreatModelInput *body = ; // 
UUID *threatModelId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // Unique identifier of the threat model to update (UUID)

ThreatModelsApi *apiInstance = [[ThreatModelsApi alloc] init];

// Update a threat model
[apiInstance updateThreatModelWith:body
    threatModelId:threatModelId
              completionHandler: ^(ThreatModel output, NSError* error) {
                            if (output) {
                                NSLog(@"%@", output);
                            }
                            if (error) {
                                NSLog(@"Error: %@", error);
                            }
                        }];
var TmiThreatModelingImprovedApi = require('tmi__threat_modeling_improved_api');
var defaultClient = TmiThreatModelingImprovedApi.ApiClient.instance;


var api = new TmiThreatModelingImprovedApi.ThreatModelsApi()
var body = ; // {{ThreatModelInput}} 
var threatModelId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // {{UUID}} Unique identifier of the threat model to update (UUID)

var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
};
api.updateThreatModel(bodythreatModelId, callback);
using System;
using System.Diagnostics;
using IO.Swagger.Api;
using IO.Swagger.Client;
using IO.Swagger.Model;

namespace Example
{
    public class updateThreatModelExample
    {
        public void main()
        {


            var apiInstance = new ThreatModelsApi();
            var body = new ThreatModelInput(); // ThreatModelInput | 
            var threatModelId = new UUID(); // UUID | Unique identifier of the threat model to update (UUID)

            try
            {
                // Update a threat model
                ThreatModel result = apiInstance.updateThreatModel(body, threatModelId);
                Debug.WriteLine(result);
            }
            catch (Exception e)
            {
                Debug.Print("Exception when calling ThreatModelsApi.updateThreatModel: " + e.Message );
            }
        }
    }
}
<?php
require_once(__DIR__ . '/vendor/autoload.php');


$api_instance = new Swagger\Client\ApiThreatModelsApi();
$body = ; // ThreatModelInput | 
$threatModelId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // UUID | Unique identifier of the threat model to update (UUID)

try {
    $result = $api_instance->updateThreatModel($body, $threatModelId);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling ThreatModelsApi->updateThreatModel: ', $e->getMessage(), PHP_EOL;
}
?>
use Data::Dumper;
use WWW::SwaggerClient::Configuration;
use WWW::SwaggerClient::ThreatModelsApi;


my $api_instance = WWW::SwaggerClient::ThreatModelsApi->new();
my $body = WWW::SwaggerClient::Object::ThreatModelInput->new(); # ThreatModelInput | 
my $threatModelId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; # UUID | Unique identifier of the threat model to update (UUID)

eval { 
    my $result = $api_instance->updateThreatModel(body => $body, threatModelId => $threatModelId);
    print Dumper($result);
};
if ($@) {
    warn "Exception when calling ThreatModelsApi->updateThreatModel: $@\n";
}
from __future__ import print_statement
import time
import swagger_client
from swagger_client.rest import ApiException
from pprint import pprint


# create an instance of the API class
api_instance = swagger_client.ThreatModelsApi()
body =  # ThreatModelInput | 
threatModelId = 38400000-8cf0-11bd-b23e-10b96e4ef00d # UUID | Unique identifier of the threat model to update (UUID)

try: 
    # Update a threat model
    api_response = api_instance.update_threat_model(body, threatModelId)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling ThreatModelsApi->updateThreatModel: %s\n" % e)

Parameters

Path parameters
Name Description
threat_model_id*
UUID (uuid)
Unique identifier of the threat model to update (UUID)
Required
Body parameters
Name Description
body *

Responses

Status: 200 - Threat model updated successfully

Status: 400 - Error response

Status: 401 - Error response

Status: 403 - Error response

Status: 404 - Error response

Status: 500 - Error response


Threats

bulkDeleteThreatModelThreats

Bulk DELETE threats

Delete multiple threats in a single request


/threat_models/{threat_model_id}/threats/bulk

Usage and SDK Samples

curl -X DELETE\
 -H "Authorization: Bearer [[accessToken]]"\
-H "Accept: application/json"\
"http://localhost:8080/threat_models/{threat_model_id}/threats/bulk?threat_ids="
import io.swagger.client.*;
import io.swagger.client.auth.*;
import io.swagger.client.model.*;
import io.swagger.client.api.ThreatsApi;

import java.io.File;
import java.util.*;

public class ThreatsApiExample {

    public static void main(String[] args) {
        ApiClient defaultClient = Configuration.getDefaultApiClient();


        ThreatsApi apiInstance = new ThreatsApi();
        UUID threatModelId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // UUID | Unique identifier of the threat model (UUID)
        array[UUID] threatIds = ; // array[UUID] | Comma-separated list of threat IDs to delete (UUID format)
        try {
            inline_response_200_7 result = apiInstance.bulkDeleteThreatModelThreats(threatModelId, threatIds);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling ThreatsApi#bulkDeleteThreatModelThreats");
            e.printStackTrace();
        }
    }
}
import io.swagger.client.api.ThreatsApi;

public class ThreatsApiExample {

    public static void main(String[] args) {
        ThreatsApi apiInstance = new ThreatsApi();
        UUID threatModelId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // UUID | Unique identifier of the threat model (UUID)
        array[UUID] threatIds = ; // array[UUID] | Comma-separated list of threat IDs to delete (UUID format)
        try {
            inline_response_200_7 result = apiInstance.bulkDeleteThreatModelThreats(threatModelId, threatIds);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling ThreatsApi#bulkDeleteThreatModelThreats");
            e.printStackTrace();
        }
    }
}
Configuration *apiConfig = [Configuration sharedConfig];
UUID *threatModelId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // Unique identifier of the threat model (UUID)
array[UUID] *threatIds = ; // Comma-separated list of threat IDs to delete (UUID format)

ThreatsApi *apiInstance = [[ThreatsApi alloc] init];

// Bulk DELETE threats
[apiInstance bulkDeleteThreatModelThreatsWith:threatModelId
    threatIds:threatIds
              completionHandler: ^(inline_response_200_7 output, NSError* error) {
                            if (output) {
                                NSLog(@"%@", output);
                            }
                            if (error) {
                                NSLog(@"Error: %@", error);
                            }
                        }];
var TmiThreatModelingImprovedApi = require('tmi__threat_modeling_improved_api');
var defaultClient = TmiThreatModelingImprovedApi.ApiClient.instance;


var api = new TmiThreatModelingImprovedApi.ThreatsApi()
var threatModelId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // {{UUID}} Unique identifier of the threat model (UUID)
var threatIds = ; // {{array[UUID]}} Comma-separated list of threat IDs to delete (UUID format)

var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
};
api.bulkDeleteThreatModelThreats(threatModelId, threatIds, callback);
using System;
using System.Diagnostics;
using IO.Swagger.Api;
using IO.Swagger.Client;
using IO.Swagger.Model;

namespace Example
{
    public class bulkDeleteThreatModelThreatsExample
    {
        public void main()
        {


            var apiInstance = new ThreatsApi();
            var threatModelId = new UUID(); // UUID | Unique identifier of the threat model (UUID)
            var threatIds = new array[UUID](); // array[UUID] | Comma-separated list of threat IDs to delete (UUID format)

            try
            {
                // Bulk DELETE threats
                inline_response_200_7 result = apiInstance.bulkDeleteThreatModelThreats(threatModelId, threatIds);
                Debug.WriteLine(result);
            }
            catch (Exception e)
            {
                Debug.Print("Exception when calling ThreatsApi.bulkDeleteThreatModelThreats: " + e.Message );
            }
        }
    }
}
<?php
require_once(__DIR__ . '/vendor/autoload.php');


$api_instance = new Swagger\Client\ApiThreatsApi();
$threatModelId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // UUID | Unique identifier of the threat model (UUID)
$threatIds = ; // array[UUID] | Comma-separated list of threat IDs to delete (UUID format)

try {
    $result = $api_instance->bulkDeleteThreatModelThreats($threatModelId, $threatIds);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling ThreatsApi->bulkDeleteThreatModelThreats: ', $e->getMessage(), PHP_EOL;
}
?>
use Data::Dumper;
use WWW::SwaggerClient::Configuration;
use WWW::SwaggerClient::ThreatsApi;


my $api_instance = WWW::SwaggerClient::ThreatsApi->new();
my $threatModelId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; # UUID | Unique identifier of the threat model (UUID)
my $threatIds = []; # array[UUID] | Comma-separated list of threat IDs to delete (UUID format)

eval { 
    my $result = $api_instance->bulkDeleteThreatModelThreats(threatModelId => $threatModelId, threatIds => $threatIds);
    print Dumper($result);
};
if ($@) {
    warn "Exception when calling ThreatsApi->bulkDeleteThreatModelThreats: $@\n";
}
from __future__ import print_statement
import time
import swagger_client
from swagger_client.rest import ApiException
from pprint import pprint


# create an instance of the API class
api_instance = swagger_client.ThreatsApi()
threatModelId = 38400000-8cf0-11bd-b23e-10b96e4ef00d # UUID | Unique identifier of the threat model (UUID)
threatIds =  # array[UUID] | Comma-separated list of threat IDs to delete (UUID format)

try: 
    # Bulk DELETE threats
    api_response = api_instance.bulk_delete_threat_model_threats(threatModelId, threatIds)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling ThreatsApi->bulkDeleteThreatModelThreats: %s\n" % e)

Parameters

Path parameters
Name Description
threat_model_id*
UUID (uuid)
Unique identifier of the threat model (UUID)
Required
Query parameters
Name Description
threat_ids*
array[UUID] (uuid)
Comma-separated list of threat IDs to delete (UUID format)
Required

Responses

Status: 200 - Successfully deleted threats

Status: 400 - Error response

Status: 401 - Error response

Status: 403 - Error response

Status: 404 - Error response


bulkPatchThreatModelThreats

Bulk PATCH threats

Apply JSON Patch operations to multiple threats in a single request


/threat_models/{threat_model_id}/threats/bulk

Usage and SDK Samples

curl -X PATCH\
 -H "Authorization: Bearer [[accessToken]]"\
-H "Accept: application/json"\
-H "Content-Type: application/json-patch+json"\
"http://localhost:8080/threat_models/{threat_model_id}/threats/bulk"
import io.swagger.client.*;
import io.swagger.client.auth.*;
import io.swagger.client.model.*;
import io.swagger.client.api.ThreatsApi;

import java.io.File;
import java.util.*;

public class ThreatsApiExample {

    public static void main(String[] args) {
        ApiClient defaultClient = Configuration.getDefaultApiClient();


        ThreatsApi apiInstance = new ThreatsApi();
        Threats_bulk_body body = ; // Threats_bulk_body | 
        UUID threatModelId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // UUID | Unique identifier of the threat model (UUID)
        try {
            array[Threat] result = apiInstance.bulkPatchThreatModelThreats(body, threatModelId);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling ThreatsApi#bulkPatchThreatModelThreats");
            e.printStackTrace();
        }
    }
}
import io.swagger.client.api.ThreatsApi;

public class ThreatsApiExample {

    public static void main(String[] args) {
        ThreatsApi apiInstance = new ThreatsApi();
        Threats_bulk_body body = ; // Threats_bulk_body | 
        UUID threatModelId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // UUID | Unique identifier of the threat model (UUID)
        try {
            array[Threat] result = apiInstance.bulkPatchThreatModelThreats(body, threatModelId);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling ThreatsApi#bulkPatchThreatModelThreats");
            e.printStackTrace();
        }
    }
}
Configuration *apiConfig = [Configuration sharedConfig];
Threats_bulk_body *body = ; // 
UUID *threatModelId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // Unique identifier of the threat model (UUID)

ThreatsApi *apiInstance = [[ThreatsApi alloc] init];

// Bulk PATCH threats
[apiInstance bulkPatchThreatModelThreatsWith:body
    threatModelId:threatModelId
              completionHandler: ^(array[Threat] output, NSError* error) {
                            if (output) {
                                NSLog(@"%@", output);
                            }
                            if (error) {
                                NSLog(@"Error: %@", error);
                            }
                        }];
var TmiThreatModelingImprovedApi = require('tmi__threat_modeling_improved_api');
var defaultClient = TmiThreatModelingImprovedApi.ApiClient.instance;


var api = new TmiThreatModelingImprovedApi.ThreatsApi()
var body = ; // {{Threats_bulk_body}} 
var threatModelId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // {{UUID}} Unique identifier of the threat model (UUID)

var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
};
api.bulkPatchThreatModelThreats(bodythreatModelId, callback);
using System;
using System.Diagnostics;
using IO.Swagger.Api;
using IO.Swagger.Client;
using IO.Swagger.Model;

namespace Example
{
    public class bulkPatchThreatModelThreatsExample
    {
        public void main()
        {


            var apiInstance = new ThreatsApi();
            var body = new Threats_bulk_body(); // Threats_bulk_body | 
            var threatModelId = new UUID(); // UUID | Unique identifier of the threat model (UUID)

            try
            {
                // Bulk PATCH threats
                array[Threat] result = apiInstance.bulkPatchThreatModelThreats(body, threatModelId);
                Debug.WriteLine(result);
            }
            catch (Exception e)
            {
                Debug.Print("Exception when calling ThreatsApi.bulkPatchThreatModelThreats: " + e.Message );
            }
        }
    }
}
<?php
require_once(__DIR__ . '/vendor/autoload.php');


$api_instance = new Swagger\Client\ApiThreatsApi();
$body = ; // Threats_bulk_body | 
$threatModelId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // UUID | Unique identifier of the threat model (UUID)

try {
    $result = $api_instance->bulkPatchThreatModelThreats($body, $threatModelId);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling ThreatsApi->bulkPatchThreatModelThreats: ', $e->getMessage(), PHP_EOL;
}
?>
use Data::Dumper;
use WWW::SwaggerClient::Configuration;
use WWW::SwaggerClient::ThreatsApi;


my $api_instance = WWW::SwaggerClient::ThreatsApi->new();
my $body = WWW::SwaggerClient::Object::Threats_bulk_body->new(); # Threats_bulk_body | 
my $threatModelId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; # UUID | Unique identifier of the threat model (UUID)

eval { 
    my $result = $api_instance->bulkPatchThreatModelThreats(body => $body, threatModelId => $threatModelId);
    print Dumper($result);
};
if ($@) {
    warn "Exception when calling ThreatsApi->bulkPatchThreatModelThreats: $@\n";
}
from __future__ import print_statement
import time
import swagger_client
from swagger_client.rest import ApiException
from pprint import pprint


# create an instance of the API class
api_instance = swagger_client.ThreatsApi()
body =  # Threats_bulk_body | 
threatModelId = 38400000-8cf0-11bd-b23e-10b96e4ef00d # UUID | Unique identifier of the threat model (UUID)

try: 
    # Bulk PATCH threats
    api_response = api_instance.bulk_patch_threat_model_threats(body, threatModelId)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling ThreatsApi->bulkPatchThreatModelThreats: %s\n" % e)

Parameters

Path parameters
Name Description
threat_model_id*
UUID (uuid)
Unique identifier of the threat model (UUID)
Required
Body parameters
Name Description
body *

Responses

Status: 200 - Successfully patched threats

Status: 400 - Error response

Status: 401 - Error response

Status: 403 - Error response

Status: 404 - Error response


Users

deleteUserAccount

Delete authenticated user account and all data

Two-step deletion process: 1. First call (no challenge parameter) - Returns challenge string 2. Second call (with challenge parameter) - Confirms deletion Ownership behavior: - Shared threat models: Transfers ownership to another owner from authorization list - Unshared threat models: Deletes completely along with all child resources


/users/me

Usage and SDK Samples

curl -X DELETE\
 -H "Authorization: Bearer [[accessToken]]"\
-H "Accept: application/json"\
"http://localhost:8080/users/me?challenge="
import io.swagger.client.*;
import io.swagger.client.auth.*;
import io.swagger.client.model.*;
import io.swagger.client.api.UsersApi;

import java.io.File;
import java.util.*;

public class UsersApiExample {

    public static void main(String[] args) {
        ApiClient defaultClient = Configuration.getDefaultApiClient();


        UsersApi apiInstance = new UsersApi();
        String challenge = challenge_example; // String | Challenge string from first request (step 2 only). Must match exactly.
        try {
            DeletionChallenge result = apiInstance.deleteUserAccount(challenge);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling UsersApi#deleteUserAccount");
            e.printStackTrace();
        }
    }
}
import io.swagger.client.api.UsersApi;

public class UsersApiExample {

    public static void main(String[] args) {
        UsersApi apiInstance = new UsersApi();
        String challenge = challenge_example; // String | Challenge string from first request (step 2 only). Must match exactly.
        try {
            DeletionChallenge result = apiInstance.deleteUserAccount(challenge);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling UsersApi#deleteUserAccount");
            e.printStackTrace();
        }
    }
}
Configuration *apiConfig = [Configuration sharedConfig];
String *challenge = challenge_example; // Challenge string from first request (step 2 only). Must match exactly. (optional)

UsersApi *apiInstance = [[UsersApi alloc] init];

// Delete authenticated user account and all data
[apiInstance deleteUserAccountWith:challenge
              completionHandler: ^(DeletionChallenge output, NSError* error) {
                            if (output) {
                                NSLog(@"%@", output);
                            }
                            if (error) {
                                NSLog(@"Error: %@", error);
                            }
                        }];
var TmiThreatModelingImprovedApi = require('tmi__threat_modeling_improved_api');
var defaultClient = TmiThreatModelingImprovedApi.ApiClient.instance;


var api = new TmiThreatModelingImprovedApi.UsersApi()
var opts = { 
  'challenge': challenge_example // {{String}} Challenge string from first request (step 2 only). Must match exactly.
};
var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
};
api.deleteUserAccount(opts, callback);
using System;
using System.Diagnostics;
using IO.Swagger.Api;
using IO.Swagger.Client;
using IO.Swagger.Model;

namespace Example
{
    public class deleteUserAccountExample
    {
        public void main()
        {


            var apiInstance = new UsersApi();
            var challenge = challenge_example;  // String | Challenge string from first request (step 2 only). Must match exactly. (optional) 

            try
            {
                // Delete authenticated user account and all data
                DeletionChallenge result = apiInstance.deleteUserAccount(challenge);
                Debug.WriteLine(result);
            }
            catch (Exception e)
            {
                Debug.Print("Exception when calling UsersApi.deleteUserAccount: " + e.Message );
            }
        }
    }
}
<?php
require_once(__DIR__ . '/vendor/autoload.php');


$api_instance = new Swagger\Client\ApiUsersApi();
$challenge = challenge_example; // String | Challenge string from first request (step 2 only). Must match exactly.

try {
    $result = $api_instance->deleteUserAccount($challenge);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling UsersApi->deleteUserAccount: ', $e->getMessage(), PHP_EOL;
}
?>
use Data::Dumper;
use WWW::SwaggerClient::Configuration;
use WWW::SwaggerClient::UsersApi;


my $api_instance = WWW::SwaggerClient::UsersApi->new();
my $challenge = challenge_example; # String | Challenge string from first request (step 2 only). Must match exactly.

eval { 
    my $result = $api_instance->deleteUserAccount(challenge => $challenge);
    print Dumper($result);
};
if ($@) {
    warn "Exception when calling UsersApi->deleteUserAccount: $@\n";
}
from __future__ import print_statement
import time
import swagger_client
from swagger_client.rest import ApiException
from pprint import pprint


# create an instance of the API class
api_instance = swagger_client.UsersApi()
challenge = challenge_example # String | Challenge string from first request (step 2 only). Must match exactly. (optional)

try: 
    # Delete authenticated user account and all data
    api_response = api_instance.delete_user_account(challenge=challenge)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling UsersApi->deleteUserAccount: %s\n" % e)

Parameters

Query parameters
Name Description
challenge
String
Challenge string from first request (step 2 only). Must match exactly.

Responses

Status: 200 - Challenge issued (step 1)

Status: 204 - User deleted successfully (step 2)

Status: 400 - Invalid or expired challenge, or challenge provided on first request

Status: 401 - Unauthorized - valid JWT token required