Skip to content

Commit b124f51

Browse files
committed
Updated sources
1 parent 4ec2eef commit b124f51

File tree

6 files changed

+272
-3
lines changed

6 files changed

+272
-3
lines changed

Gemfile.lock

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
PATH
22
remote: .
33
specs:
4-
groupdocs_conversion_cloud (23.9)
4+
groupdocs_conversion_cloud (23.10)
55
addressable (~> 2.8.0, >= 2.8.0)
66
faraday (~> 0.14.0)
77

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ gem install groupdocs_conversion_cloud
1212
To add dependency to your app copy following into your Gemfile and run `bundle install`:
1313

1414
```
15-
gem "groupdocs_conversion_cloud", "~> 23.9"
15+
gem "groupdocs_conversion_cloud", "~> 23.10"
1616
```
1717

1818
## Getting Started

lib/groupdocs_conversion_cloud.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@
4343
require_relative 'groupdocs_conversion_cloud/models/file_versions'
4444
require_relative 'groupdocs_conversion_cloud/models/files_list'
4545
require_relative 'groupdocs_conversion_cloud/models/files_upload_result'
46+
require_relative 'groupdocs_conversion_cloud/models/license_info'
4647
require_relative 'groupdocs_conversion_cloud/models/load_options'
4748
require_relative 'groupdocs_conversion_cloud/models/object_exist'
4849
require_relative 'groupdocs_conversion_cloud/models/storage_exist'

lib/groupdocs_conversion_cloud/api/license_api.rb

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,55 @@ def get_consumption_credit_with_http_info()
113113
[data, status_code, headers]
114114
end
115115

116+
# Get license information
117+
#
118+
# @return [LicenseInfo]
119+
def get_license_info()
120+
data, _status_code, _headers = get_license_info_with_http_info()
121+
data
122+
end
123+
124+
# Get license information
125+
#
126+
127+
# @return [Array<(LicenseInfo, Fixnum, Hash)>]
128+
# LicenseInfo data, response status code and response headers
129+
def get_license_info_with_http_info()
130+
131+
132+
@api_client.config.logger.debug 'Calling API: LicenseApi.get_license_info ...' if @api_client.config.debugging
133+
# resource path
134+
local_var_path = '/conversion/license'
135+
136+
# query parameters
137+
query_params = {}
138+
139+
# header parameters
140+
header_params = {}
141+
# HTTP header 'Accept' (if needed)
142+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
143+
# HTTP header 'Content-Type'
144+
header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
145+
146+
# form parameters
147+
form_params = {}
148+
149+
# http body (model)
150+
post_body = nil
151+
data, status_code, headers = @api_client.call_api(:GET, local_var_path,
152+
header_params: header_params,
153+
query_params: query_params,
154+
form_params: form_params,
155+
body: post_body,
156+
access_token: get_access_token,
157+
return_type: 'LicenseInfo')
158+
if @api_client.config.debugging
159+
@api_client.config.logger.debug "API called:
160+
LicenseApi#get_license_info\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
161+
end
162+
[data, status_code, headers]
163+
end
164+
116165
#
117166
# Helper method to convert first letter to downcase
118167
#
Lines changed: 219 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,219 @@
1+
#
2+
# --------------------------------------------------------------------------------------------------------------------
3+
# <copyright company="Aspose Pty Ltd" file="license_info.rb">
4+
# Copyright (c) 2003-2023 Aspose Pty Ltd
5+
# </copyright>
6+
# <summary>
7+
# Permission is hereby granted, free of charge, to any person obtaining a copy
8+
# of this software and associated documentation files (the "Software"), to deal
9+
# in the Software without restriction, including without limitation the rights
10+
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
11+
# copies of the Software, and to permit persons to whom the Software is
12+
# furnished to do so, subject to the following conditions:
13+
#
14+
# The above copyright notice and this permission notice shall be included in all
15+
# copies or substantial portions of the Software.
16+
#
17+
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
18+
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
19+
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
20+
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
21+
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
22+
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
23+
# SOFTWARE.
24+
# </summary>
25+
# --------------------------------------------------------------------------------------------------------------------
26+
#
27+
28+
require 'date'
29+
30+
module GroupDocsConversionCloud
31+
# Current license information
32+
class LicenseInfo
33+
34+
# True, if license was applied and valid, otherwise False
35+
attr_accessor :is_licensed
36+
37+
# Attribute mapping from ruby-style variable name to JSON key.
38+
def self.attribute_map
39+
{
40+
:'is_licensed' => :'IsLicensed'
41+
}
42+
end
43+
44+
# Attribute type mapping.
45+
def self.swagger_types
46+
{
47+
:'is_licensed' => :'BOOLEAN'
48+
}
49+
end
50+
51+
# Initializes the object
52+
# @param [Hash] attributes Model attributes in the form of hash
53+
def initialize(attributes = {})
54+
return unless attributes.is_a?(Hash)
55+
56+
# convert string to symbol for hash key
57+
attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
58+
59+
if attributes.key?(:'IsLicensed')
60+
self.is_licensed = attributes[:'IsLicensed']
61+
end
62+
63+
end
64+
65+
# Show invalid properties with the reasons. Usually used together with valid?
66+
# @return Array for valid properies with the reasons
67+
def list_invalid_properties
68+
invalid_properties = []
69+
if @is_licensed.nil?
70+
invalid_properties.push("invalid value for 'is_licensed', is_licensed cannot be nil.")
71+
end
72+
73+
return invalid_properties
74+
end
75+
76+
# Check to see if the all the properties in the model are valid
77+
# @return true if the model is valid
78+
def valid?
79+
return false if @is_licensed.nil?
80+
return true
81+
end
82+
83+
# Checks equality by comparing each attribute.
84+
# @param [Object] Object to be compared
85+
def ==(other)
86+
return true if self.equal?(other)
87+
self.class == other.class &&
88+
is_licensed == other.is_licensed
89+
end
90+
91+
# @see the `==` method
92+
# @param [Object] Object to be compared
93+
def eql?(other)
94+
self == other
95+
end
96+
97+
# Calculates hash code according to all attributes.
98+
# @return [Fixnum] Hash code
99+
def hash
100+
[is_licensed].hash
101+
end
102+
103+
# Downcases first letter.
104+
# @return downcased string
105+
def uncap(str)
106+
str[0, 1].downcase + str[1..-1]
107+
end
108+
109+
# Builds the object from hash
110+
# @param [Hash] attributes Model attributes in the form of hash
111+
# @return [Object] Returns the model itself
112+
def build_from_hash(attributes)
113+
return nil unless attributes.is_a?(Hash)
114+
self.class.swagger_types.each_pair do |key, type|
115+
pname = uncap(self.class.attribute_map[key]).intern
116+
value = attributes[pname]
117+
if type =~ /\AArray<(.*)>/i
118+
# check to ensure the input is an array given that the the attribute
119+
# is documented as an array but the input is not
120+
if value.is_a?(Array)
121+
self.send("#{key}=", value.map { |v| _deserialize($1, v) })
122+
end
123+
elsif !value.nil?
124+
self.send("#{key}=", _deserialize(type, value))
125+
end
126+
# or else data not found in attributes(hash), not an issue as the data can be optional
127+
end
128+
129+
self
130+
end
131+
132+
# Deserializes the data based on type
133+
# @param string type Data type
134+
# @param string value Value to be deserialized
135+
# @return [Object] Deserialized data
136+
def _deserialize(type, value)
137+
case type.to_sym
138+
when :DateTime
139+
Date.parse value
140+
when :Date
141+
Date.parse value
142+
when :String
143+
value.to_s
144+
when :Integer
145+
value.to_i
146+
when :Float
147+
value.to_f
148+
when :BOOLEAN
149+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
150+
true
151+
else
152+
false
153+
end
154+
when :Object
155+
# generic object (usually a Hash), return directly
156+
value
157+
when /\AArray<(?<inner_type>.+)>\z/
158+
inner_type = Regexp.last_match[:inner_type]
159+
value.map { |v| _deserialize(inner_type, v) }
160+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
161+
k_type = Regexp.last_match[:k_type]
162+
v_type = Regexp.last_match[:v_type]
163+
{}.tap do |hash|
164+
value.each do |k, v|
165+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
166+
end
167+
end
168+
else
169+
# model
170+
temp_model = GroupDocsConversionCloud.const_get(type).new
171+
temp_model.build_from_hash(value)
172+
end
173+
end
174+
175+
# Returns the string representation of the object
176+
# @return [String] String presentation of the object
177+
def to_s
178+
to_hash.to_s
179+
end
180+
181+
# to_body is an alias to to_hash (backward compatibility)
182+
# @return [Hash] Returns the object in the form of hash
183+
def to_body
184+
to_hash
185+
end
186+
187+
# Returns the object in the form of hash
188+
# @return [Hash] Returns the object in the form of hash
189+
def to_hash
190+
hash = {}
191+
self.class.attribute_map.each_pair do |attr, param|
192+
value = self.send(attr)
193+
next if value.nil?
194+
hash[param] = _to_hash(value)
195+
end
196+
hash
197+
end
198+
199+
# Outputs non-array value in the form of hash
200+
# For object, use to_hash. Otherwise, just return the value
201+
# @param [Object] value Any valid value
202+
# @return [Hash] Returns the value in the form of hash
203+
def _to_hash(value)
204+
if value.is_a?(Array)
205+
value.compact.map { |v| _to_hash(v) }
206+
elsif value.is_a?(Hash)
207+
{}.tap do |hash|
208+
value.each { |k, v| hash[k] = _to_hash(v) }
209+
end
210+
elsif value.respond_to? :to_hash
211+
value.to_hash
212+
else
213+
value
214+
end
215+
end
216+
217+
end
218+
219+
end

lib/groupdocs_conversion_cloud/version.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,5 +25,5 @@
2525
# --------------------------------------------------------------------------------------------------------------------
2626
#
2727
module GroupDocsConversionCloud
28-
VERSION = "23.9".freeze
28+
VERSION = "23.10".freeze
2929
end

0 commit comments

Comments
 (0)