Skip to content

Commit

Permalink
Release 23.4
Browse files Browse the repository at this point in the history
Update versions and templates (#71)
Update submodules
  • Loading branch information
ivankamkin committed May 17, 2023
1 parent 1ee1cd6 commit 379ecf5
Show file tree
Hide file tree
Showing 22 changed files with 264 additions and 57 deletions.
5 changes: 3 additions & 2 deletions codegen/Templates/csharp/Project.mustache
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
<Description>Aspose.Barcode for Cloud is a REST API for barcode generation and recognition. It helps you generate barcode images from scratch in linear (1D), two dimensional (2D), and postal formats. Generate barcode images in a variety of image formats: JPEG, PNG, GIF, BMP, TIFF and SVG. Recognize barcodes from different image types.

Aspose.Barcode for Cloud allows you to control all aspects of the image and barcode when generating barcode images. Specify image width, height, border style, output image format and more. You can also set barcode attributes like font style, font color, background color, barcode type and the barcode text location.</Description>
<PackageProjectUrl>https://products.aspose.cloud/barcode/net/</PackageProjectUrl>
<RepositoryUrl>https://github.com/aspose-barcode-cloud/aspose-barcode-cloud-dotnet</RepositoryUrl>
<PackageTags>Barcode Scan Recognize Generate QR DataMatrix AustraliaPost VIN MSI Aztec ISBN OPC Postnet Aspose Aspose.BarCode Aspose.BarCode-Cloud EAN13 ISSN PZN SingaporePost UPCA UPCE Code11 Code128 Code32 DotCode EAN14 EAN8 GS1DataMatrix</PackageTags>
<Copyright>© Aspose 2001-2023. All Rights Reserved.</Copyright>
Expand All @@ -18,7 +19,7 @@ Aspose.Barcode for Cloud allows you to control all aspects of the image and barc
<Product>Aspose.BarCode Cloud SDK for .NET</Product>
<PackageIcon>PackageIcon.png</PackageIcon>
<Version>{{packageVersion}}</Version>
<Authors>Aspose asposecloud</Authors>
<Authors>asposecloud</Authors>
<AssemblyVersion>{{packageVersion}}.0</AssemblyVersion>
<PackageReadmeFile>README.md</PackageReadmeFile>
<PackageReleaseNotes>https://github.com/aspose-barcode-cloud/aspose-barcode-cloud-dotnet/releases/tag/v{{packageVersion}}</PackageReleaseNotes>
Expand All @@ -31,7 +32,7 @@ Aspose.Barcode for Cloud allows you to control all aspects of the image and barc
<ItemGroup>
<None Include="LICENSE.txt" Pack="true" PackagePath="" />
<None Include="PackageIcon.png" Pack="true" PackagePath="" />
<None Include="..\README.md" Pack="true" PackagePath="" />
<None Include="..\README.md" Pack="true" PackagePath=""/>
</ItemGroup>

<ItemGroup>
Expand Down
2 changes: 1 addition & 1 deletion codegen/Templates/go/model.mustache
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ const (
{{#enumVars}}
{{^-first}}
{{/-first}}
{{{classname}}}{{name}} {{{classname}}} = {{{value}}}
{{{classname}}}{{value}} {{{classname}}} = "{{{value}}}"
{{/enumVars}}
{{/allowableValues}}
){{/isEnum}}{{^isEnum}}
Expand Down
18 changes: 1 addition & 17 deletions codegen/Templates/java/JSON.mustache
Original file line number Diff line number Diff line change
Expand Up @@ -58,23 +58,7 @@ public class JSON {
{{/jsr310}}

public static GsonBuilder createGson() {
GsonFireBuilder fireBuilder = new GsonFireBuilder()
{{#parent}}
.registerTypeSelector({{classname}}.class, new TypeSelector() {
@Override
public Class getClassForElement(JsonElement readElement) {
Map classByDiscriminatorValue = new HashMap();
{{#children}}
classByDiscriminatorValue.put("{{name}}".toUpperCase(), {{classname}}.class);
{{/children}}
classByDiscriminatorValue.put("{{classname}}".toUpperCase(), {{classname}}.class);
return getClassByDiscriminator(
classByDiscriminatorValue,
getDiscriminatorValue(readElement, "{{discriminator}}"));
}
})
{{/parent}}
;
GsonFireBuilder fireBuilder = new GsonFireBuilder();
GsonBuilder builder = fireBuilder.createGsonBuilder();
{{#disableHtmlEscaping}}
builder.disableHtmlEscaping();
Expand Down
1 change: 0 additions & 1 deletion codegen/Templates/php/api.mustache
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,6 @@ use RuntimeException;
{{^returnType}}
return [null, $statusCode, $response->getHeaders()];
{{/returnType}}

} catch (ApiException $e) {
switch ($e->getCode()) {
{{#responses}}
Expand Down
1 change: 0 additions & 1 deletion codegen/Templates/php/model.mustache
Original file line number Diff line number Diff line change
Expand Up @@ -300,7 +300,6 @@ class {{classname}} {{#parentSchema}}extends {{{parent}}} {{/parentSchema}}{{^pa
return false;
}
{{/parent}}

{{#vars}}
{{#required}}
if ($this->container['{{name}}'] === null) {
Expand Down
218 changes: 218 additions & 0 deletions codegen/Templates/python/model.mustache
Original file line number Diff line number Diff line change
@@ -0,0 +1,218 @@
# coding: utf-8

{{>partial_header}}

import pprint
import re # noqa: F401

import six


{{#models}}
{{#model}}
class {{classname}}(object):
"""NOTE: This class is auto generated by the swagger code generator program.

Do not edit the class manually.
"""{{#allowableValues}}

"""
allowed enum values
"""
{{#enumVars}}
{{name}} = {{{value}}}{{^-last}}
{{/-last}}
{{/enumVars}}{{/allowableValues}}

"""
Attributes:
swagger_types (dict): The key is attribute name
and the value is attribute type.
attribute_map (dict): The key is attribute name
and the value is json key in definition.
"""
swagger_types = {
{{#vars}}
'{{name}}': '{{{datatype}}}'{{#hasMore}},{{/hasMore}}
{{/vars}}
}

attribute_map = {
{{#vars}}
'{{name}}': '{{baseName}}'{{#hasMore}},{{/hasMore}}
{{/vars}}
}
{{#discriminator}}

discriminator_value_class_map = {
{{#children}}'{{^vendorExtensions.x-discriminator-value}}{{name}}{{/vendorExtensions.x-discriminator-value}}{{#vendorExtensions.x-discriminator-value}}{{{vendorExtensions.x-discriminator-value}}}{{/vendorExtensions.x-discriminator-value}}': '{{{classname}}}'{{^-last}},
{{/-last}}{{/children}}
}
{{/discriminator}}

def __init__(self{{#vars}}, {{name}}={{#defaultValue}}{{{defaultValue}}}{{/defaultValue}}{{^defaultValue}}None{{/defaultValue}}{{/vars}}): # noqa: E501
"""{{classname}} - a model defined in Swagger""" # noqa: E501
{{#vars}}{{#-first}}
{{/-first}}
self._{{name}} = None
{{/vars}}
self.discriminator = {{#discriminator}}'{{discriminator}}'{{/discriminator}}{{^discriminator}}None{{/discriminator}}
{{#vars}}{{#-first}}
{{/-first}}
{{#required}}
self.{{name}} = {{name}}
{{/required}}
{{^required}}
if {{name}} is not None:
self.{{name}} = {{name}}
{{/required}}
{{/vars}}

{{#vars}}
@property
def {{name}}(self):
"""Gets the {{name}} of this {{classname}}. # noqa: E501

{{#description}}
{{{description}}} # noqa: E501
{{/description}}

:return: The {{name}} of this {{classname}}. # noqa: E501
:rtype: {{datatype}}
"""
return self._{{name}}

@{{name}}.setter
def {{name}}(self, {{name}}):
"""Sets the {{name}} of this {{classname}}.

{{#description}}
{{{description}}} # noqa: E501
{{/description}}

:param {{name}}: The {{name}} of this {{classname}}. # noqa: E501
:type: {{datatype}}
"""
{{#required}}
if {{name}} is None:
raise ValueError("Invalid value for `{{name}}`, must not be `None`") # noqa: E501
{{/required}}
{{#isEnum}}
{{#isContainer}}
allowed_values = [{{#allowableValues}}{{#values}}{{#items.isString}}"{{/items.isString}}{{{this}}}{{#items.isString}}"{{/items.isString}}{{^-last}}, {{/-last}}{{/values}}{{/allowableValues}}] # noqa: E501
{{#isListContainer}}
if (not set({{{name}}}).issubset(set(allowed_values))): # noqa: E501
raise ValueError(
"Invalid values for `{{{name}}}` [{0}], must be a subset of [{1}]" # noqa: E501
.format(", ".join(map(str, set({{{name}}}) - set(allowed_values))), # noqa: E501
", ".join(map(str, allowed_values)))
)
{{/isListContainer}}
{{#isMapContainer}}
if (not set({{{name}}}.keys()).issubset(set(allowed_values))): # noqa: E501
raise ValueError(
"Invalid keys in `{{{name}}}` [{0}], must be a subset of [{1}]" # noqa: E501
.format(", ".join(map(str, set({{{name}}}.keys()) - set(allowed_values))), # noqa: E501
", ".join(map(str, allowed_values)))
)
{{/isMapContainer}}
{{/isContainer}}
{{^isContainer}}
allowed_values = [{{#allowableValues}}{{#values}}{{#isString}}"{{/isString}}{{{this}}}{{#isString}}"{{/isString}}{{^-last}}, {{/-last}}{{/values}}{{/allowableValues}}] # noqa: E501
if ({{{name}}} not in allowed_values):
raise ValueError(
"Invalid value for `{{{name}}}` ({0}), must be one of {1}" # noqa: E501
.format({{{name}}}, allowed_values)
)
{{/isContainer}}
{{/isEnum}}
{{^isEnum}}
{{#hasValidation}}
{{#maxLength}}
if ({{name}} is not None and len({{name}}) > {{maxLength}}):
raise ValueError("Invalid value for `{{name}}`, length must be less than or equal to `{{maxLength}}`") # noqa: E501
{{/maxLength}}
{{#minLength}}
if ({{name}} is not None and len({{name}}) < {{minLength}}):
raise ValueError("Invalid value for `{{name}}`, length must be greater than or equal to `{{minLength}}`") # noqa: E501
{{/minLength}}
{{#maximum}}
if ({{name}} is not None and {{name}} >{{#exclusiveMaximum}}={{/exclusiveMaximum}} {{maximum}}): # noqa: E501
raise ValueError("Invalid value for `{{name}}`, must be a value less than {{^exclusiveMaximum}}or equal to {{/exclusiveMaximum}}`{{maximum}}`") # noqa: E501
{{/maximum}}
{{#minimum}}
if ({{name}} is not None and {{name}} <{{#exclusiveMinimum}}={{/exclusiveMinimum}} {{minimum}}): # noqa: E501
raise ValueError("Invalid value for `{{name}}`, must be a value greater than {{^exclusiveMinimum}}or equal to {{/exclusiveMinimum}}`{{minimum}}`") # noqa: E501
{{/minimum}}
{{#pattern}}
if ({{name}} is not None and not re.search(r'{{{vendorExtensions.x-regex}}}', {{name}}{{#vendorExtensions.x-modifiers}}{{#-first}}, flags={{/-first}}re.{{.}}{{^-last}} | {{/-last}}{{/vendorExtensions.x-modifiers}})): # noqa: E501
raise ValueError(r"Invalid value for `{{name}}`, must be a follow pattern or equal to `{{{pattern}}}`") # noqa: E501
{{/pattern}}
{{#maxItems}}
if ({{name}} is not None and len({{name}}) > {{maxItems}}):
raise ValueError("Invalid value for `{{name}}`, number of items must be less than or equal to `{{maxItems}}`") # noqa: E501
{{/maxItems}}
{{#minItems}}
if ({{name}} is not None and len({{name}}) < {{minItems}}):
raise ValueError("Invalid value for `{{name}}`, number of items must be greater than or equal to `{{minItems}}`") # noqa: E501
{{/minItems}}
{{/hasValidation}}
{{/isEnum}}

self._{{name}} = {{name}}

{{/vars}}
{{#discriminator}}
def get_real_child_model(self, data):
"""Returns the real base class specified by the discriminator"""
discriminator_value = data[self.discriminator].lower()
return self.discriminator_value_class_map.get(discriminator_value)

{{/discriminator}}
def to_dict(self):
"""Returns the model properties as a dict"""
result = {}

for attr, _ in six.iteritems(self.swagger_types):
value = getattr(self, attr)
if isinstance(value, list):
result[attr] = list(map(
lambda x: x.to_dict() if hasattr(x, "to_dict") else x,
value
))
elif hasattr(value, "to_dict"):
result[attr] = value.to_dict()
elif isinstance(value, dict):
result[attr] = dict(map(
lambda item: (item[0], item[1].to_dict())
if hasattr(item[1], "to_dict") else item,
value.items()
))
else:
result[attr] = value
if issubclass({{classname}}, dict):
for key, value in self.items():
result[key] = value

return result

def to_str(self):
"""Returns the string representation of the model"""
return pprint.pformat(self.to_dict())

def __repr__(self):
"""For `print` and `pprint`"""
return self.to_str()

def __eq__(self, other):
"""Returns true if both objects are equal"""
if not isinstance(other, {{classname}}):
return False

return self.__dict__ == other.__dict__

def __ne__(self, other):
"""Returns true if both objects are not equal"""
return not self == other
{{/model}}
{{/models}}
Binary file modified codegen/Tools/swagger-codegen-cli.jar
Binary file not shown.
2 changes: 1 addition & 1 deletion codegen/config-android.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"androidSdkVersion": "33",
"apiPackage": "com.aspose.barcode.cloud.demo_app",
"artifactId": "Android Application for Barcode Processing in the Cloud via REST API",
"artifactVersion": "23.3.0",
"artifactVersion": "23.4.0",
"groupId": "com.aspose",
"invokerPackage": "com.aspose.barcode.cloud.demo_app",
"modelPackage": "com.aspose.barcode.cloud.demo_app.model"
Expand Down
2 changes: 1 addition & 1 deletion codegen/config-dart.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@
"browserClient": false,
"pubDescription": "This SDK allows you to work with Aspose.BarCode for Cloud REST APIs in your Dart or Flutter applications quickly and easily",
"pubName": "aspose_barcode_cloud",
"pubVersion": "0.23.3",
"pubVersion": "0.23.4",
"useEnumExtension": true
}
2 changes: 1 addition & 1 deletion codegen/config-go.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
"packageName": "barcode",
"packageVersion": "0.2303.0"
"packageVersion": "0.2304.0"
}
2 changes: 1 addition & 1 deletion codegen/config-java.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"artifactDescription": "Aspose.BarCode Cloud SDK for Java",
"artifactId": "aspose-barcode-cloud",
"artifactUrl": "https://www.aspose.cloud",
"artifactVersion": "23.3.0",
"artifactVersion": "23.4.0",
"developerEmail": "[email protected]",
"developerName": "Denis Averin",
"developerOrganization": "Aspose",
Expand Down
2 changes: 1 addition & 1 deletion codegen/config-python.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"packageName": "aspose_barcode_cloud",
"packageUrl": "https://github.com/aspose-barcode-cloud/aspose-barcode-cloud-python",
"packageVersion": "23.3.0",
"packageVersion": "23.4.0",
"projectName": "aspose-barcode-cloud"
}
8 changes: 4 additions & 4 deletions codegen/config.json
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
{
"artifactVersion": "23.3.0",
"artifactVersion": "23.4.0",
"invokerPackage": "Aspose\\BarCode",
"npmName": "aspose-barcode-cloud-node",
"npmVersion": "23.3.1",
"npmVersion": "23.4.0",
"packageName": "Aspose.BarCode.Cloud.Sdk",
"packageVersion": "23.3.0",
"packageVersion": "23.4.0",
"supportsES6": true
}
}
Loading

0 comments on commit 379ecf5

Please sign in to comment.