Files
openapi-generator/samples/client/petstore/perl/docs/UserApi.md
William Cheng 0204bf4ae2 Squashed commit of the following:
commit c5a0d0f7394aa742fa336fff7e7c1d3049761868
Merge: 8c4991ba3e f8ff8c8760
Author: William Cheng <wing328hk@gmail.com>
Date:   Tue Aug 17 18:28:12 2021 +0800

    Merge branch 'mustache-linting' of https://github.com/NathanBaulch/openapi-generator into NathanBaulch-mustache-linting

commit f8ff8c8760
Author: Nathan Baulch <nathan.baulch@gmail.com>
Date:   Thu Aug 5 14:12:47 2021 +1000

    Reorder tags that handle missing values

commit f5d8a33709
Author: Nathan Baulch <nathan.baulch@gmail.com>
Date:   Thu Aug 5 14:08:59 2021 +1000

    Use dot notation where possible

commit 493d14921e
Author: Nathan Baulch <nathan.baulch@gmail.com>
Date:   Thu Aug 5 14:10:49 2021 +1000

    Remove empty tags

commit 32480dc53f
Author: Nathan Baulch <nathan.baulch@gmail.com>
Date:   Thu Aug 5 10:41:58 2021 +1000

    Remove redundant sections

commit a8edabd722
Author: Nathan Baulch <nathan.baulch@gmail.com>
Date:   Wed Aug 4 22:02:22 2021 +1000

    Trim extra EOF new lines

commit e89bd7458e
Author: Nathan Baulch <nathan.baulch@gmail.com>
Date:   Wed Aug 4 21:59:26 2021 +1000

    Trim trailing whitespace
2021-08-17 18:37:51 +08:00

9.2 KiB

WWW::OpenAPIClient::UserApi

Load the API package

use WWW::OpenAPIClient::Object::UserApi;

All URIs are relative to http://petstore.swagger.io:80/v2

Method HTTP request Description
create_user POST /user Create user
create_users_with_array_input POST /user/createWithArray Creates list of users with given input array
create_users_with_list_input POST /user/createWithList Creates list of users with given input array
delete_user DELETE /user/{username} Delete user
get_user_by_name GET /user/{username} Get user by user name
login_user GET /user/login Logs user into the system
logout_user GET /user/logout Logs out current logged in user session
update_user PUT /user/{username} Updated user

create_user

create_user(user => $user)

Create user

This can only be done by the logged in user.

Example

use Data::Dumper;
use WWW::OpenAPIClient::UserApi;
my $api_instance = WWW::OpenAPIClient::UserApi->new(
);

my $user = WWW::OpenAPIClient::Object::User->new(); # User | Created user object

eval {
    $api_instance->create_user(user => $user);
};
if ($@) {
    warn "Exception when calling UserApi->create_user: $@\n";
}

Parameters

Name Type Description Notes
user User Created user object

Return type

void (empty response body)

Authorization

No authorization required

HTTP request headers

  • Content-Type: application/json
  • Accept: Not defined

[Back to top] [Back to API list] [Back to Model list] [Back to README]

create_users_with_array_input

create_users_with_array_input(user => $user)

Creates list of users with given input array

Example

use Data::Dumper;
use WWW::OpenAPIClient::UserApi;
my $api_instance = WWW::OpenAPIClient::UserApi->new(
);

my $user = [WWW::OpenAPIClient::Object::ARRAY[User]->new()]; # ARRAY[User] | List of user object

eval {
    $api_instance->create_users_with_array_input(user => $user);
};
if ($@) {
    warn "Exception when calling UserApi->create_users_with_array_input: $@\n";
}

Parameters

Name Type Description Notes
user ARRAY[User] List of user object

Return type

void (empty response body)

Authorization

No authorization required

HTTP request headers

  • Content-Type: application/json
  • Accept: Not defined

[Back to top] [Back to API list] [Back to Model list] [Back to README]

create_users_with_list_input

create_users_with_list_input(user => $user)

Creates list of users with given input array

Example

use Data::Dumper;
use WWW::OpenAPIClient::UserApi;
my $api_instance = WWW::OpenAPIClient::UserApi->new(
);

my $user = [WWW::OpenAPIClient::Object::ARRAY[User]->new()]; # ARRAY[User] | List of user object

eval {
    $api_instance->create_users_with_list_input(user => $user);
};
if ($@) {
    warn "Exception when calling UserApi->create_users_with_list_input: $@\n";
}

Parameters

Name Type Description Notes
user ARRAY[User] List of user object

Return type

void (empty response body)

Authorization

No authorization required

HTTP request headers

  • Content-Type: application/json
  • Accept: Not defined

[Back to top] [Back to API list] [Back to Model list] [Back to README]

delete_user

delete_user(username => $username)

Delete user

This can only be done by the logged in user.

Example

use Data::Dumper;
use WWW::OpenAPIClient::UserApi;
my $api_instance = WWW::OpenAPIClient::UserApi->new(
);

my $username = "username_example"; # string | The name that needs to be deleted

eval {
    $api_instance->delete_user(username => $username);
};
if ($@) {
    warn "Exception when calling UserApi->delete_user: $@\n";
}

Parameters

Name Type Description Notes
username string The name that needs to be deleted

Return type

void (empty response body)

Authorization

No authorization required

HTTP request headers

  • Content-Type: Not defined
  • Accept: Not defined

[Back to top] [Back to API list] [Back to Model list] [Back to README]

get_user_by_name

User get_user_by_name(username => $username)

Get user by user name

Example

use Data::Dumper;
use WWW::OpenAPIClient::UserApi;
my $api_instance = WWW::OpenAPIClient::UserApi->new(
);

my $username = "username_example"; # string | The name that needs to be fetched. Use user1 for testing.

eval {
    my $result = $api_instance->get_user_by_name(username => $username);
    print Dumper($result);
};
if ($@) {
    warn "Exception when calling UserApi->get_user_by_name: $@\n";
}

Parameters

Name Type Description Notes
username string The name that needs to be fetched. Use user1 for testing.

Return type

User

Authorization

No authorization required

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/xml, application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

login_user

string login_user(username => $username, password => $password)

Logs user into the system

Example

use Data::Dumper;
use WWW::OpenAPIClient::UserApi;
my $api_instance = WWW::OpenAPIClient::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->login_user(username => $username, password => $password);
    print Dumper($result);
};
if ($@) {
    warn "Exception when calling UserApi->login_user: $@\n";
}

Parameters

Name Type Description Notes
username string The user name for login
password string The password for login in clear text

Return type

string

Authorization

No authorization required

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/xml, application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

logout_user

logout_user()

Logs out current logged in user session

Example

use Data::Dumper;
use WWW::OpenAPIClient::UserApi;
my $api_instance = WWW::OpenAPIClient::UserApi->new(
);


eval {
    $api_instance->logout_user();
};
if ($@) {
    warn "Exception when calling UserApi->logout_user: $@\n";
}

Parameters

This endpoint does not need any parameter.

Return type

void (empty response body)

Authorization

No authorization required

HTTP request headers

  • Content-Type: Not defined
  • Accept: Not defined

[Back to top] [Back to API list] [Back to Model list] [Back to README]

update_user

update_user(username => $username, user => $user)

Updated user

This can only be done by the logged in user.

Example

use Data::Dumper;
use WWW::OpenAPIClient::UserApi;
my $api_instance = WWW::OpenAPIClient::UserApi->new(
);

my $username = "username_example"; # string | name that need to be deleted
my $user = WWW::OpenAPIClient::Object::User->new(); # User | Updated user object

eval {
    $api_instance->update_user(username => $username, user => $user);
};
if ($@) {
    warn "Exception when calling UserApi->update_user: $@\n";
}

Parameters

Name Type Description Notes
username string name that need to be deleted
user User Updated user object

Return type

void (empty response body)

Authorization

No authorization required

HTTP request headers

  • Content-Type: application/json
  • Accept: Not defined

[Back to top] [Back to API list] [Back to Model list] [Back to README]