| 1 | =begin comment | ||
| 2 | |||
| 3 | Fastly API | ||
| 4 | |||
| 5 | Via the Fastly API you can perform any of the operations that are possible within the management console, including creating services, domains, and backends, configuring rules or uploading your own application code, as well as account operations such as user administration and billing reports. The API is organized into collections of endpoints that allow manipulation of objects related to Fastly services and accounts. For the most accurate and up-to-date API reference content, visit our [Developer Hub](https://www.fastly.com/documentation/reference/api/) | ||
| 6 | |||
| 7 | The version of the API Spec document: 1.0.0 | ||
| 8 | Contact: oss@fastly.com | ||
| 9 | |||
| 10 | =end comment | ||
| 11 | |||
| 12 | =cut | ||
| 13 | |||
| 14 | # | ||
| 15 | # NOTE: This class is auto generated. | ||
| 16 | # Do not edit the class manually. | ||
| 17 | # | ||
| 18 | package WebService::Fastly::AiRuntimeControlSessionsApi; | ||
| 19 | |||
| 20 | require 5.6.0; | ||
| 21 | use strict; | ||
| 22 | use warnings; | ||
| 23 | use utf8; | ||
| 24 | use Exporter; | ||
| 25 | use Carp qw( croak ); | ||
| 26 | use Log::Any qw($log); | ||
| 27 | |||
| 28 | use WebService::Fastly::ApiClient; | ||
| 29 | |||
| 30 | use base "Class::Data::Inheritable"; | ||
| 31 | |||
| 32 | __PACKAGE__->mk_classdata('method_documentation' => {}); | ||
| 33 | |||
| 34 | sub new { | ||
| 35 | my $class = shift; | ||
| 36 | my $api_client; | ||
| 37 | |||
| 38 | if ($_[0] && ref $_[0] && ref $_[0] eq 'WebService::Fastly::ApiClient' ) { | ||
| 39 | $api_client = $_[0]; | ||
| 40 | } else { | ||
| 41 | $api_client = WebService::Fastly::ApiClient->new(@_); | ||
| 42 | } | ||
| 43 | |||
| 44 | bless { api_client => $api_client }, $class; | ||
| 45 | |||
| 46 | } | ||
| 47 | |||
| 48 | |||
| 49 | # | ||
| 50 | # arc_get_session_logs | ||
| 51 | # | ||
| 52 | # Get session logs | ||
| 53 | # | ||
| 54 | # @param string $key Filter results to a specific virtual key ID. (optional) | ||
| 55 | # @param string $provider Filter results by AI provider connection ID. (optional) | ||
| 56 | # @param string $model Filter results by AI model identifier. (optional) | ||
| 57 | # @param DateTime $from The start of the time range, in RFC 3339 format. (optional) | ||
| 58 | # @param DateTime $to The end of the time range, in RFC 3339 format. Defaults to `now`. (optional) | ||
| 59 | # @param string $cursor Cursor for pagination. Use the `next_cursor` value from a previous response to request the next page of results, or the `prev_cursor` value to request the previous page. (optional) | ||
| 60 | # @param int $limit Limit how many results are returned. (optional, default to 100) | ||
| 61 | # @param string $sort Sort field. Prefix with `-` for descending order (e.g., `sort=-created_at`). (optional, default to 'created_at') | ||
| 62 | { | ||
| 63 | my $params = { | ||
| 64 | 'key' => { | ||
| 65 | data_type => 'string', | ||
| 66 | description => 'Filter results to a specific virtual key ID.', | ||
| 67 | required => '0', | ||
| 68 | }, | ||
| 69 | 'provider' => { | ||
| 70 | data_type => 'string', | ||
| 71 | description => 'Filter results by AI provider connection ID.', | ||
| 72 | required => '0', | ||
| 73 | }, | ||
| 74 | 'model' => { | ||
| 75 | data_type => 'string', | ||
| 76 | description => 'Filter results by AI model identifier.', | ||
| 77 | required => '0', | ||
| 78 | }, | ||
| 79 | 'from' => { | ||
| 80 | data_type => 'DateTime', | ||
| 81 | description => 'The start of the time range, in RFC 3339 format.', | ||
| 82 | required => '0', | ||
| 83 | }, | ||
| 84 | 'to' => { | ||
| 85 | data_type => 'DateTime', | ||
| 86 | description => 'The end of the time range, in RFC 3339 format. Defaults to `now`.', | ||
| 87 | required => '0', | ||
| 88 | }, | ||
| 89 | 'cursor' => { | ||
| 90 | data_type => 'string', | ||
| 91 | description => 'Cursor for pagination. Use the `next_cursor` value from a previous response to request the next page of results, or the `prev_cursor` value to request the previous page. ', | ||
| 92 | required => '0', | ||
| 93 | }, | ||
| 94 | 'limit' => { | ||
| 95 | data_type => 'int', | ||
| 96 | description => 'Limit how many results are returned.', | ||
| 97 | required => '0', | ||
| 98 | }, | ||
| 99 | 'sort' => { | ||
| 100 | data_type => 'string', | ||
| 101 | description => 'Sort field. Prefix with `-` for descending order (e.g., `sort=-created_at`). ', | ||
| 102 | required => '0', | ||
| 103 | }, | ||
| 104 | }; | ||
| 105 | __PACKAGE__->method_documentation->{ 'arc_get_session_logs' } = { | ||
| 106 | summary => 'Get session logs', | ||
| 107 | params => $params, | ||
| 108 | returns => 'ArcSessionsResponse', | ||
| 109 | }; | ||
| 110 | } | ||
| 111 | # @return ArcSessionsResponse | ||
| 112 | # | ||
| 113 | sub arc_get_session_logs { | ||
| 114 | my ($self, %args) = @_; | ||
| 115 | |||
| 116 | # parse inputs | ||
| 117 | my $_resource_path = '/ai-runtime-control/v1/sessions'; | ||
| 118 | |||
| 119 | my $_method = 'GET'; | ||
| 120 | my $query_params = {}; | ||
| 121 | my $header_params = {}; | ||
| 122 | my $form_params = {}; | ||
| 123 | |||
| 124 | # 'Accept' and 'Content-Type' header | ||
| 125 | my $_header_accept = $self->{api_client}->select_header_accept('application/json', 'application/problem+json'); | ||
| 126 | if ($_header_accept) { | ||
| 127 | $header_params->{'Accept'} = $_header_accept; | ||
| 128 | } | ||
| 129 | $header_params->{'Content-Type'} = $self->{api_client}->select_header_content_type(); | ||
| 130 | |||
| 131 | # query params | ||
| 132 | if ( exists $args{'key'}) { | ||
| 133 | $query_params->{'key'} = $self->{api_client}->to_query_value($args{'key'}); | ||
| 134 | } | ||
| 135 | |||
| 136 | # query params | ||
| 137 | if ( exists $args{'provider'}) { | ||
| 138 | $query_params->{'provider'} = $self->{api_client}->to_query_value($args{'provider'}); | ||
| 139 | } | ||
| 140 | |||
| 141 | # query params | ||
| 142 | if ( exists $args{'model'}) { | ||
| 143 | $query_params->{'model'} = $self->{api_client}->to_query_value($args{'model'}); | ||
| 144 | } | ||
| 145 | |||
| 146 | # query params | ||
| 147 | if ( exists $args{'from'}) { | ||
| 148 | $query_params->{'from'} = $self->{api_client}->to_query_value($args{'from'}); | ||
| 149 | } | ||
| 150 | |||
| 151 | # query params | ||
| 152 | if ( exists $args{'to'}) { | ||
| 153 | $query_params->{'to'} = $self->{api_client}->to_query_value($args{'to'}); | ||
| 154 | } | ||
| 155 | |||
| 156 | # query params | ||
| 157 | if ( exists $args{'cursor'}) { | ||
| 158 | $query_params->{'cursor'} = $self->{api_client}->to_query_value($args{'cursor'}); | ||
| 159 | } | ||
| 160 | |||
| 161 | # query params | ||
| 162 | if ( exists $args{'limit'}) { | ||
| 163 | $query_params->{'limit'} = $self->{api_client}->to_query_value($args{'limit'}); | ||
| 164 | } | ||
| 165 | |||
| 166 | # query params | ||
| 167 | if ( exists $args{'sort'}) { | ||
| 168 | $query_params->{'sort'} = $self->{api_client}->to_query_value($args{'sort'}); | ||
| 169 | } | ||
| 170 | |||
| 171 | my $_body_data; | ||
| 172 | # authentication setting, if any | ||
| 173 | my $auth_settings = [qw(token )]; | ||
| 174 | |||
| 175 | # make the API Call | ||
| 176 | my $response = $self->{api_client}->call_api($_resource_path, $_method, | ||
| 177 | $query_params, $form_params, | ||
| 178 | $header_params, $_body_data, $auth_settings); | ||
| 179 | if (!$response) { | ||
| 180 | return; | ||
| 181 | } | ||
| 182 | my $_response_object = $self->{api_client}->deserialize('ArcSessionsResponse', $response); | ||
| 183 | return $_response_object; | ||
| 184 | } | ||
| 185 | |||
| 186 | 1; |