imgwire 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/AGENTS.md +8 -0
- data/CODEGEN_VERSION +1 -0
- data/LICENSE +21 -0
- data/README.md +159 -0
- data/generated/lib/imgwire-generated/api/cors_origins_api.rb +355 -0
- data/generated/lib/imgwire-generated/api/custom_domain_api.rb +253 -0
- data/generated/lib/imgwire-generated/api/images_api.rb +534 -0
- data/generated/lib/imgwire-generated/api/metrics_api.rb +156 -0
- data/generated/lib/imgwire-generated/api_client.rb +392 -0
- data/generated/lib/imgwire-generated/api_error.rb +58 -0
- data/generated/lib/imgwire-generated/configuration.rb +301 -0
- data/generated/lib/imgwire-generated/models/bulk_delete_images_schema.rb +248 -0
- data/generated/lib/imgwire-generated/models/cache_hit_ratio_dataset_point_schema.rb +263 -0
- data/generated/lib/imgwire-generated/models/cors_origin_create_schema.rb +246 -0
- data/generated/lib/imgwire-generated/models/cors_origin_schema.rb +341 -0
- data/generated/lib/imgwire-generated/models/cors_origin_update_schema.rb +246 -0
- data/generated/lib/imgwire-generated/models/custom_domain_certificate_status.rb +41 -0
- data/generated/lib/imgwire-generated/models/custom_domain_create_schema.rb +237 -0
- data/generated/lib/imgwire-generated/models/custom_domain_schema.rb +531 -0
- data/generated/lib/imgwire-generated/models/custom_domain_status.rb +41 -0
- data/generated/lib/imgwire-generated/models/custom_metadata_value.rb +106 -0
- data/generated/lib/imgwire-generated/models/http_validation_error.rb +222 -0
- data/generated/lib/imgwire-generated/models/image_download_job_create_schema.rb +248 -0
- data/generated/lib/imgwire-generated/models/image_download_job_schema.rb +389 -0
- data/generated/lib/imgwire-generated/models/image_download_status.rb +42 -0
- data/generated/lib/imgwire-generated/models/image_schema.rb +659 -0
- data/generated/lib/imgwire-generated/models/image_status.rb +42 -0
- data/generated/lib/imgwire-generated/models/location_inner.rb +104 -0
- data/generated/lib/imgwire-generated/models/metrics_dataset_interval.rb +42 -0
- data/generated/lib/imgwire-generated/models/metrics_datasets_schema.rb +379 -0
- data/generated/lib/imgwire-generated/models/metrics_stat_value_schema.rb +275 -0
- data/generated/lib/imgwire-generated/models/metrics_stats_schema.rb +367 -0
- data/generated/lib/imgwire-generated/models/requests_dataset_point_schema.rb +263 -0
- data/generated/lib/imgwire-generated/models/standard_upload_create_schema.rb +415 -0
- data/generated/lib/imgwire-generated/models/standard_upload_response_schema.rb +263 -0
- data/generated/lib/imgwire-generated/models/storage_bytes_dataset_point_schema.rb +289 -0
- data/generated/lib/imgwire-generated/models/supported_mime_type.rb +43 -0
- data/generated/lib/imgwire-generated/models/transfer_bytes_dataset_point_schema.rb +263 -0
- data/generated/lib/imgwire-generated/models/transformations_dataset_point_schema.rb +263 -0
- data/generated/lib/imgwire-generated/models/upload_token_create_response_schema.rb +379 -0
- data/generated/lib/imgwire-generated/models/uploads_dataset_point_schema.rb +263 -0
- data/generated/lib/imgwire-generated/models/validation_error.rb +291 -0
- data/generated/lib/imgwire-generated/version.rb +15 -0
- data/generated/lib/imgwire-generated.rb +74 -0
- data/lib/imgwire/client.rb +52 -0
- data/lib/imgwire/client_options.rb +14 -0
- data/lib/imgwire/http/upload_client.rb +53 -0
- data/lib/imgwire/image.rb +137 -0
- data/lib/imgwire/pagination.rb +82 -0
- data/lib/imgwire/resources/base_resource.rb +29 -0
- data/lib/imgwire/resources/cors_origins_resource.rb +47 -0
- data/lib/imgwire/resources/custom_domain_resource.rb +30 -0
- data/lib/imgwire/resources/images_resource.rb +106 -0
- data/lib/imgwire/resources/metrics_resource.rb +24 -0
- data/lib/imgwire/uploads.rb +78 -0
- data/lib/imgwire/version.rb +5 -0
- data/lib/imgwire.rb +18 -0
- metadata +158 -0
checksums.yaml
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
---
|
|
2
|
+
SHA256:
|
|
3
|
+
metadata.gz: 465414c80dd7d88016d6e156b188ed81c5c074836000087e4e47d11baed5a8ae
|
|
4
|
+
data.tar.gz: 8de6fcd2da02b947376eb73d9021eeb35bb62109133acecee8ad8f361c992ab8
|
|
5
|
+
SHA512:
|
|
6
|
+
metadata.gz: 6ee90396ef5802259a36e17740a2c5b7e7e103b029b3f7eae3bb5966d613dc1a546a00ba2cfe1c0ea564bcab0e43938d7643be9387727a6d2b296d194a26a209
|
|
7
|
+
data.tar.gz: 169a27d84d24340b998692974e8d4ec9f1c8248def2c14d0bcee3475cebc7e321c4cff6f8583090dd2eaabf90dd7160e6ea0c2c16024b586eecf0bad0316e9bd
|
data/AGENTS.md
ADDED
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
# imgwire-ruby Agent Notes
|
|
2
|
+
|
|
3
|
+
- `generated/` is disposable output from OpenAPI Generator. Do not hand-edit generated files.
|
|
4
|
+
- Use `yarn generate` to refresh `openapi/sdk.openapi.json`, `generated/`, and `CODEGEN_VERSION`.
|
|
5
|
+
- `@imgwire/codegen-core` is the source of truth for OpenAPI shaping.
|
|
6
|
+
- Yarn Classic is used for codegen tooling. Ruby packaging uses Bundler and RubyGems.
|
|
7
|
+
- Handwritten SDK behavior belongs in `lib/`, `spec/`, and `docs/`.
|
|
8
|
+
- CI runs `yarn verify-generated` and fails when generated artifacts or `CODEGEN_VERSION` are stale.
|
data/CODEGEN_VERSION
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
213554905f77b6ffb7a29c020c632196bf0d7567b10d10f40a0a59839008d248
|
data/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Blackhawk Software, LLC
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
data/README.md
ADDED
|
@@ -0,0 +1,159 @@
|
|
|
1
|
+
# `imgwire`
|
|
2
|
+
|
|
3
|
+
[](https://rubygems.org/gems/imgwire)
|
|
4
|
+
[](https://github.com/Blackhawk-Software/imgwire-ruby/actions/workflows/ci.yml)
|
|
5
|
+
[](https://github.com/Blackhawk-Software/imgwire-ruby/actions/workflows/release.yml)
|
|
6
|
+
|
|
7
|
+
`imgwire` is the server-side Ruby SDK for the imgwire API.
|
|
8
|
+
|
|
9
|
+
Use it in Rails apps, workers, jobs, and other backend runtimes to authenticate with a Server API Key, upload files from Ruby IO objects, manage server-side resources, and generate image transformation URLs without rebuilding imgwire request plumbing yourself.
|
|
10
|
+
|
|
11
|
+
## Installation
|
|
12
|
+
|
|
13
|
+
```bash
|
|
14
|
+
gem install imgwire
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
Or with Bundler:
|
|
18
|
+
|
|
19
|
+
```ruby
|
|
20
|
+
gem "imgwire"
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
## Quick Start
|
|
24
|
+
|
|
25
|
+
```ruby
|
|
26
|
+
require "imgwire"
|
|
27
|
+
|
|
28
|
+
client = Imgwire::Client.new(api_key: "sk_...")
|
|
29
|
+
|
|
30
|
+
File.open("hero.jpg", "rb") do |file|
|
|
31
|
+
image = client.images.upload(file: file)
|
|
32
|
+
|
|
33
|
+
puts image.id
|
|
34
|
+
puts image.url(preset: "thumbnail", width: 300, height: 300)
|
|
35
|
+
end
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
## Client Setup
|
|
39
|
+
|
|
40
|
+
```ruby
|
|
41
|
+
client = Imgwire::Client.new(api_key: "sk_...")
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
Optional configuration:
|
|
45
|
+
|
|
46
|
+
```ruby
|
|
47
|
+
client = Imgwire::Client.new(
|
|
48
|
+
api_key: "sk_...",
|
|
49
|
+
base_url: "https://api.imgwire.dev",
|
|
50
|
+
environment_id: "env_123",
|
|
51
|
+
timeout: 10,
|
|
52
|
+
max_retries: 2,
|
|
53
|
+
backoff_factor: 0.25
|
|
54
|
+
)
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
## Resources
|
|
58
|
+
|
|
59
|
+
The handwritten Ruby surface currently wraps these generated server resources:
|
|
60
|
+
|
|
61
|
+
- `client.images`
|
|
62
|
+
- `client.custom_domain`
|
|
63
|
+
- `client.cors_origins`
|
|
64
|
+
- `client.metrics`
|
|
65
|
+
|
|
66
|
+
### Uploads
|
|
67
|
+
|
|
68
|
+
The image upload helper accepts `File`, `IO`, `StringIO`, and `Tempfile` inputs:
|
|
69
|
+
|
|
70
|
+
```ruby
|
|
71
|
+
file = File.open("file.jpg", "rb")
|
|
72
|
+
image = client.images.upload(file: file)
|
|
73
|
+
```
|
|
74
|
+
|
|
75
|
+
Explicit metadata is also supported:
|
|
76
|
+
|
|
77
|
+
```ruby
|
|
78
|
+
image = client.images.upload(
|
|
79
|
+
file: StringIO.new(binary_data),
|
|
80
|
+
file_name: "file.png",
|
|
81
|
+
mime_type: "image/png",
|
|
82
|
+
content_length: binary_data.bytesize
|
|
83
|
+
)
|
|
84
|
+
```
|
|
85
|
+
|
|
86
|
+
### Pagination
|
|
87
|
+
|
|
88
|
+
```ruby
|
|
89
|
+
page = client.images.list(page: 1, limit: 25)
|
|
90
|
+
|
|
91
|
+
client.images.list_pages(limit: 100).each do |result|
|
|
92
|
+
puts result.pagination.page
|
|
93
|
+
puts result.data.length
|
|
94
|
+
end
|
|
95
|
+
|
|
96
|
+
client.images.list_all(limit: 100).each do |image|
|
|
97
|
+
puts image.id
|
|
98
|
+
end
|
|
99
|
+
```
|
|
100
|
+
|
|
101
|
+
### Image URL Transformations
|
|
102
|
+
|
|
103
|
+
Image-returning endpoints return `Imgwire::Image` values with a `url(...)` helper:
|
|
104
|
+
|
|
105
|
+
```ruby
|
|
106
|
+
image = client.images.retrieve("img_123")
|
|
107
|
+
|
|
108
|
+
puts image.url(
|
|
109
|
+
preset: "thumbnail",
|
|
110
|
+
width: 300,
|
|
111
|
+
height: 300,
|
|
112
|
+
format: "webp",
|
|
113
|
+
quality: 80
|
|
114
|
+
)
|
|
115
|
+
```
|
|
116
|
+
|
|
117
|
+
## Generation
|
|
118
|
+
|
|
119
|
+
From a clean checkout:
|
|
120
|
+
|
|
121
|
+
```bash
|
|
122
|
+
yarn install --frozen-lockfile
|
|
123
|
+
yarn generate
|
|
124
|
+
bundle install
|
|
125
|
+
bundle exec rspec
|
|
126
|
+
```
|
|
127
|
+
|
|
128
|
+
Or with the repository `Makefile`:
|
|
129
|
+
|
|
130
|
+
```bash
|
|
131
|
+
make install
|
|
132
|
+
make generate
|
|
133
|
+
make lint
|
|
134
|
+
make test
|
|
135
|
+
```
|
|
136
|
+
|
|
137
|
+
For handwritten Ruby code only, autoformat with:
|
|
138
|
+
|
|
139
|
+
```bash
|
|
140
|
+
make format-ruby
|
|
141
|
+
```
|
|
142
|
+
|
|
143
|
+
To prepare a release version bump:
|
|
144
|
+
|
|
145
|
+
```bash
|
|
146
|
+
make release-set VERSION=0.2.0
|
|
147
|
+
```
|
|
148
|
+
|
|
149
|
+
The generation pipeline:
|
|
150
|
+
|
|
151
|
+
```text
|
|
152
|
+
raw OpenAPI
|
|
153
|
+
-> @imgwire/codegen-core target "ruby"
|
|
154
|
+
-> openapi/sdk.openapi.json
|
|
155
|
+
-> OpenAPI Generator ruby client
|
|
156
|
+
-> generated/
|
|
157
|
+
-> postprocess cleanup
|
|
158
|
+
-> CODEGEN_VERSION update
|
|
159
|
+
```
|
|
@@ -0,0 +1,355 @@
|
|
|
1
|
+
=begin
|
|
2
|
+
#imgwire.dev Backend API development
|
|
3
|
+
|
|
4
|
+
#No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
|
5
|
+
|
|
6
|
+
The version of the OpenAPI document: 0.1.0
|
|
7
|
+
|
|
8
|
+
Generated by: https://openapi-generator.tech
|
|
9
|
+
Generator version: 7.14.0
|
|
10
|
+
|
|
11
|
+
=end
|
|
12
|
+
|
|
13
|
+
require 'cgi'
|
|
14
|
+
|
|
15
|
+
module ImgwireGenerated
|
|
16
|
+
class CorsOriginsApi
|
|
17
|
+
attr_accessor :api_client
|
|
18
|
+
|
|
19
|
+
def initialize(api_client = ApiClient.default)
|
|
20
|
+
@api_client = api_client
|
|
21
|
+
end
|
|
22
|
+
# Create CORS Origin
|
|
23
|
+
# @param cors_origin_create_schema [CorsOriginCreateSchema]
|
|
24
|
+
# @param [Hash] opts the optional parameters
|
|
25
|
+
# @return [CorsOriginSchema]
|
|
26
|
+
def cors_origins_create(cors_origin_create_schema, opts = {})
|
|
27
|
+
data, _status_code, _headers = cors_origins_create_with_http_info(cors_origin_create_schema, opts)
|
|
28
|
+
data
|
|
29
|
+
end
|
|
30
|
+
|
|
31
|
+
# Create CORS Origin
|
|
32
|
+
# @param cors_origin_create_schema [CorsOriginCreateSchema]
|
|
33
|
+
# @param [Hash] opts the optional parameters
|
|
34
|
+
# @return [Array<(CorsOriginSchema, Integer, Hash)>] CorsOriginSchema data, response status code and response headers
|
|
35
|
+
def cors_origins_create_with_http_info(cors_origin_create_schema, opts = {})
|
|
36
|
+
if @api_client.config.debugging
|
|
37
|
+
@api_client.config.logger.debug 'Calling API: CorsOriginsApi.cors_origins_create ...'
|
|
38
|
+
end
|
|
39
|
+
# verify the required parameter 'cors_origin_create_schema' is set
|
|
40
|
+
if @api_client.config.client_side_validation && cors_origin_create_schema.nil?
|
|
41
|
+
fail ArgumentError, "Missing the required parameter 'cors_origin_create_schema' when calling CorsOriginsApi.cors_origins_create"
|
|
42
|
+
end
|
|
43
|
+
# resource path
|
|
44
|
+
local_var_path = '/api/v1/cors_origins/'
|
|
45
|
+
|
|
46
|
+
# query parameters
|
|
47
|
+
query_params = opts[:query_params] || {}
|
|
48
|
+
|
|
49
|
+
# header parameters
|
|
50
|
+
header_params = opts[:header_params] || {}
|
|
51
|
+
# HTTP header 'Accept' (if needed)
|
|
52
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
|
|
53
|
+
# HTTP header 'Content-Type'
|
|
54
|
+
content_type = @api_client.select_header_content_type(['application/json'])
|
|
55
|
+
if !content_type.nil?
|
|
56
|
+
header_params['Content-Type'] = content_type
|
|
57
|
+
end
|
|
58
|
+
|
|
59
|
+
# form parameters
|
|
60
|
+
form_params = opts[:form_params] || {}
|
|
61
|
+
|
|
62
|
+
# http body (model)
|
|
63
|
+
post_body = opts[:debug_body] || @api_client.object_to_http_body(cors_origin_create_schema)
|
|
64
|
+
|
|
65
|
+
# return_type
|
|
66
|
+
return_type = opts[:debug_return_type] || 'CorsOriginSchema'
|
|
67
|
+
|
|
68
|
+
# auth_names
|
|
69
|
+
auth_names = opts[:debug_auth_names] || []
|
|
70
|
+
|
|
71
|
+
new_options = opts.merge(
|
|
72
|
+
:operation => :"CorsOriginsApi.cors_origins_create",
|
|
73
|
+
:header_params => header_params,
|
|
74
|
+
:query_params => query_params,
|
|
75
|
+
:form_params => form_params,
|
|
76
|
+
:body => post_body,
|
|
77
|
+
:auth_names => auth_names,
|
|
78
|
+
:return_type => return_type
|
|
79
|
+
)
|
|
80
|
+
|
|
81
|
+
data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
|
|
82
|
+
if @api_client.config.debugging
|
|
83
|
+
@api_client.config.logger.debug "API called: CorsOriginsApi#cors_origins_create\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
84
|
+
end
|
|
85
|
+
return data, status_code, headers
|
|
86
|
+
end
|
|
87
|
+
|
|
88
|
+
# Delete CORS Origin By ID
|
|
89
|
+
# @param cors_origin_id [String]
|
|
90
|
+
# @param [Hash] opts the optional parameters
|
|
91
|
+
# @return [Hash<String, String>]
|
|
92
|
+
def cors_origins_delete(cors_origin_id, opts = {})
|
|
93
|
+
data, _status_code, _headers = cors_origins_delete_with_http_info(cors_origin_id, opts)
|
|
94
|
+
data
|
|
95
|
+
end
|
|
96
|
+
|
|
97
|
+
# Delete CORS Origin By ID
|
|
98
|
+
# @param cors_origin_id [String]
|
|
99
|
+
# @param [Hash] opts the optional parameters
|
|
100
|
+
# @return [Array<(Hash<String, String>, Integer, Hash)>] Hash<String, String> data, response status code and response headers
|
|
101
|
+
def cors_origins_delete_with_http_info(cors_origin_id, opts = {})
|
|
102
|
+
if @api_client.config.debugging
|
|
103
|
+
@api_client.config.logger.debug 'Calling API: CorsOriginsApi.cors_origins_delete ...'
|
|
104
|
+
end
|
|
105
|
+
# verify the required parameter 'cors_origin_id' is set
|
|
106
|
+
if @api_client.config.client_side_validation && cors_origin_id.nil?
|
|
107
|
+
fail ArgumentError, "Missing the required parameter 'cors_origin_id' when calling CorsOriginsApi.cors_origins_delete"
|
|
108
|
+
end
|
|
109
|
+
# resource path
|
|
110
|
+
local_var_path = '/api/v1/cors_origins/{cors_origin_id}'.sub('{' + 'cors_origin_id' + '}', CGI.escape(cors_origin_id.to_s))
|
|
111
|
+
|
|
112
|
+
# query parameters
|
|
113
|
+
query_params = opts[:query_params] || {}
|
|
114
|
+
|
|
115
|
+
# header parameters
|
|
116
|
+
header_params = opts[:header_params] || {}
|
|
117
|
+
# HTTP header 'Accept' (if needed)
|
|
118
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
|
|
119
|
+
|
|
120
|
+
# form parameters
|
|
121
|
+
form_params = opts[:form_params] || {}
|
|
122
|
+
|
|
123
|
+
# http body (model)
|
|
124
|
+
post_body = opts[:debug_body]
|
|
125
|
+
|
|
126
|
+
# return_type
|
|
127
|
+
return_type = opts[:debug_return_type] || 'Hash<String, String>'
|
|
128
|
+
|
|
129
|
+
# auth_names
|
|
130
|
+
auth_names = opts[:debug_auth_names] || []
|
|
131
|
+
|
|
132
|
+
new_options = opts.merge(
|
|
133
|
+
:operation => :"CorsOriginsApi.cors_origins_delete",
|
|
134
|
+
:header_params => header_params,
|
|
135
|
+
:query_params => query_params,
|
|
136
|
+
:form_params => form_params,
|
|
137
|
+
:body => post_body,
|
|
138
|
+
:auth_names => auth_names,
|
|
139
|
+
:return_type => return_type
|
|
140
|
+
)
|
|
141
|
+
|
|
142
|
+
data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, new_options)
|
|
143
|
+
if @api_client.config.debugging
|
|
144
|
+
@api_client.config.logger.debug "API called: CorsOriginsApi#cors_origins_delete\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
145
|
+
end
|
|
146
|
+
return data, status_code, headers
|
|
147
|
+
end
|
|
148
|
+
|
|
149
|
+
# List CORS Origins
|
|
150
|
+
# @param [Hash] opts the optional parameters
|
|
151
|
+
# @option opts [Integer] :limit (default to 20)
|
|
152
|
+
# @option opts [Integer] :page (default to 1)
|
|
153
|
+
# @return [Array<CorsOriginSchema>]
|
|
154
|
+
def cors_origins_list(opts = {})
|
|
155
|
+
data, _status_code, _headers = cors_origins_list_with_http_info(opts)
|
|
156
|
+
data
|
|
157
|
+
end
|
|
158
|
+
|
|
159
|
+
# List CORS Origins
|
|
160
|
+
# @param [Hash] opts the optional parameters
|
|
161
|
+
# @option opts [Integer] :limit (default to 20)
|
|
162
|
+
# @option opts [Integer] :page (default to 1)
|
|
163
|
+
# @return [Array<(Array<CorsOriginSchema>, Integer, Hash)>] Array<CorsOriginSchema> data, response status code and response headers
|
|
164
|
+
def cors_origins_list_with_http_info(opts = {})
|
|
165
|
+
if @api_client.config.debugging
|
|
166
|
+
@api_client.config.logger.debug 'Calling API: CorsOriginsApi.cors_origins_list ...'
|
|
167
|
+
end
|
|
168
|
+
if @api_client.config.client_side_validation && !opts[:'limit'].nil? && opts[:'limit'] > 100
|
|
169
|
+
fail ArgumentError, 'invalid value for "opts[:"limit"]" when calling CorsOriginsApi.cors_origins_list, must be smaller than or equal to 100.'
|
|
170
|
+
end
|
|
171
|
+
|
|
172
|
+
if @api_client.config.client_side_validation && !opts[:'limit'].nil? && opts[:'limit'] < 1
|
|
173
|
+
fail ArgumentError, 'invalid value for "opts[:"limit"]" when calling CorsOriginsApi.cors_origins_list, must be greater than or equal to 1.'
|
|
174
|
+
end
|
|
175
|
+
|
|
176
|
+
if @api_client.config.client_side_validation && !opts[:'page'].nil? && opts[:'page'] < 1
|
|
177
|
+
fail ArgumentError, 'invalid value for "opts[:"page"]" when calling CorsOriginsApi.cors_origins_list, must be greater than or equal to 1.'
|
|
178
|
+
end
|
|
179
|
+
|
|
180
|
+
# resource path
|
|
181
|
+
local_var_path = '/api/v1/cors_origins/'
|
|
182
|
+
|
|
183
|
+
# query parameters
|
|
184
|
+
query_params = opts[:query_params] || {}
|
|
185
|
+
query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil?
|
|
186
|
+
query_params[:'page'] = opts[:'page'] if !opts[:'page'].nil?
|
|
187
|
+
|
|
188
|
+
# header parameters
|
|
189
|
+
header_params = opts[:header_params] || {}
|
|
190
|
+
# HTTP header 'Accept' (if needed)
|
|
191
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
|
|
192
|
+
|
|
193
|
+
# form parameters
|
|
194
|
+
form_params = opts[:form_params] || {}
|
|
195
|
+
|
|
196
|
+
# http body (model)
|
|
197
|
+
post_body = opts[:debug_body]
|
|
198
|
+
|
|
199
|
+
# return_type
|
|
200
|
+
return_type = opts[:debug_return_type] || 'Array<CorsOriginSchema>'
|
|
201
|
+
|
|
202
|
+
# auth_names
|
|
203
|
+
auth_names = opts[:debug_auth_names] || []
|
|
204
|
+
|
|
205
|
+
new_options = opts.merge(
|
|
206
|
+
:operation => :"CorsOriginsApi.cors_origins_list",
|
|
207
|
+
:header_params => header_params,
|
|
208
|
+
:query_params => query_params,
|
|
209
|
+
:form_params => form_params,
|
|
210
|
+
:body => post_body,
|
|
211
|
+
:auth_names => auth_names,
|
|
212
|
+
:return_type => return_type
|
|
213
|
+
)
|
|
214
|
+
|
|
215
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
|
|
216
|
+
if @api_client.config.debugging
|
|
217
|
+
@api_client.config.logger.debug "API called: CorsOriginsApi#cors_origins_list\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
218
|
+
end
|
|
219
|
+
return data, status_code, headers
|
|
220
|
+
end
|
|
221
|
+
|
|
222
|
+
# Get CORS Origin By ID
|
|
223
|
+
# @param cors_origin_id [String]
|
|
224
|
+
# @param [Hash] opts the optional parameters
|
|
225
|
+
# @return [CorsOriginSchema]
|
|
226
|
+
def cors_origins_retrieve(cors_origin_id, opts = {})
|
|
227
|
+
data, _status_code, _headers = cors_origins_retrieve_with_http_info(cors_origin_id, opts)
|
|
228
|
+
data
|
|
229
|
+
end
|
|
230
|
+
|
|
231
|
+
# Get CORS Origin By ID
|
|
232
|
+
# @param cors_origin_id [String]
|
|
233
|
+
# @param [Hash] opts the optional parameters
|
|
234
|
+
# @return [Array<(CorsOriginSchema, Integer, Hash)>] CorsOriginSchema data, response status code and response headers
|
|
235
|
+
def cors_origins_retrieve_with_http_info(cors_origin_id, opts = {})
|
|
236
|
+
if @api_client.config.debugging
|
|
237
|
+
@api_client.config.logger.debug 'Calling API: CorsOriginsApi.cors_origins_retrieve ...'
|
|
238
|
+
end
|
|
239
|
+
# verify the required parameter 'cors_origin_id' is set
|
|
240
|
+
if @api_client.config.client_side_validation && cors_origin_id.nil?
|
|
241
|
+
fail ArgumentError, "Missing the required parameter 'cors_origin_id' when calling CorsOriginsApi.cors_origins_retrieve"
|
|
242
|
+
end
|
|
243
|
+
# resource path
|
|
244
|
+
local_var_path = '/api/v1/cors_origins/{cors_origin_id}'.sub('{' + 'cors_origin_id' + '}', CGI.escape(cors_origin_id.to_s))
|
|
245
|
+
|
|
246
|
+
# query parameters
|
|
247
|
+
query_params = opts[:query_params] || {}
|
|
248
|
+
|
|
249
|
+
# header parameters
|
|
250
|
+
header_params = opts[:header_params] || {}
|
|
251
|
+
# HTTP header 'Accept' (if needed)
|
|
252
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
|
|
253
|
+
|
|
254
|
+
# form parameters
|
|
255
|
+
form_params = opts[:form_params] || {}
|
|
256
|
+
|
|
257
|
+
# http body (model)
|
|
258
|
+
post_body = opts[:debug_body]
|
|
259
|
+
|
|
260
|
+
# return_type
|
|
261
|
+
return_type = opts[:debug_return_type] || 'CorsOriginSchema'
|
|
262
|
+
|
|
263
|
+
# auth_names
|
|
264
|
+
auth_names = opts[:debug_auth_names] || []
|
|
265
|
+
|
|
266
|
+
new_options = opts.merge(
|
|
267
|
+
:operation => :"CorsOriginsApi.cors_origins_retrieve",
|
|
268
|
+
:header_params => header_params,
|
|
269
|
+
:query_params => query_params,
|
|
270
|
+
:form_params => form_params,
|
|
271
|
+
:body => post_body,
|
|
272
|
+
:auth_names => auth_names,
|
|
273
|
+
:return_type => return_type
|
|
274
|
+
)
|
|
275
|
+
|
|
276
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
|
|
277
|
+
if @api_client.config.debugging
|
|
278
|
+
@api_client.config.logger.debug "API called: CorsOriginsApi#cors_origins_retrieve\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
279
|
+
end
|
|
280
|
+
return data, status_code, headers
|
|
281
|
+
end
|
|
282
|
+
|
|
283
|
+
# Update CORS Origin By ID
|
|
284
|
+
# @param cors_origin_id [String]
|
|
285
|
+
# @param cors_origin_update_schema [CorsOriginUpdateSchema]
|
|
286
|
+
# @param [Hash] opts the optional parameters
|
|
287
|
+
# @return [CorsOriginSchema]
|
|
288
|
+
def cors_origins_update(cors_origin_id, cors_origin_update_schema, opts = {})
|
|
289
|
+
data, _status_code, _headers = cors_origins_update_with_http_info(cors_origin_id, cors_origin_update_schema, opts)
|
|
290
|
+
data
|
|
291
|
+
end
|
|
292
|
+
|
|
293
|
+
# Update CORS Origin By ID
|
|
294
|
+
# @param cors_origin_id [String]
|
|
295
|
+
# @param cors_origin_update_schema [CorsOriginUpdateSchema]
|
|
296
|
+
# @param [Hash] opts the optional parameters
|
|
297
|
+
# @return [Array<(CorsOriginSchema, Integer, Hash)>] CorsOriginSchema data, response status code and response headers
|
|
298
|
+
def cors_origins_update_with_http_info(cors_origin_id, cors_origin_update_schema, opts = {})
|
|
299
|
+
if @api_client.config.debugging
|
|
300
|
+
@api_client.config.logger.debug 'Calling API: CorsOriginsApi.cors_origins_update ...'
|
|
301
|
+
end
|
|
302
|
+
# verify the required parameter 'cors_origin_id' is set
|
|
303
|
+
if @api_client.config.client_side_validation && cors_origin_id.nil?
|
|
304
|
+
fail ArgumentError, "Missing the required parameter 'cors_origin_id' when calling CorsOriginsApi.cors_origins_update"
|
|
305
|
+
end
|
|
306
|
+
# verify the required parameter 'cors_origin_update_schema' is set
|
|
307
|
+
if @api_client.config.client_side_validation && cors_origin_update_schema.nil?
|
|
308
|
+
fail ArgumentError, "Missing the required parameter 'cors_origin_update_schema' when calling CorsOriginsApi.cors_origins_update"
|
|
309
|
+
end
|
|
310
|
+
# resource path
|
|
311
|
+
local_var_path = '/api/v1/cors_origins/{cors_origin_id}'.sub('{' + 'cors_origin_id' + '}', CGI.escape(cors_origin_id.to_s))
|
|
312
|
+
|
|
313
|
+
# query parameters
|
|
314
|
+
query_params = opts[:query_params] || {}
|
|
315
|
+
|
|
316
|
+
# header parameters
|
|
317
|
+
header_params = opts[:header_params] || {}
|
|
318
|
+
# HTTP header 'Accept' (if needed)
|
|
319
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
|
|
320
|
+
# HTTP header 'Content-Type'
|
|
321
|
+
content_type = @api_client.select_header_content_type(['application/json'])
|
|
322
|
+
if !content_type.nil?
|
|
323
|
+
header_params['Content-Type'] = content_type
|
|
324
|
+
end
|
|
325
|
+
|
|
326
|
+
# form parameters
|
|
327
|
+
form_params = opts[:form_params] || {}
|
|
328
|
+
|
|
329
|
+
# http body (model)
|
|
330
|
+
post_body = opts[:debug_body] || @api_client.object_to_http_body(cors_origin_update_schema)
|
|
331
|
+
|
|
332
|
+
# return_type
|
|
333
|
+
return_type = opts[:debug_return_type] || 'CorsOriginSchema'
|
|
334
|
+
|
|
335
|
+
# auth_names
|
|
336
|
+
auth_names = opts[:debug_auth_names] || []
|
|
337
|
+
|
|
338
|
+
new_options = opts.merge(
|
|
339
|
+
:operation => :"CorsOriginsApi.cors_origins_update",
|
|
340
|
+
:header_params => header_params,
|
|
341
|
+
:query_params => query_params,
|
|
342
|
+
:form_params => form_params,
|
|
343
|
+
:body => post_body,
|
|
344
|
+
:auth_names => auth_names,
|
|
345
|
+
:return_type => return_type
|
|
346
|
+
)
|
|
347
|
+
|
|
348
|
+
data, status_code, headers = @api_client.call_api(:PATCH, local_var_path, new_options)
|
|
349
|
+
if @api_client.config.debugging
|
|
350
|
+
@api_client.config.logger.debug "API called: CorsOriginsApi#cors_origins_update\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
351
|
+
end
|
|
352
|
+
return data, status_code, headers
|
|
353
|
+
end
|
|
354
|
+
end
|
|
355
|
+
end
|