Skip to content

Commit

Permalink
Use stdClass as data object
Browse files Browse the repository at this point in the history
  • Loading branch information
tanelt committed Jul 13, 2022
1 parent 1e68498 commit 02cfc8c
Show file tree
Hide file tree
Showing 45 changed files with 409 additions and 75 deletions.
5 changes: 3 additions & 2 deletions .openapi-generator/FILES
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ Gemfile
README.md
Rakefile
docs/Component.md
docs/Data.md
docs/DocumentsApi.md
docs/InlineResponse200.md
docs/InlineResponse2001.md
Expand All @@ -17,6 +16,7 @@ docs/InlineResponse2004.md
docs/InlineResponse2004Meta.md
docs/InlineResponse2005.md
docs/InlineResponse401.md
docs/InlineResponse402.md
docs/InlineResponse403.md
docs/InlineResponse404.md
docs/InlineResponse422.md
Expand Down Expand Up @@ -44,7 +44,6 @@ lib/pdf_generator_api_client/api_client.rb
lib/pdf_generator_api_client/api_error.rb
lib/pdf_generator_api_client/configuration.rb
lib/pdf_generator_api_client/models/component.rb
lib/pdf_generator_api_client/models/data.rb
lib/pdf_generator_api_client/models/inline_response200.rb
lib/pdf_generator_api_client/models/inline_response2001.rb
lib/pdf_generator_api_client/models/inline_response2002.rb
Expand All @@ -54,6 +53,7 @@ lib/pdf_generator_api_client/models/inline_response2004.rb
lib/pdf_generator_api_client/models/inline_response2004_meta.rb
lib/pdf_generator_api_client/models/inline_response2005.rb
lib/pdf_generator_api_client/models/inline_response401.rb
lib/pdf_generator_api_client/models/inline_response402.rb
lib/pdf_generator_api_client/models/inline_response403.rb
lib/pdf_generator_api_client/models/inline_response404.rb
lib/pdf_generator_api_client/models/inline_response422.rb
Expand All @@ -74,4 +74,5 @@ lib/pdf_generator_api_client/version.rb
pdf_generator_api_client.gemspec
spec/api_client_spec.rb
spec/configuration_spec.rb
spec/models/inline_response402_spec.rb
spec/spec_helper.rb
14 changes: 10 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,7 @@ We have validated the generated libraries, but let us know if you find any anoma
| Code | Description |
|--------|--------------------------------|
| 401 | Unauthorized |
| 402 | Payment Required |
| 403 | Forbidden |
| 404 | Not Found |
| 422 | Unprocessable Entity |
Expand All @@ -166,6 +167,11 @@ We have validated the generated libraries, but let us know if you find any anoma
| Authentication failed: property 'exp' (expiration time) missing in JWT |
| Authentication failed: incorrect signature |

## 402 Payment Required
| Description |
|-------------------------------------------------------------------------|
| Your account is suspended, please upgrade your account |

## 403 Forbidden
| Description |
|-------------------------------------------------------------------------|
Expand Down Expand Up @@ -251,16 +257,16 @@ end

api_instance = PDFGeneratorAPI::DocumentsApi.new
template_id = 19375 # Integer | Template unique identifier
data = PDFGeneratorAPI::Data.new # Data | Data used to generate the PDF. This can be JSON encoded string or a public URL to your JSON file.
body = Object # Object | Data used to generate the PDF. This can be JSON encoded string or a public URL to your JSON file.
opts = {
name: 'My document', # String | Document name, returned in the meta data.
format: 'pdf', # String | Document format. The zip option will return a ZIP file with PDF files.
output: 'base64' # String | Response format. With the url option, the document is stored for 30 days and automatically deleted.
output: 'base64' # String | Response format. "I" is used to return the file inline. With the url option, the document is stored for 30 days and automatically deleted.
}

begin
#Generate document
result = api_instance.merge_template(template_id, data, opts)
result = api_instance.merge_template(template_id, body, opts)
p result
rescue PDFGeneratorAPI::ApiError => e
puts "Exception when calling DocumentsApi->merge_template: #{e}"
Expand Down Expand Up @@ -290,7 +296,6 @@ Class | Method | HTTP request | Description
## Documentation for Models

- [PDFGeneratorAPI::Component](docs/Component.md)
- [PDFGeneratorAPI::Data](docs/Data.md)
- [PDFGeneratorAPI::InlineResponse200](docs/InlineResponse200.md)
- [PDFGeneratorAPI::InlineResponse2001](docs/InlineResponse2001.md)
- [PDFGeneratorAPI::InlineResponse2002](docs/InlineResponse2002.md)
Expand All @@ -300,6 +305,7 @@ Class | Method | HTTP request | Description
- [PDFGeneratorAPI::InlineResponse2004Meta](docs/InlineResponse2004Meta.md)
- [PDFGeneratorAPI::InlineResponse2005](docs/InlineResponse2005.md)
- [PDFGeneratorAPI::InlineResponse401](docs/InlineResponse401.md)
- [PDFGeneratorAPI::InlineResponse402](docs/InlineResponse402.md)
- [PDFGeneratorAPI::InlineResponse403](docs/InlineResponse403.md)
- [PDFGeneratorAPI::InlineResponse404](docs/InlineResponse404.md)
- [PDFGeneratorAPI::InlineResponse422](docs/InlineResponse422.md)
Expand Down
22 changes: 11 additions & 11 deletions docs/DocumentsApi.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ All URIs are relative to *https://us1.pdfgeneratorapi.com/api/v3*

## merge_template

> <InlineResponse2004> merge_template(template_id, data, opts)
> <InlineResponse2004> merge_template(template_id, body, opts)
Generate document

Expand All @@ -29,16 +29,16 @@ end

api_instance = PDFGeneratorAPI::DocumentsApi.new
template_id = 19375 # Integer | Template unique identifier
data = PDFGeneratorAPI::Data.new # Data | Data used to generate the PDF. This can be JSON encoded string or a public URL to your JSON file.
body = Object # Object | Data used to generate the PDF. This can be JSON encoded string or a public URL to your JSON file.
opts = {
name: 'My document', # String | Document name, returned in the meta data.
format: 'pdf', # String | Document format. The zip option will return a ZIP file with PDF files.
output: 'base64' # String | Response format. With the url option, the document is stored for 30 days and automatically deleted.
output: 'base64' # String | Response format. \"I\" is used to return the file inline. With the url option, the document is stored for 30 days and automatically deleted.
}

begin
# Generate document
result = api_instance.merge_template(template_id, data, opts)
result = api_instance.merge_template(template_id, body, opts)
p result
rescue PDFGeneratorAPI::ApiError => e
puts "Error when calling DocumentsApi->merge_template: #{e}"
Expand All @@ -49,12 +49,12 @@ end

This returns an Array which contains the response data, status code and headers.

> <Array(<InlineResponse2004>, Integer, Hash)> merge_template_with_http_info(template_id, data, opts)
> <Array(<InlineResponse2004>, Integer, Hash)> merge_template_with_http_info(template_id, body, opts)
```ruby
begin
# Generate document
data, status_code, headers = api_instance.merge_template_with_http_info(template_id, data, opts)
data, status_code, headers = api_instance.merge_template_with_http_info(template_id, body, opts)
p status_code # => 2xx
p headers # => { ... }
p data # => <InlineResponse2004>
Expand All @@ -68,10 +68,10 @@ end
| Name | Type | Description | Notes |
| ---- | ---- | ----------- | ----- |
| **template_id** | **Integer** | Template unique identifier | |
| **data** | [**Data**](Data.md) | Data used to generate the PDF. This can be JSON encoded string or a public URL to your JSON file. | |
| **body** | **Object** | Data used to generate the PDF. This can be JSON encoded string or a public URL to your JSON file. | |
| **name** | **String** | Document name, returned in the meta data. | [optional] |
| **format** | **String** | Document format. The zip option will return a ZIP file with PDF files. | [optional][default to &#39;pdf&#39;] |
| **output** | **String** | Response format. With the url option, the document is stored for 30 days and automatically deleted. | [optional][default to &#39;base64&#39;] |
| **output** | **String** | Response format. \&quot;I\&quot; is used to return the file inline. With the url option, the document is stored for 30 days and automatically deleted. | [optional][default to &#39;base64&#39;] |

### Return type

Expand All @@ -93,7 +93,7 @@ end
Generate document (multiple templates)

Allows to merge multiple templated with data and returns base64 encoded document or public URL to a document. NB! When the public URL option is used, the document is stored for 30 days and automatically deleted.
Allows to merge multiple templates with data and returns base64 encoded document or public URL to a document. NB! When the public URL option is used, the document is stored for 30 days and automatically deleted.

### Examples

Expand All @@ -111,7 +111,7 @@ request_body = [3.56] # Array<Object> | Data used to specify templates and data
opts = {
name: 'My document', # String | Document name, returned in the meta data.
format: 'pdf', # String | Document format. The zip option will return a ZIP file with PDF files.
output: 'base64' # String | Response format. With the url option, the document is stored for 30 days and automatically deleted.
output: 'base64' # String | Response format. \"I\" is used to return the file inline. With the url option, the document is stored for 30 days and automatically deleted.
}

begin
Expand Down Expand Up @@ -148,7 +148,7 @@ end
| **request_body** | [**Array&lt;Object&gt;**](Object.md) | Data used to specify templates and data objects which are used to merge the template | |
| **name** | **String** | Document name, returned in the meta data. | [optional] |
| **format** | **String** | Document format. The zip option will return a ZIP file with PDF files. | [optional][default to &#39;pdf&#39;] |
| **output** | **String** | Response format. With the url option, the document is stored for 30 days and automatically deleted. | [optional][default to &#39;base64&#39;] |
| **output** | **String** | Response format. \&quot;I\&quot; is used to return the file inline. With the url option, the document is stored for 30 days and automatically deleted. | [optional][default to &#39;base64&#39;] |

### Return type

Expand Down
20 changes: 20 additions & 0 deletions docs/InlineResponse402.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# PDFGeneratorAPI::InlineResponse402

## Properties

| Name | Type | Description | Notes |
| ---- | ---- | ----------- | ----- |
| **error** | **String** | Error description | [optional] |
| **status** | **Integer** | HTTP Error code | [optional] |

## Example

```ruby
require 'pdf_generator_api_client'

instance = PDFGeneratorAPI::InlineResponse402.new(
error: Account Suspended,
status: 402
)
```

2 changes: 1 addition & 1 deletion docs/TemplatesApi.md
Original file line number Diff line number Diff line change
Expand Up @@ -230,7 +230,7 @@ end
Open editor

Returns an unique URL which you can use to redirect your user to the editor from your application or use the generated URL as iframe source to show the editor within your application.
Returns an unique URL which you can use to redirect your user to the editor from your application or use the generated URL as iframe source to show the editor within your application. When using iframe, make sure that your browser allows third-party cookies.

### Examples

Expand Down
Loading

0 comments on commit 02cfc8c

Please sign in to comment.