Skip to content

Commit

Permalink
Release 2.20190710.0
Browse files Browse the repository at this point in the history
  • Loading branch information
shaofu88 committed Jul 10, 2019
1 parent e804b45 commit 1c1ec16
Show file tree
Hide file tree
Showing 13 changed files with 138 additions and 2,179 deletions.
2,222 changes: 62 additions & 2,160 deletions api.json

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions swagger-config/config-csharp.json
@@ -1,8 +1,8 @@
{
"packageName": "Square.Connect",
"packageVersion": "2.19.0",
"packageVersion": "2.20.0",
"optionalProjectFile": "true",
"httpUserAgent": "Square-Connect-CSharp/2.20190612.0",
"httpUserAgent": "Square-Connect-CSharp/2.20190710.0",
"packageGuid": "{4A65C772-5862-4E64-B742-0C6997700CD8}",
"gitUserId": "square",
"gitRepoId": "connect-csharp-sdk"
Expand Down
4 changes: 2 additions & 2 deletions swagger-config/config-java.json
Expand Up @@ -4,7 +4,7 @@
"invokerPackage": "com.squareup.connect",
"groupId": "com.squareup",
"artifactId": "connect",
"artifactVersion": "2.20190612.0",
"artifactVersion": "2.20190710.0",
"artifactUrl": "https://github.com/square/connect-java-sdk/",
"artifactDescription": "Java client library for the Square Connect API",
"developerName": "Square Inc.",
Expand All @@ -20,6 +20,6 @@
"dateLibrary": "java8",
"useGzipFeature": false,
"library": "jersey2",
"httpUserAgent": "Square-Connect-Java/2.20190612.0",
"httpUserAgent": "Square-Connect-Java/2.20190710.0",
"hideGenerationTimestamp": true
}
2 changes: 1 addition & 1 deletion swagger-config/config-javascript.json
@@ -1,6 +1,6 @@
{
"projectName": "square-connect",
"projectVersion": "2.20190612.0",
"projectVersion": "2.20190710.0",
"projectDescription": "JavaScript client library for the Square Connect v2 API",
"projectLicenseName": "Apache-2.0",
"moduleName": "SquareConnect",
Expand Down
4 changes: 2 additions & 2 deletions swagger-config/config-php.json
@@ -1,12 +1,12 @@
{
"packagePath": "SquareConnect",
"artifactVersion": "2.20190612.0",
"artifactVersion": "2.20190710.0",
"invokerPackage": "SquareConnect",
"modelPackage": "Model",
"apiPackage": "Api",
"composerVendorName": "square",
"composerProjectName": "connect",
"httpUserAgent": "Square-Connect-PHP/2.20190612.0",
"httpUserAgent": "Square-Connect-PHP/2.20190710.0",
"gitUserId": "square",
"gitRepoId": "connect-php-sdk"
}
4 changes: 2 additions & 2 deletions swagger-config/config-python.json
@@ -1,7 +1,7 @@
{
"packageName": "squareconnect",
"packageVersion": "2.20190612.0",
"httpUserAgent": "Square-Connect-Python/2.20190612.0",
"packageVersion": "2.20190710.0",
"httpUserAgent": "Square-Connect-Python/2.20190710.0",
"gitUserId": "square",
"gitRepoId": "connect-python-sdk"
}
4 changes: 2 additions & 2 deletions swagger-config/config-ruby.json
@@ -1,8 +1,8 @@
{
"gemName": "square_connect",
"moduleName": "SquareConnect",
"httpUserAgent": "Square-Connect-Ruby/2.20190612.0",
"gemVersion": "2.20190612.0",
"httpUserAgent": "Square-Connect-Ruby/2.20190710.0",
"gemVersion": "2.20190710.0",
"gemAuthor": "Square, Inc.",
"gemAuthorEmail": "developers@squareup.com",
"gemHomepage": "https://github.com/square/connect-ruby-sdk",
Expand Down
32 changes: 31 additions & 1 deletion swagger-templates/csharp/README.mustache
Expand Up @@ -7,6 +7,36 @@ This repository contains the released C# client SDK. Check out our [API
specification repository](https://github.com/square/connect-api-specification)
for the specification and template files we used to generate this.

## ENUM to String Migration
The .NET SDK no longer treats enums as explicit types. Instead, all enums are handled as static strings. Previously, you would use an enum constant to represent the related string value. For example:
```csharp
CatalogObject beverages = new CatalogObject(
Type: TypeEnum.CATEGORY,
Id: BeverageIdStr,
CategoryData: new CatalogCategory(Name: BeveragesStr)
);
```

As of version 2.20.0, you would work with the static string value directly. For example:
```csharp
CatalogObject beverages = new CatalogObject(
Type: "CATEGORY",
Id: BeverageIdStr,
CategoryData: new CatalogCategory(Name: BeveragesStr)
);
```

But, as a best practice, we recommend representing enum strings as constants for easier reuse. For example:
```csharp
const string CatalogCategoryType ="CATEGORY";

CatalogObject beverages = new CatalogObject(
Type: CatalogCategoryType,
Id: BeverageIdStr,
CategoryData: new CatalogCategory(Name: BeveragesStr)
);
```

## Frameworks supported
- .NET Standard 2.0

Expand Down Expand Up @@ -80,7 +110,7 @@ namespace Example
// This amount is in cents. It's also hard-coded for $1, which is not very useful.
int amount = 100;
string currency = "USD";
Money money = new Money(amount, Money.ToCurrencyEnum(currency));
Money money = new Money(amount, currency);
string nonce = "YOUR_NONCE";
string locationId = "YOUR_LOCATION_ID";
Expand Down
22 changes: 21 additions & 1 deletion swagger-templates/java/README.mustache
Expand Up @@ -2,6 +2,27 @@

**If you have feedback about the new SDKs, or just want to talk to other Square Developers, request an invite to the new [slack community for Square Developers](https://squ.re/2GB8GHk)**

## ENUM to String Migration
The Java SDK no longer treats enums as explicit types. Instead, all enums are handled as static strings.
Previously, you would use an enum constant to represent the related string value. For example:
```java
Money money = new Money();
money.setCurrency(Money.CurrencyEnum.USD);
```

As of version 2.20190710.0, you would work with the static string value directly. For example:
```java
Money money = new Money();
money.setCurrency("USD");
```

But, as a best practice, we recommend representing enum strings as constants for easier reuse. For example:
```java
String MONEY_USD = "USD";
Money money = new Money();
money.setCurrency(MONEY_USD);
```

## Requirements

Java 8
Expand Down Expand Up @@ -84,7 +105,6 @@ import com.squareup.connect.Configuration;
import com.squareup.connect.api.LocationsApi;
import com.squareup.connect.auth.OAuth;
import com.squareup.connect.models.Location;
import com.squareup.connect.models.Location.CapabilitiesEnum;

import java.io.File;
import java.util.*;
Expand Down
4 changes: 1 addition & 3 deletions swagger-templates/java/enum_outer_doc.mustache
@@ -1,7 +1,5 @@
# {{classname}}

## Enum

{{#allowableValues}}{{#enumVars}}
* `{{name}}` (value: `{{{value}}}`)
* `{{{value}}}`
{{/enumVars}}{{/allowableValues}}
1 change: 0 additions & 1 deletion swagger-templates/java/pojo_doc.mustache
Expand Up @@ -12,7 +12,6 @@ Name | Type | Description | Notes
{{#vars}}{{#isEnum}}

<a name="{{{datatypeWithEnum}}}"></a>
## Enum: {{datatypeWithEnum}}
Name | Value
---- | -----{{#allowableValues}}{{#enumVars}}
{{name}} | {{value}}{{/enumVars}}{{/allowableValues}}
Expand Down
2 changes: 1 addition & 1 deletion swagger-templates/javascript/README.mustache
Expand Up @@ -32,7 +32,7 @@ oauth2.accessToken = "YOUR ACCESS TOKEN";
var api = new {{{moduleName}}}.LocationsApi();

api.listLocations().then(function(data) {
console.log('API called successfully. Returned data: ' + data);
console.log('API called successfully. Returned data: ' + JSON.stringify(data, 0, 1));
}, function(error) {
console.error(error);
});
Expand Down
12 changes: 11 additions & 1 deletion swagger-templates/ruby/README.mustache
Expand Up @@ -17,7 +17,17 @@ This SDK is automatically generated by the [Swagger Codegen](https://github.com/
For more information, please visit [{{{infoUrl}}}]({{{infoUrl}}})
{{/infoUrl}}

## Installation
---
## NOTICE: New Beta Ruby SDK Availability
Square is pleased to announce early access to the beta release of **square.rb**, the new Square Ruby SDK gem. The new **square.rb** gem lets you take payments and run a business with Square APIs including Catalog, Customers, Employees, Inventory, Labor, Locations, Orders, and more. This new gem will eventually replace the square_connect gem and this repo.

You can read more about the release in our [blog post](https://developer.squareup.com/blog/announcing-square's-new-ruby-sdk/), or check out the new Square Ruby SDK gem on [GitHub](https://github.com/square/square-ruby-sdk#readme). Or just give **square.rb** a try! You can install the gem from your terminal with the command:
```ruby
gem install square.rb
```
---

## Installation of Square Connect Ruby SDK

### Option1: RubyGems
The Ruby SDK is published as a gem. Simply run:
Expand Down

0 comments on commit 1c1ec16

Please sign in to comment.