| 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::AiRuntimeControlProvidersApi; | ||
| 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_bedrock_setup | ||
| 51 | # | ||
| 52 | # Get Bedrock setup information | ||
| 53 | # | ||
| 54 | { | ||
| 55 | my $params = { | ||
| 56 | }; | ||
| 57 | __PACKAGE__->method_documentation->{ 'arc_get_bedrock_setup' } = { | ||
| 58 | summary => 'Get Bedrock setup information', | ||
| 59 | params => $params, | ||
| 60 | returns => 'ArcBedrockSetupResponse', | ||
| 61 | }; | ||
| 62 | } | ||
| 63 | # @return ArcBedrockSetupResponse | ||
| 64 | # | ||
| 65 | sub arc_get_bedrock_setup { | ||
| 66 | my ($self, %args) = @_; | ||
| 67 | |||
| 68 | # parse inputs | ||
| 69 | my $_resource_path = '/ai-runtime-control/v1/providers/bedrock/setup'; | ||
| 70 | |||
| 71 | my $_method = 'GET'; | ||
| 72 | my $query_params = {}; | ||
| 73 | my $header_params = {}; | ||
| 74 | my $form_params = {}; | ||
| 75 | |||
| 76 | # 'Accept' and 'Content-Type' header | ||
| 77 | my $_header_accept = $self->{api_client}->select_header_accept('application/json', 'application/problem+json'); | ||
| 78 | if ($_header_accept) { | ||
| 79 | $header_params->{'Accept'} = $_header_accept; | ||
| 80 | } | ||
| 81 | $header_params->{'Content-Type'} = $self->{api_client}->select_header_content_type(); | ||
| 82 | |||
| 83 | my $_body_data; | ||
| 84 | # authentication setting, if any | ||
| 85 | my $auth_settings = [qw(token )]; | ||
| 86 | |||
| 87 | # make the API Call | ||
| 88 | my $response = $self->{api_client}->call_api($_resource_path, $_method, | ||
| 89 | $query_params, $form_params, | ||
| 90 | $header_params, $_body_data, $auth_settings); | ||
| 91 | if (!$response) { | ||
| 92 | return; | ||
| 93 | } | ||
| 94 | my $_response_object = $self->{api_client}->deserialize('ArcBedrockSetupResponse', $response); | ||
| 95 | return $_response_object; | ||
| 96 | } | ||
| 97 | |||
| 98 | # | ||
| 99 | # arc_get_models_for_provider | ||
| 100 | # | ||
| 101 | # Get models for a provider | ||
| 102 | # | ||
| 103 | # @param string $provider_id The ID of the provider. (required) | ||
| 104 | { | ||
| 105 | my $params = { | ||
| 106 | 'provider_id' => { | ||
| 107 | data_type => 'string', | ||
| 108 | description => 'The ID of the provider.', | ||
| 109 | required => '1', | ||
| 110 | }, | ||
| 111 | }; | ||
| 112 | __PACKAGE__->method_documentation->{ 'arc_get_models_for_provider' } = { | ||
| 113 | summary => 'Get models for a provider', | ||
| 114 | params => $params, | ||
| 115 | returns => 'ArcModelsResponse', | ||
| 116 | }; | ||
| 117 | } | ||
| 118 | # @return ArcModelsResponse | ||
| 119 | # | ||
| 120 | sub arc_get_models_for_provider { | ||
| 121 | my ($self, %args) = @_; | ||
| 122 | |||
| 123 | # verify the required parameter 'provider_id' is set | ||
| 124 | unless (exists $args{'provider_id'}) { | ||
| 125 | croak("Missing the required parameter 'provider_id' when calling arc_get_models_for_provider"); | ||
| 126 | } | ||
| 127 | |||
| 128 | # parse inputs | ||
| 129 | my $_resource_path = '/ai-runtime-control/v1/providers/{provider_id}/models'; | ||
| 130 | |||
| 131 | my $_method = 'GET'; | ||
| 132 | my $query_params = {}; | ||
| 133 | my $header_params = {}; | ||
| 134 | my $form_params = {}; | ||
| 135 | |||
| 136 | # 'Accept' and 'Content-Type' header | ||
| 137 | my $_header_accept = $self->{api_client}->select_header_accept('application/json', 'application/problem+json'); | ||
| 138 | if ($_header_accept) { | ||
| 139 | $header_params->{'Accept'} = $_header_accept; | ||
| 140 | } | ||
| 141 | $header_params->{'Content-Type'} = $self->{api_client}->select_header_content_type(); | ||
| 142 | |||
| 143 | # path params | ||
| 144 | if ( exists $args{'provider_id'}) { | ||
| 145 | my $_base_variable = "{" . "provider_id" . "}"; | ||
| 146 | my $_base_value = $self->{api_client}->to_path_value($args{'provider_id'}); | ||
| 147 | $_resource_path =~ s/$_base_variable/$_base_value/g; | ||
| 148 | } | ||
| 149 | |||
| 150 | my $_body_data; | ||
| 151 | # authentication setting, if any | ||
| 152 | my $auth_settings = [qw(token )]; | ||
| 153 | |||
| 154 | # make the API Call | ||
| 155 | my $response = $self->{api_client}->call_api($_resource_path, $_method, | ||
| 156 | $query_params, $form_params, | ||
| 157 | $header_params, $_body_data, $auth_settings); | ||
| 158 | if (!$response) { | ||
| 159 | return; | ||
| 160 | } | ||
| 161 | my $_response_object = $self->{api_client}->deserialize('ArcModelsResponse', $response); | ||
| 162 | return $_response_object; | ||
| 163 | } | ||
| 164 | |||
| 165 | # | ||
| 166 | # arc_get_supported_providers | ||
| 167 | # | ||
| 168 | # Get supported providers | ||
| 169 | # | ||
| 170 | { | ||
| 171 | my $params = { | ||
| 172 | }; | ||
| 173 | __PACKAGE__->method_documentation->{ 'arc_get_supported_providers' } = { | ||
| 174 | summary => 'Get supported providers', | ||
| 175 | params => $params, | ||
| 176 | returns => 'ArcProvidersResponse', | ||
| 177 | }; | ||
| 178 | } | ||
| 179 | # @return ArcProvidersResponse | ||
| 180 | # | ||
| 181 | sub arc_get_supported_providers { | ||
| 182 | my ($self, %args) = @_; | ||
| 183 | |||
| 184 | # parse inputs | ||
| 185 | my $_resource_path = '/ai-runtime-control/v1/providers'; | ||
| 186 | |||
| 187 | my $_method = 'GET'; | ||
| 188 | my $query_params = {}; | ||
| 189 | my $header_params = {}; | ||
| 190 | my $form_params = {}; | ||
| 191 | |||
| 192 | # 'Accept' and 'Content-Type' header | ||
| 193 | my $_header_accept = $self->{api_client}->select_header_accept('application/json', 'application/problem+json'); | ||
| 194 | if ($_header_accept) { | ||
| 195 | $header_params->{'Accept'} = $_header_accept; | ||
| 196 | } | ||
| 197 | $header_params->{'Content-Type'} = $self->{api_client}->select_header_content_type(); | ||
| 198 | |||
| 199 | my $_body_data; | ||
| 200 | # authentication setting, if any | ||
| 201 | my $auth_settings = [qw(token )]; | ||
| 202 | |||
| 203 | # make the API Call | ||
| 204 | my $response = $self->{api_client}->call_api($_resource_path, $_method, | ||
| 205 | $query_params, $form_params, | ||
| 206 | $header_params, $_body_data, $auth_settings); | ||
| 207 | if (!$response) { | ||
| 208 | return; | ||
| 209 | } | ||
| 210 | my $_response_object = $self->{api_client}->deserialize('ArcProvidersResponse', $response); | ||
| 211 | return $_response_object; | ||
| 212 | } | ||
| 213 | |||
| 214 | 1; |