cloudmersive-convert-api-client 1.3.7 → 1.3.8

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 658bdf01cc76df80585fc703c6f5dbc96ee2eb6c44b7c51d18063ef8a5e8ed8c
4
- data.tar.gz: 0af97b1ea920bf862fac3a32aff533cca5ab705c1d706c57da277de252271f48
3
+ metadata.gz: 3972e7ff307a895a1c8f4538a28a8b18b1bac6d4524cc7dd2090b53eb27286c8
4
+ data.tar.gz: a2cb514fd1065b06d89eb9e02050753cba10d8ec1afd53b2b5380b1dca9e3923
5
5
  SHA512:
6
- metadata.gz: e3e6e4e01bee72d12773faadecf30034da677d2d510514da3e2258dc8b55ae711131f4b7305036da9a709f22514f8c70897c965c19edaca2ec2a8f31c5a551cd
7
- data.tar.gz: 489ad2c57f347c85cc365442179d47d757cf59159b9be72950568551e664822d3efd5f53e6002d046467d7ee352043f87ea569e10ad174603b64517387db8765
6
+ metadata.gz: 3c52ced3b4dc5d2665b13cda6b3f85e349d87231ad02faa8c691b3be29a2365c12ee88b45586adeb65fcb0b49ec71452312abee0b02b008fe44725a25df95468
7
+ data.tar.gz: 72d69476c5deecdc5b5e2e7532b69273664e9b3f62e9e7fb046e6d534a51180a4d5011c54a7358ee79938bfaf3b7a43b7e8170b554be505112c7bfc304dbd94b
data/README.md CHANGED
@@ -7,7 +7,7 @@ Convert API lets you effortlessly convert file formats and types.
7
7
  This SDK is automatically generated by the [Swagger Codegen](https://github.com/swagger-api/swagger-codegen) project:
8
8
 
9
9
  - API version: v1
10
- - Package version: 1.3.7
10
+ - Package version: 1.3.8
11
11
  - Build package: io.swagger.codegen.languages.RubyClientCodegen
12
12
 
13
13
  ## Installation
@@ -23,15 +23,15 @@ gem build cloudmersive-convert-api-client.gemspec
23
23
  Then either install the gem locally:
24
24
 
25
25
  ```shell
26
- gem install ./cloudmersive-convert-api-client-1.3.7.gem
26
+ gem install ./cloudmersive-convert-api-client-1.3.8.gem
27
27
  ```
28
- (for development, run `gem install --dev ./cloudmersive-convert-api-client-1.3.7.gem` to install the development dependencies)
28
+ (for development, run `gem install --dev ./cloudmersive-convert-api-client-1.3.8.gem` to install the development dependencies)
29
29
 
30
30
  or publish the gem to a gem hosting service, e.g. [RubyGems](https://rubygems.org/).
31
31
 
32
32
  Finally add this to the Gemfile:
33
33
 
34
- gem 'cloudmersive-convert-api-client', '~> 1.3.7'
34
+ gem 'cloudmersive-convert-api-client', '~> 1.3.8'
35
35
 
36
36
  ### Install from Git
37
37
 
@@ -113,6 +113,7 @@ Class | Method | HTTP request | Description
113
113
  *CloudmersiveConvertApiClient::ConvertImageApi* | [**convert_image_image_format_convert**](docs/ConvertImageApi.md#convert_image_image_format_convert) | **POST** /convert/image/{format1}/to/{format2} | Image format conversion
114
114
  *CloudmersiveConvertApiClient::ConvertImageApi* | [**convert_image_image_set_dpi**](docs/ConvertImageApi.md#convert_image_image_set_dpi) | **POST** /convert/image/set-dpi/{dpi} | Change image DPI
115
115
  *CloudmersiveConvertApiClient::ConvertImageApi* | [**convert_image_multipage_image_format_convert**](docs/ConvertImageApi.md#convert_image_multipage_image_format_convert) | **POST** /convert/image-multipage/{format1}/to/{format2} | Multi-page format conversion
116
+ *CloudmersiveConvertApiClient::ConvertTemplateApi* | [**convert_template_apply_docx_template**](docs/ConvertTemplateApi.md#convert_template_apply_docx_template) | **POST** /convert/template/docx/apply | Apply Word DOCX template
116
117
  *CloudmersiveConvertApiClient::ConvertTemplateApi* | [**convert_template_apply_html_template**](docs/ConvertTemplateApi.md#convert_template_apply_html_template) | **POST** /convert/template/html/apply | Apply HTML template
117
118
  *CloudmersiveConvertApiClient::ConvertWebApi* | [**convert_web_html_to_docx**](docs/ConvertWebApi.md#convert_web_html_to_docx) | **POST** /convert/html/to/docx | HTML to DOCX
118
119
  *CloudmersiveConvertApiClient::ConvertWebApi* | [**convert_web_html_to_pdf**](docs/ConvertWebApi.md#convert_web_html_to_pdf) | **POST** /convert/web/html/to/pdf | Convert HTML string to PDF
@@ -180,6 +181,8 @@ Class | Method | HTTP request | Description
180
181
  - [CloudmersiveConvertApiClient::DocxTable](docs/DocxTable.md)
181
182
  - [CloudmersiveConvertApiClient::DocxTableCell](docs/DocxTableCell.md)
182
183
  - [CloudmersiveConvertApiClient::DocxTableRow](docs/DocxTableRow.md)
184
+ - [CloudmersiveConvertApiClient::DocxTemplateApplicationRequest](docs/DocxTemplateApplicationRequest.md)
185
+ - [CloudmersiveConvertApiClient::DocxTemplateOperation](docs/DocxTemplateOperation.md)
183
186
  - [CloudmersiveConvertApiClient::DocxText](docs/DocxText.md)
184
187
  - [CloudmersiveConvertApiClient::ExifValue](docs/ExifValue.md)
185
188
  - [CloudmersiveConvertApiClient::FinishEditingRequest](docs/FinishEditingRequest.md)
@@ -4,9 +4,68 @@ All URIs are relative to *https://api.cloudmersive.com*
4
4
 
5
5
  Method | HTTP request | Description
6
6
  ------------- | ------------- | -------------
7
+ [**convert_template_apply_docx_template**](ConvertTemplateApi.md#convert_template_apply_docx_template) | **POST** /convert/template/docx/apply | Apply Word DOCX template
7
8
  [**convert_template_apply_html_template**](ConvertTemplateApi.md#convert_template_apply_html_template) | **POST** /convert/template/html/apply | Apply HTML template
8
9
 
9
10
 
11
+ # **convert_template_apply_docx_template**
12
+ > String convert_template_apply_docx_template(input_file, opts)
13
+
14
+ Apply Word DOCX template
15
+
16
+ Apply operations to fill in a Word DOCX template by replacing target template/placeholder strings in the DOCX with values, generating a final Word DOCX result. For example, you could create a Word Document invoice containing strings such as \"{FirstName}\" and \"{LastName}\" and then replace these values with \"John\" and \"Smith\".
17
+
18
+ ### Example
19
+ ```ruby
20
+ # load the gem
21
+ require 'cloudmersive-convert-api-client'
22
+ # setup authorization
23
+ CloudmersiveConvertApiClient.configure do |config|
24
+ # Configure API key authorization: Apikey
25
+ config.api_key['Apikey'] = 'YOUR API KEY'
26
+ # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
27
+ #config.api_key_prefix['Apikey'] = 'Bearer'
28
+ end
29
+
30
+ api_instance = CloudmersiveConvertApiClient::ConvertTemplateApi.new
31
+
32
+ input_file = File.new("/path/to/file.txt") # File | Input file to perform the operation on.
33
+
34
+ opts = {
35
+ template_definition: "template_definition_example" # String | Template definition for the document, including what values to replace
36
+ }
37
+
38
+ begin
39
+ #Apply Word DOCX template
40
+ result = api_instance.convert_template_apply_docx_template(input_file, opts)
41
+ p result
42
+ rescue CloudmersiveConvertApiClient::ApiError => e
43
+ puts "Exception when calling ConvertTemplateApi->convert_template_apply_docx_template: #{e}"
44
+ end
45
+ ```
46
+
47
+ ### Parameters
48
+
49
+ Name | Type | Description | Notes
50
+ ------------- | ------------- | ------------- | -------------
51
+ **input_file** | **File**| Input file to perform the operation on. |
52
+ **template_definition** | **String**| Template definition for the document, including what values to replace | [optional]
53
+
54
+ ### Return type
55
+
56
+ **String**
57
+
58
+ ### Authorization
59
+
60
+ [Apikey](../README.md#Apikey)
61
+
62
+ ### HTTP request headers
63
+
64
+ - **Content-Type**: multipart/form-data
65
+ - **Accept**: application/json, text/json, application/xml, text/xml
66
+
67
+
68
+
10
69
  # **convert_template_apply_html_template**
11
70
  > HtmlTemplateApplicationResponse convert_template_apply_html_template(value)
12
71
 
@@ -0,0 +1,8 @@
1
+ # CloudmersiveConvertApiClient::DocxTemplateApplicationRequest
2
+
3
+ ## Properties
4
+ Name | Type | Description | Notes
5
+ ------------ | ------------- | ------------- | -------------
6
+ **operations** | [**Array<DocxTemplateOperation>**](DocxTemplateOperation.md) | Operations to apply to this template | [optional]
7
+
8
+
@@ -0,0 +1,10 @@
1
+ # CloudmersiveConvertApiClient::DocxTemplateOperation
2
+
3
+ ## Properties
4
+ Name | Type | Description | Notes
5
+ ------------ | ------------- | ------------- | -------------
6
+ **action** | **Integer** | Operation action to take; possible values are \"Replace\" | [optional]
7
+ **match_against** | **String** | For Replace operations, the string to match against (to be replaced with ReplaceWith string) | [optional]
8
+ **replace_with** | **String** | For Replace operations, the string to Replace the original string with | [optional]
9
+
10
+
@@ -3,8 +3,8 @@
3
3
  ## Properties
4
4
  Name | Type | Description | Notes
5
5
  ------------ | ------------- | ------------- | -------------
6
- **html_template** | **String** | | [optional]
7
- **html_template_url** | **String** | | [optional]
8
- **operations** | [**Array<HtmlTemplateOperation>**](HtmlTemplateOperation.md) | | [optional]
6
+ **html_template** | **String** | HTML template input as a string | [optional]
7
+ **html_template_url** | **String** | URL to HTML template input | [optional]
8
+ **operations** | [**Array<HtmlTemplateOperation>**](HtmlTemplateOperation.md) | Operations to apply to this template | [optional]
9
9
 
10
10
 
@@ -3,8 +3,8 @@
3
3
  ## Properties
4
4
  Name | Type | Description | Notes
5
5
  ------------ | ------------- | ------------- | -------------
6
- **action** | **Integer** | | [optional]
7
- **match_agsint** | **String** | | [optional]
8
- **replace_with** | **String** | | [optional]
6
+ **action** | **Integer** | Operation action to take; possible values are \"Replace\" | [optional]
7
+ **match_agsint** | **String** | For Replace operations, the string to match against (to be replaced with ReplaceWith string) | [optional]
8
+ **replace_with** | **String** | For Replace operations, the string to Replace the original string with | [optional]
9
9
 
10
10
 
@@ -3,8 +3,8 @@
3
3
  ## Properties
4
4
  Name | Type | Description | Notes
5
5
  ------------ | ------------- | ------------- | -------------
6
- **successful** | **BOOLEAN** | | [optional]
7
- **page_count** | **Integer** | | [optional]
8
- **pages** | [**Array<PageConversionResult>**](PageConversionResult.md) | | [optional]
6
+ **successful** | **BOOLEAN** | True if successful, false otherwise | [optional]
7
+ **page_count** | **Integer** | The number of pages in the converted output | [optional]
8
+ **pages** | [**Array<PageConversionResult>**](PageConversionResult.md) | Converted page results | [optional]
9
9
 
10
10
 
@@ -3,7 +3,7 @@
3
3
  ## Properties
4
4
  Name | Type | Description | Notes
5
5
  ------------ | ------------- | ------------- | -------------
6
- **filename** | **String** | | [optional]
7
- **file_bytes** | **String** | | [optional]
6
+ **filename** | **String** | File name of the image in the converted file format | [optional]
7
+ **file_bytes** | **String** | File bytes (contents) of the image in converted file format | [optional]
8
8
 
9
9
 
@@ -43,6 +43,8 @@ require 'cloudmersive-convert-api-client/models/docx_style'
43
43
  require 'cloudmersive-convert-api-client/models/docx_table'
44
44
  require 'cloudmersive-convert-api-client/models/docx_table_cell'
45
45
  require 'cloudmersive-convert-api-client/models/docx_table_row'
46
+ require 'cloudmersive-convert-api-client/models/docx_template_application_request'
47
+ require 'cloudmersive-convert-api-client/models/docx_template_operation'
46
48
  require 'cloudmersive-convert-api-client/models/docx_text'
47
49
  require 'cloudmersive-convert-api-client/models/exif_value'
48
50
  require 'cloudmersive-convert-api-client/models/finish_editing_request'
@@ -20,6 +20,65 @@ module CloudmersiveConvertApiClient
20
20
  @api_client = api_client
21
21
  end
22
22
 
23
+ # Apply Word DOCX template
24
+ # Apply operations to fill in a Word DOCX template by replacing target template/placeholder strings in the DOCX with values, generating a final Word DOCX result. For example, you could create a Word Document invoice containing strings such as \"{FirstName}\" and \"{LastName}\" and then replace these values with \"John\" and \"Smith\".
25
+ # @param input_file Input file to perform the operation on.
26
+ # @param [Hash] opts the optional parameters
27
+ # @option opts [String] :template_definition Template definition for the document, including what values to replace
28
+ # @return [String]
29
+ def convert_template_apply_docx_template(input_file, opts = {})
30
+ data, _status_code, _headers = convert_template_apply_docx_template_with_http_info(input_file, opts)
31
+ return data
32
+ end
33
+
34
+ # Apply Word DOCX template
35
+ # Apply operations to fill in a Word DOCX template by replacing target template/placeholder strings in the DOCX with values, generating a final Word DOCX result. For example, you could create a Word Document invoice containing strings such as \"{FirstName}\" and \"{LastName}\" and then replace these values with \"John\" and \"Smith\".
36
+ # @param input_file Input file to perform the operation on.
37
+ # @param [Hash] opts the optional parameters
38
+ # @option opts [String] :template_definition Template definition for the document, including what values to replace
39
+ # @return [Array<(String, Fixnum, Hash)>] String data, response status code and response headers
40
+ def convert_template_apply_docx_template_with_http_info(input_file, opts = {})
41
+ if @api_client.config.debugging
42
+ @api_client.config.logger.debug "Calling API: ConvertTemplateApi.convert_template_apply_docx_template ..."
43
+ end
44
+ # verify the required parameter 'input_file' is set
45
+ if @api_client.config.client_side_validation && input_file.nil?
46
+ fail ArgumentError, "Missing the required parameter 'input_file' when calling ConvertTemplateApi.convert_template_apply_docx_template"
47
+ end
48
+ # resource path
49
+ local_var_path = "/convert/template/docx/apply"
50
+
51
+ # query parameters
52
+ query_params = {}
53
+
54
+ # header parameters
55
+ header_params = {}
56
+ # HTTP header 'Accept' (if needed)
57
+ header_params['Accept'] = @api_client.select_header_accept(['application/json', 'text/json', 'application/xml', 'text/xml'])
58
+ # HTTP header 'Content-Type'
59
+ header_params['Content-Type'] = @api_client.select_header_content_type(['multipart/form-data'])
60
+ header_params[:'templateDefinition'] = opts[:'template_definition'] if !opts[:'template_definition'].nil?
61
+
62
+ # form parameters
63
+ form_params = {}
64
+ form_params["inputFile"] = input_file
65
+
66
+ # http body (model)
67
+ post_body = nil
68
+ auth_names = ['Apikey']
69
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path,
70
+ :header_params => header_params,
71
+ :query_params => query_params,
72
+ :form_params => form_params,
73
+ :body => post_body,
74
+ :auth_names => auth_names,
75
+ :return_type => 'String')
76
+ if @api_client.config.debugging
77
+ @api_client.config.logger.debug "API called: ConvertTemplateApi#convert_template_apply_docx_template\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
78
+ end
79
+ return data, status_code, headers
80
+ end
81
+
23
82
  # Apply HTML template
24
83
  # Apply operations to fill in an HTML template, generating a final HTML result
25
84
  # @param value Operations to apply to template
@@ -0,0 +1,191 @@
1
+ =begin
2
+ #convertapi
3
+
4
+ #Convert API lets you effortlessly convert file formats and types.
5
+
6
+ OpenAPI spec version: v1
7
+
8
+ Generated by: https://github.com/swagger-api/swagger-codegen.git
9
+ Swagger Codegen version: unset
10
+
11
+ =end
12
+
13
+ require 'date'
14
+
15
+ module CloudmersiveConvertApiClient
16
+ # Word DOCX template application request
17
+ class DocxTemplateApplicationRequest
18
+ # Operations to apply to this template
19
+ attr_accessor :operations
20
+
21
+
22
+ # Attribute mapping from ruby-style variable name to JSON key.
23
+ def self.attribute_map
24
+ {
25
+ :'operations' => :'Operations'
26
+ }
27
+ end
28
+
29
+ # Attribute type mapping.
30
+ def self.swagger_types
31
+ {
32
+ :'operations' => :'Array<DocxTemplateOperation>'
33
+ }
34
+ end
35
+
36
+ # Initializes the object
37
+ # @param [Hash] attributes Model attributes in the form of hash
38
+ def initialize(attributes = {})
39
+ return unless attributes.is_a?(Hash)
40
+
41
+ # convert string to symbol for hash key
42
+ attributes = attributes.each_with_object({}){|(k,v), h| h[k.to_sym] = v}
43
+
44
+ if attributes.has_key?(:'Operations')
45
+ if (value = attributes[:'Operations']).is_a?(Array)
46
+ self.operations = value
47
+ end
48
+ end
49
+
50
+ end
51
+
52
+ # Show invalid properties with the reasons. Usually used together with valid?
53
+ # @return Array for valid properties with the reasons
54
+ def list_invalid_properties
55
+ invalid_properties = Array.new
56
+ return invalid_properties
57
+ end
58
+
59
+ # Check to see if the all the properties in the model are valid
60
+ # @return true if the model is valid
61
+ def valid?
62
+ return true
63
+ end
64
+
65
+ # Checks equality by comparing each attribute.
66
+ # @param [Object] Object to be compared
67
+ def ==(o)
68
+ return true if self.equal?(o)
69
+ self.class == o.class &&
70
+ operations == o.operations
71
+ end
72
+
73
+ # @see the `==` method
74
+ # @param [Object] Object to be compared
75
+ def eql?(o)
76
+ self == o
77
+ end
78
+
79
+ # Calculates hash code according to all attributes.
80
+ # @return [Fixnum] Hash code
81
+ def hash
82
+ [operations].hash
83
+ end
84
+
85
+ # Builds the object from hash
86
+ # @param [Hash] attributes Model attributes in the form of hash
87
+ # @return [Object] Returns the model itself
88
+ def build_from_hash(attributes)
89
+ return nil unless attributes.is_a?(Hash)
90
+ self.class.swagger_types.each_pair do |key, type|
91
+ if type =~ /\AArray<(.*)>/i
92
+ # check to ensure the input is an array given that the the attribute
93
+ # is documented as an array but the input is not
94
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
95
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map{ |v| _deserialize($1, v) } )
96
+ end
97
+ elsif !attributes[self.class.attribute_map[key]].nil?
98
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
99
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
100
+ end
101
+
102
+ self
103
+ end
104
+
105
+ # Deserializes the data based on type
106
+ # @param string type Data type
107
+ # @param string value Value to be deserialized
108
+ # @return [Object] Deserialized data
109
+ def _deserialize(type, value)
110
+ case type.to_sym
111
+ when :DateTime
112
+ DateTime.parse(value)
113
+ when :Date
114
+ Date.parse(value)
115
+ when :String
116
+ value.to_s
117
+ when :Integer
118
+ value.to_i
119
+ when :Float
120
+ value.to_f
121
+ when :BOOLEAN
122
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
123
+ true
124
+ else
125
+ false
126
+ end
127
+ when :Object
128
+ # generic object (usually a Hash), return directly
129
+ value
130
+ when /\AArray<(?<inner_type>.+)>\z/
131
+ inner_type = Regexp.last_match[:inner_type]
132
+ value.map { |v| _deserialize(inner_type, v) }
133
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
134
+ k_type = Regexp.last_match[:k_type]
135
+ v_type = Regexp.last_match[:v_type]
136
+ {}.tap do |hash|
137
+ value.each do |k, v|
138
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
139
+ end
140
+ end
141
+ else # model
142
+ temp_model = CloudmersiveConvertApiClient.const_get(type).new
143
+ temp_model.build_from_hash(value)
144
+ end
145
+ end
146
+
147
+ # Returns the string representation of the object
148
+ # @return [String] String presentation of the object
149
+ def to_s
150
+ to_hash.to_s
151
+ end
152
+
153
+ # to_body is an alias to to_hash (backward compatibility)
154
+ # @return [Hash] Returns the object in the form of hash
155
+ def to_body
156
+ to_hash
157
+ end
158
+
159
+ # Returns the object in the form of hash
160
+ # @return [Hash] Returns the object in the form of hash
161
+ def to_hash
162
+ hash = {}
163
+ self.class.attribute_map.each_pair do |attr, param|
164
+ value = self.send(attr)
165
+ next if value.nil?
166
+ hash[param] = _to_hash(value)
167
+ end
168
+ hash
169
+ end
170
+
171
+ # Outputs non-array value in the form of hash
172
+ # For object, use to_hash. Otherwise, just return the value
173
+ # @param [Object] value Any valid value
174
+ # @return [Hash] Returns the value in the form of hash
175
+ def _to_hash(value)
176
+ if value.is_a?(Array)
177
+ value.compact.map{ |v| _to_hash(v) }
178
+ elsif value.is_a?(Hash)
179
+ {}.tap do |hash|
180
+ value.each { |k, v| hash[k] = _to_hash(v) }
181
+ end
182
+ elsif value.respond_to? :to_hash
183
+ value.to_hash
184
+ else
185
+ value
186
+ end
187
+ end
188
+
189
+ end
190
+
191
+ end
@@ -0,0 +1,242 @@
1
+ =begin
2
+ #convertapi
3
+
4
+ #Convert API lets you effortlessly convert file formats and types.
5
+
6
+ OpenAPI spec version: v1
7
+
8
+ Generated by: https://github.com/swagger-api/swagger-codegen.git
9
+ Swagger Codegen version: unset
10
+
11
+ =end
12
+
13
+ require 'date'
14
+
15
+ module CloudmersiveConvertApiClient
16
+
17
+ class DocxTemplateOperation
18
+ # Operation action to take; possible values are \"Replace\"
19
+ attr_accessor :action
20
+
21
+ # For Replace operations, the string to match against (to be replaced with ReplaceWith string)
22
+ attr_accessor :match_against
23
+
24
+ # For Replace operations, the string to Replace the original string with
25
+ attr_accessor :replace_with
26
+
27
+ class EnumAttributeValidator
28
+ attr_reader :datatype
29
+ attr_reader :allowable_values
30
+
31
+ def initialize(datatype, allowable_values)
32
+ @allowable_values = allowable_values.map do |value|
33
+ case datatype.to_s
34
+ when /Integer/i
35
+ value.to_i
36
+ when /Float/i
37
+ value.to_f
38
+ else
39
+ value
40
+ end
41
+ end
42
+ end
43
+
44
+ def valid?(value)
45
+ !value || allowable_values.include?(value)
46
+ end
47
+ end
48
+
49
+ # Attribute mapping from ruby-style variable name to JSON key.
50
+ def self.attribute_map
51
+ {
52
+ :'action' => :'Action',
53
+ :'match_against' => :'MatchAgainst',
54
+ :'replace_with' => :'ReplaceWith'
55
+ }
56
+ end
57
+
58
+ # Attribute type mapping.
59
+ def self.swagger_types
60
+ {
61
+ :'action' => :'Integer',
62
+ :'match_against' => :'String',
63
+ :'replace_with' => :'String'
64
+ }
65
+ end
66
+
67
+ # Initializes the object
68
+ # @param [Hash] attributes Model attributes in the form of hash
69
+ def initialize(attributes = {})
70
+ return unless attributes.is_a?(Hash)
71
+
72
+ # convert string to symbol for hash key
73
+ attributes = attributes.each_with_object({}){|(k,v), h| h[k.to_sym] = v}
74
+
75
+ if attributes.has_key?(:'Action')
76
+ self.action = attributes[:'Action']
77
+ end
78
+
79
+ if attributes.has_key?(:'MatchAgainst')
80
+ self.match_against = attributes[:'MatchAgainst']
81
+ end
82
+
83
+ if attributes.has_key?(:'ReplaceWith')
84
+ self.replace_with = attributes[:'ReplaceWith']
85
+ end
86
+
87
+ end
88
+
89
+ # Show invalid properties with the reasons. Usually used together with valid?
90
+ # @return Array for valid properties with the reasons
91
+ def list_invalid_properties
92
+ invalid_properties = Array.new
93
+ return invalid_properties
94
+ end
95
+
96
+ # Check to see if the all the properties in the model are valid
97
+ # @return true if the model is valid
98
+ def valid?
99
+ action_validator = EnumAttributeValidator.new('Integer', ["1"])
100
+ return false unless action_validator.valid?(@action)
101
+ return true
102
+ end
103
+
104
+ # Custom attribute writer method checking allowed values (enum).
105
+ # @param [Object] action Object to be assigned
106
+ def action=(action)
107
+ validator = EnumAttributeValidator.new('Integer', ["1"])
108
+ unless validator.valid?(action)
109
+ fail ArgumentError, "invalid value for 'action', must be one of #{validator.allowable_values}."
110
+ end
111
+ @action = action
112
+ end
113
+
114
+ # Checks equality by comparing each attribute.
115
+ # @param [Object] Object to be compared
116
+ def ==(o)
117
+ return true if self.equal?(o)
118
+ self.class == o.class &&
119
+ action == o.action &&
120
+ match_against == o.match_against &&
121
+ replace_with == o.replace_with
122
+ end
123
+
124
+ # @see the `==` method
125
+ # @param [Object] Object to be compared
126
+ def eql?(o)
127
+ self == o
128
+ end
129
+
130
+ # Calculates hash code according to all attributes.
131
+ # @return [Fixnum] Hash code
132
+ def hash
133
+ [action, match_against, replace_with].hash
134
+ end
135
+
136
+ # Builds the object from hash
137
+ # @param [Hash] attributes Model attributes in the form of hash
138
+ # @return [Object] Returns the model itself
139
+ def build_from_hash(attributes)
140
+ return nil unless attributes.is_a?(Hash)
141
+ self.class.swagger_types.each_pair do |key, type|
142
+ if type =~ /\AArray<(.*)>/i
143
+ # check to ensure the input is an array given that the the attribute
144
+ # is documented as an array but the input is not
145
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
146
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map{ |v| _deserialize($1, v) } )
147
+ end
148
+ elsif !attributes[self.class.attribute_map[key]].nil?
149
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
150
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
151
+ end
152
+
153
+ self
154
+ end
155
+
156
+ # Deserializes the data based on type
157
+ # @param string type Data type
158
+ # @param string value Value to be deserialized
159
+ # @return [Object] Deserialized data
160
+ def _deserialize(type, value)
161
+ case type.to_sym
162
+ when :DateTime
163
+ DateTime.parse(value)
164
+ when :Date
165
+ Date.parse(value)
166
+ when :String
167
+ value.to_s
168
+ when :Integer
169
+ value.to_i
170
+ when :Float
171
+ value.to_f
172
+ when :BOOLEAN
173
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
174
+ true
175
+ else
176
+ false
177
+ end
178
+ when :Object
179
+ # generic object (usually a Hash), return directly
180
+ value
181
+ when /\AArray<(?<inner_type>.+)>\z/
182
+ inner_type = Regexp.last_match[:inner_type]
183
+ value.map { |v| _deserialize(inner_type, v) }
184
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
185
+ k_type = Regexp.last_match[:k_type]
186
+ v_type = Regexp.last_match[:v_type]
187
+ {}.tap do |hash|
188
+ value.each do |k, v|
189
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
190
+ end
191
+ end
192
+ else # model
193
+ temp_model = CloudmersiveConvertApiClient.const_get(type).new
194
+ temp_model.build_from_hash(value)
195
+ end
196
+ end
197
+
198
+ # Returns the string representation of the object
199
+ # @return [String] String presentation of the object
200
+ def to_s
201
+ to_hash.to_s
202
+ end
203
+
204
+ # to_body is an alias to to_hash (backward compatibility)
205
+ # @return [Hash] Returns the object in the form of hash
206
+ def to_body
207
+ to_hash
208
+ end
209
+
210
+ # Returns the object in the form of hash
211
+ # @return [Hash] Returns the object in the form of hash
212
+ def to_hash
213
+ hash = {}
214
+ self.class.attribute_map.each_pair do |attr, param|
215
+ value = self.send(attr)
216
+ next if value.nil?
217
+ hash[param] = _to_hash(value)
218
+ end
219
+ hash
220
+ end
221
+
222
+ # Outputs non-array value in the form of hash
223
+ # For object, use to_hash. Otherwise, just return the value
224
+ # @param [Object] value Any valid value
225
+ # @return [Hash] Returns the value in the form of hash
226
+ def _to_hash(value)
227
+ if value.is_a?(Array)
228
+ value.compact.map{ |v| _to_hash(v) }
229
+ elsif value.is_a?(Hash)
230
+ {}.tap do |hash|
231
+ value.each { |k, v| hash[k] = _to_hash(v) }
232
+ end
233
+ elsif value.respond_to? :to_hash
234
+ value.to_hash
235
+ else
236
+ value
237
+ end
238
+ end
239
+
240
+ end
241
+
242
+ end
@@ -15,10 +15,13 @@ require 'date'
15
15
  module CloudmersiveConvertApiClient
16
16
  # HTML template application request
17
17
  class HtmlTemplateApplicationRequest
18
+ # HTML template input as a string
18
19
  attr_accessor :html_template
19
20
 
21
+ # URL to HTML template input
20
22
  attr_accessor :html_template_url
21
23
 
24
+ # Operations to apply to this template
22
25
  attr_accessor :operations
23
26
 
24
27
 
@@ -15,10 +15,13 @@ require 'date'
15
15
  module CloudmersiveConvertApiClient
16
16
 
17
17
  class HtmlTemplateOperation
18
+ # Operation action to take; possible values are \"Replace\"
18
19
  attr_accessor :action
19
20
 
21
+ # For Replace operations, the string to match against (to be replaced with ReplaceWith string)
20
22
  attr_accessor :match_agsint
21
23
 
24
+ # For Replace operations, the string to Replace the original string with
22
25
  attr_accessor :replace_with
23
26
 
24
27
  class EnumAttributeValidator
@@ -15,10 +15,13 @@ require 'date'
15
15
  module CloudmersiveConvertApiClient
16
16
  # Result of converting a multi-page image into individual pages with a different format
17
17
  class MultipageImageFormatConversionResult
18
+ # True if successful, false otherwise
18
19
  attr_accessor :successful
19
20
 
21
+ # The number of pages in the converted output
20
22
  attr_accessor :page_count
21
23
 
24
+ # Converted page results
22
25
  attr_accessor :pages
23
26
 
24
27
 
@@ -15,8 +15,10 @@ require 'date'
15
15
  module CloudmersiveConvertApiClient
16
16
  # Converted page as an image
17
17
  class PageConversionResult
18
+ # File name of the image in the converted file format
18
19
  attr_accessor :filename
19
20
 
21
+ # File bytes (contents) of the image in converted file format
20
22
  attr_accessor :file_bytes
21
23
 
22
24
 
@@ -11,5 +11,5 @@ Swagger Codegen version: unset
11
11
  =end
12
12
 
13
13
  module CloudmersiveConvertApiClient
14
- VERSION = "1.3.7"
14
+ VERSION = "1.3.8"
15
15
  end
@@ -32,6 +32,19 @@ describe 'ConvertTemplateApi' do
32
32
  end
33
33
  end
34
34
 
35
+ # unit tests for convert_template_apply_docx_template
36
+ # Apply Word DOCX template
37
+ # Apply operations to fill in a Word DOCX template by replacing target template/placeholder strings in the DOCX with values, generating a final Word DOCX result. For example, you could create a Word Document invoice containing strings such as \&quot;{FirstName}\&quot; and \&quot;{LastName}\&quot; and then replace these values with \&quot;John\&quot; and \&quot;Smith\&quot;.
38
+ # @param input_file Input file to perform the operation on.
39
+ # @param [Hash] opts the optional parameters
40
+ # @option opts [String] :template_definition Template definition for the document, including what values to replace
41
+ # @return [String]
42
+ describe 'convert_template_apply_docx_template test' do
43
+ it "should work" do
44
+ # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
45
+ end
46
+ end
47
+
35
48
  # unit tests for convert_template_apply_html_template
36
49
  # Apply HTML template
37
50
  # Apply operations to fill in an HTML template, generating a final HTML result
@@ -0,0 +1,42 @@
1
+ =begin
2
+ #convertapi
3
+
4
+ #Convert API lets you effortlessly convert file formats and types.
5
+
6
+ OpenAPI spec version: v1
7
+
8
+ Generated by: https://github.com/swagger-api/swagger-codegen.git
9
+ Swagger Codegen version: unset
10
+
11
+ =end
12
+
13
+ require 'spec_helper'
14
+ require 'json'
15
+ require 'date'
16
+
17
+ # Unit tests for CloudmersiveConvertApiClient::DocxTemplateApplicationRequest
18
+ # Automatically generated by swagger-codegen (github.com/swagger-api/swagger-codegen)
19
+ # Please update as you see appropriate
20
+ describe 'DocxTemplateApplicationRequest' do
21
+ before do
22
+ # run before each test
23
+ @instance = CloudmersiveConvertApiClient::DocxTemplateApplicationRequest.new
24
+ end
25
+
26
+ after do
27
+ # run after each test
28
+ end
29
+
30
+ describe 'test an instance of DocxTemplateApplicationRequest' do
31
+ it 'should create an instance of DocxTemplateApplicationRequest' do
32
+ expect(@instance).to be_instance_of(CloudmersiveConvertApiClient::DocxTemplateApplicationRequest)
33
+ end
34
+ end
35
+ describe 'test attribute "operations"' do
36
+ it 'should work' do
37
+ # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
38
+ end
39
+ end
40
+
41
+ end
42
+
@@ -0,0 +1,58 @@
1
+ =begin
2
+ #convertapi
3
+
4
+ #Convert API lets you effortlessly convert file formats and types.
5
+
6
+ OpenAPI spec version: v1
7
+
8
+ Generated by: https://github.com/swagger-api/swagger-codegen.git
9
+ Swagger Codegen version: unset
10
+
11
+ =end
12
+
13
+ require 'spec_helper'
14
+ require 'json'
15
+ require 'date'
16
+
17
+ # Unit tests for CloudmersiveConvertApiClient::DocxTemplateOperation
18
+ # Automatically generated by swagger-codegen (github.com/swagger-api/swagger-codegen)
19
+ # Please update as you see appropriate
20
+ describe 'DocxTemplateOperation' do
21
+ before do
22
+ # run before each test
23
+ @instance = CloudmersiveConvertApiClient::DocxTemplateOperation.new
24
+ end
25
+
26
+ after do
27
+ # run after each test
28
+ end
29
+
30
+ describe 'test an instance of DocxTemplateOperation' do
31
+ it 'should create an instance of DocxTemplateOperation' do
32
+ expect(@instance).to be_instance_of(CloudmersiveConvertApiClient::DocxTemplateOperation)
33
+ end
34
+ end
35
+ describe 'test attribute "action"' do
36
+ it 'should work' do
37
+ # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
38
+ #validator = Petstore::EnumTest::EnumAttributeValidator.new('Integer', ["1"])
39
+ #validator.allowable_values.each do |value|
40
+ # expect { @instance.action = value }.not_to raise_error
41
+ #end
42
+ end
43
+ end
44
+
45
+ describe 'test attribute "match_against"' do
46
+ it 'should work' do
47
+ # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
48
+ end
49
+ end
50
+
51
+ describe 'test attribute "replace_with"' do
52
+ it 'should work' do
53
+ # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
54
+ end
55
+ end
56
+
57
+ end
58
+
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cloudmersive-convert-api-client
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.3.7
4
+ version: 1.3.8
5
5
  platform: ruby
6
6
  authors:
7
7
  - Cloudmersive
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-08-18 00:00:00.000000000 Z
11
+ date: 2019-09-09 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: typhoeus
@@ -234,6 +234,8 @@ files:
234
234
  - "./docs/DocxTable.md"
235
235
  - "./docs/DocxTableCell.md"
236
236
  - "./docs/DocxTableRow.md"
237
+ - "./docs/DocxTemplateApplicationRequest.md"
238
+ - "./docs/DocxTemplateOperation.md"
237
239
  - "./docs/DocxText.md"
238
240
  - "./docs/EditDocumentApi.md"
239
241
  - "./docs/ExifValue.md"
@@ -330,6 +332,8 @@ files:
330
332
  - "./lib/cloudmersive-convert-api-client/models/docx_table.rb"
331
333
  - "./lib/cloudmersive-convert-api-client/models/docx_table_cell.rb"
332
334
  - "./lib/cloudmersive-convert-api-client/models/docx_table_row.rb"
335
+ - "./lib/cloudmersive-convert-api-client/models/docx_template_application_request.rb"
336
+ - "./lib/cloudmersive-convert-api-client/models/docx_template_operation.rb"
333
337
  - "./lib/cloudmersive-convert-api-client/models/docx_text.rb"
334
338
  - "./lib/cloudmersive-convert-api-client/models/exif_value.rb"
335
339
  - "./lib/cloudmersive-convert-api-client/models/finish_editing_request.rb"
@@ -420,6 +424,8 @@ files:
420
424
  - "./spec/models/docx_table_cell_spec.rb"
421
425
  - "./spec/models/docx_table_row_spec.rb"
422
426
  - "./spec/models/docx_table_spec.rb"
427
+ - "./spec/models/docx_template_application_request_spec.rb"
428
+ - "./spec/models/docx_template_operation_spec.rb"
423
429
  - "./spec/models/docx_text_spec.rb"
424
430
  - "./spec/models/exif_value_spec.rb"
425
431
  - "./spec/models/finish_editing_request_spec.rb"