Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Release 24.6 #106

Merged
merged 11 commits into from
Jun 27, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ format: format-black
format-black:
python -m black --line-length=120 --exclude submodules -v .

.PHONY: swagger
swagger:
.PHONY: update
update:
./scripts/update_swagger_spec.bash

.PHONY: openapi
Expand Down
3 changes: 2 additions & 1 deletion codegen/Templates/csharp/Configuration.mustache
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
using System;
using System.Collections.Generic;
using Newtonsoft.Json;
using Newtonsoft.Json.Converters;
Expand Down Expand Up @@ -90,7 +91,7 @@ namespace Aspose.BarCode.Cloud.Sdk.Api
{
string result = ApiBaseUrl + "/v" + ApiVersion;

return result.EndsWith("/") ? result.Substring(0, result.Length - 1) : result;
return result.EndsWith("/", StringComparison.InvariantCulture) ? result.Substring(0, result.Length - 1) : result;
}

private string _jwtToken;
Expand Down
3 changes: 3 additions & 0 deletions codegen/Templates/csharp/Project.mustache
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@
<PropertyGroup>
<TargetFrameworks>netstandard2.0</TargetFrameworks>
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
<EnforceCodeStyleInBuild>true</EnforceCodeStyleInBuild>
<AnalysisLevel>latest-Recommended</AnalysisLevel>

<Company>Aspose</Company>
<Title>Aspose.BarCode Cloud SDK for .NET</Title>
<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.
Expand Down
2 changes: 1 addition & 1 deletion codegen/Templates/csharp/api.mustache
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ namespace {{packageName}}.Api
}
{{/isCollectionFormatMulti}}
{{#isPrimitiveType}}
formParams.Add(new StringContent(request.{{baseName}}.ToString()), "{{baseName}}");
formParams.Add(new StringContent($"{request.{{baseName}}}"), "{{baseName}}");
{{/isPrimitiveType}}
{{/isFile}}
}
Expand Down
36 changes: 2 additions & 34 deletions codegen/Templates/dart/README.mustache
Original file line number Diff line number Diff line change
Expand Up @@ -44,44 +44,12 @@ dependencies:
The examples below show how you can generate QR barcode and save it into a local file and then recognize using **{{pubName}}**:

```dart
import 'package:aspose_barcode_cloud/aspose_barcode_cloud.dart' as barcode;

import 'dart:typed_data';
import 'dart:io';

import 'package:http/http.dart';

Future<void> main() async {
const fileName = "qr.png";
// Setup
final apiClient = barcode.ApiClient(
clientId: "Client Id from https://dashboard.aspose.cloud/applications",
clientSecret:
"Client Secret from https://dashboard.aspose.cloud/applications",
);
final api = barcode.BarcodeApi(apiClient);

// Generate image with barcode
Uint8List? generated =
await api.getBarcodeGenerate("QR", "text", textLocation: "None");
// Save generated image to file
await File(fileName).writeAsBytes(generated!);
print("Generated image saved to " + fileName);

// Recognize generated image
final formFile = MultipartFile.fromBytes("image", generated.toList(),
filename: "barcode.png");
barcode.BarcodeResponseList? recognized =
await api.postBarcodeRecognizeFromUrlOrContent(image: formFile);

print("Recognized Type: " + recognized!.barcodes![0].type!);
print("Recognized Value: " + recognized.barcodes![0].barcodeValue!);
}
%insert example/main.dart%
```

## Dependencies

- http: '>=0.13.0 <0.14.0'
- http: '>=0.13.0 <2.0.0'

## Licensing

Expand Down
2 changes: 1 addition & 1 deletion codegen/Templates/dart/pubspec.mustache
Original file line number Diff line number Diff line change
Expand Up @@ -17,5 +17,5 @@ dependencies:
http: '>=0.13.0 <2.0.0'

dev_dependencies:
lints: ^3.0.0
lints: ^4.0.0
test: ^1.25.1
102 changes: 3 additions & 99 deletions codegen/Templates/go/README.mustache
Original file line number Diff line number Diff line change
Expand Up @@ -51,111 +51,15 @@ To use Aspose.BarCode Cloud SDK for Go you need to register an account with [Asp
The examples below show how you can generate QR barcode and save it into a local file using **{{packageName}}**:

```go
package main

import (
"context"
"fmt"
"github.com/antihax/optional"
"github.com/aspose-barcode-cloud/aspose-barcode-cloud-go/barcode"
"github.com/aspose-barcode-cloud/aspose-barcode-cloud-go/barcode/jwt"
"os"
)

func main() {
jwtConf := jwt.NewConfig(
"Client Id from https://dashboard.aspose.cloud/applications",
"Client Secret from https://dashboard.aspose.cloud/applications",
)
fileName := "testdata/generated.png"

authCtx := context.WithValue(context.Background(),
barcode.ContextJWT,
jwtConf.TokenSource(context.Background()))

client := barcode.NewAPIClient(barcode.NewConfiguration())

opts := &barcode.BarcodeApiGetBarcodeGenerateOpts{
TextLocation: optional.NewString("None"),
}

data, _, err := client.BarcodeApi.GetBarcodeGenerate(authCtx,
string(barcode.EncodeBarcodeTypeQR),
"Go SDK example",
opts)
if err != nil {
panic(err)
}

out, err := os.Create(fileName)
if err != nil {
panic(err)
}
defer out.Close()

written, err := out.Write(data)
if err != nil {
panic(err)
}

fmt.Printf("Written %d bytes to file %s\n", written, fileName)
}
%insert examples/generate/example.go%
```

### Recognize a barcode on image

The examples below show how you can recognize barcode text and type on the image using **{{packageName}}**:
The examples below show how you can scan barcode text and type on the image using **{{packageName}}**:

```go
package main

import (
"context"
"fmt"
"github.com/antihax/optional"
"github.com/aspose-barcode-cloud/aspose-barcode-cloud-go/barcode"
"github.com/aspose-barcode-cloud/aspose-barcode-cloud-go/barcode/jwt"
"os"
)

func main() {
jwtConf := jwt.NewConfig(
"Client Id from https://dashboard.aspose.cloud/applications",
"Client Secret from https://dashboard.aspose.cloud/applications",
)
fileName := "testdata/pdf417Sample.png"

file, err := os.Open(fileName)
if err != nil {
panic(err)
}
defer file.Close()

client := barcode.NewAPIClient(barcode.NewConfiguration())
authCtx := context.WithValue(context.Background(),
barcode.ContextJWT,
jwtConf.TokenSource(context.Background()))

optionals := barcode.BarcodeApiPostBarcodeRecognizeFromUrlOrContentOpts{
Preset: optional.NewString(string(barcode.PresetTypeHighPerformance)),
Image: optional.NewInterface(file),
}

recognized, _, err := client.BarcodeApi.PostBarcodeRecognizeFromUrlOrContent(
authCtx,
&optionals)
if err != nil {
panic(err)
}

if len(recognized.Barcodes) == 0 {
fmt.Printf("No barcodes in %s", fileName)
}

for i, oneBarcode := range recognized.Barcodes {
fmt.Printf("Recognized #%d: %s %s", i+1, oneBarcode.Type, oneBarcode.BarcodeValue)
}
}
%insert examples/scan/example.go%
```

## Dependencies
Expand Down
21 changes: 16 additions & 5 deletions codegen/Templates/java/pom.mustache
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>{{groupId}}</groupId>
<artifactId>{{artifactId}}</artifactId>
Expand Down Expand Up @@ -140,6 +141,15 @@
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>versions-maven-plugin</artifactId>
<version>${versions-maven-plugin.version}</version>
<configuration>
<generateBackupPoms>false</generateBackupPoms>
<rulesUri>file://${project.basedir}/versions-rule.xml</rulesUri>
</configuration>
</plugin>
</plugins>
</build>

Expand Down Expand Up @@ -233,19 +243,20 @@
<java.version>{{#java8}}1.8{{/java8}}{{^java8}}1.7{{/java8}}</java.version>
<maven.compiler.source>${java.version}</maven.compiler.source>
<maven.compiler.target>${java.version}</maven.compiler.target>
<gson-fire-version>1.8.5</gson-fire-version>
<gson-fire-version>1.9.0</gson-fire-version>
{{! Check version compatibility with gson-fire }}
<gson-version>2.10.1</gson-version>
<swagger-core-version>1.6.8</swagger-core-version>
<gson-version>2.11.0</gson-version>
<swagger-core-version>1.6.14</swagger-core-version>
<okhttp-version>2.7.5</okhttp-version>
{{#joda}}
<jodatime-version>2.9.9</jodatime-version>
{{/joda}}
{{#threetenbp}}
<threetenbp-version>1.6.5</threetenbp-version>
<threetenbp-version>1.6.9</threetenbp-version>
{{/threetenbp}}
<maven-plugin-version>1.0.0</maven-plugin-version>
<junit-version>4.13.2</junit-version>
<versions-maven-plugin.version>2.16.2</versions-maven-plugin.version>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>
</project>
1 change: 1 addition & 0 deletions codegen/Templates/nodejs/api.mustache
Original file line number Diff line number Diff line change
Expand Up @@ -204,6 +204,7 @@ export class {{classname}} {
const requestPath =
this._configuration.getApiBaseUrl() +
'{{{path}}}'{{#pathParams}}.replace(
// eslint-disable-next-line no-useless-concat
'{' + '{{baseName}}' + '}',
String(request.{{paramName}})
){{/pathParams}};
Expand Down
11 changes: 5 additions & 6 deletions codegen/Templates/nodejs/package.mustache
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@
"scripts": {
"test": "dts test",
"cover": "dts test --coverage",
"lint": "tsc --strict",
"lint": "dts lint src test",
"format": "dts lint src test --fix",
"prepare": "dts build --target node",
"check-updates": "ncu -u --enginesNode"
Expand All @@ -147,16 +147,15 @@
"tabWidth": 4
},
"devDependencies": {
"@types/uuid": "^9.0.8",
"@types/uuid": "^10.0.0",
"dts-cli": "^2.0.5",
"eslint-config-prettier": "^9.1.0",
"eslint-plugin-prettier": "^5.1.3",
"npm-check-updates": "^16.14.20",
"prettier": "^3.2.5",
"prettier": "^3.3.2",
"ts-jest": "^29.1.3",
"tslib": "^2.6.2",
"typescript": "^5.4.5",
"uuid": "^9.0.1"
"tslib": "^2.6.3",
"uuid": "^10.0.0"
},
"bugs": {
"url": "https://github.com/aspose-barcode-cloud/aspose-barcode-cloud-node/issues"
Expand Down
3 changes: 1 addition & 2 deletions codegen/Templates/python/README.mustache
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@

[Aspose.BarCode for Cloud](https://products.aspose.cloud/barcode/) is a REST API for Linear, 2D and postal barcode generation and recognition in the cloud. API recognizes and generates barcode images in a variety of formats. Barcode REST API allows to specify barcode image attributes like image width, height, border style and output image format in order to customize the generation process. Developers can also specify the barcode type and text attributes such as text location and font styles in order to suit the application requirements.

This repository contains Aspose.BarCode Cloud SDK for Python source code. This SDK allows you to work with Aspose.BarCode for Cloud REST APIs in your Python 2 or Python 3 applications quickly and easily.
This repository contains Aspose.BarCode Cloud SDK for Python source code. This SDK allows you to work with Aspose.BarCode for Cloud REST APIs in your Python 3 applications quickly and easily.

Supported Python versions:

Expand Down Expand Up @@ -99,7 +99,6 @@ pprint(response)

## Requirements

- six >= 1.10
- urllib3 >= 1.21.1, <2.0

## Licensing
Expand Down
5 changes: 1 addition & 4 deletions codegen/Templates/python/api.mustache
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,6 @@ from __future__ import absolute_import, division
import re # noqa: F401
import warnings # noqa: F401

# python 2 and python 3 compatibility library
import six

from {{packageName}}.api_client import ApiClient


Expand Down Expand Up @@ -89,7 +86,7 @@ class {{classname}}(object):
all_params.add("_request_timeout")

params = locals()
for key, val in six.iteritems(params["kwargs"]):
for key, val in params["kwargs"].items():
if key not in all_params:
raise TypeError(
"Got an unexpected keyword argument '%s'"
Expand Down
Loading