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
= {
'create_dashboard_request'
=> {
data_type
=>
'CreateDashboardRequest'
,
description
=>
''
,
required
=>
'0'
,
},
};
__PACKAGE__->method_documentation->{
'create_dashboard'
} = {
summary
=>
'Create a new dashboard'
,
params
=>
$params
,
returns
=>
'Dashboard'
,
};
}
sub
create_dashboard {
my
(
$self
,
%args
) =
@_
;
my
$_resource_path
=
'/observability/dashboards'
;
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/json'
);
my
$_body_data
;
if
(
exists
$args
{
'create_dashboard_request'
}) {
$_body_data
=
$args
{
'create_dashboard_request'
};
}
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(
'Dashboard'
,
$response
);
return
$_response_object
;
}
{
my
$params
= {
'dashboard_id'
=> {
data_type
=>
'string'
,
description
=>
''
,
required
=>
'1'
,
},
};
__PACKAGE__->method_documentation->{
'delete_dashboard'
} = {
summary
=>
'Delete an existing dashboard'
,
params
=>
$params
,
returns
=>
undef
,
};
}
sub
delete_dashboard {
my
(
$self
,
%args
) =
@_
;
unless
(
exists
$args
{
'dashboard_id'
}) {
croak(
"Missing the required parameter 'dashboard_id' when calling delete_dashboard"
);
}
my
$_resource_path
=
'/observability/dashboards/{dashboard_id}'
;
my
$_method
=
'DELETE'
;
my
$query_params
= {};
my
$header_params
= {};
my
$form_params
= {};
my
$_header_accept
=
$self
->{api_client}->select_header_accept();
if
(
$_header_accept
) {
$header_params
->{
'Accept'
} =
$_header_accept
;
}
$header_params
->{
'Content-Type'
} =
$self
->{api_client}->select_header_content_type();
if
(
exists
$args
{
'dashboard_id'
}) {
my
$_base_variable
=
"{"
.
"dashboard_id"
.
"}"
;
my
$_base_value
=
$self
->{api_client}->to_path_value(
$args
{
'dashboard_id'
});
$_resource_path
=~ s/
$_base_variable
/
$_base_value
/g;
}
my
$_body_data
;
my
$auth_settings
= [
qw(token )
];
$self
->{api_client}->call_api(
$_resource_path
,
$_method
,
$query_params
,
$form_params
,
$header_params
,
$_body_data
,
$auth_settings
);
return
;
}
{
my
$params
= {
'dashboard_id'
=> {
data_type
=>
'string'
,
description
=>
''
,
required
=>
'1'
,
},
};
__PACKAGE__->method_documentation->{
'get_dashboard'
} = {
summary
=>
'Retrieve a dashboard by ID'
,
params
=>
$params
,
returns
=>
'Dashboard'
,
};
}
sub
get_dashboard {
my
(
$self
,
%args
) =
@_
;
unless
(
exists
$args
{
'dashboard_id'
}) {
croak(
"Missing the required parameter 'dashboard_id' when calling get_dashboard"
);
}
my
$_resource_path
=
'/observability/dashboards/{dashboard_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
{
'dashboard_id'
}) {
my
$_base_variable
=
"{"
.
"dashboard_id"
.
"}"
;
my
$_base_value
=
$self
->{api_client}->to_path_value(
$args
{
'dashboard_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(
'Dashboard'
,
$response
);
return
$_response_object
;
}
{
my
$params
= {
};
__PACKAGE__->method_documentation->{
'list_dashboards'
} = {
summary
=>
'List all custom dashboards'
,
params
=>
$params
,
returns
=>
'ListDashboardsResponse'
,
};
}
sub
list_dashboards {
my
(
$self
,
%args
) =
@_
;
my
$_resource_path
=
'/observability/dashboards'
;
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(
'ListDashboardsResponse'
,
$response
);
return
$_response_object
;
}
{
my
$params
= {
'dashboard_id'
=> {
data_type
=>
'string'
,
description
=>
''
,
required
=>
'1'
,
},
'update_dashboard_request'
=> {
data_type
=>
'UpdateDashboardRequest'
,
description
=>
''
,
required
=>
'0'
,
},
};
__PACKAGE__->method_documentation->{
'update_dashboard'
} = {
summary
=>
'Update an existing dashboard'
,
params
=>
$params
,
returns
=>
'Dashboard'
,
};
}
sub
update_dashboard {
my
(
$self
,
%args
) =
@_
;
unless
(
exists
$args
{
'dashboard_id'
}) {
croak(
"Missing the required parameter 'dashboard_id' when calling update_dashboard"
);
}
my
$_resource_path
=
'/observability/dashboards/{dashboard_id}'
;
my
$_method
=
'PATCH'
;
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/json'
);
if
(
exists
$args
{
'dashboard_id'
}) {
my
$_base_variable
=
"{"
.
"dashboard_id"
.
"}"
;
my
$_base_value
=
$self
->{api_client}->to_path_value(
$args
{
'dashboard_id'
});
$_resource_path
=~ s/
$_base_variable
/
$_base_value
/g;
}
my
$_body_data
;
if
(
exists
$args
{
'update_dashboard_request'
}) {
$_body_data
=
$args
{
'update_dashboard_request'
};
}
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(
'Dashboard'
,
$response
);
return
$_response_object
;
}
1;