Hide Show 12 lines of Pod
require
5.6.0;
__PACKAGE__->mk_classdata(
'method_documentation'
=> {});
sub
new {
my
$class
=
shift
;
my
$api_client
;
if
(
$_
[0] &&
ref
$_
[0] &&
ref
$_
[0] eq
'WebService::Fastly::ApiClient'
) {
$api_client
=
$_
[0];
}
else
{
$api_client
= WebService::Fastly::ApiClient->new(
@_
);
}
bless
{
api_client
=>
$api_client
},
$class
;
}
{
my
$params
= {
'login'
=> {
data_type
=>
'string'
,
description
=>
''
,
required
=>
'0'
,
},
'name'
=> {
data_type
=>
'string'
,
description
=>
'The real life name of the user.'
,
required
=>
'0'
,
},
'limit_services'
=> {
data_type
=>
'boolean'
,
description
=>
'Indicates that the user has limited access to the customer's services.'
,
required
=>
'0'
,
},
'locked'
=> {
data_type
=>
'boolean'
,
description
=>
'Indicates whether the is account is locked for editing or not.'
,
required
=>
'0'
,
},
'require_new_password'
=> {
data_type
=>
'boolean'
,
description
=>
'Indicates if a new password is required at next login.'
,
required
=>
'0'
,
},
'role'
=> {
data_type
=>
'RoleUser'
,
description
=>
''
,
required
=>
'0'
,
},
'two_factor_auth_enabled'
=> {
data_type
=>
'boolean'
,
description
=>
'Indicates if 2FA is enabled on the user.'
,
required
=>
'0'
,
},
'two_factor_setup_required'
=> {
data_type
=>
'boolean'
,
description
=>
'Indicates if 2FA is required by the user's customer account.'
,
required
=>
'0'
,
},
};
__PACKAGE__->method_documentation->{
'create_user'
} = {
summary
=>
'Create a user'
,
params
=>
$params
,
returns
=>
'UserResponse'
,
};
}
sub
create_user {
my
(
$self
,
%args
) =
@_
;
my
$_resource_path
=
'/user'
;
my
$_method
=
'POST'
;
my
$query_params
= {};
my
$header_params
= {};
my
$form_params
= {};
my
$_header_accept
=
$self
->{api_client}->select_header_accept(
'application/json'
);
if
(
$_header_accept
) {
$header_params
->{
'Accept'
} =
$_header_accept
;
}
$header_params
->{
'Content-Type'
} =
$self
->{api_client}->select_header_content_type(
'application/x-www-form-urlencoded'
);
if
(
exists
$args
{
'login'
} ) {
$form_params
->{
'login'
} =
$self
->{api_client}->to_form_value(
$args
{
'login'
});
}
if
(
exists
$args
{
'name'
} ) {
$form_params
->{
'name'
} =
$self
->{api_client}->to_form_value(
$args
{
'name'
});
}
if
(
exists
$args
{
'limit_services'
} ) {
$form_params
->{
'limit_services'
} =
$self
->{api_client}->to_form_value(
$args
{
'limit_services'
});
}
if
(
exists
$args
{
'locked'
} ) {
$form_params
->{
'locked'
} =
$self
->{api_client}->to_form_value(
$args
{
'locked'
});
}
if
(
exists
$args
{
'require_new_password'
} ) {
$form_params
->{
'require_new_password'
} =
$self
->{api_client}->to_form_value(
$args
{
'require_new_password'
});
}
if
(
exists
$args
{
'role'
} ) {
$form_params
->{
'role'
} =
$self
->{api_client}->to_form_value(
$args
{
'role'
});
}
if
(
exists
$args
{
'two_factor_auth_enabled'
} ) {
$form_params
->{
'two_factor_auth_enabled'
} =
$self
->{api_client}->to_form_value(
$args
{
'two_factor_auth_enabled'
});
}
if
(
exists
$args
{
'two_factor_setup_required'
} ) {
$form_params
->{
'two_factor_setup_required'
} =
$self
->{api_client}->to_form_value(
$args
{
'two_factor_setup_required'
});
}
my
$_body_data
;
my
$auth_settings
= [
qw(token )
];
my
$response
=
$self
->{api_client}->call_api(
$_resource_path
,
$_method
,
$query_params
,
$form_params
,
$header_params
,
$_body_data
,
$auth_settings
);
if
(!
$response
) {
return
;
}
my
$_response_object
=
$self
->{api_client}->deserialize(
'UserResponse'
,
$response
);
return
$_response_object
;
}
{
my
$params
= {
'user_id'
=> {
data_type
=>
'string'
,
description
=>
'Alphanumeric string identifying the user.'
,
required
=>
'1'
,
},
};
__PACKAGE__->method_documentation->{
'delete_user'
} = {
summary
=>
'Delete a user'
,
params
=>
$params
,
returns
=>
'InlineResponse200'
,
};
}
sub
delete_user {
my
(
$self
,
%args
) =
@_
;
unless
(
exists
$args
{
'user_id'
}) {
croak(
"Missing the required parameter 'user_id' when calling delete_user"
);
}
my
$_resource_path
=
'/user/{user_id}'
;
my
$_method
=
'DELETE'
;
my
$query_params
= {};
my
$header_params
= {};
my
$form_params
= {};
my
$_header_accept
=
$self
->{api_client}->select_header_accept(
'application/json'
);
if
(
$_header_accept
) {
$header_params
->{
'Accept'
} =
$_header_accept
;
}
$header_params
->{
'Content-Type'
} =
$self
->{api_client}->select_header_content_type();
if
(
exists
$args
{
'user_id'
}) {
my
$_base_variable
=
"{"
.
"user_id"
.
"}"
;
my
$_base_value
=
$self
->{api_client}->to_path_value(
$args
{
'user_id'
});
$_resource_path
=~ s/
$_base_variable
/
$_base_value
/g;
}
my
$_body_data
;
my
$auth_settings
= [
qw(token )
];
my
$response
=
$self
->{api_client}->call_api(
$_resource_path
,
$_method
,
$query_params
,
$form_params
,
$header_params
,
$_body_data
,
$auth_settings
);
if
(!
$response
) {
return
;
}
my
$_response_object
=
$self
->{api_client}->deserialize(
'InlineResponse200'
,
$response
);
return
$_response_object
;
}
{
my
$params
= {
};
__PACKAGE__->method_documentation->{
'get_current_user'
} = {
summary
=>
'Get the current user'
,
params
=>
$params
,
returns
=>
'UserResponse'
,
};
}
sub
get_current_user {
my
(
$self
,
%args
) =
@_
;
my
$_resource_path
=
'/current_user'
;
my
$_method
=
'GET'
;
my
$query_params
= {};
my
$header_params
= {};
my
$form_params
= {};
my
$_header_accept
=
$self
->{api_client}->select_header_accept(
'application/json'
);
if
(
$_header_accept
) {
$header_params
->{
'Accept'
} =
$_header_accept
;
}
$header_params
->{
'Content-Type'
} =
$self
->{api_client}->select_header_content_type();
my
$_body_data
;
my
$auth_settings
= [
qw(token )
];
my
$response
=
$self
->{api_client}->call_api(
$_resource_path
,
$_method
,
$query_params
,
$form_params
,
$header_params
,
$_body_data
,
$auth_settings
);
if
(!
$response
) {
return
;
}
my
$_response_object
=
$self
->{api_client}->deserialize(
'UserResponse'
,
$response
);
return
$_response_object
;
}
{
my
$params
= {
'user_id'
=> {
data_type
=>
'string'
,
description
=>
'Alphanumeric string identifying the user.'
,
required
=>
'1'
,
},
};
__PACKAGE__->method_documentation->{
'get_user'
} = {
summary
=>
'Get a user'
,
params
=>
$params
,
returns
=>
'UserResponse'
,
};
}
sub
get_user {
my
(
$self
,
%args
) =
@_
;
unless
(
exists
$args
{
'user_id'
}) {
croak(
"Missing the required parameter 'user_id' when calling get_user"
);
}
my
$_resource_path
=
'/user/{user_id}'
;
my
$_method
=
'GET'
;
my
$query_params
= {};
my
$header_params
= {};
my
$form_params
= {};
my
$_header_accept
=
$self
->{api_client}->select_header_accept(
'application/json'
);
if
(
$_header_accept
) {
$header_params
->{
'Accept'
} =
$_header_accept
;
}
$header_params
->{
'Content-Type'
} =
$self
->{api_client}->select_header_content_type();
if
(
exists
$args
{
'user_id'
}) {
my
$_base_variable
=
"{"
.
"user_id"
.
"}"
;
my
$_base_value
=
$self
->{api_client}->to_path_value(
$args
{
'user_id'
});
$_resource_path
=~ s/
$_base_variable
/
$_base_value
/g;
}
my
$_body_data
;
my
$auth_settings
= [
qw(token )
];
my
$response
=
$self
->{api_client}->call_api(
$_resource_path
,
$_method
,
$query_params
,
$form_params
,
$header_params
,
$_body_data
,
$auth_settings
);
if
(!
$response
) {
return
;
}
my
$_response_object
=
$self
->{api_client}->deserialize(
'UserResponse'
,
$response
);
return
$_response_object
;
}
{
my
$params
= {
'user_login'
=> {
data_type
=>
'string'
,
description
=>
'The login associated with the user (typically, an email address).'
,
required
=>
'1'
,
},
};
__PACKAGE__->method_documentation->{
'request_password_reset'
} = {
summary
=>
'Request a password reset'
,
params
=>
$params
,
returns
=>
'InlineResponse200'
,
};
}
sub
request_password_reset {
my
(
$self
,
%args
) =
@_
;
unless
(
exists
$args
{
'user_login'
}) {
croak(
"Missing the required parameter 'user_login' when calling request_password_reset"
);
}
my
$_resource_path
=
'/user/{user_login}/password/request_reset'
;
my
$_method
=
'POST'
;
my
$query_params
= {};
my
$header_params
= {};
my
$form_params
= {};
my
$_header_accept
=
$self
->{api_client}->select_header_accept(
'application/json'
);
if
(
$_header_accept
) {
$header_params
->{
'Accept'
} =
$_header_accept
;
}
$header_params
->{
'Content-Type'
} =
$self
->{api_client}->select_header_content_type();
if
(
exists
$args
{
'user_login'
}) {
my
$_base_variable
=
"{"
.
"user_login"
.
"}"
;
my
$_base_value
=
$self
->{api_client}->to_path_value(
$args
{
'user_login'
});
$_resource_path
=~ s/
$_base_variable
/
$_base_value
/g;
}
my
$_body_data
;
my
$auth_settings
= [
qw(token )
];
my
$response
=
$self
->{api_client}->call_api(
$_resource_path
,
$_method
,
$query_params
,
$form_params
,
$header_params
,
$_body_data
,
$auth_settings
);
if
(!
$response
) {
return
;
}
my
$_response_object
=
$self
->{api_client}->deserialize(
'InlineResponse200'
,
$response
);
return
$_response_object
;
}
{
my
$params
= {
'user_id'
=> {
data_type
=>
'string'
,
description
=>
'Alphanumeric string identifying the user.'
,
required
=>
'1'
,
},
'login'
=> {
data_type
=>
'string'
,
description
=>
''
,
required
=>
'0'
,
},
'name'
=> {
data_type
=>
'string'
,
description
=>
'The real life name of the user.'
,
required
=>
'0'
,
},
'limit_services'
=> {
data_type
=>
'boolean'
,
description
=>
'Indicates that the user has limited access to the customer's services.'
,
required
=>
'0'
,
},
'locked'
=> {
data_type
=>
'boolean'
,
description
=>
'Indicates whether the is account is locked for editing or not.'
,
required
=>
'0'
,
},
'require_new_password'
=> {
data_type
=>
'boolean'
,
description
=>
'Indicates if a new password is required at next login.'
,
required
=>
'0'
,
},
'role'
=> {
data_type
=>
'RoleUser'
,
description
=>
''
,
required
=>
'0'
,
},
'two_factor_auth_enabled'
=> {
data_type
=>
'boolean'
,
description
=>
'Indicates if 2FA is enabled on the user.'
,
required
=>
'0'
,
},
'two_factor_setup_required'
=> {
data_type
=>
'boolean'
,
description
=>
'Indicates if 2FA is required by the user's customer account.'
,
required
=>
'0'
,
},
};
__PACKAGE__->method_documentation->{
'update_user'
} = {
summary
=>
'Update a user'
,
params
=>
$params
,
returns
=>
'UserResponse'
,
};
}
sub
update_user {
my
(
$self
,
%args
) =
@_
;
unless
(
exists
$args
{
'user_id'
}) {
croak(
"Missing the required parameter 'user_id' when calling update_user"
);
}
my
$_resource_path
=
'/user/{user_id}'
;
my
$_method
=
'PUT'
;
my
$query_params
= {};
my
$header_params
= {};
my
$form_params
= {};
my
$_header_accept
=
$self
->{api_client}->select_header_accept(
'application/json'
);
if
(
$_header_accept
) {
$header_params
->{
'Accept'
} =
$_header_accept
;
}
$header_params
->{
'Content-Type'
} =
$self
->{api_client}->select_header_content_type(
'application/x-www-form-urlencoded'
);
if
(
exists
$args
{
'user_id'
}) {
my
$_base_variable
=
"{"
.
"user_id"
.
"}"
;
my
$_base_value
=
$self
->{api_client}->to_path_value(
$args
{
'user_id'
});
$_resource_path
=~ s/
$_base_variable
/
$_base_value
/g;
}
if
(
exists
$args
{
'login'
} ) {
$form_params
->{
'login'
} =
$self
->{api_client}->to_form_value(
$args
{
'login'
});
}
if
(
exists
$args
{
'name'
} ) {
$form_params
->{
'name'
} =
$self
->{api_client}->to_form_value(
$args
{
'name'
});
}
if
(
exists
$args
{
'limit_services'
} ) {
$form_params
->{
'limit_services'
} =
$self
->{api_client}->to_form_value(
$args
{
'limit_services'
});
}
if
(
exists
$args
{
'locked'
} ) {
$form_params
->{
'locked'
} =
$self
->{api_client}->to_form_value(
$args
{
'locked'
});
}
if
(
exists
$args
{
'require_new_password'
} ) {
$form_params
->{
'require_new_password'
} =
$self
->{api_client}->to_form_value(
$args
{
'require_new_password'
});
}
if
(
exists
$args
{
'role'
} ) {
$form_params
->{
'role'
} =
$self
->{api_client}->to_form_value(
$args
{
'role'
});
}
if
(
exists
$args
{
'two_factor_auth_enabled'
} ) {
$form_params
->{
'two_factor_auth_enabled'
} =
$self
->{api_client}->to_form_value(
$args
{
'two_factor_auth_enabled'
});
}
if
(
exists
$args
{
'two_factor_setup_required'
} ) {
$form_params
->{
'two_factor_setup_required'
} =
$self
->{api_client}->to_form_value(
$args
{
'two_factor_setup_required'
});
}
my
$_body_data
;
my
$auth_settings
= [
qw(token )
];
my
$response
=
$self
->{api_client}->call_api(
$_resource_path
,
$_method
,
$query_params
,
$form_params
,
$header_params
,
$_body_data
,
$auth_settings
);
if
(!
$response
) {
return
;
}
my
$_response_object
=
$self
->{api_client}->deserialize(
'UserResponse'
,
$response
);
return
$_response_object
;
}
{
my
$params
= {
'old_password'
=> {
data_type
=>
'string'
,
description
=>
'The user's current password.'
,
required
=>
'0'
,
},
'new_password'
=> {
data_type
=>
'string'
,
description
=>
'The user's new password.'
,
required
=>
'0'
,
},
};
__PACKAGE__->method_documentation->{
'update_user_password'
} = {
summary
=>
'Update the user's password'
,
params
=>
$params
,
returns
=>
'UserResponse'
,
};
}
sub
update_user_password {
my
(
$self
,
%args
) =
@_
;
my
$_resource_path
=
'/current_user/password'
;
my
$_method
=
'POST'
;
my
$query_params
= {};
my
$header_params
= {};
my
$form_params
= {};
my
$_header_accept
=
$self
->{api_client}->select_header_accept(
'application/json'
);
if
(
$_header_accept
) {
$header_params
->{
'Accept'
} =
$_header_accept
;
}
$header_params
->{
'Content-Type'
} =
$self
->{api_client}->select_header_content_type(
'application/x-www-form-urlencoded'
);
if
(
exists
$args
{
'old_password'
} ) {
$form_params
->{
'old_password'
} =
$self
->{api_client}->to_form_value(
$args
{
'old_password'
});
}
if
(
exists
$args
{
'new_password'
} ) {
$form_params
->{
'new_password'
} =
$self
->{api_client}->to_form_value(
$args
{
'new_password'
});
}
my
$_body_data
;
my
$auth_settings
= [
qw(session_password_change )
];
my
$response
=
$self
->{api_client}->call_api(
$_resource_path
,
$_method
,
$query_params
,
$form_params
,
$header_params
,
$_body_data
,
$auth_settings
);
if
(!
$response
) {
return
;
}
my
$_response_object
=
$self
->{api_client}->deserialize(
'UserResponse'
,
$response
);
return
$_response_object
;
}
1;