Open Safety

SafetyData

addSubmission

Submit a new a safety submission to the system


/safety/submission

Usage and SDK Samples

curl -X POST "https://opensafety.zone/v2/safety/submission"
import io.swagger.client.*;
import io.swagger.client.auth.*;
import io.swagger.client.model.*;
import io.swagger.client.api.SafetyDataApi;

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

public class SafetyDataApiExample {

    public static void main(String[] args) {
        
        SafetyDataApi apiInstance = new SafetyDataApi();
        Submission body = ; // Submission | Safety object that needs to be added to the system
        try {
            apiInstance.addSubmission(body);
        } catch (ApiException e) {
            System.err.println("Exception when calling SafetyDataApi#addSubmission");
            e.printStackTrace();
        }
    }
}
import io.swagger.client.api.SafetyDataApi;

public class SafetyDataApiExample {

    public static void main(String[] args) {
        SafetyDataApi apiInstance = new SafetyDataApi();
        Submission body = ; // Submission | Safety object that needs to be added to the system
        try {
            apiInstance.addSubmission(body);
        } catch (ApiException e) {
            System.err.println("Exception when calling SafetyDataApi#addSubmission");
            e.printStackTrace();
        }
    }
}
Submission *body = ; // Safety object that needs to be added to the system

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

// Submit a new a safety submission to the system
[apiInstance addSubmissionWith:body
              completionHandler: ^(NSError* error) {
                            if (error) {
                                NSLog(@"Error: %@", error);
                            }
                        }];
var OpenSafety = require('open_safety');

var api = new OpenSafety.SafetyDataApi()

var body = ; // {Submission} Safety object that needs to be added to the system


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

namespace Example
{
    public class addSubmissionExample
    {
        public void main()
        {
            
            var apiInstance = new SafetyDataApi();
            var body = new Submission(); // Submission | Safety object that needs to be added to the system

            try
            {
                // Submit a new a safety submission to the system
                apiInstance.addSubmission(body);
            }
            catch (Exception e)
            {
                Debug.Print("Exception when calling SafetyDataApi.addSubmission: " + e.Message );
            }
        }
    }
}
<?php
require_once(__DIR__ . '/vendor/autoload.php');

$api_instance = new Swagger\Client\Api\SafetyDataApi();
$body = ; // Submission | Safety object that needs to be added to the system

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

my $api_instance = WWW::SwaggerClient::SafetyDataApi->new();
my $body = WWW::SwaggerClient::Object::Submission->new(); # Submission | Safety object that needs to be added to the system

eval { 
    $api_instance->addSubmission(body => $body);
};
if ($@) {
    warn "Exception when calling SafetyDataApi->addSubmission: $@\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.SafetyDataApi()
body =  # Submission | Safety object that needs to be added to the system

try: 
    # Submit a new a safety submission to the system
    api_instance.add_submission(body)
except ApiException as e:
    print("Exception when calling SafetyDataApi->addSubmission: %s\n" % e)

Parameters

Body parameters
Name Description
body *

Responses

Status: 405 - Invalid input


deleteSubmission

Deletes a safety submission


/safety/submission/{submissionId}

Usage and SDK Samples

curl -X DELETE "https://opensafety.zone/v2/safety/submission/{submissionId}"
import io.swagger.client.*;
import io.swagger.client.auth.*;
import io.swagger.client.model.*;
import io.swagger.client.api.SafetyDataApi;

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

public class SafetyDataApiExample {

    public static void main(String[] args) {
        ApiClient defaultClient = Configuration.getDefaultApiClient();
        
        // Configure OAuth2 access token for authorization: safety_auth
        OAuth safety_auth = (OAuth) defaultClient.getAuthentication("safety_auth");
        safety_auth.setAccessToken("YOUR ACCESS TOKEN");

        SafetyDataApi apiInstance = new SafetyDataApi();
        Long submissionId = 789; // Long | Safety submission id to delete
        String apiKey = apiKey_example; // String | 
        try {
            apiInstance.deleteSubmission(submissionId, apiKey);
        } catch (ApiException e) {
            System.err.println("Exception when calling SafetyDataApi#deleteSubmission");
            e.printStackTrace();
        }
    }
}
import io.swagger.client.api.SafetyDataApi;

public class SafetyDataApiExample {

    public static void main(String[] args) {
        SafetyDataApi apiInstance = new SafetyDataApi();
        Long submissionId = 789; // Long | Safety submission id to delete
        String apiKey = apiKey_example; // String | 
        try {
            apiInstance.deleteSubmission(submissionId, apiKey);
        } catch (ApiException e) {
            System.err.println("Exception when calling SafetyDataApi#deleteSubmission");
            e.printStackTrace();
        }
    }
}
Configuration *apiConfig = [Configuration sharedConfig];

// Configure OAuth2 access token for authorization: (authentication scheme: safety_auth)
[apiConfig setAccessToken:@"YOUR_ACCESS_TOKEN"];

Long *submissionId = 789; // Safety submission id to delete
String *apiKey = apiKey_example; //  (optional)

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

// Deletes a safety submission
[apiInstance deleteSubmissionWith:submissionId
    apiKey:apiKey
              completionHandler: ^(NSError* error) {
                            if (error) {
                                NSLog(@"Error: %@", error);
                            }
                        }];
var OpenSafety = require('open_safety');
var defaultClient = OpenSafety.ApiClient.instance;

// Configure OAuth2 access token for authorization: safety_auth
var safety_auth = defaultClient.authentications['safety_auth'];
safety_auth.accessToken = "YOUR ACCESS TOKEN"

var api = new OpenSafety.SafetyDataApi()

var submissionId = 789; // {Long} Safety submission id to delete

var opts = { 
  'apiKey': apiKey_example // {String} 
};

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

namespace Example
{
    public class deleteSubmissionExample
    {
        public void main()
        {
            
            // Configure OAuth2 access token for authorization: safety_auth
            Configuration.Default.AccessToken = "YOUR_ACCESS_TOKEN";

            var apiInstance = new SafetyDataApi();
            var submissionId = 789;  // Long | Safety submission id to delete
            var apiKey = apiKey_example;  // String |  (optional) 

            try
            {
                // Deletes a safety submission
                apiInstance.deleteSubmission(submissionId, apiKey);
            }
            catch (Exception e)
            {
                Debug.Print("Exception when calling SafetyDataApi.deleteSubmission: " + e.Message );
            }
        }
    }
}
<?php
require_once(__DIR__ . '/vendor/autoload.php');

// Configure OAuth2 access token for authorization: safety_auth
Swagger\Client\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');

$api_instance = new Swagger\Client\Api\SafetyDataApi();
$submissionId = 789; // Long | Safety submission id to delete
$apiKey = apiKey_example; // String | 

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

# Configure OAuth2 access token for authorization: safety_auth
$WWW::SwaggerClient::Configuration::access_token = 'YOUR_ACCESS_TOKEN';

my $api_instance = WWW::SwaggerClient::SafetyDataApi->new();
my $submissionId = 789; # Long | Safety submission id to delete
my $apiKey = apiKey_example; # String | 

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

# Configure OAuth2 access token for authorization: safety_auth
swagger_client.configuration.access_token = 'YOUR_ACCESS_TOKEN'

# create an instance of the API class
api_instance = swagger_client.SafetyDataApi()
submissionId = 789 # Long | Safety submission id to delete
apiKey = apiKey_example # String |  (optional)

try: 
    # Deletes a safety submission
    api_instance.delete_submission(submissionId, apiKey=apiKey)
except ApiException as e:
    print("Exception when calling SafetyDataApi->deleteSubmission: %s\n" % e)

Parameters

Path parameters
Name Description
submissionId*
Long (int64)
Safety submission id to delete
Required
Header parameters
Name Description
api_key
String

Responses

Status: 400 - Invalid ID supplied

Status: 404 - Safety submission not found


findsafetyByStatus

Find a safety submission by its status

Multiple status values can be provided with comma separated strings


/safety/findByStatus

Usage and SDK Samples

curl -X GET "https://opensafety.zone/v2/safety/findByStatus?status="
import io.swagger.client.*;
import io.swagger.client.auth.*;
import io.swagger.client.model.*;
import io.swagger.client.api.SafetyDataApi;

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

public class SafetyDataApiExample {

    public static void main(String[] args) {
        ApiClient defaultClient = Configuration.getDefaultApiClient();
        
        // Configure OAuth2 access token for authorization: safety_auth
        OAuth safety_auth = (OAuth) defaultClient.getAuthentication("safety_auth");
        safety_auth.setAccessToken("YOUR ACCESS TOKEN");

        SafetyDataApi apiInstance = new SafetyDataApi();
        array[String] status = ; // array[String] | Status values that need to be considered for filter
        try {
            array[Submission] result = apiInstance.findsafetyByStatus(status);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling SafetyDataApi#findsafetyByStatus");
            e.printStackTrace();
        }
    }
}
import io.swagger.client.api.SafetyDataApi;

public class SafetyDataApiExample {

    public static void main(String[] args) {
        SafetyDataApi apiInstance = new SafetyDataApi();
        array[String] status = ; // array[String] | Status values that need to be considered for filter
        try {
            array[Submission] result = apiInstance.findsafetyByStatus(status);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling SafetyDataApi#findsafetyByStatus");
            e.printStackTrace();
        }
    }
}
Configuration *apiConfig = [Configuration sharedConfig];

// Configure OAuth2 access token for authorization: (authentication scheme: safety_auth)
[apiConfig setAccessToken:@"YOUR_ACCESS_TOKEN"];

array[String] *status = ; // Status values that need to be considered for filter

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

// Find a safety submission by its status
[apiInstance findsafetyByStatusWith:status
              completionHandler: ^(array[Submission] output, NSError* error) {
                            if (output) {
                                NSLog(@"%@", output);
                            }
                            if (error) {
                                NSLog(@"Error: %@", error);
                            }
                        }];
var OpenSafety = require('open_safety');
var defaultClient = OpenSafety.ApiClient.instance;

// Configure OAuth2 access token for authorization: safety_auth
var safety_auth = defaultClient.authentications['safety_auth'];
safety_auth.accessToken = "YOUR ACCESS TOKEN"

var api = new OpenSafety.SafetyDataApi()

var status = ; // {array[String]} Status values that need to be considered for filter


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

namespace Example
{
    public class findsafetyByStatusExample
    {
        public void main()
        {
            
            // Configure OAuth2 access token for authorization: safety_auth
            Configuration.Default.AccessToken = "YOUR_ACCESS_TOKEN";

            var apiInstance = new SafetyDataApi();
            var status = new array[String](); // array[String] | Status values that need to be considered for filter

            try
            {
                // Find a safety submission by its status
                array[Submission] result = apiInstance.findsafetyByStatus(status);
                Debug.WriteLine(result);
            }
            catch (Exception e)
            {
                Debug.Print("Exception when calling SafetyDataApi.findsafetyByStatus: " + e.Message );
            }
        }
    }
}
<?php
require_once(__DIR__ . '/vendor/autoload.php');

// Configure OAuth2 access token for authorization: safety_auth
Swagger\Client\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');

$api_instance = new Swagger\Client\Api\SafetyDataApi();
$status = ; // array[String] | Status values that need to be considered for filter

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

# Configure OAuth2 access token for authorization: safety_auth
$WWW::SwaggerClient::Configuration::access_token = 'YOUR_ACCESS_TOKEN';

my $api_instance = WWW::SwaggerClient::SafetyDataApi->new();
my $status = []; # array[String] | Status values that need to be considered for filter

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

# Configure OAuth2 access token for authorization: safety_auth
swagger_client.configuration.access_token = 'YOUR_ACCESS_TOKEN'

# create an instance of the API class
api_instance = swagger_client.SafetyDataApi()
status =  # array[String] | Status values that need to be considered for filter

try: 
    # Find a safety submission by its status
    api_response = api_instance.findsafety_by_status(status)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling SafetyDataApi->findsafetyByStatus: %s\n" % e)

Parameters

Query parameters
Name Description
status*
array[String]
Status values that need to be considered for filter
Required

Responses

Status: 200 - successful operation

Status: 400 - Invalid status value


getSubmissionById

Find a safety submission by its system ID

Provide the ID of the submission as stored within the system


/safety/submission/{submissionId}

Usage and SDK Samples

curl -X GET -H "api_key: [[apiKey]]" "https://opensafety.zone/v2/safety/submission/{submissionId}"
import io.swagger.client.*;
import io.swagger.client.auth.*;
import io.swagger.client.model.*;
import io.swagger.client.api.SafetyDataApi;

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

public class SafetyDataApiExample {

    public static void main(String[] args) {
        ApiClient defaultClient = Configuration.getDefaultApiClient();
        
        // Configure API key authorization: api_key
        ApiKeyAuth api_key = (ApiKeyAuth) defaultClient.getAuthentication("api_key");
        api_key.setApiKey("YOUR API KEY");
        // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
        //api_key.setApiKeyPrefix("Token");

        SafetyDataApi apiInstance = new SafetyDataApi();
        Long submissionId = 789; // Long | ID of submission to return
        try {
            SafetyData result = apiInstance.getSubmissionById(submissionId);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling SafetyDataApi#getSubmissionById");
            e.printStackTrace();
        }
    }
}
import io.swagger.client.api.SafetyDataApi;

public class SafetyDataApiExample {

    public static void main(String[] args) {
        SafetyDataApi apiInstance = new SafetyDataApi();
        Long submissionId = 789; // Long | ID of submission to return
        try {
            SafetyData result = apiInstance.getSubmissionById(submissionId);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling SafetyDataApi#getSubmissionById");
            e.printStackTrace();
        }
    }
}
Configuration *apiConfig = [Configuration sharedConfig];

// Configure API key authorization: (authentication scheme: api_key)
[apiConfig setApiKey:@"YOUR_API_KEY" forApiKeyIdentifier:@"api_key"];
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
//[apiConfig setApiKeyPrefix:@"Bearer" forApiKeyIdentifier:@"api_key"];

Long *submissionId = 789; // ID of submission to return

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

// Find a safety submission by its system ID
[apiInstance getSubmissionByIdWith:submissionId
              completionHandler: ^(SafetyData output, NSError* error) {
                            if (output) {
                                NSLog(@"%@", output);
                            }
                            if (error) {
                                NSLog(@"Error: %@", error);
                            }
                        }];
var OpenSafety = require('open_safety');
var defaultClient = OpenSafety.ApiClient.instance;

// Configure API key authorization: api_key
var api_key = defaultClient.authentications['api_key'];
api_key.apiKey = "YOUR API KEY"
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//api_key.apiKeyPrefix['api_key'] = "Token"

var api = new OpenSafety.SafetyDataApi()

var submissionId = 789; // {Long} ID of submission to return


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

namespace Example
{
    public class getSubmissionByIdExample
    {
        public void main()
        {
            
            // Configure API key authorization: api_key
            Configuration.Default.ApiKey.Add("api_key", "YOUR_API_KEY");
            // Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
            // Configuration.Default.ApiKeyPrefix.Add("api_key", "Bearer");

            var apiInstance = new SafetyDataApi();
            var submissionId = 789;  // Long | ID of submission to return

            try
            {
                // Find a safety submission by its system ID
                SafetyData result = apiInstance.getSubmissionById(submissionId);
                Debug.WriteLine(result);
            }
            catch (Exception e)
            {
                Debug.Print("Exception when calling SafetyDataApi.getSubmissionById: " + e.Message );
            }
        }
    }
}
<?php
require_once(__DIR__ . '/vendor/autoload.php');

// Configure API key authorization: api_key
Swagger\Client\Configuration::getDefaultConfiguration()->setApiKey('api_key', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// Swagger\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('api_key', 'Bearer');

$api_instance = new Swagger\Client\Api\SafetyDataApi();
$submissionId = 789; // Long | ID of submission to return

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

# Configure API key authorization: api_key
$WWW::SwaggerClient::Configuration::api_key->{'api_key'} = 'YOUR_API_KEY';
# uncomment below to setup prefix (e.g. Bearer) for API key, if needed
#$WWW::SwaggerClient::Configuration::api_key_prefix->{'api_key'} = "Bearer";

my $api_instance = WWW::SwaggerClient::SafetyDataApi->new();
my $submissionId = 789; # Long | ID of submission to return

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

# Configure API key authorization: api_key
swagger_client.configuration.api_key['api_key'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# swagger_client.configuration.api_key_prefix['api_key'] = 'Bearer'

# create an instance of the API class
api_instance = swagger_client.SafetyDataApi()
submissionId = 789 # Long | ID of submission to return

try: 
    # Find a safety submission by its system ID
    api_response = api_instance.get_submission_by_id(submissionId)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling SafetyDataApi->getSubmissionById: %s\n" % e)

Parameters

Path parameters
Name Description
submissionId*
Long (int64)
ID of submission to return
Required

Responses

Status: 200 - successful operation

Status: 400 - Invalid ID supplied

Status: 404 - Submission not found


updateSubmission

Update an existing safety submission on the system


/safety/submission

Usage and SDK Samples

curl -X PUT "https://opensafety.zone/v2/safety/submission"
import io.swagger.client.*;
import io.swagger.client.auth.*;
import io.swagger.client.model.*;
import io.swagger.client.api.SafetyDataApi;

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

public class SafetyDataApiExample {

    public static void main(String[] args) {
        ApiClient defaultClient = Configuration.getDefaultApiClient();
        
        // Configure OAuth2 access token for authorization: safety_auth
        OAuth safety_auth = (OAuth) defaultClient.getAuthentication("safety_auth");
        safety_auth.setAccessToken("YOUR ACCESS TOKEN");

        SafetyDataApi apiInstance = new SafetyDataApi();
        Submission body = ; // Submission | Safety object to update on the system
        try {
            apiInstance.updateSubmission(body);
        } catch (ApiException e) {
            System.err.println("Exception when calling SafetyDataApi#updateSubmission");
            e.printStackTrace();
        }
    }
}
import io.swagger.client.api.SafetyDataApi;

public class SafetyDataApiExample {

    public static void main(String[] args) {
        SafetyDataApi apiInstance = new SafetyDataApi();
        Submission body = ; // Submission | Safety object to update on the system
        try {
            apiInstance.updateSubmission(body);
        } catch (ApiException e) {
            System.err.println("Exception when calling SafetyDataApi#updateSubmission");
            e.printStackTrace();
        }
    }
}
Configuration *apiConfig = [Configuration sharedConfig];

// Configure OAuth2 access token for authorization: (authentication scheme: safety_auth)
[apiConfig setAccessToken:@"YOUR_ACCESS_TOKEN"];

Submission *body = ; // Safety object to update on the system

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

// Update an existing safety submission on the system
[apiInstance updateSubmissionWith:body
              completionHandler: ^(NSError* error) {
                            if (error) {
                                NSLog(@"Error: %@", error);
                            }
                        }];
var OpenSafety = require('open_safety');
var defaultClient = OpenSafety.ApiClient.instance;

// Configure OAuth2 access token for authorization: safety_auth
var safety_auth = defaultClient.authentications['safety_auth'];
safety_auth.accessToken = "YOUR ACCESS TOKEN"

var api = new OpenSafety.SafetyDataApi()

var body = ; // {Submission} Safety object to update on the system


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

namespace Example
{
    public class updateSubmissionExample
    {
        public void main()
        {
            
            // Configure OAuth2 access token for authorization: safety_auth
            Configuration.Default.AccessToken = "YOUR_ACCESS_TOKEN";

            var apiInstance = new SafetyDataApi();
            var body = new Submission(); // Submission | Safety object to update on the system

            try
            {
                // Update an existing safety submission on the system
                apiInstance.updateSubmission(body);
            }
            catch (Exception e)
            {
                Debug.Print("Exception when calling SafetyDataApi.updateSubmission: " + e.Message );
            }
        }
    }
}
<?php
require_once(__DIR__ . '/vendor/autoload.php');

// Configure OAuth2 access token for authorization: safety_auth
Swagger\Client\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');

$api_instance = new Swagger\Client\Api\SafetyDataApi();
$body = ; // Submission | Safety object to update on the system

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

# Configure OAuth2 access token for authorization: safety_auth
$WWW::SwaggerClient::Configuration::access_token = 'YOUR_ACCESS_TOKEN';

my $api_instance = WWW::SwaggerClient::SafetyDataApi->new();
my $body = WWW::SwaggerClient::Object::Submission->new(); # Submission | Safety object to update on the system

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

# Configure OAuth2 access token for authorization: safety_auth
swagger_client.configuration.access_token = 'YOUR_ACCESS_TOKEN'

# create an instance of the API class
api_instance = swagger_client.SafetyDataApi()
body =  # Submission | Safety object to update on the system

try: 
    # Update an existing safety submission on the system
    api_instance.update_submission(body)
except ApiException as e:
    print("Exception when calling SafetyDataApi->updateSubmission: %s\n" % e)

Parameters

Body parameters
Name Description
body *

Responses

Status: 400 - Invalid ID supplied

Status: 404 - Safety Data not found

Status: 405 - Validation exception


SafetyUsers

createUser

Create a safety user

Create a new safety user


/user

Usage and SDK Samples

curl -X POST "https://opensafety.zone/v2/user"
import io.swagger.client.*;
import io.swagger.client.auth.*;
import io.swagger.client.model.*;
import io.swagger.client.api.SafetyUsersApi;

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

public class SafetyUsersApiExample {

    public static void main(String[] args) {
        
        SafetyUsersApi apiInstance = new SafetyUsersApi();
        User body = ; // User | Created user object
        try {
            apiInstance.createUser(body);
        } catch (ApiException e) {
            System.err.println("Exception when calling SafetyUsersApi#createUser");
            e.printStackTrace();
        }
    }
}
import io.swagger.client.api.SafetyUsersApi;

public class SafetyUsersApiExample {

    public static void main(String[] args) {
        SafetyUsersApi apiInstance = new SafetyUsersApi();
        User body = ; // User | Created user object
        try {
            apiInstance.createUser(body);
        } catch (ApiException e) {
            System.err.println("Exception when calling SafetyUsersApi#createUser");
            e.printStackTrace();
        }
    }
}
User *body = ; // Created user object

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

// Create a safety user
[apiInstance createUserWith:body
              completionHandler: ^(NSError* error) {
                            if (error) {
                                NSLog(@"Error: %@", error);
                            }
                        }];
var OpenSafety = require('open_safety');

var api = new OpenSafety.SafetyUsersApi()

var body = ; // {User} Created user object


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

namespace Example
{
    public class createUserExample
    {
        public void main()
        {
            
            var apiInstance = new SafetyUsersApi();
            var body = new User(); // User | Created user object

            try
            {
                // Create a safety user
                apiInstance.createUser(body);
            }
            catch (Exception e)
            {
                Debug.Print("Exception when calling SafetyUsersApi.createUser: " + e.Message );
            }
        }
    }
}
<?php
require_once(__DIR__ . '/vendor/autoload.php');

$api_instance = new Swagger\Client\Api\SafetyUsersApi();
$body = ; // User | Created user object

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

my $api_instance = WWW::SwaggerClient::SafetyUsersApi->new();
my $body = WWW::SwaggerClient::Object::User->new(); # User | Created user object

eval { 
    $api_instance->createUser(body => $body);
};
if ($@) {
    warn "Exception when calling SafetyUsersApi->createUser: $@\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.SafetyUsersApi()
body =  # User | Created user object

try: 
    # Create a safety user
    api_instance.create_user(body)
except ApiException as e:
    print("Exception when calling SafetyUsersApi->createUser: %s\n" % e)

Parameters

Body parameters
Name Description
body *

Responses

Status: default - successful operation


createUsersWithArrayInput

Creates list of users with given input array


/user/createWithArray

Usage and SDK Samples

curl -X POST "https://opensafety.zone/v2/user/createWithArray"
import io.swagger.client.*;
import io.swagger.client.auth.*;
import io.swagger.client.model.*;
import io.swagger.client.api.SafetyUsersApi;

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

public class SafetyUsersApiExample {

    public static void main(String[] args) {
        
        SafetyUsersApi apiInstance = new SafetyUsersApi();
        array[User] body = ; // array[User] | List of user object
        try {
            apiInstance.createUsersWithArrayInput(body);
        } catch (ApiException e) {
            System.err.println("Exception when calling SafetyUsersApi#createUsersWithArrayInput");
            e.printStackTrace();
        }
    }
}
import io.swagger.client.api.SafetyUsersApi;

public class SafetyUsersApiExample {

    public static void main(String[] args) {
        SafetyUsersApi apiInstance = new SafetyUsersApi();
        array[User] body = ; // array[User] | List of user object
        try {
            apiInstance.createUsersWithArrayInput(body);
        } catch (ApiException e) {
            System.err.println("Exception when calling SafetyUsersApi#createUsersWithArrayInput");
            e.printStackTrace();
        }
    }
}
array[User] *body = ; // List of user object

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

// Creates list of users with given input array
[apiInstance createUsersWithArrayInputWith:body
              completionHandler: ^(NSError* error) {
                            if (error) {
                                NSLog(@"Error: %@", error);
                            }
                        }];
var OpenSafety = require('open_safety');

var api = new OpenSafety.SafetyUsersApi()

var body = ; // {array[User]} List of user object


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

namespace Example
{
    public class createUsersWithArrayInputExample
    {
        public void main()
        {
            
            var apiInstance = new SafetyUsersApi();
            var body = new array[User](); // array[User] | List of user object

            try
            {
                // Creates list of users with given input array
                apiInstance.createUsersWithArrayInput(body);
            }
            catch (Exception e)
            {
                Debug.Print("Exception when calling SafetyUsersApi.createUsersWithArrayInput: " + e.Message );
            }
        }
    }
}
<?php
require_once(__DIR__ . '/vendor/autoload.php');

$api_instance = new Swagger\Client\Api\SafetyUsersApi();
$body = ; // array[User] | List of user object

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

my $api_instance = WWW::SwaggerClient::SafetyUsersApi->new();
my $body = [WWW::SwaggerClient::Object::array[User]->new()]; # array[User] | List of user object

eval { 
    $api_instance->createUsersWithArrayInput(body => $body);
};
if ($@) {
    warn "Exception when calling SafetyUsersApi->createUsersWithArrayInput: $@\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.SafetyUsersApi()
body =  # array[User] | List of user object

try: 
    # Creates list of users with given input array
    api_instance.create_users_with_array_input(body)
except ApiException as e:
    print("Exception when calling SafetyUsersApi->createUsersWithArrayInput: %s\n" % e)

Parameters

Body parameters
Name Description
body *

Responses

Status: default - successful operation


createUsersWithListInput

Creates list of users with given input array


/user/createWithList

Usage and SDK Samples

curl -X POST "https://opensafety.zone/v2/user/createWithList"
import io.swagger.client.*;
import io.swagger.client.auth.*;
import io.swagger.client.model.*;
import io.swagger.client.api.SafetyUsersApi;

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

public class SafetyUsersApiExample {

    public static void main(String[] args) {
        
        SafetyUsersApi apiInstance = new SafetyUsersApi();
        array[User] body = ; // array[User] | List of user object
        try {
            apiInstance.createUsersWithListInput(body);
        } catch (ApiException e) {
            System.err.println("Exception when calling SafetyUsersApi#createUsersWithListInput");
            e.printStackTrace();
        }
    }
}
import io.swagger.client.api.SafetyUsersApi;

public class SafetyUsersApiExample {

    public static void main(String[] args) {
        SafetyUsersApi apiInstance = new SafetyUsersApi();
        array[User] body = ; // array[User] | List of user object
        try {
            apiInstance.createUsersWithListInput(body);
        } catch (ApiException e) {
            System.err.println("Exception when calling SafetyUsersApi#createUsersWithListInput");
            e.printStackTrace();
        }
    }
}
array[User] *body = ; // List of user object

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

// Creates list of users with given input array
[apiInstance createUsersWithListInputWith:body
              completionHandler: ^(NSError* error) {
                            if (error) {
                                NSLog(@"Error: %@", error);
                            }
                        }];
var OpenSafety = require('open_safety');

var api = new OpenSafety.SafetyUsersApi()

var body = ; // {array[User]} List of user object


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

namespace Example
{
    public class createUsersWithListInputExample
    {
        public void main()
        {
            
            var apiInstance = new SafetyUsersApi();
            var body = new array[User](); // array[User] | List of user object

            try
            {
                // Creates list of users with given input array
                apiInstance.createUsersWithListInput(body);
            }
            catch (Exception e)
            {
                Debug.Print("Exception when calling SafetyUsersApi.createUsersWithListInput: " + e.Message );
            }
        }
    }
}
<?php
require_once(__DIR__ . '/vendor/autoload.php');

$api_instance = new Swagger\Client\Api\SafetyUsersApi();
$body = ; // array[User] | List of user object

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

my $api_instance = WWW::SwaggerClient::SafetyUsersApi->new();
my $body = [WWW::SwaggerClient::Object::array[User]->new()]; # array[User] | List of user object

eval { 
    $api_instance->createUsersWithListInput(body => $body);
};
if ($@) {
    warn "Exception when calling SafetyUsersApi->createUsersWithListInput: $@\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.SafetyUsersApi()
body =  # array[User] | List of user object

try: 
    # Creates list of users with given input array
    api_instance.create_users_with_list_input(body)
except ApiException as e:
    print("Exception when calling SafetyUsersApi->createUsersWithListInput: %s\n" % e)

Parameters

Body parameters
Name Description
body *

Responses

Status: default - successful operation


deleteUser

Delete user

This can only be done by the logged in user.


/user/{useremail}

Usage and SDK Samples

curl -X DELETE "https://opensafety.zone/v2/user/{useremail}"
import io.swagger.client.*;
import io.swagger.client.auth.*;
import io.swagger.client.model.*;
import io.swagger.client.api.SafetyUsersApi;

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

public class SafetyUsersApiExample {

    public static void main(String[] args) {
        
        SafetyUsersApi apiInstance = new SafetyUsersApi();
        String username = username_example; // String | The name that needs to be deleted
        try {
            apiInstance.deleteUser(username);
        } catch (ApiException e) {
            System.err.println("Exception when calling SafetyUsersApi#deleteUser");
            e.printStackTrace();
        }
    }
}
import io.swagger.client.api.SafetyUsersApi;

public class SafetyUsersApiExample {

    public static void main(String[] args) {
        SafetyUsersApi apiInstance = new SafetyUsersApi();
        String username = username_example; // String | The name that needs to be deleted
        try {
            apiInstance.deleteUser(username);
        } catch (ApiException e) {
            System.err.println("Exception when calling SafetyUsersApi#deleteUser");
            e.printStackTrace();
        }
    }
}
String *username = username_example; // The name that needs to be deleted

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

// Delete user
[apiInstance deleteUserWith:username
              completionHandler: ^(NSError* error) {
                            if (error) {
                                NSLog(@"Error: %@", error);
                            }
                        }];
var OpenSafety = require('open_safety');

var api = new OpenSafety.SafetyUsersApi()

var username = username_example; // {String} The name that needs to be deleted


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

namespace Example
{
    public class deleteUserExample
    {
        public void main()
        {
            
            var apiInstance = new SafetyUsersApi();
            var username = username_example;  // String | The name that needs to be deleted

            try
            {
                // Delete user
                apiInstance.deleteUser(username);
            }
            catch (Exception e)
            {
                Debug.Print("Exception when calling SafetyUsersApi.deleteUser: " + e.Message );
            }
        }
    }
}
<?php
require_once(__DIR__ . '/vendor/autoload.php');

$api_instance = new Swagger\Client\Api\SafetyUsersApi();
$username = username_example; // String | The name that needs to be deleted

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

my $api_instance = WWW::SwaggerClient::SafetyUsersApi->new();
my $username = username_example; # String | The name that needs to be deleted

eval { 
    $api_instance->deleteUser(username => $username);
};
if ($@) {
    warn "Exception when calling SafetyUsersApi->deleteUser: $@\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.SafetyUsersApi()
username = username_example # String | The name that needs to be deleted

try: 
    # Delete user
    api_instance.delete_user(username)
except ApiException as e:
    print("Exception when calling SafetyUsersApi->deleteUser: %s\n" % e)

Parameters

Path parameters
Name Description
username*
String
The name that needs to be deleted
Required

Responses

Status: 400 - Invalid username supplied

Status: 404 - User not found


getUserByEmail

Get user by their username or email address


/user/{useremail}

Usage and SDK Samples

curl -X GET "https://opensafety.zone/v2/user/{useremail}"
import io.swagger.client.*;
import io.swagger.client.auth.*;
import io.swagger.client.model.*;
import io.swagger.client.api.SafetyUsersApi;

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

public class SafetyUsersApiExample {

    public static void main(String[] args) {
        
        SafetyUsersApi apiInstance = new SafetyUsersApi();
        String username = username_example; // String | The name that needs to be fetched. Use user1 for testing. 
        try {
            User result = apiInstance.getUserByEmail(username);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling SafetyUsersApi#getUserByEmail");
            e.printStackTrace();
        }
    }
}
import io.swagger.client.api.SafetyUsersApi;

public class SafetyUsersApiExample {

    public static void main(String[] args) {
        SafetyUsersApi apiInstance = new SafetyUsersApi();
        String username = username_example; // String | The name that needs to be fetched. Use user1 for testing. 
        try {
            User result = apiInstance.getUserByEmail(username);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling SafetyUsersApi#getUserByEmail");
            e.printStackTrace();
        }
    }
}
String *username = username_example; // The name that needs to be fetched. Use user1 for testing. 

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

// Get user by their username or email address
[apiInstance getUserByEmailWith:username
              completionHandler: ^(User output, NSError* error) {
                            if (output) {
                                NSLog(@"%@", output);
                            }
                            if (error) {
                                NSLog(@"Error: %@", error);
                            }
                        }];
var OpenSafety = require('open_safety');

var api = new OpenSafety.SafetyUsersApi()

var username = username_example; // {String} The name that needs to be fetched. Use user1 for testing. 


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

namespace Example
{
    public class getUserByEmailExample
    {
        public void main()
        {
            
            var apiInstance = new SafetyUsersApi();
            var username = username_example;  // String | The name that needs to be fetched. Use user1 for testing. 

            try
            {
                // Get user by their username or email address
                User result = apiInstance.getUserByEmail(username);
                Debug.WriteLine(result);
            }
            catch (Exception e)
            {
                Debug.Print("Exception when calling SafetyUsersApi.getUserByEmail: " + e.Message );
            }
        }
    }
}
<?php
require_once(__DIR__ . '/vendor/autoload.php');

$api_instance = new Swagger\Client\Api\SafetyUsersApi();
$username = username_example; // String | The name that needs to be fetched. Use user1 for testing. 

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

my $api_instance = WWW::SwaggerClient::SafetyUsersApi->new();
my $username = username_example; # String | The name that needs to be fetched. Use user1 for testing. 

eval { 
    my $result = $api_instance->getUserByEmail(username => $username);
    print Dumper($result);
};
if ($@) {
    warn "Exception when calling SafetyUsersApi->getUserByEmail: $@\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.SafetyUsersApi()
username = username_example # String | The name that needs to be fetched. Use user1 for testing. 

try: 
    # Get user by their username or email address
    api_response = api_instance.get_user_by_email(username)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling SafetyUsersApi->getUserByEmail: %s\n" % e)

Parameters

Path parameters
Name Description
username*
String
The name that needs to be fetched. Use user1 for testing.
Required

Responses

Status: 200 - successful operation

Status: 400 - Invalid username supplied

Status: 404 - User not found


getUserById

Get user by sytem Id


/user/{userId}

Usage and SDK Samples

curl -X GET "https://opensafety.zone/v2/user/{userId}"
import io.swagger.client.*;
import io.swagger.client.auth.*;
import io.swagger.client.model.*;
import io.swagger.client.api.SafetyUsersApi;

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

public class SafetyUsersApiExample {

    public static void main(String[] args) {
        
        SafetyUsersApi apiInstance = new SafetyUsersApi();
        String username = username_example; // String | A user from the system. 
        try {
            User result = apiInstance.getUserById(username);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling SafetyUsersApi#getUserById");
            e.printStackTrace();
        }
    }
}
import io.swagger.client.api.SafetyUsersApi;

public class SafetyUsersApiExample {

    public static void main(String[] args) {
        SafetyUsersApi apiInstance = new SafetyUsersApi();
        String username = username_example; // String | A user from the system. 
        try {
            User result = apiInstance.getUserById(username);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling SafetyUsersApi#getUserById");
            e.printStackTrace();
        }
    }
}
String *username = username_example; // A user from the system. 

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

// Get user by sytem Id
[apiInstance getUserByIdWith:username
              completionHandler: ^(User output, NSError* error) {
                            if (output) {
                                NSLog(@"%@", output);
                            }
                            if (error) {
                                NSLog(@"Error: %@", error);
                            }
                        }];
var OpenSafety = require('open_safety');

var api = new OpenSafety.SafetyUsersApi()

var username = username_example; // {String} A user from the system. 


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

namespace Example
{
    public class getUserByIdExample
    {
        public void main()
        {
            
            var apiInstance = new SafetyUsersApi();
            var username = username_example;  // String | A user from the system. 

            try
            {
                // Get user by sytem Id
                User result = apiInstance.getUserById(username);
                Debug.WriteLine(result);
            }
            catch (Exception e)
            {
                Debug.Print("Exception when calling SafetyUsersApi.getUserById: " + e.Message );
            }
        }
    }
}
<?php
require_once(__DIR__ . '/vendor/autoload.php');

$api_instance = new Swagger\Client\Api\SafetyUsersApi();
$username = username_example; // String | A user from the system. 

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

my $api_instance = WWW::SwaggerClient::SafetyUsersApi->new();
my $username = username_example; # String | A user from the system. 

eval { 
    my $result = $api_instance->getUserById(username => $username);
    print Dumper($result);
};
if ($@) {
    warn "Exception when calling SafetyUsersApi->getUserById: $@\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.SafetyUsersApi()
username = username_example # String | A user from the system. 

try: 
    # Get user by sytem Id
    api_response = api_instance.get_user_by_id(username)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling SafetyUsersApi->getUserById: %s\n" % e)

Parameters

Path parameters
Name Description
username*
String
A user from the system.
Required

Responses

Status: 200 - successful operation

Status: 400 - Invalid username supplied

Status: 404 - User not found


updateUser

Updated user

This can only be done by the logged in user.


/user/{useremail}

Usage and SDK Samples

curl -X PUT "https://opensafety.zone/v2/user/{useremail}"
import io.swagger.client.*;
import io.swagger.client.auth.*;
import io.swagger.client.model.*;
import io.swagger.client.api.SafetyUsersApi;

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

public class SafetyUsersApiExample {

    public static void main(String[] args) {
        
        SafetyUsersApi apiInstance = new SafetyUsersApi();
        String username = username_example; // String | name that need to be updated
        User body = ; // User | Updated user object
        try {
            apiInstance.updateUser(username, body);
        } catch (ApiException e) {
            System.err.println("Exception when calling SafetyUsersApi#updateUser");
            e.printStackTrace();
        }
    }
}
import io.swagger.client.api.SafetyUsersApi;

public class SafetyUsersApiExample {

    public static void main(String[] args) {
        SafetyUsersApi apiInstance = new SafetyUsersApi();
        String username = username_example; // String | name that need to be updated
        User body = ; // User | Updated user object
        try {
            apiInstance.updateUser(username, body);
        } catch (ApiException e) {
            System.err.println("Exception when calling SafetyUsersApi#updateUser");
            e.printStackTrace();
        }
    }
}
String *username = username_example; // name that need to be updated
User *body = ; // Updated user object

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

// Updated user
[apiInstance updateUserWith:username
    body:body
              completionHandler: ^(NSError* error) {
                            if (error) {
                                NSLog(@"Error: %@", error);
                            }
                        }];
var OpenSafety = require('open_safety');

var api = new OpenSafety.SafetyUsersApi()

var username = username_example; // {String} name that need to be updated

var body = ; // {User} Updated user object


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

namespace Example
{
    public class updateUserExample
    {
        public void main()
        {
            
            var apiInstance = new SafetyUsersApi();
            var username = username_example;  // String | name that need to be updated
            var body = new User(); // User | Updated user object

            try
            {
                // Updated user
                apiInstance.updateUser(username, body);
            }
            catch (Exception e)
            {
                Debug.Print("Exception when calling SafetyUsersApi.updateUser: " + e.Message );
            }
        }
    }
}
<?php
require_once(__DIR__ . '/vendor/autoload.php');

$api_instance = new Swagger\Client\Api\SafetyUsersApi();
$username = username_example; // String | name that need to be updated
$body = ; // User | Updated user object

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

my $api_instance = WWW::SwaggerClient::SafetyUsersApi->new();
my $username = username_example; # String | name that need to be updated
my $body = WWW::SwaggerClient::Object::User->new(); # User | Updated user object

eval { 
    $api_instance->updateUser(username => $username, body => $body);
};
if ($@) {
    warn "Exception when calling SafetyUsersApi->updateUser: $@\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.SafetyUsersApi()
username = username_example # String | name that need to be updated
body =  # User | Updated user object

try: 
    # Updated user
    api_instance.update_user(username, body)
except ApiException as e:
    print("Exception when calling SafetyUsersApi->updateUser: %s\n" % e)

Parameters

Path parameters
Name Description
username*
String
name that need to be updated
Required
Body parameters
Name Description
body *

Responses

Status: 400 - Invalid user supplied

Status: 404 - User not found