diff --git a/modules/swagger-codegen/src/main/java/io/swagger/codegen/CodegenConstants.java b/modules/swagger-codegen/src/main/java/io/swagger/codegen/CodegenConstants.java index aacb5f2737e..89a8666d93d 100644 --- a/modules/swagger-codegen/src/main/java/io/swagger/codegen/CodegenConstants.java +++ b/modules/swagger-codegen/src/main/java/io/swagger/codegen/CodegenConstants.java @@ -19,6 +19,12 @@ public class CodegenConstants { public static final String PHP_INVOKER_PACKAGE = "phpInvokerPackage"; public static final String PHP_INVOKER_PACKAGE_DESC = "root package for generated php code"; + public static final String PERL_MODULE_NAME = "perlModuleName"; + public static final String PERL_MODULE_NAME_DESC = "root module name for generated perl code"; + + public static final String PYTHON_PACKAGE_NAME = "pythonPackageName"; + public static final String PYTHON_PACKAGE_NAME_DESC = "package name for generated python code"; + public static final String GROUP_ID = "groupId"; public static final String GROUP_ID_DESC = "groupId in generated pom.xml"; diff --git a/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/StaticHtml2Generator.java b/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/StaticHtml2Generator.java index 7a07ef8a58f..06c23075e8e 100644 --- a/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/StaticHtml2Generator.java +++ b/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/StaticHtml2Generator.java @@ -24,6 +24,8 @@ public class StaticHtml2Generator extends DefaultCodegen implements CodegenConfi protected String artifactVersion = "1.0.0"; protected String jsProjectName; protected String jsModuleName; + protected String perlModuleName = "WWW::SwaggerClient"; + protected String pythonPackageName = "swagger_client"; public StaticHtml2Generator() { super(); @@ -40,6 +42,8 @@ public class StaticHtml2Generator extends DefaultCodegen implements CodegenConfi cliOptions.add(new CliOption("licenseUrl", "a URL pointing to the full license")); cliOptions.add(new CliOption(CodegenConstants.INVOKER_PACKAGE, CodegenConstants.INVOKER_PACKAGE_DESC)); cliOptions.add(new CliOption(CodegenConstants.PHP_INVOKER_PACKAGE, CodegenConstants.PHP_INVOKER_PACKAGE_DESC)); + cliOptions.add(new CliOption(CodegenConstants.PERL_MODULE_NAME, CodegenConstants.PERL_MODULE_NAME_DESC)); + cliOptions.add(new CliOption(CodegenConstants.PYTHON_PACKAGE_NAME, CodegenConstants.PYTHON_PACKAGE_NAME_DESC)); cliOptions.add(new CliOption(CodegenConstants.PACKAGE_NAME, "C# package name")); cliOptions.add(new CliOption(CodegenConstants.GROUP_ID, CodegenConstants.GROUP_ID_DESC)); cliOptions.add(new CliOption(CodegenConstants.ARTIFACT_ID, CodegenConstants.ARTIFACT_ID_DESC)); @@ -53,6 +57,8 @@ public class StaticHtml2Generator extends DefaultCodegen implements CodegenConfi additionalProperties.put("licenseUrl", "http://apache.org/licenses/LICENSE-2.0.html"); additionalProperties.put(CodegenConstants.INVOKER_PACKAGE, invokerPackage); additionalProperties.put(CodegenConstants.PHP_INVOKER_PACKAGE, phpInvokerPackage); + additionalProperties.put(CodegenConstants.PERL_MODULE_NAME, perlModuleName); + additionalProperties.put(CodegenConstants.PYTHON_PACKAGE_NAME, pythonPackageName); additionalProperties.put(CodegenConstants.PACKAGE_NAME, packageName); additionalProperties.put(CodegenConstants.GROUP_ID, groupId); additionalProperties.put(CodegenConstants.ARTIFACT_ID, artifactId); diff --git a/modules/swagger-codegen/src/main/resources/htmlDocs2/index.mustache b/modules/swagger-codegen/src/main/resources/htmlDocs2/index.mustache index a6b8ad90c7a..01f9f2eb720 100644 --- a/modules/swagger-codegen/src/main/resources/htmlDocs2/index.mustache +++ b/modules/swagger-codegen/src/main/resources/htmlDocs2/index.mustache @@ -218,6 +218,8 @@
{{>sample_php}}
{{>sample_perl}}
+ {{>sample_python}}
+ use Data::Dumper;
+use WWW::SwaggerClient::Configuration;
+use WWW::SwaggerClient::PetApi;
+
+# Configure OAuth2 access token for authorization: petstore_auth
+$WWW::SwaggerClient::Configuration::access_token = 'YOUR_ACCESS_TOKEN';
+
+my $api_instance = WWW::SwaggerClient::PetApi->new();
+my $body = WWW::SwaggerClient::Object::Pet->new(); # Pet | Pet object that needs to be added to the store
+
+eval {
+ $api_instance->addPet(body => $body);
+};
+if ($@) {
+ warn "Exception when calling PetApi->addPet: $@\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: petstore_auth
+swagger_client.configuration.access_token = 'YOUR_ACCESS_TOKEN'
+
+# create an instance of the API class
+api_instance = swagger_client.PetApi()
+body = # Pet | Pet object that needs to be added to the store
+
+try:
+ # Add a new pet to the store
+ api_instance.addPet(body)
+except ApiException as e:
+ print("Exception when calling PetApi->addPet: %s\n" % e)
+ use Data::Dumper;
+use WWW::SwaggerClient::Configuration;
+use WWW::SwaggerClient::PetApi;
+
+# Configure OAuth2 access token for authorization: petstore_auth
+$WWW::SwaggerClient::Configuration::access_token = 'YOUR_ACCESS_TOKEN';
+
+my $api_instance = WWW::SwaggerClient::PetApi->new();
+my $petId = 789; # Long | Pet id to delete
+my $apiKey = apiKey_example; # String |
+
+eval {
+ $api_instance->deletePet(petId => $petId, apiKey => $apiKey);
+};
+if ($@) {
+ warn "Exception when calling PetApi->deletePet: $@\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: petstore_auth
+swagger_client.configuration.access_token = 'YOUR_ACCESS_TOKEN'
+
+# create an instance of the API class
+api_instance = swagger_client.PetApi()
+petId = 789 # Long | Pet id to delete
+apiKey = apiKey_example # String | (optional)
+
+try:
+ # Deletes a pet
+ api_instance.deletePet(petId, apiKey=apiKey)
+except ApiException as e:
+ print("Exception when calling PetApi->deletePet: %s\n" % e)
+ use Data::Dumper;
+use WWW::SwaggerClient::Configuration;
+use WWW::SwaggerClient::PetApi;
+
+# Configure OAuth2 access token for authorization: petstore_auth
+$WWW::SwaggerClient::Configuration::access_token = 'YOUR_ACCESS_TOKEN';
+
+my $api_instance = WWW::SwaggerClient::PetApi->new();
+my $status = []; # array[String] | Status values that need to be considered for filter
+
+eval {
+ my $result = $api_instance->findPetsByStatus(status => $status);
+ print Dumper($result);
+};
+if ($@) {
+ warn "Exception when calling PetApi->findPetsByStatus: $@\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: petstore_auth
+swagger_client.configuration.access_token = 'YOUR_ACCESS_TOKEN'
+
+# create an instance of the API class
+api_instance = swagger_client.PetApi()
+status = # array[String] | Status values that need to be considered for filter
+
+try:
+ # Finds Pets by status
+ api_response = api_instance.findPetsByStatus(status)
+ pprint(api_response)
+except ApiException as e:
+ print("Exception when calling PetApi->findPetsByStatus: %s\n" % e)
+ use Data::Dumper;
+use WWW::SwaggerClient::Configuration;
+use WWW::SwaggerClient::PetApi;
+
+# Configure OAuth2 access token for authorization: petstore_auth
+$WWW::SwaggerClient::Configuration::access_token = 'YOUR_ACCESS_TOKEN';
+
+my $api_instance = WWW::SwaggerClient::PetApi->new();
+my $tags = []; # array[String] | Tags to filter by
+
+eval {
+ my $result = $api_instance->findPetsByTags(tags => $tags);
+ print Dumper($result);
+};
+if ($@) {
+ warn "Exception when calling PetApi->findPetsByTags: $@\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: petstore_auth
+swagger_client.configuration.access_token = 'YOUR_ACCESS_TOKEN'
+
+# create an instance of the API class
+api_instance = swagger_client.PetApi()
+tags = # array[String] | Tags to filter by
+
+try:
+ # Finds Pets by tags
+ api_response = api_instance.findPetsByTags(tags)
+ pprint(api_response)
+except ApiException as e:
+ print("Exception when calling PetApi->findPetsByTags: %s\n" % e)
+ use Data::Dumper;
+use WWW::SwaggerClient::Configuration;
+use WWW::SwaggerClient::PetApi;
+
+# 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::PetApi->new();
+my $petId = 789; # Long | ID of pet to return
+
+eval {
+ my $result = $api_instance->getPetById(petId => $petId);
+ print Dumper($result);
+};
+if ($@) {
+ warn "Exception when calling PetApi->getPetById: $@\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.PetApi()
+petId = 789 # Long | ID of pet to return
+
+try:
+ # Find pet by ID
+ api_response = api_instance.getPetById(petId)
+ pprint(api_response)
+except ApiException as e:
+ print("Exception when calling PetApi->getPetById: %s\n" % e)
+ use Data::Dumper;
+use WWW::SwaggerClient::Configuration;
+use WWW::SwaggerClient::PetApi;
+
+# Configure OAuth2 access token for authorization: petstore_auth
+$WWW::SwaggerClient::Configuration::access_token = 'YOUR_ACCESS_TOKEN';
+
+my $api_instance = WWW::SwaggerClient::PetApi->new();
+my $body = WWW::SwaggerClient::Object::Pet->new(); # Pet | Pet object that needs to be added to the store
+
+eval {
+ $api_instance->updatePet(body => $body);
+};
+if ($@) {
+ warn "Exception when calling PetApi->updatePet: $@\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: petstore_auth
+swagger_client.configuration.access_token = 'YOUR_ACCESS_TOKEN'
+
+# create an instance of the API class
+api_instance = swagger_client.PetApi()
+body = # Pet | Pet object that needs to be added to the store
+
+try:
+ # Update an existing pet
+ api_instance.updatePet(body)
+except ApiException as e:
+ print("Exception when calling PetApi->updatePet: %s\n" % e)
+ use Data::Dumper;
+use WWW::SwaggerClient::Configuration;
+use WWW::SwaggerClient::PetApi;
+
+# Configure OAuth2 access token for authorization: petstore_auth
+$WWW::SwaggerClient::Configuration::access_token = 'YOUR_ACCESS_TOKEN';
+
+my $api_instance = WWW::SwaggerClient::PetApi->new();
+my $petId = 789; # Long | ID of pet that needs to be updated
+my $name = name_example; # String | Updated name of the pet
+my $status = status_example; # String | Updated status of the pet
+
+eval {
+ $api_instance->updatePetWithForm(petId => $petId, name => $name, status => $status);
+};
+if ($@) {
+ warn "Exception when calling PetApi->updatePetWithForm: $@\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: petstore_auth
+swagger_client.configuration.access_token = 'YOUR_ACCESS_TOKEN'
+
+# create an instance of the API class
+api_instance = swagger_client.PetApi()
+petId = 789 # Long | ID of pet that needs to be updated
+name = name_example # String | Updated name of the pet (optional)
+status = status_example # String | Updated status of the pet (optional)
+
+try:
+ # Updates a pet in the store with form data
+ api_instance.updatePetWithForm(petId, name=name, status=status)
+except ApiException as e:
+ print("Exception when calling PetApi->updatePetWithForm: %s\n" % e)
+ use Data::Dumper;
+use WWW::SwaggerClient::Configuration;
+use WWW::SwaggerClient::PetApi;
+
+# Configure OAuth2 access token for authorization: petstore_auth
+$WWW::SwaggerClient::Configuration::access_token = 'YOUR_ACCESS_TOKEN';
+
+my $api_instance = WWW::SwaggerClient::PetApi->new();
+my $petId = 789; # Long | ID of pet to update
+my $additionalMetadata = additionalMetadata_example; # String | Additional data to pass to server
+my $file = /path/to/file.txt; # File | file to upload
+
+eval {
+ my $result = $api_instance->uploadFile(petId => $petId, additionalMetadata => $additionalMetadata, file => $file);
+ print Dumper($result);
+};
+if ($@) {
+ warn "Exception when calling PetApi->uploadFile: $@\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: petstore_auth
+swagger_client.configuration.access_token = 'YOUR_ACCESS_TOKEN'
+
+# create an instance of the API class
+api_instance = swagger_client.PetApi()
+petId = 789 # Long | ID of pet to update
+additionalMetadata = additionalMetadata_example # String | Additional data to pass to server (optional)
+file = /path/to/file.txt # File | file to upload (optional)
+
+try:
+ # uploads an image
+ api_response = api_instance.uploadFile(petId, additionalMetadata=additionalMetadata, file=file)
+ pprint(api_response)
+except ApiException as e:
+ print("Exception when calling PetApi->uploadFile: %s\n" % e)
+ use Data::Dumper;
+use WWW::SwaggerClient::Configuration;
+use WWW::SwaggerClient::StoreApi;
+
+my $api_instance = WWW::SwaggerClient::StoreApi->new();
+my $orderId = orderId_example; # String | ID of the order that needs to be deleted
+
+eval {
+ $api_instance->deleteOrder(orderId => $orderId);
+};
+if ($@) {
+ warn "Exception when calling StoreApi->deleteOrder: $@\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.StoreApi()
+orderId = orderId_example # String | ID of the order that needs to be deleted
+
+try:
+ # Delete purchase order by ID
+ api_instance.deleteOrder(orderId)
+except ApiException as e:
+ print("Exception when calling StoreApi->deleteOrder: %s\n" % e)
+ use Data::Dumper;
+use WWW::SwaggerClient::Configuration;
+use WWW::SwaggerClient::StoreApi;
+
+# 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::StoreApi->new();
+
+eval {
+ my $result = $api_instance->getInventory();
+ print Dumper($result);
+};
+if ($@) {
+ warn "Exception when calling StoreApi->getInventory: $@\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.StoreApi()
+
+try:
+ # Returns pet inventories by status
+ api_response = api_instance.getInventory()
+ pprint(api_response)
+except ApiException as e:
+ print("Exception when calling StoreApi->getInventory: %s\n" % e)
+ use Data::Dumper;
+use WWW::SwaggerClient::Configuration;
+use WWW::SwaggerClient::StoreApi;
+
+my $api_instance = WWW::SwaggerClient::StoreApi->new();
+my $orderId = 789; # Long | ID of pet that needs to be fetched
+
+eval {
+ my $result = $api_instance->getOrderById(orderId => $orderId);
+ print Dumper($result);
+};
+if ($@) {
+ warn "Exception when calling StoreApi->getOrderById: $@\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.StoreApi()
+orderId = 789 # Long | ID of pet that needs to be fetched
+
+try:
+ # Find purchase order by ID
+ api_response = api_instance.getOrderById(orderId)
+ pprint(api_response)
+except ApiException as e:
+ print("Exception when calling StoreApi->getOrderById: %s\n" % e)
+ use Data::Dumper;
+use WWW::SwaggerClient::Configuration;
+use WWW::SwaggerClient::StoreApi;
+
+my $api_instance = WWW::SwaggerClient::StoreApi->new();
+my $body = WWW::SwaggerClient::Object::Order->new(); # Order | order placed for purchasing the pet
+
+eval {
+ my $result = $api_instance->placeOrder(body => $body);
+ print Dumper($result);
+};
+if ($@) {
+ warn "Exception when calling StoreApi->placeOrder: $@\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.StoreApi()
+body = # Order | order placed for purchasing the pet
+
+try:
+ # Place an order for a pet
+ api_response = api_instance.placeOrder(body)
+ pprint(api_response)
+except ApiException as e:
+ print("Exception when calling StoreApi->placeOrder: %s\n" % e)
+ use Data::Dumper;
+use WWW::SwaggerClient::Configuration;
+use WWW::SwaggerClient::UserApi;
+
+my $api_instance = WWW::SwaggerClient::UserApi->new();
+my $body = WWW::SwaggerClient::Object::User->new(); # User | Created user object
+
+eval {
+ $api_instance->createUser(body => $body);
+};
+if ($@) {
+ warn "Exception when calling UserApi->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.UserApi()
+body = # User | Created user object
+
+try:
+ # Create user
+ api_instance.createUser(body)
+except ApiException as e:
+ print("Exception when calling UserApi->createUser: %s\n" % e)
+ use Data::Dumper;
+use WWW::SwaggerClient::Configuration;
+use WWW::SwaggerClient::UserApi;
+
+my $api_instance = WWW::SwaggerClient::UserApi->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 UserApi->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.UserApi()
+body = # array[User] | List of user object
+
+try:
+ # Creates list of users with given input array
+ api_instance.createUsersWithArrayInput(body)
+except ApiException as e:
+ print("Exception when calling UserApi->createUsersWithArrayInput: %s\n" % e)
+ use Data::Dumper;
+use WWW::SwaggerClient::Configuration;
+use WWW::SwaggerClient::UserApi;
+
+my $api_instance = WWW::SwaggerClient::UserApi->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 UserApi->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.UserApi()
+body = # array[User] | List of user object
+
+try:
+ # Creates list of users with given input array
+ api_instance.createUsersWithListInput(body)
+except ApiException as e:
+ print("Exception when calling UserApi->createUsersWithListInput: %s\n" % e)
+ use Data::Dumper;
+use WWW::SwaggerClient::Configuration;
+use WWW::SwaggerClient::UserApi;
+
+my $api_instance = WWW::SwaggerClient::UserApi->new();
+my $username = username_example; # String | The name that needs to be deleted
+
+eval {
+ $api_instance->deleteUser(username => $username);
+};
+if ($@) {
+ warn "Exception when calling UserApi->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.UserApi()
+username = username_example # String | The name that needs to be deleted
+
+try:
+ # Delete user
+ api_instance.deleteUser(username)
+except ApiException as e:
+ print("Exception when calling UserApi->deleteUser: %s\n" % e)
+ use Data::Dumper;
+use WWW::SwaggerClient::Configuration;
+use WWW::SwaggerClient::UserApi;
+
+my $api_instance = WWW::SwaggerClient::UserApi->new();
+my $username = username_example; # String | The name that needs to be fetched. Use user1 for testing.
+
+eval {
+ my $result = $api_instance->getUserByName(username => $username);
+ print Dumper($result);
+};
+if ($@) {
+ warn "Exception when calling UserApi->getUserByName: $@\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.UserApi()
+username = username_example # String | The name that needs to be fetched. Use user1 for testing.
+
+try:
+ # Get user by user name
+ api_response = api_instance.getUserByName(username)
+ pprint(api_response)
+except ApiException as e:
+ print("Exception when calling UserApi->getUserByName: %s\n" % e)
+ use Data::Dumper;
+use WWW::SwaggerClient::Configuration;
+use WWW::SwaggerClient::UserApi;
+
+my $api_instance = WWW::SwaggerClient::UserApi->new();
+my $username = username_example; # String | The user name for login
+my $password = password_example; # String | The password for login in clear text
+
+eval {
+ my $result = $api_instance->loginUser(username => $username, password => $password);
+ print Dumper($result);
+};
+if ($@) {
+ warn "Exception when calling UserApi->loginUser: $@\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.UserApi()
+username = username_example # String | The user name for login
+password = password_example # String | The password for login in clear text
+
+try:
+ # Logs user into the system
+ api_response = api_instance.loginUser(username, password)
+ pprint(api_response)
+except ApiException as e:
+ print("Exception when calling UserApi->loginUser: %s\n" % e)
+ use Data::Dumper;
+use WWW::SwaggerClient::Configuration;
+use WWW::SwaggerClient::UserApi;
+
+my $api_instance = WWW::SwaggerClient::UserApi->new();
+
+eval {
+ $api_instance->logoutUser();
+};
+if ($@) {
+ warn "Exception when calling UserApi->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.UserApi()
+
+try:
+ # Logs out current logged in user session
+ api_instance.logoutUser()
+except ApiException as e:
+ print("Exception when calling UserApi->logoutUser: %s\n" % e)
+ use Data::Dumper;
+use WWW::SwaggerClient::Configuration;
+use WWW::SwaggerClient::UserApi;
+
+my $api_instance = WWW::SwaggerClient::UserApi->new();
+my $username = username_example; # String | name that need to be deleted
+my $body = WWW::SwaggerClient::Object::User->new(); # User | Updated user object
+
+eval {
+ $api_instance->updateUser(username => $username, body => $body);
+};
+if ($@) {
+ warn "Exception when calling UserApi->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.UserApi()
+username = username_example # String | name that need to be deleted
+body = # User | Updated user object
+
+try:
+ # Updated user
+ api_instance.updateUser(username, body)
+except ApiException as e:
+ print("Exception when calling UserApi->updateUser: %s\n" % e)
+