diff --git a/CHANGES.md b/CHANGES.md index 8649e06..1002d43 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -1,5 +1,14 @@ # Change Log +## Version 2.20190410.1 (2019-04-24) + +## Details + +* **New functionality**: Employees API (Connect v2) — New fields to + capture contact information for employee profiles. +* **New functionality**: `V1Tender.CardBrand` — New V1 enum to represent + brand information for credit cars. + ## Version 2.20190410.0 (2019-04-10) ## New features: Orders API beta diff --git a/README.md b/README.md index cfeeffb..53477ac 100644 --- a/README.md +++ b/README.md @@ -18,7 +18,7 @@ Add this dependency to your project's POM: com.squareup connect - 2.20190410.0 + 2.20190410.1 compile ``` @@ -28,7 +28,7 @@ Add this dependency to your project's POM: Add this dependency to your project's build file: ```groovy -compile "com.squareup:connect:2.20190410.0" +compile "com.squareup:connect:2.20190410.1" ``` ### Option 3: Build and Install locally @@ -70,7 +70,7 @@ At first generate the JAR by executing: Then manually install the following JARs: -* target/connect-2.20190410.0.jar +* target/connect-2.20190410.1.jar * target/lib/*.jar ## Getting Started @@ -625,6 +625,7 @@ Class | Method | HTTP request | Description - [V1SettlementEntryType](docs/V1SettlementEntryType.md) - [V1SettlementStatus](docs/V1SettlementStatus.md) - [V1Tender](docs/V1Tender.md) + - [V1TenderCardBrand](docs/V1TenderCardBrand.md) - [V1TenderEntryMethod](docs/V1TenderEntryMethod.md) - [V1TenderType](docs/V1TenderType.md) - [V1Timecard](docs/V1Timecard.md) diff --git a/build.gradle b/build.gradle index 8cb1a4c..c4f38b2 100644 --- a/build.gradle +++ b/build.gradle @@ -2,7 +2,7 @@ apply plugin: 'idea' apply plugin: 'eclipse' group = 'com.squareup' -version = '2.20190410.0' +version = '2.20190410.1' buildscript { repositories { diff --git a/docs/CatalogApi.md b/docs/CatalogApi.md index 8cab982..4838b5f 100644 --- a/docs/CatalogApi.md +++ b/docs/CatalogApi.md @@ -303,7 +303,7 @@ oauth2.setAccessToken("YOUR ACCESS TOKEN"); CatalogApi apiInstance = new CatalogApi(); String cursor = "cursor_example"; // String | The pagination cursor returned in the previous response. Leave unset for an initial request. See [Pagination](/basics/api101/pagination) for more information. -String types = "types_example"; // String | An optional case-insensitive, comma-separated list of object types to retrieve, for example `ITEM,ITEM_VARIATION,CATEGORY`. The legal values are taken from the [CatalogObjectType](#type-catalogobjecttype) enumeration, namely `\"ITEM\"`, `\"ITEM_VARIATION\"`, `\"CATEGORY\"`, `\"DISCOUNT\"`, `\"TAX\"`, `\"MODIFIER\"`, or `\"MODIFIER_LIST\"`. +String types = "types_example"; // String | An optional case-insensitive, comma-separated list of object types to retrieve, for example `ITEM,ITEM_VARIATION,CATEGORY,IMAGE`. The legal values are taken from the [CatalogObjectType](#type-catalogobjecttype) enumeration, namely `ITEM`, `ITEM_VARIATION`, `CATEGORY`, `DISCOUNT`, `TAX`, `MODIFIER`, `MODIFIER_LIST`, or `IMAGE`. try { ListCatalogResponse result = apiInstance.listCatalog(cursor, types); System.out.println(result); @@ -318,7 +318,7 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **cursor** | **String**| The pagination cursor returned in the previous response. Leave unset for an initial request. See [Pagination](/basics/api101/pagination) for more information. | [optional] - **types** | **String**| An optional case-insensitive, comma-separated list of object types to retrieve, for example `ITEM,ITEM_VARIATION,CATEGORY`. The legal values are taken from the [CatalogObjectType](#type-catalogobjecttype) enumeration, namely `\"ITEM\"`, `\"ITEM_VARIATION\"`, `\"CATEGORY\"`, `\"DISCOUNT\"`, `\"TAX\"`, `\"MODIFIER\"`, or `\"MODIFIER_LIST\"`. | [optional] + **types** | **String**| An optional case-insensitive, comma-separated list of object types to retrieve, for example `ITEM,ITEM_VARIATION,CATEGORY,IMAGE`. The legal values are taken from the [CatalogObjectType](#type-catalogobjecttype) enumeration, namely `ITEM`, `ITEM_VARIATION`, `CATEGORY`, `DISCOUNT`, `TAX`, `MODIFIER`, `MODIFIER_LIST`, or `IMAGE`. | [optional] ### Return type diff --git a/docs/CatalogItem.md b/docs/CatalogItem.md index ef454d8..9408c90 100644 --- a/docs/CatalogItem.md +++ b/docs/CatalogItem.md @@ -10,7 +10,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **name** | **String** | The item's name. Searchable. This field must not be empty. This field has max length of 512 Unicode code points. | [optional] **description** | **String** | The item's description. Searchable. This field has max length of 4096 Unicode code points. | [optional] -**abbreviation** | **String** | The text of the item's display label in the Square Point of Sale app. Only up to the first five characters of the string are used. Searchable. This field has max length of 24 Unicode code points. | [optional] +**abbreviation** | **String** | The text of the item's display label in the Square Point of Sale app. Only up to the first five characters of the string are used. Searchable. This field has max length of 24 Unicode code points. | [optional] **labelColor** | **String** | The color of the item's display label in the Square Point of Sale app. This must be a valid hex color code. | [optional] **availableOnline** | **Boolean** | If `true`, the item can be added to shipping orders from the merchant's online store. | [optional] **availableForPickup** | **Boolean** | If `true`, the item can be added to pickup orders from the merchant's online store. | [optional] diff --git a/docs/CatalogObject.md b/docs/CatalogObject.md index 5c63a06..3df10d9 100644 --- a/docs/CatalogObject.md +++ b/docs/CatalogObject.md @@ -3,7 +3,7 @@ ### Description -The wrapper object for object types in the Catalog data model. The type of a particular `CatalogObject` is determined by the value of `type` and only the corresponding data field may be set. - if type = `ITEM`, only `item_data` will be populated and it will contain a valid [CatalogItem](#type-catalogitem) object. - if type = `ITEM_VARIATION`, only `item_variation_data` will be populated and it will contain a valid [CatalogItemVariation](#type-catalogitemvariation) object. - if type = `MODIFIER`, only `modifier_data` will be populated and it will contain a valid [CatalogModifier](#type-catalogmodifier) object. - if type = `MODIFIER_LIST`, only `modifier_list_data` will be populated and it will contain a valid [CatalogModifierList](#type-catalogmodifierlist) object. - if type = `CATEGORY`, only `category_data` will be populated and it will contain a valid [CatalogCategory](#type-catalogcategory) object. - if type = `DISCOUNT`, only `discount_data` will be populated and it will contain a valid [CatalogDiscount](#type-catalogdiscount) object. - if type = `TAX`, only `tax_data` will be populated and it will contain a valid [CatalogTax](#type-catalogtax) object. For a more detailed discussion of the Catalog data model, please see the [Catalog Overview](/products/catalog/overview). +The wrapper object for object types in the Catalog data model. The type of a particular `CatalogObject` is determined by the value of `type` and only the corresponding data field may be set. - if type = `ITEM`, only `item_data` will be populated and it will contain a valid [CatalogItem](#type-catalogitem) object. - if type = `ITEM_VARIATION`, only `item_variation_data` will be populated and it will contain a valid [CatalogItemVariation](#type-catalogitemvariation) object. - if type = `MODIFIER`, only `modifier_data` will be populated and it will contain a valid [CatalogModifier](#type-catalogmodifier) object. - if type = `MODIFIER_LIST`, only `modifier_list_data` will be populated and it will contain a valid [CatalogModifierList](#type-catalogmodifierlist) object. - if type = `CATEGORY`, only `category_data` will be populated and it will contain a valid [CatalogCategory](#type-catalogcategory) object. - if type = `DISCOUNT`, only `discount_data` will be populated and it will contain a valid [CatalogDiscount](#type-catalogdiscount) object. - if type = `TAX`, only `tax_data` will be populated and it will contain a valid [CatalogTax](#type-catalogtax) object. - if type = `IMAGE`, only `image_data` will be populated and it will contain a valid [CatalogImage](#type-catalogimage) object. For a more detailed discussion of the Catalog data model, please see the [Catalog Overview](/products/catalog/overview). ## Properties Name | Type | Description | Notes @@ -11,7 +11,7 @@ Name | Type | Description | Notes **type** | [**TypeEnum**](#TypeEnum) | The type of this object. Each object type has expected properties expressed in a structured format within its corresponding `*_data` field below. See [CatalogObjectType](#type-catalogobjecttype) for possible values | **id** | **String** | An identifier to reference this object in the catalog. When a new CatalogObject is inserted, the client should set the id to a temporary identifier starting with a `'#'` character. Other objects being inserted or updated within the same request may use this identifier to refer to the new object. When the server receives the new object, it will supply a unique identifier that replaces the temporary identifier for all future references. | **updatedAt** | **String** | Last modification [timestamp](#workingwithdates) in RFC 3339 format, e.g., `\"2016-08-15T23:59:33.123Z\"` would indicate the UTC time (denoted by `Z`) of August 15, 2016 at 23:59:33 and 123 milliseconds. | [optional] -**version** | **Long** | The version of the object. When updating an object, the version supplied by the must match the version in the database, otherwise the write will be rejected as conflicting. | [optional] +**version** | **Long** | The version of the object. When updating an object, the version supplied must match the version in the database, otherwise the write will be rejected as conflicting. | [optional] **isDeleted** | **Boolean** | If `true`, the object has been deleted from the database. Must be `false` for new objects being inserted. When deleted, the `updated_at` field will equal the deletion time. | [optional] **catalogV1Ids** | [**List<CatalogV1Id>**](CatalogV1Id.md) | The Connect V1 IDs for this object at each [location](#type-location) where it is present, where they differ from the object's Connect V2 ID. The field will only be present for objects that have been created or modified by legacy APIs. | [optional] **presentAtAllLocations** | **Boolean** | If `true`, this object is present at all locations (including future locations), except where specified in the `absent_at_location_ids` field. If `false`, this object is not present at any locations (including future locations), except where specified in the `present_at_location_ids` field. If not specified, defaults to `true`. | [optional] diff --git a/docs/CatalogQuery.md b/docs/CatalogQuery.md index e3b125b..a7b55b7 100644 --- a/docs/CatalogQuery.md +++ b/docs/CatalogQuery.md @@ -3,7 +3,7 @@ ### Description -A query to be applied to a SearchCatalogObjects request. Only one query field may be present. Where an attribute name is required, it should be specified as the name of any field marked \"searchable\" from the structured data types for the desired result object type(s) ([CatalogItem](#type-catalogitem), [CatalogItemVariation](#type-catalogitemvariation), [CatalogCategory](#type-catalogcategory), [CatalogTax](#type-catalogtax), [CatalogDiscount](#type-catalogdiscount), [CatalogModifierList](#type-catalogmodifierlist), [CatalogModifier](#type-catalogmodifier)). For example, a query that should return Items may specify attribute names from any of the searchable fields of the [CatalogItem](#type-catalogitem) data type, namely `\"name\"`, `\"description\"`, and `\"abbreviation\"`. +A query to be applied to a [SearchCatalogObjectsRequest](#type-searchcatalogobjectsrequest). Only one query field may be present. Where an attribute name is required, it should be specified as the name of any field marked \"searchable\" from the structured data types for the desired result object type(s) ([CatalogItem](#type-catalogitem), [CatalogItemVariation](#type-catalogitemvariation), [CatalogCategory](#type-catalogcategory), [CatalogTax](#type-catalogtax), [CatalogDiscount](#type-catalogdiscount), [CatalogModifierList](#type-catalogmodifierlist), [CatalogModifier](#type-catalogmodifier)). For example, a query that should return Items may specify attribute names from any of the searchable fields of the [CatalogItem](#type-catalogitem) data type, namely `\"name\"`, `\"description\"`, and `\"abbreviation\"`. ## Properties Name | Type | Description | Notes diff --git a/docs/ChargeRequest.md b/docs/ChargeRequest.md index 8962081..f9afc8b 100644 --- a/docs/ChargeRequest.md +++ b/docs/ChargeRequest.md @@ -14,7 +14,7 @@ Name | Type | Description | Notes **customerCardId** | **String** | The ID of the customer card on file to charge. Do not provide a value for this field if you provide a value for `card_nonce`. If you provide this value, you _must_ also provide a value for `customer_id`. | [optional] **delayCapture** | **Boolean** | If `true`, the request will only perform an Auth on the provided card. You can then later perform either a Capture (with the [CaptureTransaction](#endpoint-capturetransaction) endpoint) or a Void (with the [VoidTransaction](#endpoint-voidtransaction) endpoint). Default value: `false` | [optional] **referenceId** | **String** | An optional ID you can associate with the transaction for your own purposes (such as to associate the transaction with an entity ID in your own database). This value cannot exceed 40 characters. | [optional] -**note** | **String** | | [optional] +**note** | **String** | An optional note to associate with the transaction. This value cannot exceed 60 characters. | [optional] **customerId** | **String** | The ID of the customer to associate this transaction with. This field is required if you provide a value for `customer_card_id`, and optional otherwise. | [optional] **billingAddress** | [**Address**](Address.md) | The buyer's billing address. This value is optional, but this transaction is ineligible for chargeback protection if neither this parameter nor `shipping_address` is provided. | [optional] **shippingAddress** | [**Address**](Address.md) | The buyer's shipping address, if available. This value is optional, but this transaction is ineligible for chargeback protection if neither this parameter nor `billing_address` is provided. | [optional] diff --git a/docs/Employee.md b/docs/Employee.md index 8618622..e872d36 100644 --- a/docs/Employee.md +++ b/docs/Employee.md @@ -11,6 +11,8 @@ Name | Type | Description | Notes **id** | **String** | UUID for this `Employee`. | [optional] **firstName** | **String** | Given (first) name of the employee. | [optional] **lastName** | **String** | Family (last) name of the employee | [optional] +**email** | **String** | Email of the employee | [optional] +**phoneNumber** | **String** | Phone number of the employee in E.164 format, i.e. \"+12125554250\" | [optional] **locationIds** | **List<String>** | A list of location IDs where this employee has access. | [optional] **status** | [**StatusEnum**](#StatusEnum) | Specifies the status of the employee being fetched. See [EmployeeStatus](#type-employeestatus) for possible values | [optional] **createdAt** | **String** | A read-only timestamp in RFC 3339 format. | [optional] diff --git a/docs/ListCatalogRequest.md b/docs/ListCatalogRequest.md index e36d19d..928cc88 100644 --- a/docs/ListCatalogRequest.md +++ b/docs/ListCatalogRequest.md @@ -9,7 +9,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **cursor** | **String** | The pagination cursor returned in the previous response. Leave unset for an initial request. See [Pagination](/basics/api101/pagination) for more information. | [optional] -**types** | **String** | An optional case-insensitive, comma-separated list of object types to retrieve, for example `ITEM,ITEM_VARIATION,CATEGORY`. The legal values are taken from the [CatalogObjectType](#type-catalogobjecttype) enumeration, namely `\"ITEM\"`, `\"ITEM_VARIATION\"`, `\"CATEGORY\"`, `\"DISCOUNT\"`, `\"TAX\"`, `\"MODIFIER\"`, or `\"MODIFIER_LIST\"`. | [optional] +**types** | **String** | An optional case-insensitive, comma-separated list of object types to retrieve, for example `ITEM,ITEM_VARIATION,CATEGORY,IMAGE`. The legal values are taken from the [CatalogObjectType](#type-catalogobjecttype) enumeration, namely `ITEM`, `ITEM_VARIATION`, `CATEGORY`, `DISCOUNT`, `TAX`, `MODIFIER`, `MODIFIER_LIST`, or `IMAGE`. | [optional] diff --git a/docs/ObtainTokenResponse.md b/docs/ObtainTokenResponse.md index 3e6f60b..08d081b 100644 --- a/docs/ObtainTokenResponse.md +++ b/docs/ObtainTokenResponse.md @@ -8,7 +8,7 @@ ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**accessToken** | **String** | A valid OAuth access token. Provide the access token in a header with every request to Connect API endpoints. See the [Build with OAuth](/authz/oauth/build-with-the-api) guide for more information. | [optional] +**accessToken** | **String** | A valid OAuth access token. OAuth access tokens are 64 bytes long. Provide the access token in a header with every request to Connect API endpoints. See the [Build with OAuth](/authz/oauth/build-with-the-api) guide for more information. | [optional] **tokenType** | **String** | This value is always _bearer_. | [optional] **expiresAt** | **String** | The date when access_token expires, in [ISO 8601](http://www.iso.org/iso/home/standards/iso8601.htm) format. | [optional] **merchantId** | **String** | The ID of the authorizing merchant's business. | [optional] diff --git a/docs/UpsertCatalogObjectRequest.md b/docs/UpsertCatalogObjectRequest.md index 7531c13..3bcd665 100644 --- a/docs/UpsertCatalogObjectRequest.md +++ b/docs/UpsertCatalogObjectRequest.md @@ -9,7 +9,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **idempotencyKey** | **String** | A value you specify that uniquely identifies this request among all your requests. A common way to create a valid idempotency key is to use a Universally unique identifier (UUID). If you're unsure whether a particular request was successful, you can reattempt it with the same idempotency key without worrying about creating duplicate objects. See [Idempotency](/basics/api101/idempotency) for more information. | -**object** | [**CatalogObject**](CatalogObject.md) | A [CatalogObject](#type-catalogobject) to be created or updated. The object's `is_deleted` field must not be set to `true`. When creating a new object, the object's ID must either start with a `#` character or be left blank. In either case it will be replaced with a server-generated ID. | +**object** | [**CatalogObject**](CatalogObject.md) | A [CatalogObject](#type-catalogobject) to be created or updated. - For updates, the object must be active (the `is_deleted` field is not `true`). - For creates, the object ID must start with `#`. The provided ID is replaced with a server-generated ID. | diff --git a/docs/V1Tender.md b/docs/V1Tender.md index ba3a1ef..8b2be1d 100644 --- a/docs/V1Tender.md +++ b/docs/V1Tender.md @@ -13,7 +13,7 @@ Name | Type | Description | Notes **name** | **String** | A human-readable description of the tender. | [optional] **employeeId** | **String** | The ID of the employee that processed the tender. | [optional] **receiptUrl** | **String** | The URL of the receipt for the tender. | [optional] -**cardBrand** | [**CardBrandEnum**](#CardBrandEnum) | The brand of credit card provided. See [CardBrand](#type-cardbrand) for possible values | [optional] +**cardBrand** | [**CardBrandEnum**](#CardBrandEnum) | The brand of credit card provided. See [V1TenderCardBrand](#type-v1tendercardbrand) for possible values | [optional] **panSuffix** | **String** | The last four digits of the provided credit card's account number. | [optional] **entryMethod** | [**EntryMethodEnum**](#EntryMethodEnum) | The tender's unique ID. See [V1TenderEntryMethod](#type-v1tenderentrymethod) for possible values | [optional] **paymentNote** | **String** | Notes entered by the merchant about the tender at the time of payment, if any. Typically only present for tender with the type: OTHER. | [optional] @@ -46,7 +46,7 @@ Name | Value ---- | ----- OTHER_BRAND | "OTHER_BRAND" VISA | "VISA" -MASTERCARD | "MASTERCARD" +MASTER_CARD | "MASTER_CARD" AMERICAN_EXPRESS | "AMERICAN_EXPRESS" DISCOVER | "DISCOVER" DISCOVER_DINERS | "DISCOVER_DINERS" diff --git a/docs/V1TenderCardBrand.md b/docs/V1TenderCardBrand.md new file mode 100644 index 0000000..16ccc1c --- /dev/null +++ b/docs/V1TenderCardBrand.md @@ -0,0 +1,26 @@ + +# V1TenderCardBrand + +## Enum + + +* `OTHER_BRAND` (value: `"OTHER_BRAND"`) + +* `VISA` (value: `"VISA"`) + +* `MASTER_CARD` (value: `"MASTER_CARD"`) + +* `AMERICAN_EXPRESS` (value: `"AMERICAN_EXPRESS"`) + +* `DISCOVER` (value: `"DISCOVER"`) + +* `DISCOVER_DINERS` (value: `"DISCOVER_DINERS"`) + +* `JCB` (value: `"JCB"`) + +* `CHINA_UNIONPAY` (value: `"CHINA_UNIONPAY"`) + +* `SQUARE_GIFT_CARD` (value: `"SQUARE_GIFT_CARD"`) + + + diff --git a/pom.xml b/pom.xml index 991d1b6..3a9be93 100644 --- a/pom.xml +++ b/pom.xml @@ -5,7 +5,7 @@ connect jar connect - 2.20190410.0 + 2.20190410.1 https://github.com/square/connect-java-sdk/ Java client library for the Square Connect API diff --git a/src/main/java/com/squareup/connect/ApiClient.java b/src/main/java/com/squareup/connect/ApiClient.java index 7d2e95b..58bb0ac 100644 --- a/src/main/java/com/squareup/connect/ApiClient.java +++ b/src/main/java/com/squareup/connect/ApiClient.java @@ -73,7 +73,7 @@ public ApiClient() { this.dateFormat = new RFC3339DateFormat(); // Set default User-Agent. - setUserAgent("Square-Connect-Java/2.20190410.0"); + setUserAgent("Square-Connect-Java/2.20190410.1"); // Setup authentications (key: authentication name, value: authentication). authentications = new HashMap(); diff --git a/src/main/java/com/squareup/connect/api/CatalogApi.java b/src/main/java/com/squareup/connect/api/CatalogApi.java index 2d49547..2b01559 100644 --- a/src/main/java/com/squareup/connect/api/CatalogApi.java +++ b/src/main/java/com/squareup/connect/api/CatalogApi.java @@ -466,7 +466,7 @@ public DeleteCatalogObjectResponse deleteCatalogObject(String objectId) throws A * ListCatalog * Returns a list of [CatalogObject](#type-catalogobject)s that includes all objects of a set of desired types (for example, all [CatalogItem](#type-catalogitem) and [CatalogTax](#type-catalogtax) objects) in the catalog. The types parameter is specified as a comma-separated list of valid [CatalogObject](#type-catalogobject) types: `ITEM`, `ITEM_VARIATION`, `MODIFIER`, `MODIFIER_LIST`, `CATEGORY`, `DISCOUNT`, `TAX`. * @param cursor The pagination cursor returned in the previous response. Leave unset for an initial request. See [Pagination](/basics/api101/pagination) for more information. (optional) - * @param types An optional case-insensitive, comma-separated list of object types to retrieve, for example `ITEM,ITEM_VARIATION,CATEGORY`. The legal values are taken from the [CatalogObjectType](#type-catalogobjecttype) enumeration, namely `\"ITEM\"`, `\"ITEM_VARIATION\"`, `\"CATEGORY\"`, `\"DISCOUNT\"`, `\"TAX\"`, `\"MODIFIER\"`, or `\"MODIFIER_LIST\"`. (optional) + * @param types An optional case-insensitive, comma-separated list of object types to retrieve, for example `ITEM,ITEM_VARIATION,CATEGORY,IMAGE`. The legal values are taken from the [CatalogObjectType](#type-catalogobjecttype) enumeration, namely `ITEM`, `ITEM_VARIATION`, `CATEGORY`, `DISCOUNT`, `TAX`, `MODIFIER`, `MODIFIER_LIST`, or `IMAGE`. (optional) * @return ListCatalogResponse * @throws ApiException if fails to make API call */ @@ -507,7 +507,7 @@ public ListCatalogResponse listCatalog(String cursor, String types) throws ApiEx * ListCatalog * Returns a list of [CatalogObject](#type-catalogobject)s that includes all objects of a set of desired types (for example, all [CatalogItem](#type-catalogitem) and [CatalogTax](#type-catalogtax) objects) in the catalog. The types parameter is specified as a comma-separated list of valid [CatalogObject](#type-catalogobject) types: `ITEM`, `ITEM_VARIATION`, `MODIFIER`, `MODIFIER_LIST`, `CATEGORY`, `DISCOUNT`, `TAX`. * @param cursor The pagination cursor returned in the previous response. Leave unset for an initial request. See [Pagination](/basics/api101/pagination) for more information. (optional) - * @param types An optional case-insensitive, comma-separated list of object types to retrieve, for example `ITEM,ITEM_VARIATION,CATEGORY`. The legal values are taken from the [CatalogObjectType](#type-catalogobjecttype) enumeration, namely `\"ITEM\"`, `\"ITEM_VARIATION\"`, `\"CATEGORY\"`, `\"DISCOUNT\"`, `\"TAX\"`, `\"MODIFIER\"`, or `\"MODIFIER_LIST\"`. (optional) + * @param types An optional case-insensitive, comma-separated list of object types to retrieve, for example `ITEM,ITEM_VARIATION,CATEGORY,IMAGE`. The legal values are taken from the [CatalogObjectType](#type-catalogobjecttype) enumeration, namely `ITEM`, `ITEM_VARIATION`, `CATEGORY`, `DISCOUNT`, `TAX`, `MODIFIER`, `MODIFIER_LIST`, or `IMAGE`. (optional) * @return CompleteResponse * @throws ApiException if fails to make API call */ diff --git a/src/main/java/com/squareup/connect/models/CatalogItem.java b/src/main/java/com/squareup/connect/models/CatalogItem.java index 0d9c545..c89dde3 100644 --- a/src/main/java/com/squareup/connect/models/CatalogItem.java +++ b/src/main/java/com/squareup/connect/models/CatalogItem.java @@ -150,10 +150,10 @@ public CatalogItem abbreviation(String abbreviation) { } /** - * The text of the item's display label in the Square Point of Sale app. Only up to the first five characters of the string are used. Searchable. This field has max length of 24 Unicode code points. + * The text of the item's display label in the Square Point of Sale app. Only up to the first five characters of the string are used. Searchable. This field has max length of 24 Unicode code points. * @return abbreviation **/ - @ApiModelProperty(value = "The text of the item's display label in the Square Point of Sale app. Only up to the first five characters of the string are used. Searchable. This field has max length of 24 Unicode code points.") + @ApiModelProperty(value = "The text of the item's display label in the Square Point of Sale app. Only up to the first five characters of the string are used. Searchable. This field has max length of 24 Unicode code points.") public String getAbbreviation() { return abbreviation; } diff --git a/src/main/java/com/squareup/connect/models/CatalogObject.java b/src/main/java/com/squareup/connect/models/CatalogObject.java index 0505b99..0ad72af 100644 --- a/src/main/java/com/squareup/connect/models/CatalogObject.java +++ b/src/main/java/com/squareup/connect/models/CatalogObject.java @@ -32,9 +32,9 @@ import java.util.List; /** - * The wrapper object for object types in the Catalog data model. The type of a particular `CatalogObject` is determined by the value of `type` and only the corresponding data field may be set. - if type = `ITEM`, only `item_data` will be populated and it will contain a valid [CatalogItem](#type-catalogitem) object. - if type = `ITEM_VARIATION`, only `item_variation_data` will be populated and it will contain a valid [CatalogItemVariation](#type-catalogitemvariation) object. - if type = `MODIFIER`, only `modifier_data` will be populated and it will contain a valid [CatalogModifier](#type-catalogmodifier) object. - if type = `MODIFIER_LIST`, only `modifier_list_data` will be populated and it will contain a valid [CatalogModifierList](#type-catalogmodifierlist) object. - if type = `CATEGORY`, only `category_data` will be populated and it will contain a valid [CatalogCategory](#type-catalogcategory) object. - if type = `DISCOUNT`, only `discount_data` will be populated and it will contain a valid [CatalogDiscount](#type-catalogdiscount) object. - if type = `TAX`, only `tax_data` will be populated and it will contain a valid [CatalogTax](#type-catalogtax) object. For a more detailed discussion of the Catalog data model, please see the [Catalog Overview](/products/catalog/overview). + * The wrapper object for object types in the Catalog data model. The type of a particular `CatalogObject` is determined by the value of `type` and only the corresponding data field may be set. - if type = `ITEM`, only `item_data` will be populated and it will contain a valid [CatalogItem](#type-catalogitem) object. - if type = `ITEM_VARIATION`, only `item_variation_data` will be populated and it will contain a valid [CatalogItemVariation](#type-catalogitemvariation) object. - if type = `MODIFIER`, only `modifier_data` will be populated and it will contain a valid [CatalogModifier](#type-catalogmodifier) object. - if type = `MODIFIER_LIST`, only `modifier_list_data` will be populated and it will contain a valid [CatalogModifierList](#type-catalogmodifierlist) object. - if type = `CATEGORY`, only `category_data` will be populated and it will contain a valid [CatalogCategory](#type-catalogcategory) object. - if type = `DISCOUNT`, only `discount_data` will be populated and it will contain a valid [CatalogDiscount](#type-catalogdiscount) object. - if type = `TAX`, only `tax_data` will be populated and it will contain a valid [CatalogTax](#type-catalogtax) object. - if type = `IMAGE`, only `image_data` will be populated and it will contain a valid [CatalogImage](#type-catalogimage) object. For a more detailed discussion of the Catalog data model, please see the [Catalog Overview](/products/catalog/overview). */ -@ApiModel(description = "The wrapper object for object types in the Catalog data model. The type of a particular `CatalogObject` is determined by the value of `type` and only the corresponding data field may be set. - if type = `ITEM`, only `item_data` will be populated and it will contain a valid [CatalogItem](#type-catalogitem) object. - if type = `ITEM_VARIATION`, only `item_variation_data` will be populated and it will contain a valid [CatalogItemVariation](#type-catalogitemvariation) object. - if type = `MODIFIER`, only `modifier_data` will be populated and it will contain a valid [CatalogModifier](#type-catalogmodifier) object. - if type = `MODIFIER_LIST`, only `modifier_list_data` will be populated and it will contain a valid [CatalogModifierList](#type-catalogmodifierlist) object. - if type = `CATEGORY`, only `category_data` will be populated and it will contain a valid [CatalogCategory](#type-catalogcategory) object. - if type = `DISCOUNT`, only `discount_data` will be populated and it will contain a valid [CatalogDiscount](#type-catalogdiscount) object. - if type = `TAX`, only `tax_data` will be populated and it will contain a valid [CatalogTax](#type-catalogtax) object. For a more detailed discussion of the Catalog data model, please see the [Catalog Overview](/products/catalog/overview).") +@ApiModel(description = "The wrapper object for object types in the Catalog data model. The type of a particular `CatalogObject` is determined by the value of `type` and only the corresponding data field may be set. - if type = `ITEM`, only `item_data` will be populated and it will contain a valid [CatalogItem](#type-catalogitem) object. - if type = `ITEM_VARIATION`, only `item_variation_data` will be populated and it will contain a valid [CatalogItemVariation](#type-catalogitemvariation) object. - if type = `MODIFIER`, only `modifier_data` will be populated and it will contain a valid [CatalogModifier](#type-catalogmodifier) object. - if type = `MODIFIER_LIST`, only `modifier_list_data` will be populated and it will contain a valid [CatalogModifierList](#type-catalogmodifierlist) object. - if type = `CATEGORY`, only `category_data` will be populated and it will contain a valid [CatalogCategory](#type-catalogcategory) object. - if type = `DISCOUNT`, only `discount_data` will be populated and it will contain a valid [CatalogDiscount](#type-catalogdiscount) object. - if type = `TAX`, only `tax_data` will be populated and it will contain a valid [CatalogTax](#type-catalogtax) object. - if type = `IMAGE`, only `image_data` will be populated and it will contain a valid [CatalogImage](#type-catalogimage) object. For a more detailed discussion of the Catalog data model, please see the [Catalog Overview](/products/catalog/overview).") public class CatalogObject { /** @@ -193,10 +193,10 @@ public CatalogObject version(Long version) { } /** - * The version of the object. When updating an object, the version supplied by the must match the version in the database, otherwise the write will be rejected as conflicting. + * The version of the object. When updating an object, the version supplied must match the version in the database, otherwise the write will be rejected as conflicting. * @return version **/ - @ApiModelProperty(value = "The version of the object. When updating an object, the version supplied by the must match the version in the database, otherwise the write will be rejected as conflicting.") + @ApiModelProperty(value = "The version of the object. When updating an object, the version supplied must match the version in the database, otherwise the write will be rejected as conflicting.") public Long getVersion() { return version; } diff --git a/src/main/java/com/squareup/connect/models/CatalogQuery.java b/src/main/java/com/squareup/connect/models/CatalogQuery.java index f0ea848..acf6a7e 100644 --- a/src/main/java/com/squareup/connect/models/CatalogQuery.java +++ b/src/main/java/com/squareup/connect/models/CatalogQuery.java @@ -28,9 +28,9 @@ import io.swagger.annotations.ApiModelProperty; /** - * A query to be applied to a SearchCatalogObjects request. Only one query field may be present. Where an attribute name is required, it should be specified as the name of any field marked \"searchable\" from the structured data types for the desired result object type(s) ([CatalogItem](#type-catalogitem), [CatalogItemVariation](#type-catalogitemvariation), [CatalogCategory](#type-catalogcategory), [CatalogTax](#type-catalogtax), [CatalogDiscount](#type-catalogdiscount), [CatalogModifierList](#type-catalogmodifierlist), [CatalogModifier](#type-catalogmodifier)). For example, a query that should return Items may specify attribute names from any of the searchable fields of the [CatalogItem](#type-catalogitem) data type, namely `\"name\"`, `\"description\"`, and `\"abbreviation\"`. + * A query to be applied to a [SearchCatalogObjectsRequest](#type-searchcatalogobjectsrequest). Only one query field may be present. Where an attribute name is required, it should be specified as the name of any field marked \"searchable\" from the structured data types for the desired result object type(s) ([CatalogItem](#type-catalogitem), [CatalogItemVariation](#type-catalogitemvariation), [CatalogCategory](#type-catalogcategory), [CatalogTax](#type-catalogtax), [CatalogDiscount](#type-catalogdiscount), [CatalogModifierList](#type-catalogmodifierlist), [CatalogModifier](#type-catalogmodifier)). For example, a query that should return Items may specify attribute names from any of the searchable fields of the [CatalogItem](#type-catalogitem) data type, namely `\"name\"`, `\"description\"`, and `\"abbreviation\"`. */ -@ApiModel(description = "A query to be applied to a SearchCatalogObjects request. Only one query field may be present. Where an attribute name is required, it should be specified as the name of any field marked \"searchable\" from the structured data types for the desired result object type(s) ([CatalogItem](#type-catalogitem), [CatalogItemVariation](#type-catalogitemvariation), [CatalogCategory](#type-catalogcategory), [CatalogTax](#type-catalogtax), [CatalogDiscount](#type-catalogdiscount), [CatalogModifierList](#type-catalogmodifierlist), [CatalogModifier](#type-catalogmodifier)). For example, a query that should return Items may specify attribute names from any of the searchable fields of the [CatalogItem](#type-catalogitem) data type, namely `\"name\"`, `\"description\"`, and `\"abbreviation\"`.") +@ApiModel(description = "A query to be applied to a [SearchCatalogObjectsRequest](#type-searchcatalogobjectsrequest). Only one query field may be present. Where an attribute name is required, it should be specified as the name of any field marked \"searchable\" from the structured data types for the desired result object type(s) ([CatalogItem](#type-catalogitem), [CatalogItemVariation](#type-catalogitemvariation), [CatalogCategory](#type-catalogcategory), [CatalogTax](#type-catalogtax), [CatalogDiscount](#type-catalogdiscount), [CatalogModifierList](#type-catalogmodifierlist), [CatalogModifier](#type-catalogmodifier)). For example, a query that should return Items may specify attribute names from any of the searchable fields of the [CatalogItem](#type-catalogitem) data type, namely `\"name\"`, `\"description\"`, and `\"abbreviation\"`.") public class CatalogQuery { @JsonProperty("sorted_attribute_query") diff --git a/src/main/java/com/squareup/connect/models/ChargeRequest.java b/src/main/java/com/squareup/connect/models/ChargeRequest.java index db7d99f..2c82d83 100644 --- a/src/main/java/com/squareup/connect/models/ChargeRequest.java +++ b/src/main/java/com/squareup/connect/models/ChargeRequest.java @@ -184,10 +184,10 @@ public ChargeRequest note(String note) { } /** - * + * An optional note to associate with the transaction. This value cannot exceed 60 characters. * @return note **/ - @ApiModelProperty(value = "") + @ApiModelProperty(value = "An optional note to associate with the transaction. This value cannot exceed 60 characters.") public String getNote() { return note; } diff --git a/src/main/java/com/squareup/connect/models/Employee.java b/src/main/java/com/squareup/connect/models/Employee.java index df4e65d..a3d9f03 100644 --- a/src/main/java/com/squareup/connect/models/Employee.java +++ b/src/main/java/com/squareup/connect/models/Employee.java @@ -37,6 +37,12 @@ public class Employee { @JsonProperty("last_name") private String lastName = null; + @JsonProperty("email") + private String email = null; + + @JsonProperty("phone_number") + private String phoneNumber = null; + @JsonProperty("location_ids") private List locationIds = new ArrayList(); @@ -133,6 +139,42 @@ public void setLastName(String lastName) { this.lastName = lastName; } + public Employee email(String email) { + this.email = email; + return this; + } + + /** + * Email of the employee + * @return email + **/ + @ApiModelProperty(value = "Email of the employee") + public String getEmail() { + return email; + } + + public void setEmail(String email) { + this.email = email; + } + + public Employee phoneNumber(String phoneNumber) { + this.phoneNumber = phoneNumber; + return this; + } + + /** + * Phone number of the employee in E.164 format, i.e. \"+12125554250\" + * @return phoneNumber + **/ + @ApiModelProperty(value = "Phone number of the employee in E.164 format, i.e. \"+12125554250\"") + public String getPhoneNumber() { + return phoneNumber; + } + + public void setPhoneNumber(String phoneNumber) { + this.phoneNumber = phoneNumber; + } + public Employee locationIds(List locationIds) { this.locationIds = locationIds; return this; @@ -223,6 +265,8 @@ public boolean equals(java.lang.Object o) { return Objects.equals(this.id, employee.id) && Objects.equals(this.firstName, employee.firstName) && Objects.equals(this.lastName, employee.lastName) && + Objects.equals(this.email, employee.email) && + Objects.equals(this.phoneNumber, employee.phoneNumber) && Objects.equals(this.locationIds, employee.locationIds) && Objects.equals(this.status, employee.status) && Objects.equals(this.createdAt, employee.createdAt) && @@ -231,7 +275,7 @@ public boolean equals(java.lang.Object o) { @Override public int hashCode() { - return Objects.hash(id, firstName, lastName, locationIds, status, createdAt, updatedAt); + return Objects.hash(id, firstName, lastName, email, phoneNumber, locationIds, status, createdAt, updatedAt); } @@ -243,6 +287,8 @@ public String toString() { sb.append(" id: ").append(toIndentedString(id)).append("\n"); sb.append(" firstName: ").append(toIndentedString(firstName)).append("\n"); sb.append(" lastName: ").append(toIndentedString(lastName)).append("\n"); + sb.append(" email: ").append(toIndentedString(email)).append("\n"); + sb.append(" phoneNumber: ").append(toIndentedString(phoneNumber)).append("\n"); sb.append(" locationIds: ").append(toIndentedString(locationIds)).append("\n"); sb.append(" status: ").append(toIndentedString(status)).append("\n"); sb.append(" createdAt: ").append(toIndentedString(createdAt)).append("\n"); diff --git a/src/main/java/com/squareup/connect/models/ListCatalogRequest.java b/src/main/java/com/squareup/connect/models/ListCatalogRequest.java index 4228ff4..875cb68 100644 --- a/src/main/java/com/squareup/connect/models/ListCatalogRequest.java +++ b/src/main/java/com/squareup/connect/models/ListCatalogRequest.java @@ -56,10 +56,10 @@ public ListCatalogRequest types(String types) { } /** - * An optional case-insensitive, comma-separated list of object types to retrieve, for example `ITEM,ITEM_VARIATION,CATEGORY`. The legal values are taken from the [CatalogObjectType](#type-catalogobjecttype) enumeration, namely `\"ITEM\"`, `\"ITEM_VARIATION\"`, `\"CATEGORY\"`, `\"DISCOUNT\"`, `\"TAX\"`, `\"MODIFIER\"`, or `\"MODIFIER_LIST\"`. + * An optional case-insensitive, comma-separated list of object types to retrieve, for example `ITEM,ITEM_VARIATION,CATEGORY,IMAGE`. The legal values are taken from the [CatalogObjectType](#type-catalogobjecttype) enumeration, namely `ITEM`, `ITEM_VARIATION`, `CATEGORY`, `DISCOUNT`, `TAX`, `MODIFIER`, `MODIFIER_LIST`, or `IMAGE`. * @return types **/ - @ApiModelProperty(value = "An optional case-insensitive, comma-separated list of object types to retrieve, for example `ITEM,ITEM_VARIATION,CATEGORY`. The legal values are taken from the [CatalogObjectType](#type-catalogobjecttype) enumeration, namely `\"ITEM\"`, `\"ITEM_VARIATION\"`, `\"CATEGORY\"`, `\"DISCOUNT\"`, `\"TAX\"`, `\"MODIFIER\"`, or `\"MODIFIER_LIST\"`.") + @ApiModelProperty(value = "An optional case-insensitive, comma-separated list of object types to retrieve, for example `ITEM,ITEM_VARIATION,CATEGORY,IMAGE`. The legal values are taken from the [CatalogObjectType](#type-catalogobjecttype) enumeration, namely `ITEM`, `ITEM_VARIATION`, `CATEGORY`, `DISCOUNT`, `TAX`, `MODIFIER`, `MODIFIER_LIST`, or `IMAGE`.") public String getTypes() { return types; } diff --git a/src/main/java/com/squareup/connect/models/ObtainTokenResponse.java b/src/main/java/com/squareup/connect/models/ObtainTokenResponse.java index eea9da8..91b55f1 100644 --- a/src/main/java/com/squareup/connect/models/ObtainTokenResponse.java +++ b/src/main/java/com/squareup/connect/models/ObtainTokenResponse.java @@ -56,10 +56,10 @@ public ObtainTokenResponse accessToken(String accessToken) { } /** - * A valid OAuth access token. Provide the access token in a header with every request to Connect API endpoints. See the [Build with OAuth](/authz/oauth/build-with-the-api) guide for more information. + * A valid OAuth access token. OAuth access tokens are 64 bytes long. Provide the access token in a header with every request to Connect API endpoints. See the [Build with OAuth](/authz/oauth/build-with-the-api) guide for more information. * @return accessToken **/ - @ApiModelProperty(value = "A valid OAuth access token. Provide the access token in a header with every request to Connect API endpoints. See the [Build with OAuth](/authz/oauth/build-with-the-api) guide for more information.") + @ApiModelProperty(value = "A valid OAuth access token. OAuth access tokens are 64 bytes long. Provide the access token in a header with every request to Connect API endpoints. See the [Build with OAuth](/authz/oauth/build-with-the-api) guide for more information.") public String getAccessToken() { return accessToken; } diff --git a/src/main/java/com/squareup/connect/models/UpsertCatalogObjectRequest.java b/src/main/java/com/squareup/connect/models/UpsertCatalogObjectRequest.java index 51423d9..28106b0 100644 --- a/src/main/java/com/squareup/connect/models/UpsertCatalogObjectRequest.java +++ b/src/main/java/com/squareup/connect/models/UpsertCatalogObjectRequest.java @@ -57,10 +57,10 @@ public UpsertCatalogObjectRequest object(CatalogObject object) { } /** - * A [CatalogObject](#type-catalogobject) to be created or updated. The object's `is_deleted` field must not be set to `true`. When creating a new object, the object's ID must either start with a `#` character or be left blank. In either case it will be replaced with a server-generated ID. + * A [CatalogObject](#type-catalogobject) to be created or updated. - For updates, the object must be active (the `is_deleted` field is not `true`). - For creates, the object ID must start with `#`. The provided ID is replaced with a server-generated ID. * @return object **/ - @ApiModelProperty(required = true, value = "A [CatalogObject](#type-catalogobject) to be created or updated. The object's `is_deleted` field must not be set to `true`. When creating a new object, the object's ID must either start with a `#` character or be left blank. In either case it will be replaced with a server-generated ID.") + @ApiModelProperty(required = true, value = "A [CatalogObject](#type-catalogobject) to be created or updated. - For updates, the object must be active (the `is_deleted` field is not `true`). - For creates, the object ID must start with `#`. The provided ID is replaced with a server-generated ID.") public CatalogObject getObject() { return object; } diff --git a/src/main/java/com/squareup/connect/models/V1Tender.java b/src/main/java/com/squareup/connect/models/V1Tender.java index 31d50bd..44ee703 100644 --- a/src/main/java/com/squareup/connect/models/V1Tender.java +++ b/src/main/java/com/squareup/connect/models/V1Tender.java @@ -85,14 +85,14 @@ public static TypeEnum fromValue(String text) { private String receiptUrl = null; /** - * The brand of credit card provided. See [CardBrand](#type-cardbrand) for possible values + * The brand of credit card provided. See [V1TenderCardBrand](#type-v1tendercardbrand) for possible values */ public enum CardBrandEnum { OTHER_BRAND("OTHER_BRAND"), VISA("VISA"), - MASTERCARD("MASTERCARD"), + MASTER_CARD("MASTER_CARD"), AMERICAN_EXPRESS("AMERICAN_EXPRESS"), @@ -297,10 +297,10 @@ public V1Tender cardBrand(CardBrandEnum cardBrand) { } /** - * The brand of credit card provided. See [CardBrand](#type-cardbrand) for possible values + * The brand of credit card provided. See [V1TenderCardBrand](#type-v1tendercardbrand) for possible values * @return cardBrand **/ - @ApiModelProperty(value = "The brand of credit card provided. See [CardBrand](#type-cardbrand) for possible values") + @ApiModelProperty(value = "The brand of credit card provided. See [V1TenderCardBrand](#type-v1tendercardbrand) for possible values") public CardBrandEnum getCardBrand() { return cardBrand; } diff --git a/src/main/java/com/squareup/connect/models/V1TenderCardBrand.java b/src/main/java/com/squareup/connect/models/V1TenderCardBrand.java new file mode 100644 index 0000000..a3ead04 --- /dev/null +++ b/src/main/java/com/squareup/connect/models/V1TenderCardBrand.java @@ -0,0 +1,65 @@ +/* + * Square Connect API + * Client library for accessing the Square Connect APIs + * + * OpenAPI spec version: 2.0 + * Contact: developers@squareup.com + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + */ + + +package com.squareup.connect.models; + +import java.util.Objects; +import io.swagger.annotations.ApiModel; + +import com.fasterxml.jackson.annotation.JsonCreator; + +/** + * The brand of a credit card. + */ +public enum V1TenderCardBrand { + + OTHER_BRAND("OTHER_BRAND"), + + VISA("VISA"), + + MASTER_CARD("MASTER_CARD"), + + AMERICAN_EXPRESS("AMERICAN_EXPRESS"), + + DISCOVER("DISCOVER"), + + DISCOVER_DINERS("DISCOVER_DINERS"), + + JCB("JCB"), + + CHINA_UNIONPAY("CHINA_UNIONPAY"), + + SQUARE_GIFT_CARD("SQUARE_GIFT_CARD"); + + private String value; + + V1TenderCardBrand(String value) { + this.value = value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static V1TenderCardBrand fromValue(String text) { + for (V1TenderCardBrand b : V1TenderCardBrand.values()) { + if (String.valueOf(b.value).equals(text)) { + return b; + } + } + return null; + } +} +