diff --git a/CHANGES.md b/CHANGES.md index 494fe69..727dfa0 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -1,5 +1,15 @@ # Change Log +## Version 2.4 (2017-09-27) + +### New features: Register Domain for Apple Pay + +* `RegisterDomain` endpoint activates a domain for use with Web Apple Pay. + +### Other Changes + +* `Location.type` used to indicate whether or not the location object represents a physical space. + ## Version 2.3.1 (2017-09-15) ### New features: Charge Orders diff --git a/README.md b/README.md index f48f79e..e69e302 100644 --- a/README.md +++ b/README.md @@ -18,7 +18,7 @@ Add this dependency to your project's POM: com.squareup connect - 2.3.1 + 2.4.0 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.3.1" +compile "com.squareup:connect:2.4.0" ``` ### Build and Install locally @@ -47,7 +47,7 @@ At first generate the JAR by executing: Then manually install the following JARs: -* target/connect-2.3.1.jar +* target/connect-2.4.0.jar * target/lib/*.jar ## Getting Started @@ -59,12 +59,12 @@ Please follow the [installation](#installation) instruction and execute the foll import com.squareup.connect.*; import com.squareup.connect.auth.*; import com.squareup.connect.models.*; -import com.squareup.connect.api.CatalogApi; +import com.squareup.connect.api.ApplePayApi; import java.io.File; import java.util.*; -public class CatalogApiExample { +public class ApplePayApiExample { public static void main(String[] args) { ApiClient defaultClient = Configuration.getDefaultApiClient(); @@ -73,13 +73,13 @@ public class CatalogApiExample { OAuth oauth2 = (OAuth) defaultClient.getAuthentication("oauth2"); oauth2.setAccessToken("YOUR ACCESS TOKEN"); - CatalogApi apiInstance = new CatalogApi(); - BatchDeleteCatalogObjectsRequest body = new BatchDeleteCatalogObjectsRequest(); // BatchDeleteCatalogObjectsRequest | An object containing the fields to POST for the request. See the corresponding object definition for field details. + ApplePayApi apiInstance = new ApplePayApi(); + RegisterDomainRequest body = new RegisterDomainRequest(); // RegisterDomainRequest | An object containing the fields to POST for the request. See the corresponding object definition for field details. try { - BatchDeleteCatalogObjectsResponse result = apiInstance.batchDeleteCatalogObjects(body); + RegisterDomainResponse result = apiInstance.registerDomain(body); System.out.println(result); } catch (ApiException e) { - System.err.println("Exception when calling CatalogApi#batchDeleteCatalogObjects"); + System.err.println("Exception when calling ApplePayApi#registerDomain"); e.printStackTrace(); } } @@ -93,6 +93,7 @@ All URIs are relative to *https://connect.squareup.com* Class | Method | HTTP request | Description ------------ | ------------- | ------------- | ------------- +*ApplePayApi* | [**registerDomain**](docs/ApplePayApi.md#registerDomain) | **POST** /v2/apple-pay/domains | RegisterDomain *CatalogApi* | [**batchDeleteCatalogObjects**](docs/CatalogApi.md#batchDeleteCatalogObjects) | **POST** /v2/catalog/batch-delete | BatchDeleteCatalogObjects *CatalogApi* | [**batchRetrieveCatalogObjects**](docs/CatalogApi.md#batchRetrieveCatalogObjects) | **POST** /v2/catalog/batch-retrieve | BatchRetrieveCatalogObjects *CatalogApi* | [**batchUpsertCatalogObjects**](docs/CatalogApi.md#batchUpsertCatalogObjects) | **POST** /v2/catalog/batch-upsert | BatchUpsertCatalogObjects @@ -284,6 +285,7 @@ Class | Method | HTTP request | Description - [Location](docs/Location.md) - [LocationCapability](docs/LocationCapability.md) - [LocationStatus](docs/LocationStatus.md) + - [LocationType](docs/LocationType.md) - [Money](docs/Money.md) - [Order](docs/Order.md) - [OrderLineItem](docs/OrderLineItem.md) @@ -295,6 +297,9 @@ Class | Method | HTTP request | Description - [OrderLineItemTaxType](docs/OrderLineItemTaxType.md) - [Refund](docs/Refund.md) - [RefundStatus](docs/RefundStatus.md) + - [RegisterDomainRequest](docs/RegisterDomainRequest.md) + - [RegisterDomainResponse](docs/RegisterDomainResponse.md) + - [RegisterDomainResponseStatus](docs/RegisterDomainResponseStatus.md) - [RetrieveCatalogObjectRequest](docs/RetrieveCatalogObjectRequest.md) - [RetrieveCatalogObjectResponse](docs/RetrieveCatalogObjectResponse.md) - [RetrieveCustomerRequest](docs/RetrieveCustomerRequest.md) diff --git a/build.gradle b/build.gradle index e5dfa54..1b63454 100644 --- a/build.gradle +++ b/build.gradle @@ -2,7 +2,7 @@ apply plugin: 'idea' apply plugin: 'eclipse' group = 'com.squareup' -version = '2.3.1' +version = '2.4.0' buildscript { repositories { diff --git a/docs/ApplePayApi.md b/docs/ApplePayApi.md new file mode 100644 index 0000000..af61f6d --- /dev/null +++ b/docs/ApplePayApi.md @@ -0,0 +1,62 @@ +# ApplePayApi + +All URIs are relative to *https://connect.squareup.com* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**registerDomain**](ApplePayApi.md#registerDomain) | **POST** /v2/apple-pay/domains | RegisterDomain + + + +# **registerDomain** +> RegisterDomainResponse registerDomain(body) + +RegisterDomain + +Activates a domain for use with Web Apple Pay and Square. A validation will be performed on this domain by Apple to ensure is it properly set up as an Apple Pay enabled domain. This endpoint provides an easy way for platform developers to bulk activate Web Apple Pay with Square for merchants using their platform. To learn more about Apple Pay on Web see the Apple Pay section in the [Embedding the Square Payment Form](https://docs.connect.squareup.com/articles/adding-payment-form) guide. + +### Example +```java +// Import classes: +//import com.squareup.connect.ApiClient; +//import com.squareup.connect.ApiException; +//import com.squareup.connect.Configuration; +//import com.squareup.connect.auth.*; +//import com.squareup.connect.api.ApplePayApi; + +ApiClient defaultClient = Configuration.getDefaultApiClient(); + +// Configure OAuth2 access token for authorization: oauth2 +OAuth oauth2 = (OAuth) defaultClient.getAuthentication("oauth2"); +oauth2.setAccessToken("YOUR ACCESS TOKEN"); + +ApplePayApi apiInstance = new ApplePayApi(); +RegisterDomainRequest body = new RegisterDomainRequest(); // RegisterDomainRequest | An object containing the fields to POST for the request. See the corresponding object definition for field details. +try { + RegisterDomainResponse result = apiInstance.registerDomain(body); + System.out.println(result); +} catch (ApiException e) { + System.err.println("Exception when calling ApplePayApi#registerDomain"); + e.printStackTrace(); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **body** | [**RegisterDomainRequest**](RegisterDomainRequest.md)| An object containing the fields to POST for the request. See the corresponding object definition for field details. | + +### Return type + +[**RegisterDomainResponse**](RegisterDomainResponse.md) + +### Authorization + +[oauth2](../README.md#oauth2) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + diff --git a/docs/CatalogObject.md b/docs/CatalogObject.md index e50fd8a..c93c9a0 100644 --- a/docs/CatalogObject.md +++ b/docs/CatalogObject.md @@ -10,7 +10,7 @@ Name | Type | Description | Notes **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] **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. | [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] **presentAtLocationIds** | **List<String>** | A list of locations where the object is present, even if `present_at_all_locations` is `false`. | [optional] **absentAtLocationIds** | **List<String>** | A list of locations where the object is not present, even if `present_at_all_locations` is `true`. | [optional] **itemData** | [**CatalogItem**](CatalogItem.md) | Structured data for a [CatalogItem](#type-catalogitem), set for CatalogObjects of type `ITEM`. | [optional] diff --git a/docs/Location.md b/docs/Location.md index 8016e6b..77cfc47 100644 --- a/docs/Location.md +++ b/docs/Location.md @@ -5,7 +5,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **id** | **String** | The location's unique ID. | [optional] -**name** | **String** | The location's name. Location names are set by the location owner and displayed in the dashboard as the location's nickname | [optional] +**name** | **String** | The location's name. Location names are set by the account owner and displayed in the dashboard as the location's nickname | [optional] **address** | [**Address**](Address.md) | The location's physical address. | [optional] **timezone** | **String** | The [IANA Timezone Database](https://www.iana.org/time-zones) identifier for the location's timezone. | [optional] **capabilities** | [**List<CapabilitiesEnum>**](#List<CapabilitiesEnum>) | Indicates which Square features are enabled for the location. See [LocationCapability](#type-locationcapability) for possible values. | [optional] @@ -17,6 +17,7 @@ Name | Type | Description | Notes **currency** | [**CurrencyEnum**](#CurrencyEnum) | The currency used for all transactions at this location, specified in __ISO 4217 format__. For example, the currency for a location processing transactions in the United States is 'USD'. See [Currency](#type-currency) for possible values. | [optional] **phoneNumber** | **String** | The location's phone_number. | [optional] **businessName** | **String** | The location's business_name which is shown to its customers. For example, this is the name printed on its customer's receipts. | [optional] +**type** | [**TypeEnum**](#TypeEnum) | The location's type, as set by the account owner in the Square dashboard. Typically used to indicate whether or not the location object represents a physical space like a building or mall space. See [LocationType](#type-locationtype) for possible values. | [optional] @@ -477,4 +478,12 @@ ZMW | "ZMW" BTC | "BTC" + +## Enum: TypeEnum +Name | Value +---- | ----- +PHYSICAL | "PHYSICAL" +MOBILE | "MOBILE" + + diff --git a/docs/LocationType.md b/docs/LocationType.md new file mode 100644 index 0000000..61dd0f3 --- /dev/null +++ b/docs/LocationType.md @@ -0,0 +1,12 @@ + +# LocationType + +## Enum + + +* `PHYSICAL` (value: `"PHYSICAL"`) + +* `MOBILE` (value: `"MOBILE"`) + + + diff --git a/docs/RegisterDomainRequest.md b/docs/RegisterDomainRequest.md new file mode 100644 index 0000000..12ab35b --- /dev/null +++ b/docs/RegisterDomainRequest.md @@ -0,0 +1,10 @@ + +# RegisterDomainRequest + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**domainName** | **String** | A domain name as described in RFC-1034 that will be registered with ApplePay | + + + diff --git a/docs/RegisterDomainResponse.md b/docs/RegisterDomainResponse.md new file mode 100644 index 0000000..9fc9a0d --- /dev/null +++ b/docs/RegisterDomainResponse.md @@ -0,0 +1,19 @@ + +# RegisterDomainResponse + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**errors** | [**List<Error>**](Error.md) | Any errors that occurred during the request. | [optional] +**status** | [**StatusEnum**](#StatusEnum) | Status of the domain registration. See [RegisterDomainResponseStatus](#type-registerdomainresponsestatus) for possible values. | [optional] + + + +## Enum: StatusEnum +Name | Value +---- | ----- +PENDING | "PENDING" +VERIFIED | "VERIFIED" + + + diff --git a/docs/RegisterDomainResponseStatus.md b/docs/RegisterDomainResponseStatus.md new file mode 100644 index 0000000..97a2b36 --- /dev/null +++ b/docs/RegisterDomainResponseStatus.md @@ -0,0 +1,12 @@ + +# RegisterDomainResponseStatus + +## Enum + + +* `PENDING` (value: `"PENDING"`) + +* `VERIFIED` (value: `"VERIFIED"`) + + + diff --git a/pom.xml b/pom.xml index 83651a5..6616d23 100644 --- a/pom.xml +++ b/pom.xml @@ -5,7 +5,7 @@ connect jar connect - 2.3.1 + 2.4.0 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 a03a543..ed1f7e7 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.3.1"); + setUserAgent("Square-Connect-Java/2.4.0"); // Setup authentications (key: authentication name, value: authentication). authentications = new HashMap(); diff --git a/src/main/java/com/squareup/connect/api/ApplePayApi.java b/src/main/java/com/squareup/connect/api/ApplePayApi.java new file mode 100644 index 0000000..db0eb5d --- /dev/null +++ b/src/main/java/com/squareup/connect/api/ApplePayApi.java @@ -0,0 +1,123 @@ +package com.squareup.connect.api; + +import com.squareup.connect.ApiException; +import com.squareup.connect.ApiClient; +import com.squareup.connect.Configuration; +import com.squareup.connect.Pair; +import com.squareup.connect.CompleteResponse; + +import javax.ws.rs.core.GenericType; + +import com.squareup.connect.models.RegisterDomainRequest; +import com.squareup.connect.models.RegisterDomainResponse; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + + +public class ApplePayApi { + private ApiClient apiClient; + + public ApplePayApi() { + this(Configuration.getDefaultApiClient()); + } + + public ApplePayApi(ApiClient apiClient) { + this.apiClient = apiClient; + } + + public ApiClient getApiClient() { + return apiClient; + } + + public void setApiClient(ApiClient apiClient) { + this.apiClient = apiClient; + } + + /** + * RegisterDomain + * Activates a domain for use with Web Apple Pay and Square. A validation will be performed on this domain by Apple to ensure is it properly set up as an Apple Pay enabled domain. This endpoint provides an easy way for platform developers to bulk activate Web Apple Pay with Square for merchants using their platform. To learn more about Apple Pay on Web see the Apple Pay section in the [Embedding the Square Payment Form](https://docs.connect.squareup.com/articles/adding-payment-form) guide. + * @param body An object containing the fields to POST for the request. See the corresponding object definition for field details. (required) + * @return RegisterDomainResponse + * @throws ApiException if fails to make API call + */ + public RegisterDomainResponse registerDomain(RegisterDomainRequest body) throws ApiException { + Object localVarPostBody = body; + + // verify the required parameter 'body' is set + if (body == null) { + throw new ApiException(400, "Missing the required parameter 'body' when calling registerDomain"); + } + + // create path and map variables + String localVarPath = "/v2/apple-pay/domains"; + + // query params + List localVarQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + + + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + + final String[] localVarContentTypes = { + "application/json" + }; + final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + + String[] localVarAuthNames = new String[] { "oauth2" }; + + GenericType localVarReturnType = new GenericType() {}; + CompleteResponse completeResponse = (CompleteResponse)apiClient.invokeAPI(localVarPath, "POST", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType); + return completeResponse.getData(); + } + + /** + * RegisterDomain + * Activates a domain for use with Web Apple Pay and Square. A validation will be performed on this domain by Apple to ensure is it properly set up as an Apple Pay enabled domain. This endpoint provides an easy way for platform developers to bulk activate Web Apple Pay with Square for merchants using their platform. To learn more about Apple Pay on Web see the Apple Pay section in the [Embedding the Square Payment Form](https://docs.connect.squareup.com/articles/adding-payment-form) guide. + * @param body An object containing the fields to POST for the request. See the corresponding object definition for field details. (required) + * @return CompleteResponse + * @throws ApiException if fails to make API call + */ + public CompleteResponseregisterDomainWithHttpInfo(RegisterDomainRequest body) throws ApiException { + Object localVarPostBody = body; + + // verify the required parameter 'body' is set + if (body == null) { + throw new ApiException(400, "Missing the required parameter 'body' when calling registerDomain"); + } + + // create path and map variables + String localVarPath = "/v2/apple-pay/domains"; + + // query params + List localVarQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + + + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + + final String[] localVarContentTypes = { + "application/json" + }; + final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + + String[] localVarAuthNames = new String[] { "oauth2" }; + + GenericType localVarReturnType = new GenericType() {}; + return (CompleteResponse)apiClient.invokeAPI(localVarPath, "POST", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType); + } +} diff --git a/src/main/java/com/squareup/connect/models/CatalogObject.java b/src/main/java/com/squareup/connect/models/CatalogObject.java index de71114..a7649b5 100644 --- a/src/main/java/com/squareup/connect/models/CatalogObject.java +++ b/src/main/java/com/squareup/connect/models/CatalogObject.java @@ -243,10 +243,10 @@ public CatalogObject presentAtAllLocations(Boolean presentAtAllLocations) { } /** - * 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 `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`. * @return presentAtAllLocations **/ - @ApiModelProperty(value = "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.") + @ApiModelProperty(value = "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`.") public Boolean getPresentAtAllLocations() { return presentAtAllLocations; } diff --git a/src/main/java/com/squareup/connect/models/Location.java b/src/main/java/com/squareup/connect/models/Location.java index 475c1fe..40b316b 100644 --- a/src/main/java/com/squareup/connect/models/Location.java +++ b/src/main/java/com/squareup/connect/models/Location.java @@ -1040,6 +1040,39 @@ public static CurrencyEnum fromValue(String text) { @JsonProperty("business_name") private String businessName = null; + /** + * The location's type, as set by the account owner in the Square dashboard. Typically used to indicate whether or not the location object represents a physical space like a building or mall space. See [LocationType](#type-locationtype) for possible values. + */ + public enum TypeEnum { + PHYSICAL("PHYSICAL"), + + MOBILE("MOBILE"); + + private String value; + + TypeEnum(String value) { + this.value = value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static TypeEnum fromValue(String text) { + for (TypeEnum b : TypeEnum.values()) { + if (String.valueOf(b.value).equals(text)) { + return b; + } + } + return null; + } + } + + @JsonProperty("type") + private TypeEnum type = null; + public Location id(String id) { this.id = id; return this; @@ -1064,10 +1097,10 @@ public Location name(String name) { } /** - * The location's name. Location names are set by the location owner and displayed in the dashboard as the location's nickname + * The location's name. Location names are set by the account owner and displayed in the dashboard as the location's nickname * @return name **/ - @ApiModelProperty(value = "The location's name. Location names are set by the location owner and displayed in the dashboard as the location's nickname") + @ApiModelProperty(value = "The location's name. Location names are set by the account owner and displayed in the dashboard as the location's nickname") public String getName() { return name; } @@ -1279,6 +1312,24 @@ public void setBusinessName(String businessName) { this.businessName = businessName; } + public Location type(TypeEnum type) { + this.type = type; + return this; + } + + /** + * The location's type, as set by the account owner in the Square dashboard. Typically used to indicate whether or not the location object represents a physical space like a building or mall space. See [LocationType](#type-locationtype) for possible values. + * @return type + **/ + @ApiModelProperty(value = "The location's type, as set by the account owner in the Square dashboard. Typically used to indicate whether or not the location object represents a physical space like a building or mall space. See [LocationType](#type-locationtype) for possible values.") + public TypeEnum getType() { + return type; + } + + public void setType(TypeEnum type) { + this.type = type; + } + @Override public boolean equals(java.lang.Object o) { @@ -1301,12 +1352,13 @@ public boolean equals(java.lang.Object o) { Objects.equals(this.languageCode, location.languageCode) && Objects.equals(this.currency, location.currency) && Objects.equals(this.phoneNumber, location.phoneNumber) && - Objects.equals(this.businessName, location.businessName); + Objects.equals(this.businessName, location.businessName) && + Objects.equals(this.type, location.type); } @Override public int hashCode() { - return Objects.hash(id, name, address, timezone, capabilities, status, createdAt, merchantId, country, languageCode, currency, phoneNumber, businessName); + return Objects.hash(id, name, address, timezone, capabilities, status, createdAt, merchantId, country, languageCode, currency, phoneNumber, businessName, type); } @@ -1328,6 +1380,7 @@ public String toString() { sb.append(" currency: ").append(toIndentedString(currency)).append("\n"); sb.append(" phoneNumber: ").append(toIndentedString(phoneNumber)).append("\n"); sb.append(" businessName: ").append(toIndentedString(businessName)).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); sb.append("}"); return sb.toString(); } diff --git a/src/main/java/com/squareup/connect/models/LocationCapability.java b/src/main/java/com/squareup/connect/models/LocationCapability.java index 2b4defb..3e97088 100644 --- a/src/main/java/com/squareup/connect/models/LocationCapability.java +++ b/src/main/java/com/squareup/connect/models/LocationCapability.java @@ -19,7 +19,7 @@ import com.fasterxml.jackson.annotation.JsonCreator; /** - * Indicates account capabilities that a business's location might or might not have enabled. + * Indicates payment capabilities that a business's location might or might not have enabled. */ public enum LocationCapability { diff --git a/src/main/java/com/squareup/connect/models/LocationType.java b/src/main/java/com/squareup/connect/models/LocationType.java new file mode 100644 index 0000000..09f5056 --- /dev/null +++ b/src/main/java/com/squareup/connect/models/LocationType.java @@ -0,0 +1,51 @@ +/* + * 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; + +/** + * Indicates the location's type. + */ +public enum LocationType { + + PHYSICAL("PHYSICAL"), + + MOBILE("MOBILE"); + + private String value; + + LocationType(String value) { + this.value = value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static LocationType fromValue(String text) { + for (LocationType b : LocationType.values()) { + if (String.valueOf(b.value).equals(text)) { + return b; + } + } + return null; + } +} + diff --git a/src/main/java/com/squareup/connect/models/RegisterDomainRequest.java b/src/main/java/com/squareup/connect/models/RegisterDomainRequest.java new file mode 100644 index 0000000..aaa4174 --- /dev/null +++ b/src/main/java/com/squareup/connect/models/RegisterDomainRequest.java @@ -0,0 +1,91 @@ +/* + * 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 com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; + +/** + * Defines the parameters that can be included in the body of a request to the [RegisterDomain](#endpoint-registerdomain) endpoint. + */ +@ApiModel(description = "Defines the parameters that can be included in the body of a request to the [RegisterDomain](#endpoint-registerdomain) endpoint.") + +public class RegisterDomainRequest { + @JsonProperty("domain_name") + private String domainName = null; + + public RegisterDomainRequest domainName(String domainName) { + this.domainName = domainName; + return this; + } + + /** + * A domain name as described in RFC-1034 that will be registered with ApplePay + * @return domainName + **/ + @ApiModelProperty(required = true, value = "A domain name as described in RFC-1034 that will be registered with ApplePay") + public String getDomainName() { + return domainName; + } + + public void setDomainName(String domainName) { + this.domainName = domainName; + } + + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + RegisterDomainRequest registerDomainRequest = (RegisterDomainRequest) o; + return Objects.equals(this.domainName, registerDomainRequest.domainName); + } + + @Override + public int hashCode() { + return Objects.hash(domainName); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class RegisterDomainRequest {\n"); + + sb.append(" domainName: ").append(toIndentedString(domainName)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/src/main/java/com/squareup/connect/models/RegisterDomainResponse.java b/src/main/java/com/squareup/connect/models/RegisterDomainResponse.java new file mode 100644 index 0000000..dd56e09 --- /dev/null +++ b/src/main/java/com/squareup/connect/models/RegisterDomainResponse.java @@ -0,0 +1,152 @@ +/* + * 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 com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import com.squareup.connect.models.Error; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.util.ArrayList; +import java.util.List; + +/** + * Defines the fields that are included in the response body of a request to the [RegisterDomain](#endpoint-registerdomain) endpoint. Either `errors` or `status` will be present in a given response (never both). + */ +@ApiModel(description = "Defines the fields that are included in the response body of a request to the [RegisterDomain](#endpoint-registerdomain) endpoint. Either `errors` or `status` will be present in a given response (never both).") + +public class RegisterDomainResponse { + @JsonProperty("errors") + private List errors = new ArrayList(); + + /** + * Status of the domain registration. See [RegisterDomainResponseStatus](#type-registerdomainresponsestatus) for possible values. + */ + public enum StatusEnum { + PENDING("PENDING"), + + VERIFIED("VERIFIED"); + + private String value; + + StatusEnum(String value) { + this.value = value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static StatusEnum fromValue(String text) { + for (StatusEnum b : StatusEnum.values()) { + if (String.valueOf(b.value).equals(text)) { + return b; + } + } + return null; + } + } + + @JsonProperty("status") + private StatusEnum status = null; + + public RegisterDomainResponse errors(List errors) { + this.errors = errors; + return this; + } + + public RegisterDomainResponse addErrorsItem(Error errorsItem) { + this.errors.add(errorsItem); + return this; + } + + /** + * Any errors that occurred during the request. + * @return errors + **/ + @ApiModelProperty(value = "Any errors that occurred during the request.") + public List getErrors() { + return errors; + } + + public void setErrors(List errors) { + this.errors = errors; + } + + public RegisterDomainResponse status(StatusEnum status) { + this.status = status; + return this; + } + + /** + * Status of the domain registration. See [RegisterDomainResponseStatus](#type-registerdomainresponsestatus) for possible values. + * @return status + **/ + @ApiModelProperty(value = "Status of the domain registration. See [RegisterDomainResponseStatus](#type-registerdomainresponsestatus) for possible values.") + public StatusEnum getStatus() { + return status; + } + + public void setStatus(StatusEnum status) { + this.status = status; + } + + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + RegisterDomainResponse registerDomainResponse = (RegisterDomainResponse) o; + return Objects.equals(this.errors, registerDomainResponse.errors) && + Objects.equals(this.status, registerDomainResponse.status); + } + + @Override + public int hashCode() { + return Objects.hash(errors, status); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class RegisterDomainResponse {\n"); + + sb.append(" errors: ").append(toIndentedString(errors)).append("\n"); + sb.append(" status: ").append(toIndentedString(status)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/src/main/java/com/squareup/connect/models/RegisterDomainResponseStatus.java b/src/main/java/com/squareup/connect/models/RegisterDomainResponseStatus.java new file mode 100644 index 0000000..c19bbc3 --- /dev/null +++ b/src/main/java/com/squareup/connect/models/RegisterDomainResponseStatus.java @@ -0,0 +1,51 @@ +/* + * 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 status of domain registration. + */ +public enum RegisterDomainResponseStatus { + + PENDING("PENDING"), + + VERIFIED("VERIFIED"); + + private String value; + + RegisterDomainResponseStatus(String value) { + this.value = value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static RegisterDomainResponseStatus fromValue(String text) { + for (RegisterDomainResponseStatus b : RegisterDomainResponseStatus.values()) { + if (String.valueOf(b.value).equals(text)) { + return b; + } + } + return null; + } +} +