forestvpn_cloud_api 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +7 -0
- data/Gemfile +9 -0
- data/README.md +139 -0
- data/Rakefile +10 -0
- data/docs/Action.md +32 -0
- data/docs/Activity.md +36 -0
- data/docs/Address.md +28 -0
- data/docs/Billing.md +24 -0
- data/docs/Country.md +26 -0
- data/docs/CreateBillingRequest.md +22 -0
- data/docs/CreateOrUpdateDataUsageLimitRequest.md +20 -0
- data/docs/CreateOrUpdatePaymentProfileRequest.md +34 -0
- data/docs/CreateOrUpdateProfileRequest.md +22 -0
- data/docs/DataUsageLimit.md +24 -0
- data/docs/Error.md +20 -0
- data/docs/GeoApi.md +77 -0
- data/docs/LimitsApi.md +447 -0
- data/docs/Location.md +28 -0
- data/docs/PaymentMethod.md +24 -0
- data/docs/PaymentProfile.md +32 -0
- data/docs/Profile.md +26 -0
- data/docs/ProfileStats.md +26 -0
- data/docs/ProfilesApi.md +996 -0
- data/docs/Project.md +22 -0
- data/docs/ResourceRef.md +20 -0
- data/docs/User.md +32 -0
- data/forestvpn_cloud_api.gemspec +39 -0
- data/git_push.sh +57 -0
- data/lib/forestvpn_cloud_api/api/geo_api.rb +77 -0
- data/lib/forestvpn_cloud_api/api/limits_api.rb +405 -0
- data/lib/forestvpn_cloud_api/api/profiles_api.rb +915 -0
- data/lib/forestvpn_cloud_api/api_client.rb +426 -0
- data/lib/forestvpn_cloud_api/api_error.rb +57 -0
- data/lib/forestvpn_cloud_api/configuration.rb +335 -0
- data/lib/forestvpn_cloud_api/models/action.rb +348 -0
- data/lib/forestvpn_cloud_api/models/activity.rb +360 -0
- data/lib/forestvpn_cloud_api/models/address.rb +269 -0
- data/lib/forestvpn_cloud_api/models/billing.rb +266 -0
- data/lib/forestvpn_cloud_api/models/country.rb +282 -0
- data/lib/forestvpn_cloud_api/models/create_billing_request.rb +252 -0
- data/lib/forestvpn_cloud_api/models/create_or_update_data_usage_limit_request.rb +230 -0
- data/lib/forestvpn_cloud_api/models/create_or_update_payment_profile_request.rb +328 -0
- data/lib/forestvpn_cloud_api/models/create_or_update_profile_request.rb +275 -0
- data/lib/forestvpn_cloud_api/models/data_usage_limit.rb +302 -0
- data/lib/forestvpn_cloud_api/models/error.rb +238 -0
- data/lib/forestvpn_cloud_api/models/location.rb +296 -0
- data/lib/forestvpn_cloud_api/models/payment_method.rb +261 -0
- data/lib/forestvpn_cloud_api/models/payment_profile.rb +313 -0
- data/lib/forestvpn_cloud_api/models/profile.rb +320 -0
- data/lib/forestvpn_cloud_api/models/profile_stats.rb +280 -0
- data/lib/forestvpn_cloud_api/models/project.rb +254 -0
- data/lib/forestvpn_cloud_api/models/resource_ref.rb +238 -0
- data/lib/forestvpn_cloud_api/models/user.rb +307 -0
- data/lib/forestvpn_cloud_api/version.rb +15 -0
- data/lib/forestvpn_cloud_api.rb +61 -0
- data/spec/api/geo_api_spec.rb +45 -0
- data/spec/api/limits_api_spec.rb +102 -0
- data/spec/api/profiles_api_spec.rb +195 -0
- data/spec/api_client_spec.rb +188 -0
- data/spec/configuration_spec.rb +42 -0
- data/spec/models/action_spec.rb +80 -0
- data/spec/models/activity_spec.rb +92 -0
- data/spec/models/address_spec.rb +64 -0
- data/spec/models/billing_spec.rb +52 -0
- data/spec/models/country_spec.rb +58 -0
- data/spec/models/create_billing_request_spec.rb +46 -0
- data/spec/models/create_or_update_data_usage_limit_request_spec.rb +40 -0
- data/spec/models/create_or_update_payment_profile_request_spec.rb +82 -0
- data/spec/models/create_or_update_profile_request_spec.rb +50 -0
- data/spec/models/data_usage_limit_spec.rb +56 -0
- data/spec/models/error_spec.rb +40 -0
- data/spec/models/location_spec.rb +64 -0
- data/spec/models/payment_method_spec.rb +52 -0
- data/spec/models/payment_profile_spec.rb +76 -0
- data/spec/models/profile_spec.rb +62 -0
- data/spec/models/profile_stats_spec.rb +58 -0
- data/spec/models/project_spec.rb +46 -0
- data/spec/models/resource_ref_spec.rb +40 -0
- data/spec/models/user_spec.rb +76 -0
- data/spec/spec_helper.rb +111 -0
- metadata +203 -0
data/docs/Project.md
ADDED
@@ -0,0 +1,22 @@
|
|
1
|
+
# ForestVPNCloudAPI::Project
|
2
|
+
|
3
|
+
## Properties
|
4
|
+
|
5
|
+
| Name | Type | Description | Notes |
|
6
|
+
| ---- | ---- | ----------- | ----- |
|
7
|
+
| **id** | **String** | | |
|
8
|
+
| **slug** | **String** | Project slug. Should be globally unique. | |
|
9
|
+
| **name** | **String** | Project name | |
|
10
|
+
|
11
|
+
## Example
|
12
|
+
|
13
|
+
```ruby
|
14
|
+
require 'forestvpn_cloud_api'
|
15
|
+
|
16
|
+
instance = ForestVPNCloudAPI::Project.new(
|
17
|
+
id: null,
|
18
|
+
slug: null,
|
19
|
+
name: null
|
20
|
+
)
|
21
|
+
```
|
22
|
+
|
data/docs/ResourceRef.md
ADDED
@@ -0,0 +1,20 @@
|
|
1
|
+
# ForestVPNCloudAPI::ResourceRef
|
2
|
+
|
3
|
+
## Properties
|
4
|
+
|
5
|
+
| Name | Type | Description | Notes |
|
6
|
+
| ---- | ---- | ----------- | ----- |
|
7
|
+
| **id** | **String** | | |
|
8
|
+
| **type** | **String** | | |
|
9
|
+
|
10
|
+
## Example
|
11
|
+
|
12
|
+
```ruby
|
13
|
+
require 'forestvpn_cloud_api'
|
14
|
+
|
15
|
+
instance = ForestVPNCloudAPI::ResourceRef.new(
|
16
|
+
id: null,
|
17
|
+
type: null
|
18
|
+
)
|
19
|
+
```
|
20
|
+
|
data/docs/User.md
ADDED
@@ -0,0 +1,32 @@
|
|
1
|
+
# ForestVPNCloudAPI::User
|
2
|
+
|
3
|
+
## Properties
|
4
|
+
|
5
|
+
| Name | Type | Description | Notes |
|
6
|
+
| ---- | ---- | ----------- | ----- |
|
7
|
+
| **id** | **String** | | |
|
8
|
+
| **username** | **String** | | |
|
9
|
+
| **first_name** | **String** | | [optional] |
|
10
|
+
| **last_name** | **String** | | [optional] |
|
11
|
+
| **email** | **String** | | |
|
12
|
+
| **email_verified** | **Boolean** | | |
|
13
|
+
| **photo_url** | **String** | | [optional] |
|
14
|
+
| **date_joined** | **Time** | | |
|
15
|
+
|
16
|
+
## Example
|
17
|
+
|
18
|
+
```ruby
|
19
|
+
require 'forestvpn_cloud_api'
|
20
|
+
|
21
|
+
instance = ForestVPNCloudAPI::User.new(
|
22
|
+
id: null,
|
23
|
+
username: null,
|
24
|
+
first_name: null,
|
25
|
+
last_name: null,
|
26
|
+
email: null,
|
27
|
+
email_verified: null,
|
28
|
+
photo_url: null,
|
29
|
+
date_joined: null
|
30
|
+
)
|
31
|
+
```
|
32
|
+
|
@@ -0,0 +1,39 @@
|
|
1
|
+
# -*- encoding: utf-8 -*-
|
2
|
+
|
3
|
+
=begin
|
4
|
+
#ForestVPN Cloud API
|
5
|
+
|
6
|
+
#ForestVPN Cloud - it's a Google Cloud but for VPN apps. Ready to use VPN Cloud Platform minimizes efforts to build fast, secure, and modern VPN apps.
|
7
|
+
|
8
|
+
The version of the OpenAPI document: 2.0
|
9
|
+
Contact: support@forestvpn.com
|
10
|
+
Generated by: https://openapi-generator.tech
|
11
|
+
OpenAPI Generator version: 6.0.0
|
12
|
+
|
13
|
+
=end
|
14
|
+
|
15
|
+
$:.push File.expand_path("../lib", __FILE__)
|
16
|
+
require "forestvpn_cloud_api/version"
|
17
|
+
|
18
|
+
Gem::Specification.new do |s|
|
19
|
+
s.name = "forestvpn_cloud_api"
|
20
|
+
s.version = ForestVPNCloudAPI::VERSION
|
21
|
+
s.platform = Gem::Platform::RUBY
|
22
|
+
s.authors = ["Digital Services LLC"]
|
23
|
+
s.email = ["support@forestvpn.com"]
|
24
|
+
s.homepage = "https://forestvpn.com/"
|
25
|
+
s.summary = "A package to interact api.forestvpn.com/cloud/ (manage vpn profiles / check usage statistics / manage locations / manage servers / etc)"
|
26
|
+
s.description = "ForestVPN Cloud - it's a Google Cloud but for VPN apps. Ready to use VPN Cloud Platform minimizes efforts to build fast, secure, and modern VPN apps. "
|
27
|
+
s.license = "MIT"
|
28
|
+
s.required_ruby_version = ">= 2.4"
|
29
|
+
|
30
|
+
s.add_runtime_dependency 'faraday', '>= 1.0.1', '< 3.0'
|
31
|
+
s.add_runtime_dependency 'faraday-multipart'
|
32
|
+
|
33
|
+
s.add_development_dependency 'rspec', '~> 3.6', '>= 3.6.0'
|
34
|
+
|
35
|
+
s.files = `find *`.split("\n").uniq.sort.select { |f| !f.empty? }
|
36
|
+
s.test_files = `find spec/*`.split("\n")
|
37
|
+
s.executables = []
|
38
|
+
s.require_paths = ["lib"]
|
39
|
+
end
|
data/git_push.sh
ADDED
@@ -0,0 +1,57 @@
|
|
1
|
+
#!/bin/sh
|
2
|
+
# ref: https://help.github.com/articles/adding-an-existing-project-to-github-using-the-command-line/
|
3
|
+
#
|
4
|
+
# Usage example: /bin/sh ./git_push.sh wing328 openapi-petstore-perl "minor update" "gitlab.com"
|
5
|
+
|
6
|
+
git_user_id=$1
|
7
|
+
git_repo_id=$2
|
8
|
+
release_note=$3
|
9
|
+
git_host=$4
|
10
|
+
|
11
|
+
if [ "$git_host" = "" ]; then
|
12
|
+
git_host="github.com"
|
13
|
+
echo "[INFO] No command line input provided. Set \$git_host to $git_host"
|
14
|
+
fi
|
15
|
+
|
16
|
+
if [ "$git_user_id" = "" ]; then
|
17
|
+
git_user_id="GIT_USER_ID"
|
18
|
+
echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id"
|
19
|
+
fi
|
20
|
+
|
21
|
+
if [ "$git_repo_id" = "" ]; then
|
22
|
+
git_repo_id="GIT_REPO_ID"
|
23
|
+
echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id"
|
24
|
+
fi
|
25
|
+
|
26
|
+
if [ "$release_note" = "" ]; then
|
27
|
+
release_note="Minor update"
|
28
|
+
echo "[INFO] No command line input provided. Set \$release_note to $release_note"
|
29
|
+
fi
|
30
|
+
|
31
|
+
# Initialize the local directory as a Git repository
|
32
|
+
git init
|
33
|
+
|
34
|
+
# Adds the files in the local repository and stages them for commit.
|
35
|
+
git add .
|
36
|
+
|
37
|
+
# Commits the tracked changes and prepares them to be pushed to a remote repository.
|
38
|
+
git commit -m "$release_note"
|
39
|
+
|
40
|
+
# Sets the new remote
|
41
|
+
git_remote=$(git remote)
|
42
|
+
if [ "$git_remote" = "" ]; then # git remote not defined
|
43
|
+
|
44
|
+
if [ "$GIT_TOKEN" = "" ]; then
|
45
|
+
echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment."
|
46
|
+
git remote add origin https://${git_host}/${git_user_id}/${git_repo_id}.git
|
47
|
+
else
|
48
|
+
git remote add origin https://${git_user_id}:"${GIT_TOKEN}"@${git_host}/${git_user_id}/${git_repo_id}.git
|
49
|
+
fi
|
50
|
+
|
51
|
+
fi
|
52
|
+
|
53
|
+
git pull origin master
|
54
|
+
|
55
|
+
# Pushes (Forces) the changes in the local repository up to the remote repository
|
56
|
+
echo "Git pushing to https://${git_host}/${git_user_id}/${git_repo_id}.git"
|
57
|
+
git push origin master 2>&1 | grep -v 'To https'
|
@@ -0,0 +1,77 @@
|
|
1
|
+
=begin
|
2
|
+
#ForestVPN Cloud API
|
3
|
+
|
4
|
+
#ForestVPN Cloud - it's a Google Cloud but for VPN apps. Ready to use VPN Cloud Platform minimizes efforts to build fast, secure, and modern VPN apps.
|
5
|
+
|
6
|
+
The version of the OpenAPI document: 2.0
|
7
|
+
Contact: support@forestvpn.com
|
8
|
+
Generated by: https://openapi-generator.tech
|
9
|
+
OpenAPI Generator version: 6.0.0
|
10
|
+
|
11
|
+
=end
|
12
|
+
|
13
|
+
require 'cgi'
|
14
|
+
|
15
|
+
module ForestVPNCloudAPI
|
16
|
+
class GeoApi
|
17
|
+
attr_accessor :api_client
|
18
|
+
|
19
|
+
def initialize(api_client = ApiClient.default)
|
20
|
+
@api_client = api_client
|
21
|
+
end
|
22
|
+
# Location list
|
23
|
+
# @param [Hash] opts the optional parameters
|
24
|
+
# @return [Array<Location>]
|
25
|
+
def list_locations(opts = {})
|
26
|
+
data, _status_code, _headers = list_locations_with_http_info(opts)
|
27
|
+
data
|
28
|
+
end
|
29
|
+
|
30
|
+
# Location list
|
31
|
+
# @param [Hash] opts the optional parameters
|
32
|
+
# @return [Array<(Array<Location>, Integer, Hash)>] Array<Location> data, response status code and response headers
|
33
|
+
def list_locations_with_http_info(opts = {})
|
34
|
+
if @api_client.config.debugging
|
35
|
+
@api_client.config.logger.debug 'Calling API: GeoApi.list_locations ...'
|
36
|
+
end
|
37
|
+
# resource path
|
38
|
+
local_var_path = '/locations/'
|
39
|
+
|
40
|
+
# query parameters
|
41
|
+
query_params = opts[:query_params] || {}
|
42
|
+
|
43
|
+
# header parameters
|
44
|
+
header_params = opts[:header_params] || {}
|
45
|
+
# HTTP header 'Accept' (if needed)
|
46
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
47
|
+
|
48
|
+
# form parameters
|
49
|
+
form_params = opts[:form_params] || {}
|
50
|
+
|
51
|
+
# http body (model)
|
52
|
+
post_body = opts[:debug_body]
|
53
|
+
|
54
|
+
# return_type
|
55
|
+
return_type = opts[:debug_return_type] || 'Array<Location>'
|
56
|
+
|
57
|
+
# auth_names
|
58
|
+
auth_names = opts[:debug_auth_names] || ['ApiTokenAuth', 'BearerTokenAuth']
|
59
|
+
|
60
|
+
new_options = opts.merge(
|
61
|
+
:operation => :"GeoApi.list_locations",
|
62
|
+
:header_params => header_params,
|
63
|
+
:query_params => query_params,
|
64
|
+
:form_params => form_params,
|
65
|
+
:body => post_body,
|
66
|
+
:auth_names => auth_names,
|
67
|
+
:return_type => return_type
|
68
|
+
)
|
69
|
+
|
70
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
|
71
|
+
if @api_client.config.debugging
|
72
|
+
@api_client.config.logger.debug "API called: GeoApi#list_locations\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
73
|
+
end
|
74
|
+
return data, status_code, headers
|
75
|
+
end
|
76
|
+
end
|
77
|
+
end
|
@@ -0,0 +1,405 @@
|
|
1
|
+
=begin
|
2
|
+
#ForestVPN Cloud API
|
3
|
+
|
4
|
+
#ForestVPN Cloud - it's a Google Cloud but for VPN apps. Ready to use VPN Cloud Platform minimizes efforts to build fast, secure, and modern VPN apps.
|
5
|
+
|
6
|
+
The version of the OpenAPI document: 2.0
|
7
|
+
Contact: support@forestvpn.com
|
8
|
+
Generated by: https://openapi-generator.tech
|
9
|
+
OpenAPI Generator version: 6.0.0
|
10
|
+
|
11
|
+
=end
|
12
|
+
|
13
|
+
require 'cgi'
|
14
|
+
|
15
|
+
module ForestVPNCloudAPI
|
16
|
+
class LimitsApi
|
17
|
+
attr_accessor :api_client
|
18
|
+
|
19
|
+
def initialize(api_client = ApiClient.default)
|
20
|
+
@api_client = api_client
|
21
|
+
end
|
22
|
+
# Create data usage limit
|
23
|
+
# @param [Hash] opts the optional parameters
|
24
|
+
# @option opts [CreateOrUpdateDataUsageLimitRequest] :create_or_update_data_usage_limit_request
|
25
|
+
# @return [DataUsageLimit]
|
26
|
+
def create_data_usage_limit(opts = {})
|
27
|
+
data, _status_code, _headers = create_data_usage_limit_with_http_info(opts)
|
28
|
+
data
|
29
|
+
end
|
30
|
+
|
31
|
+
# Create data usage limit
|
32
|
+
# @param [Hash] opts the optional parameters
|
33
|
+
# @option opts [CreateOrUpdateDataUsageLimitRequest] :create_or_update_data_usage_limit_request
|
34
|
+
# @return [Array<(DataUsageLimit, Integer, Hash)>] DataUsageLimit data, response status code and response headers
|
35
|
+
def create_data_usage_limit_with_http_info(opts = {})
|
36
|
+
if @api_client.config.debugging
|
37
|
+
@api_client.config.logger.debug 'Calling API: LimitsApi.create_data_usage_limit ...'
|
38
|
+
end
|
39
|
+
# resource path
|
40
|
+
local_var_path = '/limits/data-usage/'
|
41
|
+
|
42
|
+
# query parameters
|
43
|
+
query_params = opts[:query_params] || {}
|
44
|
+
|
45
|
+
# header parameters
|
46
|
+
header_params = opts[:header_params] || {}
|
47
|
+
# HTTP header 'Accept' (if needed)
|
48
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
49
|
+
# HTTP header 'Content-Type'
|
50
|
+
content_type = @api_client.select_header_content_type(['application/json'])
|
51
|
+
if !content_type.nil?
|
52
|
+
header_params['Content-Type'] = content_type
|
53
|
+
end
|
54
|
+
|
55
|
+
# form parameters
|
56
|
+
form_params = opts[:form_params] || {}
|
57
|
+
|
58
|
+
# http body (model)
|
59
|
+
post_body = opts[:debug_body] || @api_client.object_to_http_body(opts[:'create_or_update_data_usage_limit_request'])
|
60
|
+
|
61
|
+
# return_type
|
62
|
+
return_type = opts[:debug_return_type] || 'DataUsageLimit'
|
63
|
+
|
64
|
+
# auth_names
|
65
|
+
auth_names = opts[:debug_auth_names] || ['ApiTokenAuth', 'BearerTokenAuth']
|
66
|
+
|
67
|
+
new_options = opts.merge(
|
68
|
+
:operation => :"LimitsApi.create_data_usage_limit",
|
69
|
+
:header_params => header_params,
|
70
|
+
:query_params => query_params,
|
71
|
+
:form_params => form_params,
|
72
|
+
:body => post_body,
|
73
|
+
:auth_names => auth_names,
|
74
|
+
:return_type => return_type
|
75
|
+
)
|
76
|
+
|
77
|
+
data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
|
78
|
+
if @api_client.config.debugging
|
79
|
+
@api_client.config.logger.debug "API called: LimitsApi#create_data_usage_limit\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
80
|
+
end
|
81
|
+
return data, status_code, headers
|
82
|
+
end
|
83
|
+
|
84
|
+
# Delete data usage limit
|
85
|
+
# @param limit_id [String]
|
86
|
+
# @param [Hash] opts the optional parameters
|
87
|
+
# @return [nil]
|
88
|
+
def delete_data_usage_limit(limit_id, opts = {})
|
89
|
+
delete_data_usage_limit_with_http_info(limit_id, opts)
|
90
|
+
nil
|
91
|
+
end
|
92
|
+
|
93
|
+
# Delete data usage limit
|
94
|
+
# @param limit_id [String]
|
95
|
+
# @param [Hash] opts the optional parameters
|
96
|
+
# @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers
|
97
|
+
def delete_data_usage_limit_with_http_info(limit_id, opts = {})
|
98
|
+
if @api_client.config.debugging
|
99
|
+
@api_client.config.logger.debug 'Calling API: LimitsApi.delete_data_usage_limit ...'
|
100
|
+
end
|
101
|
+
# verify the required parameter 'limit_id' is set
|
102
|
+
if @api_client.config.client_side_validation && limit_id.nil?
|
103
|
+
fail ArgumentError, "Missing the required parameter 'limit_id' when calling LimitsApi.delete_data_usage_limit"
|
104
|
+
end
|
105
|
+
# resource path
|
106
|
+
local_var_path = '/limits/data-usage/{limitId}/'.sub('{' + 'limitId' + '}', CGI.escape(limit_id.to_s))
|
107
|
+
|
108
|
+
# query parameters
|
109
|
+
query_params = opts[:query_params] || {}
|
110
|
+
|
111
|
+
# header parameters
|
112
|
+
header_params = opts[:header_params] || {}
|
113
|
+
# HTTP header 'Accept' (if needed)
|
114
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
115
|
+
|
116
|
+
# form parameters
|
117
|
+
form_params = opts[:form_params] || {}
|
118
|
+
|
119
|
+
# http body (model)
|
120
|
+
post_body = opts[:debug_body]
|
121
|
+
|
122
|
+
# return_type
|
123
|
+
return_type = opts[:debug_return_type]
|
124
|
+
|
125
|
+
# auth_names
|
126
|
+
auth_names = opts[:debug_auth_names] || ['ApiTokenAuth', 'BearerTokenAuth']
|
127
|
+
|
128
|
+
new_options = opts.merge(
|
129
|
+
:operation => :"LimitsApi.delete_data_usage_limit",
|
130
|
+
:header_params => header_params,
|
131
|
+
:query_params => query_params,
|
132
|
+
:form_params => form_params,
|
133
|
+
:body => post_body,
|
134
|
+
:auth_names => auth_names,
|
135
|
+
:return_type => return_type
|
136
|
+
)
|
137
|
+
|
138
|
+
data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, new_options)
|
139
|
+
if @api_client.config.debugging
|
140
|
+
@api_client.config.logger.debug "API called: LimitsApi#delete_data_usage_limit\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
141
|
+
end
|
142
|
+
return data, status_code, headers
|
143
|
+
end
|
144
|
+
|
145
|
+
# Data usage limit details
|
146
|
+
# @param limit_id [String]
|
147
|
+
# @param [Hash] opts the optional parameters
|
148
|
+
# @return [DataUsageLimit]
|
149
|
+
def get_data_usage_limit(limit_id, opts = {})
|
150
|
+
data, _status_code, _headers = get_data_usage_limit_with_http_info(limit_id, opts)
|
151
|
+
data
|
152
|
+
end
|
153
|
+
|
154
|
+
# Data usage limit details
|
155
|
+
# @param limit_id [String]
|
156
|
+
# @param [Hash] opts the optional parameters
|
157
|
+
# @return [Array<(DataUsageLimit, Integer, Hash)>] DataUsageLimit data, response status code and response headers
|
158
|
+
def get_data_usage_limit_with_http_info(limit_id, opts = {})
|
159
|
+
if @api_client.config.debugging
|
160
|
+
@api_client.config.logger.debug 'Calling API: LimitsApi.get_data_usage_limit ...'
|
161
|
+
end
|
162
|
+
# verify the required parameter 'limit_id' is set
|
163
|
+
if @api_client.config.client_side_validation && limit_id.nil?
|
164
|
+
fail ArgumentError, "Missing the required parameter 'limit_id' when calling LimitsApi.get_data_usage_limit"
|
165
|
+
end
|
166
|
+
# resource path
|
167
|
+
local_var_path = '/limits/data-usage/{limitId}/'.sub('{' + 'limitId' + '}', CGI.escape(limit_id.to_s))
|
168
|
+
|
169
|
+
# query parameters
|
170
|
+
query_params = opts[:query_params] || {}
|
171
|
+
|
172
|
+
# header parameters
|
173
|
+
header_params = opts[:header_params] || {}
|
174
|
+
# HTTP header 'Accept' (if needed)
|
175
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
176
|
+
|
177
|
+
# form parameters
|
178
|
+
form_params = opts[:form_params] || {}
|
179
|
+
|
180
|
+
# http body (model)
|
181
|
+
post_body = opts[:debug_body]
|
182
|
+
|
183
|
+
# return_type
|
184
|
+
return_type = opts[:debug_return_type] || 'DataUsageLimit'
|
185
|
+
|
186
|
+
# auth_names
|
187
|
+
auth_names = opts[:debug_auth_names] || ['ApiTokenAuth', 'BearerTokenAuth']
|
188
|
+
|
189
|
+
new_options = opts.merge(
|
190
|
+
:operation => :"LimitsApi.get_data_usage_limit",
|
191
|
+
:header_params => header_params,
|
192
|
+
:query_params => query_params,
|
193
|
+
:form_params => form_params,
|
194
|
+
:body => post_body,
|
195
|
+
:auth_names => auth_names,
|
196
|
+
:return_type => return_type
|
197
|
+
)
|
198
|
+
|
199
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
|
200
|
+
if @api_client.config.debugging
|
201
|
+
@api_client.config.logger.debug "API called: LimitsApi#get_data_usage_limit\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
202
|
+
end
|
203
|
+
return data, status_code, headers
|
204
|
+
end
|
205
|
+
|
206
|
+
# Data usage limit list
|
207
|
+
# @param [Hash] opts the optional parameters
|
208
|
+
# @return [Array<DataUsageLimit>]
|
209
|
+
def lis_data_usage_limits(opts = {})
|
210
|
+
data, _status_code, _headers = lis_data_usage_limits_with_http_info(opts)
|
211
|
+
data
|
212
|
+
end
|
213
|
+
|
214
|
+
# Data usage limit list
|
215
|
+
# @param [Hash] opts the optional parameters
|
216
|
+
# @return [Array<(Array<DataUsageLimit>, Integer, Hash)>] Array<DataUsageLimit> data, response status code and response headers
|
217
|
+
def lis_data_usage_limits_with_http_info(opts = {})
|
218
|
+
if @api_client.config.debugging
|
219
|
+
@api_client.config.logger.debug 'Calling API: LimitsApi.lis_data_usage_limits ...'
|
220
|
+
end
|
221
|
+
# resource path
|
222
|
+
local_var_path = '/limits/data-usage/'
|
223
|
+
|
224
|
+
# query parameters
|
225
|
+
query_params = opts[:query_params] || {}
|
226
|
+
|
227
|
+
# header parameters
|
228
|
+
header_params = opts[:header_params] || {}
|
229
|
+
# HTTP header 'Accept' (if needed)
|
230
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
231
|
+
|
232
|
+
# form parameters
|
233
|
+
form_params = opts[:form_params] || {}
|
234
|
+
|
235
|
+
# http body (model)
|
236
|
+
post_body = opts[:debug_body]
|
237
|
+
|
238
|
+
# return_type
|
239
|
+
return_type = opts[:debug_return_type] || 'Array<DataUsageLimit>'
|
240
|
+
|
241
|
+
# auth_names
|
242
|
+
auth_names = opts[:debug_auth_names] || ['ApiTokenAuth', 'BearerTokenAuth']
|
243
|
+
|
244
|
+
new_options = opts.merge(
|
245
|
+
:operation => :"LimitsApi.lis_data_usage_limits",
|
246
|
+
:header_params => header_params,
|
247
|
+
:query_params => query_params,
|
248
|
+
:form_params => form_params,
|
249
|
+
:body => post_body,
|
250
|
+
:auth_names => auth_names,
|
251
|
+
:return_type => return_type
|
252
|
+
)
|
253
|
+
|
254
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
|
255
|
+
if @api_client.config.debugging
|
256
|
+
@api_client.config.logger.debug "API called: LimitsApi#lis_data_usage_limits\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
257
|
+
end
|
258
|
+
return data, status_code, headers
|
259
|
+
end
|
260
|
+
|
261
|
+
# Partial update profile details
|
262
|
+
# @param limit_id [String]
|
263
|
+
# @param create_or_update_data_usage_limit_request [CreateOrUpdateDataUsageLimitRequest]
|
264
|
+
# @param [Hash] opts the optional parameters
|
265
|
+
# @return [DataUsageLimit]
|
266
|
+
def partial_update_data_usage_limit(limit_id, create_or_update_data_usage_limit_request, opts = {})
|
267
|
+
data, _status_code, _headers = partial_update_data_usage_limit_with_http_info(limit_id, create_or_update_data_usage_limit_request, opts)
|
268
|
+
data
|
269
|
+
end
|
270
|
+
|
271
|
+
# Partial update profile details
|
272
|
+
# @param limit_id [String]
|
273
|
+
# @param create_or_update_data_usage_limit_request [CreateOrUpdateDataUsageLimitRequest]
|
274
|
+
# @param [Hash] opts the optional parameters
|
275
|
+
# @return [Array<(DataUsageLimit, Integer, Hash)>] DataUsageLimit data, response status code and response headers
|
276
|
+
def partial_update_data_usage_limit_with_http_info(limit_id, create_or_update_data_usage_limit_request, opts = {})
|
277
|
+
if @api_client.config.debugging
|
278
|
+
@api_client.config.logger.debug 'Calling API: LimitsApi.partial_update_data_usage_limit ...'
|
279
|
+
end
|
280
|
+
# verify the required parameter 'limit_id' is set
|
281
|
+
if @api_client.config.client_side_validation && limit_id.nil?
|
282
|
+
fail ArgumentError, "Missing the required parameter 'limit_id' when calling LimitsApi.partial_update_data_usage_limit"
|
283
|
+
end
|
284
|
+
# verify the required parameter 'create_or_update_data_usage_limit_request' is set
|
285
|
+
if @api_client.config.client_side_validation && create_or_update_data_usage_limit_request.nil?
|
286
|
+
fail ArgumentError, "Missing the required parameter 'create_or_update_data_usage_limit_request' when calling LimitsApi.partial_update_data_usage_limit"
|
287
|
+
end
|
288
|
+
# resource path
|
289
|
+
local_var_path = '/limits/data-usage/{limitId}/'.sub('{' + 'limitId' + '}', CGI.escape(limit_id.to_s))
|
290
|
+
|
291
|
+
# query parameters
|
292
|
+
query_params = opts[:query_params] || {}
|
293
|
+
|
294
|
+
# header parameters
|
295
|
+
header_params = opts[:header_params] || {}
|
296
|
+
# HTTP header 'Accept' (if needed)
|
297
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
298
|
+
# HTTP header 'Content-Type'
|
299
|
+
content_type = @api_client.select_header_content_type(['application/json'])
|
300
|
+
if !content_type.nil?
|
301
|
+
header_params['Content-Type'] = content_type
|
302
|
+
end
|
303
|
+
|
304
|
+
# form parameters
|
305
|
+
form_params = opts[:form_params] || {}
|
306
|
+
|
307
|
+
# http body (model)
|
308
|
+
post_body = opts[:debug_body] || @api_client.object_to_http_body(create_or_update_data_usage_limit_request)
|
309
|
+
|
310
|
+
# return_type
|
311
|
+
return_type = opts[:debug_return_type] || 'DataUsageLimit'
|
312
|
+
|
313
|
+
# auth_names
|
314
|
+
auth_names = opts[:debug_auth_names] || ['ApiTokenAuth', 'BearerTokenAuth']
|
315
|
+
|
316
|
+
new_options = opts.merge(
|
317
|
+
:operation => :"LimitsApi.partial_update_data_usage_limit",
|
318
|
+
:header_params => header_params,
|
319
|
+
:query_params => query_params,
|
320
|
+
:form_params => form_params,
|
321
|
+
:body => post_body,
|
322
|
+
:auth_names => auth_names,
|
323
|
+
:return_type => return_type
|
324
|
+
)
|
325
|
+
|
326
|
+
data, status_code, headers = @api_client.call_api(:PATCH, local_var_path, new_options)
|
327
|
+
if @api_client.config.debugging
|
328
|
+
@api_client.config.logger.debug "API called: LimitsApi#partial_update_data_usage_limit\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
329
|
+
end
|
330
|
+
return data, status_code, headers
|
331
|
+
end
|
332
|
+
|
333
|
+
# Update data usage limit
|
334
|
+
# @param limit_id [String]
|
335
|
+
# @param create_or_update_data_usage_limit_request [CreateOrUpdateDataUsageLimitRequest]
|
336
|
+
# @param [Hash] opts the optional parameters
|
337
|
+
# @return [DataUsageLimit]
|
338
|
+
def update_data_usage_limit(limit_id, create_or_update_data_usage_limit_request, opts = {})
|
339
|
+
data, _status_code, _headers = update_data_usage_limit_with_http_info(limit_id, create_or_update_data_usage_limit_request, opts)
|
340
|
+
data
|
341
|
+
end
|
342
|
+
|
343
|
+
# Update data usage limit
|
344
|
+
# @param limit_id [String]
|
345
|
+
# @param create_or_update_data_usage_limit_request [CreateOrUpdateDataUsageLimitRequest]
|
346
|
+
# @param [Hash] opts the optional parameters
|
347
|
+
# @return [Array<(DataUsageLimit, Integer, Hash)>] DataUsageLimit data, response status code and response headers
|
348
|
+
def update_data_usage_limit_with_http_info(limit_id, create_or_update_data_usage_limit_request, opts = {})
|
349
|
+
if @api_client.config.debugging
|
350
|
+
@api_client.config.logger.debug 'Calling API: LimitsApi.update_data_usage_limit ...'
|
351
|
+
end
|
352
|
+
# verify the required parameter 'limit_id' is set
|
353
|
+
if @api_client.config.client_side_validation && limit_id.nil?
|
354
|
+
fail ArgumentError, "Missing the required parameter 'limit_id' when calling LimitsApi.update_data_usage_limit"
|
355
|
+
end
|
356
|
+
# verify the required parameter 'create_or_update_data_usage_limit_request' is set
|
357
|
+
if @api_client.config.client_side_validation && create_or_update_data_usage_limit_request.nil?
|
358
|
+
fail ArgumentError, "Missing the required parameter 'create_or_update_data_usage_limit_request' when calling LimitsApi.update_data_usage_limit"
|
359
|
+
end
|
360
|
+
# resource path
|
361
|
+
local_var_path = '/limits/data-usage/{limitId}/'.sub('{' + 'limitId' + '}', CGI.escape(limit_id.to_s))
|
362
|
+
|
363
|
+
# query parameters
|
364
|
+
query_params = opts[:query_params] || {}
|
365
|
+
|
366
|
+
# header parameters
|
367
|
+
header_params = opts[:header_params] || {}
|
368
|
+
# HTTP header 'Accept' (if needed)
|
369
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
370
|
+
# HTTP header 'Content-Type'
|
371
|
+
content_type = @api_client.select_header_content_type(['application/json'])
|
372
|
+
if !content_type.nil?
|
373
|
+
header_params['Content-Type'] = content_type
|
374
|
+
end
|
375
|
+
|
376
|
+
# form parameters
|
377
|
+
form_params = opts[:form_params] || {}
|
378
|
+
|
379
|
+
# http body (model)
|
380
|
+
post_body = opts[:debug_body] || @api_client.object_to_http_body(create_or_update_data_usage_limit_request)
|
381
|
+
|
382
|
+
# return_type
|
383
|
+
return_type = opts[:debug_return_type] || 'DataUsageLimit'
|
384
|
+
|
385
|
+
# auth_names
|
386
|
+
auth_names = opts[:debug_auth_names] || ['ApiTokenAuth', 'BearerTokenAuth']
|
387
|
+
|
388
|
+
new_options = opts.merge(
|
389
|
+
:operation => :"LimitsApi.update_data_usage_limit",
|
390
|
+
:header_params => header_params,
|
391
|
+
:query_params => query_params,
|
392
|
+
:form_params => form_params,
|
393
|
+
:body => post_body,
|
394
|
+
:auth_names => auth_names,
|
395
|
+
:return_type => return_type
|
396
|
+
)
|
397
|
+
|
398
|
+
data, status_code, headers = @api_client.call_api(:PUT, local_var_path, new_options)
|
399
|
+
if @api_client.config.debugging
|
400
|
+
@api_client.config.logger.debug "API called: LimitsApi#update_data_usage_limit\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
401
|
+
end
|
402
|
+
return data, status_code, headers
|
403
|
+
end
|
404
|
+
end
|
405
|
+
end
|