| 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::ProductKvStoreApi; | ||
| 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 | # disable_product_kv_store | ||
| 51 | # | ||
| 52 | # Disable product | ||
| 53 | # | ||
| 54 | { | ||
| 55 | my $params = { | ||
| 56 | }; | ||
| 57 | __PACKAGE__->method_documentation->{ 'disable_product_kv_store' } = { | ||
| 58 | summary => 'Disable product', | ||
| 59 | params => $params, | ||
| 60 | returns => undef, | ||
| 61 | }; | ||
| 62 | } | ||
| 63 | # @return void | ||
| 64 | # | ||
| 65 | sub disable_product_kv_store { | ||
| 66 | my ($self, %args) = @_; | ||
| 67 | |||
| 68 | # parse inputs | ||
| 69 | my $_resource_path = '/enabled-products/v1/kv_store'; | ||
| 70 | |||
| 71 | my $_method = 'DELETE'; | ||
| 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(); | ||
| 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 | $self->{api_client}->call_api($_resource_path, $_method, | ||
| 89 | $query_params, $form_params, | ||
| 90 | $header_params, $_body_data, $auth_settings); | ||
| 91 | return; | ||
| 92 | } | ||
| 93 | |||
| 94 | # | ||
| 95 | # enable_kv_store | ||
| 96 | # | ||
| 97 | # Enable product | ||
| 98 | # | ||
| 99 | { | ||
| 100 | my $params = { | ||
| 101 | }; | ||
| 102 | __PACKAGE__->method_documentation->{ 'enable_kv_store' } = { | ||
| 103 | summary => 'Enable product', | ||
| 104 | params => $params, | ||
| 105 | returns => 'KvStoreResponseBodyEnable', | ||
| 106 | }; | ||
| 107 | } | ||
| 108 | # @return KvStoreResponseBodyEnable | ||
| 109 | # | ||
| 110 | sub enable_kv_store { | ||
| 111 | my ($self, %args) = @_; | ||
| 112 | |||
| 113 | # parse inputs | ||
| 114 | my $_resource_path = '/enabled-products/v1/kv_store'; | ||
| 115 | |||
| 116 | my $_method = 'PUT'; | ||
| 117 | my $query_params = {}; | ||
| 118 | my $header_params = {}; | ||
| 119 | my $form_params = {}; | ||
| 120 | |||
| 121 | # 'Accept' and 'Content-Type' header | ||
| 122 | my $_header_accept = $self->{api_client}->select_header_accept('application/json'); | ||
| 123 | if ($_header_accept) { | ||
| 124 | $header_params->{'Accept'} = $_header_accept; | ||
| 125 | } | ||
| 126 | $header_params->{'Content-Type'} = $self->{api_client}->select_header_content_type(); | ||
| 127 | |||
| 128 | my $_body_data; | ||
| 129 | # authentication setting, if any | ||
| 130 | my $auth_settings = [qw(token )]; | ||
| 131 | |||
| 132 | # make the API Call | ||
| 133 | my $response = $self->{api_client}->call_api($_resource_path, $_method, | ||
| 134 | $query_params, $form_params, | ||
| 135 | $header_params, $_body_data, $auth_settings); | ||
| 136 | if (!$response) { | ||
| 137 | return; | ||
| 138 | } | ||
| 139 | my $_response_object = $self->{api_client}->deserialize('KvStoreResponseBodyEnable', $response); | ||
| 140 | return $_response_object; | ||
| 141 | } | ||
| 142 | |||
| 143 | # | ||
| 144 | # get_kv_store | ||
| 145 | # | ||
| 146 | # Get product enablement status | ||
| 147 | # | ||
| 148 | { | ||
| 149 | my $params = { | ||
| 150 | }; | ||
| 151 | __PACKAGE__->method_documentation->{ 'get_kv_store' } = { | ||
| 152 | summary => 'Get product enablement status', | ||
| 153 | params => $params, | ||
| 154 | returns => 'KvStoreResponseBodyEnable', | ||
| 155 | }; | ||
| 156 | } | ||
| 157 | # @return KvStoreResponseBodyEnable | ||
| 158 | # | ||
| 159 | sub get_kv_store { | ||
| 160 | my ($self, %args) = @_; | ||
| 161 | |||
| 162 | # parse inputs | ||
| 163 | my $_resource_path = '/enabled-products/v1/kv_store'; | ||
| 164 | |||
| 165 | my $_method = 'GET'; | ||
| 166 | my $query_params = {}; | ||
| 167 | my $header_params = {}; | ||
| 168 | my $form_params = {}; | ||
| 169 | |||
| 170 | # 'Accept' and 'Content-Type' header | ||
| 171 | my $_header_accept = $self->{api_client}->select_header_accept('application/json'); | ||
| 172 | if ($_header_accept) { | ||
| 173 | $header_params->{'Accept'} = $_header_accept; | ||
| 174 | } | ||
| 175 | $header_params->{'Content-Type'} = $self->{api_client}->select_header_content_type(); | ||
| 176 | |||
| 177 | my $_body_data; | ||
| 178 | # authentication setting, if any | ||
| 179 | my $auth_settings = [qw(token )]; | ||
| 180 | |||
| 181 | # make the API Call | ||
| 182 | my $response = $self->{api_client}->call_api($_resource_path, $_method, | ||
| 183 | $query_params, $form_params, | ||
| 184 | $header_params, $_body_data, $auth_settings); | ||
| 185 | if (!$response) { | ||
| 186 | return; | ||
| 187 | } | ||
| 188 | my $_response_object = $self->{api_client}->deserialize('KvStoreResponseBodyEnable', $response); | ||
| 189 | return $_response_object; | ||
| 190 | } | ||
| 191 | |||
| 192 | 1; |