docspring
Advanced tools
| # DocSpring::CopyTemplateData | ||
| ## Properties | ||
| Name | Type | Description | Notes | ||
| ------------ | ------------- | ------------- | ------------- | ||
| **name** | **String** | | [optional] | ||
| **parent_folder_id** | **String** | | | ||
| =begin | ||
| #API v1 | ||
| #DocSpring is a service that helps you fill out and sign PDF templates. | ||
| OpenAPI spec version: v1 | ||
| Generated by: https://openapi-generator.tech | ||
| OpenAPI Generator version: 3.3.0 | ||
| =end | ||
| require 'date' | ||
| module DocSpring | ||
| class CopyTemplateData | ||
| attr_accessor :name | ||
| attr_accessor :parent_folder_id | ||
| # Attribute mapping from ruby-style variable name to JSON key. | ||
| def self.attribute_map | ||
| { | ||
| :'name' => :'name', | ||
| :'parent_folder_id' => :'parent_folder_id' | ||
| } | ||
| end | ||
| # Attribute type mapping. | ||
| def self.openapi_types | ||
| { | ||
| :'name' => :'String', | ||
| :'parent_folder_id' => :'String' | ||
| } | ||
| end | ||
| # Initializes the object | ||
| # @param [Hash] attributes Model attributes in the form of hash | ||
| def initialize(attributes = {}) | ||
| return unless attributes.is_a?(Hash) | ||
| # convert string to symbol for hash key | ||
| attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v } | ||
| if attributes.has_key?(:'name') | ||
| self.name = attributes[:'name'] | ||
| end | ||
| if attributes.has_key?(:'parent_folder_id') | ||
| self.parent_folder_id = attributes[:'parent_folder_id'] | ||
| end | ||
| end | ||
| # Show invalid properties with the reasons. Usually used together with valid? | ||
| # @return Array for valid properties with the reasons | ||
| def list_invalid_properties | ||
| invalid_properties = Array.new | ||
| if @parent_folder_id.nil? | ||
| invalid_properties.push('invalid value for "parent_folder_id", parent_folder_id cannot be nil.') | ||
| end | ||
| invalid_properties | ||
| end | ||
| # Check to see if the all the properties in the model are valid | ||
| # @return true if the model is valid | ||
| def valid? | ||
| return false if @parent_folder_id.nil? | ||
| true | ||
| end | ||
| # Checks equality by comparing each attribute. | ||
| # @param [Object] Object to be compared | ||
| def ==(o) | ||
| return true if self.equal?(o) | ||
| self.class == o.class && | ||
| name == o.name && | ||
| parent_folder_id == o.parent_folder_id | ||
| end | ||
| # @see the `==` method | ||
| # @param [Object] Object to be compared | ||
| def eql?(o) | ||
| self == o | ||
| end | ||
| # Calculates hash code according to all attributes. | ||
| # @return [Fixnum] Hash code | ||
| def hash | ||
| [name, parent_folder_id].hash | ||
| end | ||
| # Builds the object from hash | ||
| # @param [Hash] attributes Model attributes in the form of hash | ||
| # @return [Object] Returns the model itself | ||
| def build_from_hash(attributes) | ||
| return nil unless attributes.is_a?(Hash) | ||
| self.class.openapi_types.each_pair do |key, type| | ||
| if type =~ /\AArray<(.*)>/i | ||
| # check to ensure the input is an array given that the the attribute | ||
| # is documented as an array but the input is not | ||
| if attributes[self.class.attribute_map[key]].is_a?(Array) | ||
| self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) | ||
| end | ||
| elsif !attributes[self.class.attribute_map[key]].nil? | ||
| self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) | ||
| end # or else data not found in attributes(hash), not an issue as the data can be optional | ||
| end | ||
| self | ||
| end | ||
| # Deserializes the data based on type | ||
| # @param string type Data type | ||
| # @param string value Value to be deserialized | ||
| # @return [Object] Deserialized data | ||
| def _deserialize(type, value) | ||
| case type.to_sym | ||
| when :DateTime | ||
| DateTime.parse(value) | ||
| when :Date | ||
| Date.parse(value) | ||
| when :String | ||
| value.to_s | ||
| when :Integer | ||
| value.to_i | ||
| when :Float | ||
| value.to_f | ||
| when :BOOLEAN | ||
| if value.to_s =~ /\A(true|t|yes|y|1)\z/i | ||
| true | ||
| else | ||
| false | ||
| end | ||
| when :Object | ||
| # generic object (usually a Hash), return directly | ||
| value | ||
| when /\AArray<(?<inner_type>.+)>\z/ | ||
| inner_type = Regexp.last_match[:inner_type] | ||
| value.map { |v| _deserialize(inner_type, v) } | ||
| when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/ | ||
| k_type = Regexp.last_match[:k_type] | ||
| v_type = Regexp.last_match[:v_type] | ||
| {}.tap do |hash| | ||
| value.each do |k, v| | ||
| hash[_deserialize(k_type, k)] = _deserialize(v_type, v) | ||
| end | ||
| end | ||
| else # model | ||
| temp_model = DocSpring.const_get(type).new | ||
| temp_model.build_from_hash(value) | ||
| end | ||
| end | ||
| # Returns the string representation of the object | ||
| # @return [String] String presentation of the object | ||
| def to_s | ||
| to_hash.to_s | ||
| end | ||
| # to_body is an alias to to_hash (backward compatibility) | ||
| # @return [Hash] Returns the object in the form of hash | ||
| def to_body | ||
| to_hash | ||
| end | ||
| # Returns the object in the form of hash | ||
| # @return [Hash] Returns the object in the form of hash | ||
| def to_hash | ||
| hash = {} | ||
| self.class.attribute_map.each_pair do |attr, param| | ||
| value = self.send(attr) | ||
| next if value.nil? | ||
| hash[param] = _to_hash(value) | ||
| end | ||
| hash | ||
| end | ||
| # Outputs non-array value in the form of hash | ||
| # For object, use to_hash. Otherwise, just return the value | ||
| # @param [Object] value Any valid value | ||
| # @return [Hash] Returns the value in the form of hash | ||
| def _to_hash(value) | ||
| if value.is_a?(Array) | ||
| value.compact.map { |v| _to_hash(v) } | ||
| elsif value.is_a?(Hash) | ||
| {}.tap do |hash| | ||
| value.each { |k, v| hash[k] = _to_hash(v) } | ||
| end | ||
| elsif value.respond_to? :to_hash | ||
| value.to_hash | ||
| else | ||
| value | ||
| end | ||
| end | ||
| end | ||
| end |
| =begin | ||
| #API v1 | ||
| #DocSpring is a service that helps you fill out and sign PDF templates. | ||
| OpenAPI spec version: v1 | ||
| Generated by: https://openapi-generator.tech | ||
| OpenAPI Generator version: 3.3.0 | ||
| =end | ||
| require 'spec_helper' | ||
| require 'json' | ||
| require 'date' | ||
| # Unit tests for DocSpring::CopyTemplateData | ||
| # Automatically generated by openapi-generator (https://openapi-generator.tech) | ||
| # Please update as you see appropriate | ||
| describe 'CopyTemplateData' do | ||
| before do | ||
| # run before each test | ||
| @instance = DocSpring::CopyTemplateData.new | ||
| end | ||
| after do | ||
| # run after each test | ||
| end | ||
| describe 'test an instance of CopyTemplateData' do | ||
| it 'should create an instance of CopyTemplateData' do | ||
| expect(@instance).to be_instance_of(DocSpring::CopyTemplateData) | ||
| end | ||
| end | ||
| describe 'test attribute "name"' do | ||
| it 'should work' do | ||
| # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers | ||
| end | ||
| end | ||
| describe 'test attribute "parent_folder_id"' do | ||
| it 'should work' do | ||
| # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers | ||
| end | ||
| end | ||
| end |
+4
-0
@@ -0,1 +1,5 @@ | ||
| ### 1.3.2 [November 19, 2020] | ||
| - Added "sort_order" property for Submission Data Requests | ||
| ### 1.3.1 [September 27, 2020] | ||
@@ -2,0 +6,0 @@ |
@@ -6,4 +6,4 @@ # DocSpring::MoveTemplateData | ||
| ------------ | ------------- | ------------- | ------------- | ||
| **parent_folder_id** | **String** | | [optional] | ||
| **parent_folder_id** | **String** | | | ||
+52
-0
@@ -12,2 +12,3 @@ # DocSpring::PDFApi | ||
| [**combine_submissions**](PDFApi.md#combine_submissions) | **POST** /combined_submissions | Merge generated PDFs together | ||
| [**copy_template**](PDFApi.md#copy_template) | **POST** /templates/{template_id}/copy | Copy a Template | ||
| [**create_custom_file_from_upload**](PDFApi.md#create_custom_file_from_upload) | **POST** /custom_files | Create a new custom file from a cached presign upload | ||
@@ -289,2 +290,53 @@ [**create_data_request_token**](PDFApi.md#create_data_request_token) | **POST** /data_requests/{data_request_id}/tokens | Creates a new data request token for form authentication | ||
| # **copy_template** | ||
| > Template copy_template(template_id, copy_template_data) | ||
| Copy a Template | ||
| ### Example | ||
| ```ruby | ||
| # load the gem | ||
| require 'docspring' | ||
| # setup authorization | ||
| DocSpring.configure do |config| | ||
| # Configure HTTP basic authorization: api_token_basic | ||
| config.username = 'YOUR USERNAME' | ||
| config.password = 'YOUR PASSWORD' | ||
| end | ||
| api_instance = DocSpring::PDFApi.new | ||
| template_id = 'tpl_000000000000000001' # String | | ||
| copy_template_data = DocSpring::CopyTemplateData.new # CopyTemplateData | | ||
| begin | ||
| #Copy a Template | ||
| result = api_instance.copy_template(template_id, copy_template_data) | ||
| p result | ||
| rescue DocSpring::ApiError => e | ||
| puts "Exception when calling PDFApi->copy_template: #{e}" | ||
| end | ||
| ``` | ||
| ### Parameters | ||
| Name | Type | Description | Notes | ||
| ------------- | ------------- | ------------- | ------------- | ||
| **template_id** | **String**| | | ||
| **copy_template_data** | [**CopyTemplateData**](CopyTemplateData.md)| | | ||
| ### Return type | ||
| [**Template**](Template.md) | ||
| ### Authorization | ||
| [api_token_basic](../README.md#api_token_basic) | ||
| ### HTTP request headers | ||
| - **Content-Type**: application/json | ||
| - **Accept**: application/json | ||
| # **create_custom_file_from_upload** | ||
@@ -291,0 +343,0 @@ > CreateCustomFileResponse create_custom_file_from_upload(create_custom_file_data) |
@@ -10,2 +10,3 @@ # DocSpring::SubmissionDataRequest | ||
| **order** | **Integer** | | | ||
| **sort_order** | **Integer** | | | ||
| **fields** | **Array<String>** | | | ||
@@ -12,0 +13,0 @@ **metadata** | **Object** | | |
+1
-1
| PATH | ||
| remote: . | ||
| specs: | ||
| docspring (1.3.1) | ||
| docspring (1.3.2) | ||
| ffi (~> 1.0, >= 1.9.24) | ||
@@ -6,0 +6,0 @@ json (>= 1.8) |
+1
-0
@@ -28,2 +28,3 @@ =begin | ||
| require 'docspring/models/combined_submission_data' | ||
| require 'docspring/models/copy_template_data' | ||
| require 'docspring/models/create_combined_submission_response' | ||
@@ -30,0 +31,0 @@ require 'docspring/models/create_custom_file_data' |
@@ -50,2 +50,6 @@ =begin | ||
| invalid_properties = Array.new | ||
| if @parent_folder_id.nil? | ||
| invalid_properties.push('invalid value for "parent_folder_id", parent_folder_id cannot be nil.') | ||
| end | ||
| invalid_properties | ||
@@ -57,2 +61,3 @@ end | ||
| def valid? | ||
| return false if @parent_folder_id.nil? | ||
| true | ||
@@ -59,0 +64,0 @@ end |
@@ -25,2 +25,4 @@ =begin | ||
| attr_accessor :sort_order | ||
| attr_accessor :fields | ||
@@ -85,2 +87,3 @@ | ||
| :'order' => :'order', | ||
| :'sort_order' => :'sort_order', | ||
| :'fields' => :'fields', | ||
@@ -111,2 +114,3 @@ :'metadata' => :'metadata', | ||
| :'order' => :'Integer', | ||
| :'sort_order' => :'Integer', | ||
| :'fields' => :'Array<String>', | ||
@@ -154,2 +158,6 @@ :'metadata' => :'Object', | ||
| if attributes.has_key?(:'sort_order') | ||
| self.sort_order = attributes[:'sort_order'] | ||
| end | ||
| if attributes.has_key?(:'fields') | ||
@@ -230,2 +238,6 @@ if (value = attributes[:'fields']).is_a?(Array) | ||
| if @sort_order.nil? | ||
| invalid_properties.push('invalid value for "sort_order", sort_order cannot be nil.') | ||
| end | ||
| if @metadata.nil? | ||
@@ -247,2 +259,3 @@ invalid_properties.push('invalid value for "metadata", metadata cannot be nil.') | ||
| return false if @order.nil? | ||
| return false if @sort_order.nil? | ||
| return false if @metadata.nil? | ||
@@ -298,2 +311,3 @@ return false if @state.nil? | ||
| order == o.order && | ||
| sort_order == o.sort_order && | ||
| fields == o.fields && | ||
@@ -325,3 +339,3 @@ metadata == o.metadata && | ||
| def hash | ||
| [id, name, email, order, fields, metadata, state, viewed_at, completed_at, auth_type, auth_second_factor_type, auth_provider, auth_session_started_at, auth_session_id_hash, auth_user_id_hash, auth_username_hash, auth_phone_number_hash, ip_address, user_agent].hash | ||
| [id, name, email, order, sort_order, fields, metadata, state, viewed_at, completed_at, auth_type, auth_second_factor_type, auth_provider, auth_session_started_at, auth_session_id_hash, auth_user_id_hash, auth_username_hash, auth_phone_number_hash, ip_address, user_agent].hash | ||
| end | ||
@@ -328,0 +342,0 @@ |
@@ -14,3 +14,3 @@ =begin | ||
| module DocSpring | ||
| VERSION = '1.3.1' | ||
| VERSION = '1.3.2' | ||
| end |
+6
-4
@@ -10,3 +10,3 @@ # docspring | ||
| - API version: v1 | ||
| - Package version: 1.3.1 | ||
| - Package version: 1.3.2 | ||
| - Build package: com.docspring.codegen.DocSpringRubyClientCodegen | ||
@@ -27,5 +27,5 @@ | ||
| ```shell | ||
| gem install ./docspring-1.3.1.gem | ||
| gem install ./docspring-1.3.2.gem | ||
| ``` | ||
| (for development, run `gem install --dev ./docspring-1.3.1.gem` to install the development dependencies) | ||
| (for development, run `gem install --dev ./docspring-1.3.2.gem` to install the development dependencies) | ||
@@ -36,3 +36,3 @@ or publish the gem to a gem hosting service, e.g. [RubyGems](https://rubygems.org/). | ||
| gem 'docspring', '~> 1.3.1' | ||
| gem 'docspring', '~> 1.3.2' | ||
@@ -92,2 +92,3 @@ ### Install from Git | ||
| *DocSpring::PDFApi* | [**combine_submissions**](docs/PDFApi.md#combine_submissions) | **POST** /combined_submissions | Merge generated PDFs together | ||
| *DocSpring::PDFApi* | [**copy_template**](docs/PDFApi.md#copy_template) | **POST** /templates/{template_id}/copy | Copy a Template | ||
| *DocSpring::PDFApi* | [**create_custom_file_from_upload**](docs/PDFApi.md#create_custom_file_from_upload) | **POST** /custom_files | Create a new custom file from a cached presign upload | ||
@@ -130,2 +131,3 @@ *DocSpring::PDFApi* | [**create_data_request_token**](docs/PDFApi.md#create_data_request_token) | **POST** /data_requests/{data_request_id}/tokens | Creates a new data request token for form authentication | ||
| - [DocSpring::CombinedSubmissionData](docs/CombinedSubmissionData.md) | ||
| - [DocSpring::CopyTemplateData](docs/CopyTemplateData.md) | ||
| - [DocSpring::CreateCombinedSubmissionResponse](docs/CreateCombinedSubmissionResponse.md) | ||
@@ -132,0 +134,0 @@ - [DocSpring::CreateCustomFileData](docs/CreateCustomFileData.md) |
@@ -105,2 +105,16 @@ =begin | ||
| end | ||
| # integration tests for copy_template | ||
| # Copy a Template | ||
| # @param template_id | ||
| # @param copy_template_data | ||
| # @param [Hash] opts the optional parameters | ||
| # @return [Template] | ||
| describe 'copy_template test' do | ||
| it 'should work' do | ||
| template_id = 'tpl_000000000000000001' # String | | ||
| copy_template_data = DocSpring::CopyTemplateData.new # CopyTemplateData | | ||
| result = api_instance.copy_template(template_id, copy_template_data) | ||
| expect(result).to_not be_nil | ||
| end | ||
| end | ||
| # integration tests for create_custom_file_from_upload | ||
@@ -107,0 +121,0 @@ # Create a new custom file from a cached presign upload |
@@ -59,2 +59,8 @@ =begin | ||
| describe 'test attribute "sort_order"' do | ||
| it 'should work' do | ||
| # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers | ||
| end | ||
| end | ||
| describe 'test attribute "fields"' do | ||
@@ -61,0 +67,0 @@ it 'should work' do |
Sorry, the diff of this file is too big to display