diff --git a/.travis.yml b/.travis.yml index 245e252..8dc22c8 100644 --- a/.travis.yml +++ b/.travis.yml @@ -12,7 +12,7 @@ install: script: - export frameworkVersion=net45 - - export releaseVersion="2.1.0" + - export releaseVersion="2.2.0" - /bin/sh ./mono_nunit_test.sh after_success: diff --git a/README.md b/README.md index 1c83bde..d5d8f2f 100644 --- a/README.md +++ b/README.md @@ -252,8 +252,10 @@ Class | Method | HTTP request - [Model.CreateCustomerCardResponse](docs/CreateCustomerCardResponse.md) - [Model.CreateCustomerRequest](docs/CreateCustomerRequest.md) - [Model.CreateCustomerResponse](docs/CreateCustomerResponse.md) + - [Model.CreateOrderRequest](docs/CreateOrderRequest.md) + - [Model.CreateOrderRequestDiscount](docs/CreateOrderRequestDiscount.md) - [Model.CreateOrderRequestLineItem](docs/CreateOrderRequestLineItem.md) - - [Model.CreateOrderRequestOrder](docs/CreateOrderRequestOrder.md) + - [Model.CreateOrderRequestTax](docs/CreateOrderRequestTax.md) - [Model.CreateRefundRequest](docs/CreateRefundRequest.md) - [Model.CreateRefundResponse](docs/CreateRefundResponse.md) - [Model.Customer](docs/Customer.md) @@ -282,6 +284,8 @@ Class | Method | HTTP request - [Model.Money](docs/Money.md) - [Model.Order](docs/Order.md) - [Model.OrderLineItem](docs/OrderLineItem.md) + - [Model.OrderLineItemDiscount](docs/OrderLineItemDiscount.md) + - [Model.OrderLineItemTax](docs/OrderLineItemTax.md) - [Model.Refund](docs/Refund.md) - [Model.RetrieveCatalogObjectRequest](docs/RetrieveCatalogObjectRequest.md) - [Model.RetrieveCatalogObjectResponse](docs/RetrieveCatalogObjectResponse.md) @@ -364,8 +368,8 @@ Class | Method | HTTP request - BANK_ACCOUNTS_READ: GET endpoints related to a merchant's bank accounts - ITEMS_READ: GET endpoints related to a merchant's item library - ITEMS_WRITE: POST, PUT, and DELETE endpoints related to a merchant's item library - - ORDERS_READ: GET endpoints related to a merchant's Square online store. - - ORDERS_WRITE: POST, PUT, and DELETE endpoints related to a merchant's Square online store + - ORDERS_READ: GET endpoints related to a merchant's orders + - ORDERS_WRITE: POST, PUT, and DELETE endpoints related to a merchant's orders - EMPLOYEES_READ: GET endpoints related to employee management - EMPLOYEES_WRITE: POST, PUT, and DELETE endpoints related to employee management - TIMECARDS_READ: GET endpoints related to employee timecards diff --git a/docs/Card.md b/docs/Card.md index 30e79e1..6aa8e7c 100644 --- a/docs/Card.md +++ b/docs/Card.md @@ -10,6 +10,7 @@ Name | Type | Description | Notes **ExpYear** | **long?** | The four-digit year of the card's expiration date. | [optional] **CardholderName** | **string** | The cardholder name. This value is present only if this object represents a customer's card on file. | [optional] **BillingAddress** | [**Address**](Address.md) | The card's billing address. This value is present only if this object represents a customer's card on file. | [optional] +**Fingerprint** | **string** | The unique string fingerprint for the card. The fingerprint is based on the credit card number and is unique to the merchant. If a card is used at multiple locations for the same merchant, it will have the same fingerprint in each case. Note: Fingerprint may not exist on old transactions. | [optional] ## CardBrandEnum diff --git a/docs/CatalogApi.md b/docs/CatalogApi.md index 3b8652b..7aba76b 100644 --- a/docs/CatalogApi.md +++ b/docs/CatalogApi.md @@ -88,7 +88,7 @@ Name | Type | Description | Notes BatchRetrieveCatalogObjects -Returns a set of objects based on the provided ID. [CatalogItem](#type-catalogitem)s returned in the set include all of the child information including: all [CatalogItemVariation](#type-catalogitemvariation) objects, references to its [CatalogModifierList](#type-catalogmodifierlist) objects, and the ids of any [CatalogTax](#type-catalogtax) objects that apply to it. +Returns a set of objects based on the provided ID. Each [CatalogItem](#type-catalogitem) returned in the set includes all of its child information including: all of its [CatalogItemVariation](#type-catalogitemvariation) objects, references to its [CatalogModifierList](#type-catalogmodifierlist) objects, and the ids of any [CatalogTax](#type-catalogtax) objects that apply to it. ### Example ```csharp @@ -433,7 +433,7 @@ namespace Example var apiInstance = new CatalogApi(); var objectId = objectId_example; // string | The object ID of any type of [CatalogObject](#type-catalogobject)s to be retrieved. - var includeRelatedObjects = true; // bool? | If `true`, the response will include additional objects that are related to the requested object, as follows: If the `object` field of the response contains a [CatalogItem](#type-catalogitem), its associated [CatalogCategory](#type-catalogcategory), [CatalogTax](#type-catalogtax)es, and [CatalogModifierList](#type-catalogmodifierlist)s will be returned in the `related_objects` field of the response. If the `object` field of the response contains a [CatalogItemVariation](#type-catalogitemvariation), its parent [CatalogItem](#type-catalogitem) will be returned in the `related_objects` field of the response. (optional) + var includeRelatedObjects = true; // bool? | If `true`, the response will include additional objects that are related to the requested object, as follows: If the `object` field of the response contains a [CatalogItem](#type-catalogitem), its associated [CatalogCategory](#type-catalogcategory), [CatalogTax](#type-catalogtax)es, and [CatalogModifierList](#type-catalogmodifierlist)s will be returned in the `related_objects` field of the response. If the `object` field of the response contains a [CatalogItemVariation](#type-catalogitemvariation), its parent [CatalogItem](#type-catalogitem) will be returned in the `related_objects` field of the response. Default value: `false` (optional) try { @@ -455,7 +455,7 @@ namespace Example Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **objectId** | **string**| The object ID of any type of [CatalogObject](#type-catalogobject)s to be retrieved. | - **includeRelatedObjects** | **bool?**| If `true`, the response will include additional objects that are related to the requested object, as follows: If the `object` field of the response contains a [CatalogItem](#type-catalogitem), its associated [CatalogCategory](#type-catalogcategory), [CatalogTax](#type-catalogtax)es, and [CatalogModifierList](#type-catalogmodifierlist)s will be returned in the `related_objects` field of the response. If the `object` field of the response contains a [CatalogItemVariation](#type-catalogitemvariation), its parent [CatalogItem](#type-catalogitem) will be returned in the `related_objects` field of the response. | [optional] + **includeRelatedObjects** | **bool?**| If `true`, the response will include additional objects that are related to the requested object, as follows: If the `object` field of the response contains a [CatalogItem](#type-catalogitem), its associated [CatalogCategory](#type-catalogcategory), [CatalogTax](#type-catalogtax)es, and [CatalogModifierList](#type-catalogmodifierlist)s will be returned in the `related_objects` field of the response. If the `object` field of the response contains a [CatalogItemVariation](#type-catalogitemvariation), its parent [CatalogItem](#type-catalogitem) will be returned in the `related_objects` field of the response. Default value: `false` | [optional] ### Return type @@ -478,7 +478,7 @@ Name | Type | Description | Notes SearchCatalogObjects -Queries the targeted catalog using a variety of query types ([CatalogQuerySortedAttribute](#type-catalogquerysortedattribute), ([CatalogQueryExact](#type-catalogqueryexact, ([CatalogQueryRange](#type-catalogqueryrange), ([CatalogQueryText](#type-catalogquerytext), ([CatalogQueryItemsForTax](#type-catalogqueryitemsfortax), ([CatalogQueryItemsForModifierList](#type-catalogqueryitemsformodifierlist)). +Queries the targeted catalog using a variety of query types ([CatalogQuerySortedAttribute](#type-catalogquerysortedattribute), ([CatalogQueryExact](#type-catalogqueryexact), ([CatalogQueryRange](#type-catalogqueryrange), ([CatalogQueryText](#type-catalogquerytext), ([CatalogQueryItemsForTax](#type-catalogqueryitemsfortax), ([CatalogQueryItemsForModifierList](#type-catalogqueryitemsformodifierlist)). ### Example ```csharp diff --git a/docs/CatalogItem.md b/docs/CatalogItem.md index 6948faa..9c131ea 100644 --- a/docs/CatalogItem.md +++ b/docs/CatalogItem.md @@ -6,7 +6,7 @@ Name | Type | Description | Notes **Name** | **string** | The item's name. Searchable. | **Description** | **string** | The item's description. Searchable. | [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. | [optional] -**LabelColor** | **string** | The color of the item's display label in the Square Point of Sale app. Searchable. | [optional] +**LabelColor** | **string** | The color of the item's display label in the Square Point of Sale app. | [optional] **AvailableOnline** | **bool?** | If `true`, the item can be added to shipping orders from the merchant's online store. | [optional] **AvailableForPickup** | **bool?** | If `true`, the item can be added to pickup orders from the merchant's online store. | [optional] **AvailableElectronically** | **bool?** | If `true`, the item can be added to electronically fulfilled orders from the merchant's online store. | [optional] diff --git a/docs/CatalogItemVariation.md b/docs/CatalogItemVariation.md index 07cde89..9ce3464 100644 --- a/docs/CatalogItemVariation.md +++ b/docs/CatalogItemVariation.md @@ -9,7 +9,7 @@ Name | Type | Description | Notes **Upc** | **string** | The item variation's UPC, if any. Searchable. | [optional] **PricingType** | **PricingTypeEnum** | Indicates whether the item variation's price is fixed or determined at the time of sale. See [CatalogPricingType](#type-catalogpricingtype) for all possible values. | [optional] **PriceMoney** | [**Money**](Money.md) | The item variation's price, if fixed pricing is used. | [optional] -**LocationOverrides** | [**List<ItemVariationLocationOverrides>**](ItemVariationLocationOverrides.md) | Per-location price and inventory overrides. | [optional] +**LocationOverrides** | [**List<ItemVariationLocationOverrides>**](ItemVariationLocationOverrides.md) | Per-[location][#type-location] price and inventory overrides. | [optional] **TrackInventory** | **bool?** | If `true`, inventory tracking is active for the variation. | [optional] **InventoryAlertType** | **InventoryAlertTypeEnum** | Indicates whether the item variation displays an alert when its inventory quantity is less than or equal to its `inventory_alert_threshold`. See [InventoryAlertType](#type-inventoryalerttype) for all possible values. | [optional] **InventoryAlertThreshold** | **long?** | If the inventory quantity for the variation is less than or equal to this value and `inventory_alert_type` is `LOW_QUANTITY`, the variation displays an alert in the merchant dashboard. This value is always an integer. | [optional] diff --git a/docs/CatalogObject.md b/docs/CatalogObject.md index a026c64..2b6910d 100644 --- a/docs/CatalogObject.md +++ b/docs/CatalogObject.md @@ -4,11 +4,11 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **Type** | **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 all possible values. | -**Id** | **string** | A unique Square-assigned identifier to reference this object in the catalog. | +**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] -**IsDeleted** | **bool?** | 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. 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 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] +**IsDeleted** | **bool?** | 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** | **bool?** | 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] **PresentAtLocationIds** | **List** | A list of locations where the object is present, even if `present_at_all_locations` is `false`. | [optional] **AbsentAtLocationIds** | **List** | A list of locations where the object is not present, even if `present_at_all_locations` is `true`. | [optional] diff --git a/docs/CatalogQuery.md b/docs/CatalogQuery.md index 73952f2..a089395 100644 --- a/docs/CatalogQuery.md +++ b/docs/CatalogQuery.md @@ -7,7 +7,7 @@ Name | Type | Description | Notes **ExactQuery** | [**CatalogQueryExact**](CatalogQueryExact.md) | A query that returns only objects for which the given (string-valued) attribute has the given case-insensitive value. | [optional] **PrefixQuery** | [**CatalogQueryPrefix**](CatalogQueryPrefix.md) | A query that returns only objects for which the given (string-valued) attribute has the given case-insensitive prefix. | [optional] **RangeQuery** | [**CatalogQueryRange**](CatalogQueryRange.md) | A query that returns only objects for which the given (integer-valued) attribute lies in the given range. | [optional] -**TextQuery** | [**CatalogQueryText**](CatalogQueryText.md) | A query that returns only objects whose searchable attributes contain all of the given keywords as prefixes. For example, if a [CatalogItem](#type-catalogitem) contains attributes `{\"name\": \"t-shirt\"}` and `{\"description\": \"Small, Red\"}`, it will be matched by the query `{\"keywords\": [\"shirt\", \"sm\", \"re\"]}`. | [optional] +**TextQuery** | [**CatalogQueryText**](CatalogQueryText.md) | A query that returns only objects whose searchable attributes contain all of the given keywords as prefixes. For example, if a [CatalogItem](#type-catalogitem) contains attributes `{\"name\": \"t-shirt\"}` and `{\"description\": \"Small, Purple\"}`, it will be matched by the query `{\"keywords\": [\"shirt\", \"sma\", \"purp\"]}`. | [optional] **ItemsForTaxQuery** | [**CatalogQueryItemsForTax**](CatalogQueryItemsForTax.md) | A query that returns all [CatalogItem](#type-catalogitem)s that have any of the given [CatalogTax](#type-catalogtax)es enabled. | [optional] **ItemsForModifierListQuery** | [**CatalogQueryItemsForModifierList**](CatalogQueryItemsForModifierList.md) | A query that returns all [CatalogItem](#type-catalogitem)s that have any of the given [CatalogModifierList](#type-catalogmodifierlist)s enabled. | [optional] diff --git a/docs/CatalogTax.md b/docs/CatalogTax.md index c9344f0..3a14e0d 100644 --- a/docs/CatalogTax.md +++ b/docs/CatalogTax.md @@ -6,7 +6,7 @@ Name | Type | Description | Notes **Name** | **string** | The tax's name. Searchable. | **CalculationPhase** | **CalculationPhaseEnum** | Whether the tax is calculated based on a payment's subtotal or total. See [TaxCalculationPhase](#type-taxcalculationphase) for all possible values. | [optional] **InclusionType** | **InclusionTypeEnum** | Whether the tax is `ADDITIVE` or `INCLUSIVE`. See [TaxInclusionType](#type-taxinclusiontype) for all possible values. | [optional] -**Percentage** | **string** | The percentage of the tax in decimal form, using a '.' as the decimal separator and without a '%' sign. A value of `7.5` corresponds to 7.5%. | [optional] +**Percentage** | **string** | The percentage of the tax in decimal form, using a `'.'` as the decimal separator and without a `'%'` sign. A value of `7.5` corresponds to 7.5%. | [optional] **AppliesToCustomAmounts** | **bool?** | If `true`, the fee applies to custom amounts entered into the Square Point of Sale app that are not associated with a particular [CatalogItem](#type-catalogitem). | [optional] **Enabled** | **bool?** | If `true`, the tax will be shown as enabled in the Square Point of Sale app. | [optional] diff --git a/docs/CatalogV1Id.md b/docs/CatalogV1Id.md index 306a224..6e128ef 100644 --- a/docs/CatalogV1Id.md +++ b/docs/CatalogV1Id.md @@ -4,7 +4,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **_CatalogV1Id** | **string** | The ID for an object in Connect V1, if different from its Connect V2 ID. | [optional] -**LocationId** | **string** | The ID of the location this Connect V1 ID is associated with. | [optional] +**LocationId** | **string** | The ID of the [location][#type-location] this Connect V1 ID is associated with. | [optional] diff --git a/docs/CreateCheckoutRequest.md b/docs/CreateCheckoutRequest.md index e02018e..715f896 100644 --- a/docs/CreateCheckoutRequest.md +++ b/docs/CreateCheckoutRequest.md @@ -4,7 +4,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **IdempotencyKey** | **string** | A unique string that identifies this checkout among others you've created. It can be any valid string but must be unique for every order sent to Square Checkout for a given location ID. The idempotency key is used to avoid processing the same order more than once. If you're unsure whether a particular checkout was created successfully, you can reattempt it with the same idempotency key and all the same other parameters without worrying about creating duplicates. We recommend using a random number/string generator native to the language you are working in to generate strings for your idempotency keys. See [Idempotency keys](#idempotencykeys) for more information. | -**Order** | [**CreateOrderRequestOrder**](CreateOrderRequestOrder.md) | The order including line items to be checked out. | +**Order** | [**CreateOrderRequest**](CreateOrderRequest.md) | The order including line items to be checked out. | **AskForShippingAddress** | **bool?** | If `true`, Square Checkout will collect shipping information on your behalf and store that information with the transaction information in your Square Dashboard. Default: `false`. | [optional] **MerchantSupportEmail** | **string** | The email address to display on the Square Checkout confirmation page and confirmation email that the buyer can use to contact the merchant. If this value is not set, the confirmation page and email will display the primary email address associated with the merchant's Square account. Default: none; only exists if explicitly set. | [optional] **PrePopulateBuyerEmail** | **string** | If provided, the buyer's email is pre-populated on the checkout page as an editable text field. Default: none; only exists if explicitly set. | [optional] diff --git a/docs/CreateOrderRequestOrder.md b/docs/CreateOrderRequest.md similarity index 69% rename from docs/CreateOrderRequestOrder.md rename to docs/CreateOrderRequest.md index 2722c92..2ca21f9 100644 --- a/docs/CreateOrderRequestOrder.md +++ b/docs/CreateOrderRequest.md @@ -1,10 +1,12 @@ -# Square.Connect.Model.CreateOrderRequestOrder +# Square.Connect.Model.CreateOrderRequest ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **ReferenceId** | **string** | An optional ID you can associate with the order for your own purposes (such as to associate the order with an entity ID in your own database). This value cannot exceed 40 characters. | [optional] **LineItems** | [**List<CreateOrderRequestLineItem>**](CreateOrderRequestLineItem.md) | The line items to associate with this order. Each line item represents a different product (or a custom monetary amount) to include in a purchase. | +**Taxes** | [**List<CreateOrderRequestTax>**](CreateOrderRequestTax.md) | The taxes include the custom taxes. | [optional] +**Discounts** | [**List<CreateOrderRequestDiscount>**](CreateOrderRequestDiscount.md) | The discounts include the custom discounts . | [optional] diff --git a/docs/CreateOrderRequestDiscount.md b/docs/CreateOrderRequestDiscount.md new file mode 100644 index 0000000..c2d857b --- /dev/null +++ b/docs/CreateOrderRequestDiscount.md @@ -0,0 +1,13 @@ +# Square.Connect.Model.CreateOrderRequestDiscount +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Name** | **string** | The discount's name. | [optional] +**Percentage** | **string** | The percentage of the discount, as a string representation of a decimal number. A value of `7.25` corresponds to a percentage of 7.25%. This value range between 0.0 up to 100.0 | [optional] +**AmountMoney** | [**Money**](Money.md) | The monetary amount of the discount. | [optional] + + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/docs/CreateOrderRequestLineItem.md b/docs/CreateOrderRequestLineItem.md index bb62e2b..b099274 100644 --- a/docs/CreateOrderRequestLineItem.md +++ b/docs/CreateOrderRequestLineItem.md @@ -3,9 +3,11 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**Name** | **string** | The name of the line item. This value cannot exceed 500 characters. | +**Name** | **string** | The name of the line item. This value cannot exceed 500 characters. | [optional] **Quantity** | **string** | The quantity to purchase, as a string representation of a number. Currently, only integer values are supported. | -**BasePriceMoney** | [**Money**](Money.md) | The base price for a single unit of the line item's associated variation. If a line item represents a Custom Amount instead of a particular product, this field indicates that amount. | +**BasePriceMoney** | [**Money**](Money.md) | The base price for a single unit of the line item's associated variation. If a line item represents a Custom Amount instead of a particular product, this field indicates that amount. | [optional] +**Taxes** | [**List<CreateOrderRequestTax>**](CreateOrderRequestTax.md) | The taxes include the custom taxes. | [optional] +**Discounts** | [**List<CreateOrderRequestDiscount>**](CreateOrderRequestDiscount.md) | The discounts include the custom discounts. | [optional] diff --git a/docs/CreateOrderRequestTax.md b/docs/CreateOrderRequestTax.md new file mode 100644 index 0000000..f5b738a --- /dev/null +++ b/docs/CreateOrderRequestTax.md @@ -0,0 +1,22 @@ +# Square.Connect.Model.CreateOrderRequestTax +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Name** | **string** | The tax's name. | [optional] +**Type** | **TypeEnum** | Indicates the calculation method used to apply the line item tax. Default: `ADDITIVE`; See [OrderLineItemTaxType](#type-orderlineitemtaxtype) for possible values. | [optional] +**Percentage** | **string** | The percentage of the tax, as a string representation of a decimal number. A value of `7.25` corresponds to a percentage of 7.25%. This value range between 0.0 up to 100.0 | [optional] + + +## TypeEnum + +Name | Value +------------ | ------------- +**UNKNOWN** | "UNKNOWN" +**ADDITIVE** | "ADDITIVE" +**INCLUSIVE** | "INCLUSIVE" + + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/docs/CustomersApi.md b/docs/CustomersApi.md index 7c9c24b..32ba8c4 100644 --- a/docs/CustomersApi.md +++ b/docs/CustomersApi.md @@ -84,7 +84,7 @@ Name | Type | Description | Notes CreateCustomerCard -Adds a card on file to an existing customer. +Adds a card on file to an existing customer. In the United States Square takes care of automatically updating any cards on file that might have expired since you first attached them to a customer. ### Example ```csharp @@ -413,7 +413,7 @@ Name | Type | Description | Notes UpdateCustomer -Updates the details of an existing customer. You cannot edit a customer's cards on file with this endpoint. To make changes to a card on file, you must delete the existing card on file with the [DeleteCustomerCard](#endpoint-deletecustomercard) endpoint, then create a new one with the [CreateCustomerCard](#endpoint-createcustomercard) endpoint. +Updates the details of an existing customer. The ID of the customer may change if the customer has been merged into another customer. You cannot edit a customer's cards on file with this endpoint. To make changes to a card on file, you must delete the existing card on file with the [DeleteCustomerCard](#endpoint-deletecustomercard) endpoint, then create a new one with the [CreateCustomerCard](#endpoint-createcustomercard) endpoint. ### Example ```csharp diff --git a/docs/Error.md b/docs/Error.md index 08b4b94..e278ec6 100644 --- a/docs/Error.md +++ b/docs/Error.md @@ -88,6 +88,7 @@ Name | Value **UNEXPECTEDVALUE** | "UNEXPECTED_VALUE" **SANDBOXNOTSUPPORTED** | "SANDBOX_NOT_SUPPORTED" **INVALIDEMAILADDRESS** | "INVALID_EMAIL_ADDRESS" +**CHECKOUTEXPIRED** | "CHECKOUT_EXPIRED" **CARDDECLINED** | "CARD_DECLINED" **VERIFYCVVFAILURE** | "VERIFY_CVV_FAILURE" **VERIFYAVSFAILURE** | "VERIFY_AVS_FAILURE" diff --git a/docs/ItemVariationLocationOverrides.md b/docs/ItemVariationLocationOverrides.md index e0bb9a5..23e673e 100644 --- a/docs/ItemVariationLocationOverrides.md +++ b/docs/ItemVariationLocationOverrides.md @@ -3,10 +3,10 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**LocationId** | **string** | The ID of the location. | [optional] -**PriceMoney** | [**Money**](Money.md) | The price of the [CatalogItemVariation](#type-catalogitemvariation) at the given location, or blank for variable pricing. | [optional] -**PricingType** | **PricingTypeEnum** | The pricing type (fixed or variable) for the [CatalogItemVariation](#type-catalogitemvariation) at the given location. See [CatalogPricingType](#type-catalogpricingtype) for all possible values. | [optional] -**TrackInventory** | **bool?** | If `true`, inventory tracking is active for the [CatalogItemVariation](#type-catalogitemvariation) at this location. | [optional] +**LocationId** | **string** | The ID of the [location][#type-location]. | [optional] +**PriceMoney** | [**Money**](Money.md) | The price of the [CatalogItemVariation](#type-catalogitemvariation) at the given [location][#type-location], or blank for variable pricing. | [optional] +**PricingType** | **PricingTypeEnum** | The pricing type (fixed or variable) for the [CatalogItemVariation](#type-catalogitemvariation) at the given [location][#type-location]. See [CatalogPricingType](#type-catalogpricingtype) for all possible values. | [optional] +**TrackInventory** | **bool?** | If `true`, inventory tracking is active for the [CatalogItemVariation](#type-catalogitemvariation) at this [location][#type-location]. | [optional] **InventoryAlertType** | **InventoryAlertTypeEnum** | Indicates whether the [CatalogItemVariation](#type-catalogitemvariation) displays an alert when its inventory quantity is less than or equal to its `inventory_alert_threshold`. See [InventoryAlertType](#type-inventoryalerttype) for all possible values. | [optional] **InventoryAlertThreshold** | **long?** | If the inventory quantity for the variation is less than or equal to this value and `inventory_alert_type` is `LOW_QUANTITY`, the variation displays an alert in the merchant dashboard. This value is always an integer. | [optional] diff --git a/docs/Order.md b/docs/Order.md index e9be2d2..f96ccdf 100644 --- a/docs/Order.md +++ b/docs/Order.md @@ -3,11 +3,12 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**Id** | **string** | The order's unique ID. This value is not present if the order was not created with the [CreateOrder](#endpoint-createorder) endpoint. | [optional] **LocationId** | **string** | The ID of the merchant location this order is associated with. | [optional] **ReferenceId** | **string** | A client specified identifier to associate an entity in another system with this order. | [optional] **LineItems** | [**List<OrderLineItem>**](OrderLineItem.md) | The line items included in the order. Every order has at least one line item. | [optional] **TotalMoney** | [**Money**](Money.md) | The total amount of money to collect for the order. | [optional] +**TotalTaxMoney** | [**Money**](Money.md) | The total tax amount of money to collect for the order. | [optional] +**TotalDiscountMoney** | [**Money**](Money.md) | The total discount amount of money to collect for the order. | [optional] diff --git a/docs/OrderLineItem.md b/docs/OrderLineItem.md index 2ff59e6..9c29dc0 100644 --- a/docs/OrderLineItem.md +++ b/docs/OrderLineItem.md @@ -3,10 +3,13 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**Id** | **string** | The line item's ID, unique only within this order. | [optional] **Name** | **string** | The name of the line item. | [optional] **Quantity** | **string** | The quantity of the product to purchase. Currently, this string must have an integer value. | [optional] -**BasePriceMoney** | [**Money**](Money.md) | The base price for a single unit of the line item's associated variation. If a line item represents a Custom Amount instead of a particular product, this field indicates that amount. | [optional] +**Taxes** | [**List<OrderLineItemTax>**](OrderLineItemTax.md) | The taxes applied to this line item. | [optional] +**Discounts** | [**List<OrderLineItemDiscount>**](OrderLineItemDiscount.md) | The discounts applied to this line item. | [optional] +**BasePriceMoney** | [**Money**](Money.md) | The base price for a single unit of the line item. | [optional] +**TotalTaxMoney** | [**Money**](Money.md) | The total tax amount of money to collect for the line item. | [optional] +**TotalDiscountMoney** | [**Money**](Money.md) | The total discount amount of money to collect for the line item. | [optional] **TotalMoney** | [**Money**](Money.md) | The total amount of money to collect for this line item. | [optional] diff --git a/docs/OrderLineItemDiscount.md b/docs/OrderLineItemDiscount.md new file mode 100644 index 0000000..176ed95 --- /dev/null +++ b/docs/OrderLineItemDiscount.md @@ -0,0 +1,35 @@ +# Square.Connect.Model.OrderLineItemDiscount +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Name** | **string** | The discount's name. | [optional] +**Type** | **TypeEnum** | The type of the discount. If it is created by API, it would be either `FIXED_PERCENTAGE` or `FIXED_AMOUNT`. VARIABLE_* is not supported in API because the order is created at the time of sale and either percentage or amount has to be specified. See [OrderLineItemDiscountType](#type-orderlineitemdiscounttype) for possible values. | [optional] +**Percentage** | **string** | The percentage of the tax, as a string representation of a decimal number. A value of `7.25` corresponds to a percentage of 7.25%. The percentage won't be set for an amount-based discount. | [optional] +**AmountMoney** | [**Money**](Money.md) | The total monetary amount of the applicable discount. If it is at order level, it is the value of the order level discount. If it is at line item level, it is the value of the line item level discount. The amount_money won't be set for a percentage-based discount. | [optional] +**AppliedMoney** | [**Money**](Money.md) | The amount of discount actually applied to this line item. Represents the amount of money applied to a line item as a discount When an amount-based discount is at order-level, this value is different from `amount_money` because the discount is distributed across the line items. | [optional] +**Scope** | **ScopeEnum** | Indicates the level at which the discount applies. See [OrderLineItemDiscountScope](#type-orderlineitemdiscountscope) for possible values. | [optional] + + +## TypeEnum + +Name | Value +------------ | ------------- +**UNKNOWN** | "UNKNOWN" +**FIXEDPERCENTAGE** | "FIXED_PERCENTAGE" +**FIXEDAMOUNT** | "FIXED_AMOUNT" +**VARIABLEPERCENTAGE** | "VARIABLE_PERCENTAGE" +**VARIABLEAMOUNT** | "VARIABLE_AMOUNT" + + +## ScopeEnum + +Name | Value +------------ | ------------- +**LINEITEM** | "LINE_ITEM" +**ORDER** | "ORDER" + + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/docs/OrderLineItemDiscountScope.md b/docs/OrderLineItemDiscountScope.md new file mode 100644 index 0000000..343fec2 --- /dev/null +++ b/docs/OrderLineItemDiscountScope.md @@ -0,0 +1,10 @@ +# Square.Connect.Model.OrderLineItemDiscountScope +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/docs/OrderLineItemDiscountType.md b/docs/OrderLineItemDiscountType.md new file mode 100644 index 0000000..9827afd --- /dev/null +++ b/docs/OrderLineItemDiscountType.md @@ -0,0 +1,10 @@ +# Square.Connect.Model.OrderLineItemDiscountType +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/docs/OrderLineItemTax.md b/docs/OrderLineItemTax.md new file mode 100644 index 0000000..f7a6ee0 --- /dev/null +++ b/docs/OrderLineItemTax.md @@ -0,0 +1,23 @@ +# Square.Connect.Model.OrderLineItemTax +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Name** | **string** | The tax's name. | [optional] +**Type** | **TypeEnum** | Indicates the calculation method used to apply the tax. See [OrderLineItemTaxType](#type-orderlineitemtaxtype) for possible values. | [optional] +**Percentage** | **string** | The percentage of the tax, as a string representation of a decimal number. A value of `7.25` corresponds to a percentage of 7.25%. | [optional] +**AppliedMoney** | [**Money**](Money.md) | The amount of the money applied by the tax in an order. | [optional] + + +## TypeEnum + +Name | Value +------------ | ------------- +**UNKNOWN** | "UNKNOWN" +**ADDITIVE** | "ADDITIVE" +**INCLUSIVE** | "INCLUSIVE" + + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/docs/OrderLineItemTaxType.md b/docs/OrderLineItemTaxType.md new file mode 100644 index 0000000..8898fe4 --- /dev/null +++ b/docs/OrderLineItemTaxType.md @@ -0,0 +1,10 @@ +# Square.Connect.Model.OrderLineItemTaxType +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/docs/RetrieveCatalogObjectRequest.md b/docs/RetrieveCatalogObjectRequest.md index 92802ef..09ec469 100644 --- a/docs/RetrieveCatalogObjectRequest.md +++ b/docs/RetrieveCatalogObjectRequest.md @@ -3,7 +3,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**IncludeRelatedObjects** | **bool?** | If `true`, the response will include additional objects that are related to the requested object, as follows: If the `object` field of the response contains a [CatalogItem](#type-catalogitem), its associated [CatalogCategory](#type-catalogcategory), [CatalogTax](#type-catalogtax)es, and [CatalogModifierList](#type-catalogmodifierlist)s will be returned in the `related_objects` field of the response. If the `object` field of the response contains a [CatalogItemVariation](#type-catalogitemvariation), its parent [CatalogItem](#type-catalogitem) will be returned in the `related_objects` field of the response. | [optional] +**IncludeRelatedObjects** | **bool?** | If `true`, the response will include additional objects that are related to the requested object, as follows: If the `object` field of the response contains a [CatalogItem](#type-catalogitem), its associated [CatalogCategory](#type-catalogcategory), [CatalogTax](#type-catalogtax)es, and [CatalogModifierList](#type-catalogmodifierlist)s will be returned in the `related_objects` field of the response. If the `object` field of the response contains a [CatalogItemVariation](#type-catalogitemvariation), its parent [CatalogItem](#type-catalogitem) will be returned in the `related_objects` field of the response. Default value: `false` | [optional] diff --git a/docs/SearchCatalogObjectsRequest.md b/docs/SearchCatalogObjectsRequest.md index 192ea9c..a53a359 100644 --- a/docs/SearchCatalogObjectsRequest.md +++ b/docs/SearchCatalogObjectsRequest.md @@ -7,7 +7,7 @@ Name | Type | Description | Notes **ObjectTypes** | **List** | The desired set of object types to apper in the search results. The legal values are taken from the [CatalogObjectType](#type-catalogobjecttype) enumeration, namely `\"ITEM\"`, `\"ITEM_VARIATION\"`, `\"CATEGORY\"`, `\"DISCOUNT\"`, `\"TAX\"`, `\"MODIFIER\"`, or `\"MODIFIER_LIST\"`. | [optional] **IncludeDeletedObjects** | **bool?** | If `true`, deleted objects will be included in the results. Deleted objects will have their `is_deleted` field set to `true`. | [optional] **IncludeRelatedObjects** | **bool?** | If `true`, the response will include additional objects that are related to the requested object, as follows: If a [CatalogItem](#type-catalogitem) is returned in the object field of the response, its associated [CatalogCategory](#type-catalogcategory), [CatalogTax](#type-catalogtax)es, and [CatalogModifierList](#type-catalogmodifierlist)s will be included in the `related_objects` field of the response. If a [CatalogItemVariation](#type-catalogitemvariation) is returned in the object field of the response, its parent [CatalogItem](#type-catalogitem) will be included in the `related_objects` field of the response. | [optional] -**BeginTime** | **string** | Return only objects that have been modified after this [timestamp](#workingwithdates) (in RFC 3339 format, e.g., \"2016-09-04T23:59:33.123Z\"). | [optional] +**BeginTime** | **string** | Return only objects that have been modified after this [timestamp](#workingwithdates) (in RFC 3339 format, e.g., \"2016-09-04T23:59:33.123Z\"). The timestamp is exclusive - objects whose timestamp is equal to `begin_time` will not be included in the response. | [optional] **Query** | [**CatalogQuery**](CatalogQuery.md) | A query to be used to filter or sort the results. If no query is specified, the entire catalog will be returned. | [optional] **Limit** | **int?** | A limit on the number of results to be returned in a single page. The limit is advisory - the implementation may return more or fewer results. If the supplied limit is negative, zero, or is higher than the maximum limit of 1,000, it will be ignored. | [optional] diff --git a/docs/Transaction.md b/docs/Transaction.md index fc0fd9f..0e4ecd4 100644 --- a/docs/Transaction.md +++ b/docs/Transaction.md @@ -10,7 +10,7 @@ Name | Type | Description | Notes **Refunds** | [**List<Refund>**](Refund.md) | Refunds that have been applied to any tender in the transaction. | [optional] **ReferenceId** | **string** | If the transaction was created with the [Charge](#endpoint-charge) endpoint, this value is the same as the value provided for the `reference_id` parameter in the request to that endpoint. Otherwise, it is not set. | [optional] **Product** | **ProductEnum** | The Square product that processed the transaction. | [optional] -**ClientId** | **string** | If the transaction was created in the Square Register app, this value is the ID generated for the transaction by Square Register. This ID has no relationship to the transaction's canonical `id`, which is generated by Square's backend servers. This value is generated for bookkeeping purposes, in case the transaction cannot immediately be completed (for example, if the transaction is processed in offline mode). It is not currently possible with the Connect API to perform a transaction lookup by this value. | [optional] +**ClientId** | **string** | If the transaction was created in the Square Point of Sale app, this value is the ID generated for the transaction by Square Point of Sale. This ID has no relationship to the transaction's canonical `id`, which is generated by Square's backend servers. This value is generated for bookkeeping purposes, in case the transaction cannot immediately be completed (for example, if the transaction is processed in offline mode). It is not currently possible with the Connect API to perform a transaction lookup by this value. | [optional] **Order** | [**Order**](Order.md) | The order associated with this transaction, if any. | [optional] **ShippingAddress** | [**Address**](Address.md) | The shipping address provided in the request, if any. | [optional] diff --git a/docs/TransactionsApi.md b/docs/TransactionsApi.md index 598c654..af2648a 100644 --- a/docs/TransactionsApi.md +++ b/docs/TransactionsApi.md @@ -153,7 +153,7 @@ Name | Type | Description | Notes CreateRefund -Initiates a refund for a previously charged tender. +Initiates a refund for a previously charged tender. You must issue a refund within 120 days of the associated payment. See (this article)[https://squareup.com/help/us/en/article/5060] for more information on refund behavior. ### Example ```csharp diff --git a/docs/V1Payment.md b/docs/V1Payment.md index 1febdbe..bc12a80 100644 --- a/docs/V1Payment.md +++ b/docs/V1Payment.md @@ -6,7 +6,7 @@ Name | Type | Description | Notes **Id** | **string** | The payment's unique identifier. | [optional] **MerchantId** | **string** | The unique identifier of the merchant that took the payment. | [optional] **CreatedAt** | **string** | The time when the payment was created, in ISO 8601 format. | [optional] -**CreatorId** | **bool?** | The unique identifier of the Square account that took the payment. | [optional] +**CreatorId** | **string** | The unique identifier of the Square account that took the payment. | [optional] **Device** | [**Device**](Device.md) | The device that took the payment. | [optional] **PaymentUrl** | **string** | The URL of the payment's detail page in the merchant dashboard. The merchant must be signed in to the merchant dashboard to view this page. | [optional] **ReceiptUrl** | **string** | The URL of the receipt for the payment. Note that for split tender payments, this URL corresponds to the receipt for the first tender listed in the payment's tender field. Each Tender object has its own receipt_url field you can use to get the other receipts associated with a split tender payment. | [optional] diff --git a/src/Square.Connect.Test/Api/CheckoutApiTests.cs b/src/Square.Connect.Test/Api/CheckoutApiTests.cs index 801f635..95fbca3 100644 --- a/src/Square.Connect.Test/Api/CheckoutApiTests.cs +++ b/src/Square.Connect.Test/Api/CheckoutApiTests.cs @@ -1,4 +1,4 @@ -/* +/* * Square Connect API * * Client library for accessing the Square Connect APIs @@ -33,7 +33,9 @@ namespace Square.Connect.Test [TestFixture] public class CheckoutApiTests { + private TestAccounts testAccounts; private CheckoutApi instance; + private string locationId; /// /// Setup before each unit test @@ -42,6 +44,10 @@ public class CheckoutApiTests public void Init() { instance = new CheckoutApi(); + testAccounts = new TestAccounts(); + var testAccount = testAccounts["US-Prod-Sandbox"]; + locationId = testAccount.LocationId; + Configuration.Default.AccessToken = testAccount.AccessToken; } /// @@ -59,24 +65,96 @@ public void Cleanup() [Test] public void InstanceTest() { - // TODO uncomment below to test 'IsInstanceOfType' CheckoutApi - //Assert.IsInstanceOfType(typeof(CheckoutApi), instance, "instance is a CheckoutApi"); + Assert.IsInstanceOf(typeof(CheckoutApi), instance, "instance is a CheckoutApi"); } - /// /// Test CreateCheckout /// [Test] public void CreateCheckoutTest() { - // TODO uncomment below to test the method and replace null with proper value - //string locationId = null; - //CreateCheckoutRequest body = null; - //var response = instance.CreateCheckout(locationId, body); - //Assert.IsInstanceOf (response, "response is CreateCheckoutResponse"); + + CreateCheckoutRequest body = new CreateCheckoutRequest( + IdempotencyKey: Guid.NewGuid().ToString(), + Order: new CreateOrderRequest( + ReferenceId: "reference_id", + LineItems: new List() { + new CreateOrderRequestLineItem( + Name: "Printed T Shirt", + Quantity: "2", + BasePriceMoney: new Money(Amount: 1500, Currency: Money.CurrencyEnum.USD), + Discounts: new List() { + new CreateOrderRequestDiscount( + Name: "7% off previous season item", + Percentage: "7" + ), + new CreateOrderRequestDiscount( + Name: "$3 off Customer Discount", + AmountMoney: new Money(300, Money.CurrencyEnum.USD) + ) + } + ), + new CreateOrderRequestLineItem( + Name: "Slim Jeans", + Quantity: "1", + BasePriceMoney: new Money(Amount: 2500, Currency: Money.CurrencyEnum.USD) + ), + new CreateOrderRequestLineItem( + Name: "Woven Sweater", + Quantity: "3", + BasePriceMoney: new Money(Amount: 3500, Currency: Money.CurrencyEnum.USD), + Discounts: new List() { + new CreateOrderRequestDiscount( + Name: "$11 off Customer Discount", + AmountMoney: new Money(1100, Money.CurrencyEnum.USD) + ) + }, + Taxes: new List() { + new CreateOrderRequestTax( + Name: "Fair Trade Tax", + Percentage: "5" + ) + } + ) + }, + Discounts: new List() { + new CreateOrderRequestDiscount( + Name: "Father's day 12% OFF", + Percentage: "12" + ), + new CreateOrderRequestDiscount( + Name: "Global Sales $55 OFF", + AmountMoney: new Money(5500, Money.CurrencyEnum.USD) + ) + }, + Taxes: new List() { + new CreateOrderRequestTax( + Name: "Sales Tax", + Percentage: "8.5" + ) + } + ), + AskForShippingAddress: true, + MerchantSupportEmail: "merchant+support@website.com", + PrePopulateBuyerEmail: "example@email.com", + PrePopulateShippingAddress: new Address( + AddressLine1: "1455 Market St.", + AddressLine2: "Suite 600", + Locality: "San Francisco", + AdministrativeDistrictLevel1: "CA", + PostalCode: "94103", + Country: Address.CountryEnum.US, + FirstName: "Jane", + LastName: "Doe" + ), + RedirectUrl: "https://merchant.website.com/order-confirm" + ); + var response = instance.CreateCheckout(locationId, body); + Assert.IsInstanceOf (response, "response is CreateCheckoutResponse"); + Assert.IsNull(response.Errors); + Assert.True(response.Checkout.CheckoutPageUrl.StartsWith("https://connect.", StringComparison.Ordinal)); } - } } diff --git a/src/Square.Connect.Test/Model/CreateOrderRequestOrderTests.cs b/src/Square.Connect.Test/Model/CreateOrderRequestOrderTests.cs deleted file mode 100644 index 86ec1e6..0000000 --- a/src/Square.Connect.Test/Model/CreateOrderRequestOrderTests.cs +++ /dev/null @@ -1,86 +0,0 @@ -/* - * Square Connect API - * - * Client library for accessing the Square Connect APIs - * - * OpenAPI spec version: 2.0 - * Contact: developers@squareup.com - * Generated by: https://github.com/swagger-api/swagger-codegen.git - */ - - -using NUnit.Framework; - -using System; -using System.Linq; -using System.IO; -using System.Collections.Generic; -using Square.Connect.Api; -using Square.Connect.Model; -using Square.Connect.Client; -using System.Reflection; - -namespace Square.Connect.Test -{ - /// - /// Class for testing CreateOrderRequestOrder - /// - /// - /// This file is automatically generated by Swagger Codegen. - /// Please update the test case below to test the model. - /// - [TestFixture] - public class CreateOrderRequestOrderTests - { - // TODO uncomment below to declare an instance variable for CreateOrderRequestOrder - //private CreateOrderRequestOrder instance; - - /// - /// Setup before each test - /// - [SetUp] - public void Init() - { - // TODO uncomment below to create an instance of CreateOrderRequestOrder - //instance = new CreateOrderRequestOrder(); - } - - /// - /// Clean up after each test - /// - [TearDown] - public void Cleanup() - { - - } - - /// - /// Test an instance of CreateOrderRequestOrder - /// - [Test] - public void CreateOrderRequestOrderInstanceTest() - { - // TODO uncomment below to test "IsInstanceOfType" CreateOrderRequestOrder - //Assert.IsInstanceOfType (instance, "variable 'instance' is a CreateOrderRequestOrder"); - } - - /// - /// Test the property 'ReferenceId' - /// - [Test] - public void ReferenceIdTest() - { - // TODO unit test for the property 'ReferenceId' - } - /// - /// Test the property 'LineItems' - /// - [Test] - public void LineItemsTest() - { - // TODO unit test for the property 'LineItems' - } - - } - -} diff --git a/src/Square.Connect/Api/CatalogApi.cs b/src/Square.Connect/Api/CatalogApi.cs index a499dee..a34ce8d 100644 --- a/src/Square.Connect/Api/CatalogApi.cs +++ b/src/Square.Connect/Api/CatalogApi.cs @@ -49,7 +49,7 @@ public interface ICatalogApi : IApiAccessor /// BatchRetrieveCatalogObjects /// /// - /// Returns a set of objects based on the provided ID. [CatalogItem](#type-catalogitem)s returned in the set include all of the child information including: all [CatalogItemVariation](#type-catalogitemvariation) objects, references to its [CatalogModifierList](#type-catalogmodifierlist) objects, and the ids of any [CatalogTax](#type-catalogtax) objects that apply to it. + /// Returns a set of objects based on the provided ID. Each [CatalogItem](#type-catalogitem) returned in the set includes all of its child information including: all of its [CatalogItemVariation](#type-catalogitemvariation) objects, references to its [CatalogModifierList](#type-catalogmodifierlist) objects, and the ids of any [CatalogTax](#type-catalogtax) objects that apply to it. /// /// Thrown when fails to make API call /// An object containing the fields to POST for the request. See the corresponding object definition for field details. @@ -60,7 +60,7 @@ public interface ICatalogApi : IApiAccessor /// BatchRetrieveCatalogObjects /// /// - /// Returns a set of objects based on the provided ID. [CatalogItem](#type-catalogitem)s returned in the set include all of the child information including: all [CatalogItemVariation](#type-catalogitemvariation) objects, references to its [CatalogModifierList](#type-catalogmodifierlist) objects, and the ids of any [CatalogTax](#type-catalogtax) objects that apply to it. + /// Returns a set of objects based on the provided ID. Each [CatalogItem](#type-catalogitem) returned in the set includes all of its child information including: all of its [CatalogItemVariation](#type-catalogitemvariation) objects, references to its [CatalogModifierList](#type-catalogmodifierlist) objects, and the ids of any [CatalogTax](#type-catalogtax) objects that apply to it. /// /// Thrown when fails to make API call /// An object containing the fields to POST for the request. See the corresponding object definition for field details. @@ -158,7 +158,7 @@ public interface ICatalogApi : IApiAccessor /// /// Thrown when fails to make API call /// The object ID of any type of [CatalogObject](#type-catalogobject)s to be retrieved. - /// If `true`, the response will include additional objects that are related to the requested object, as follows: If the `object` field of the response contains a [CatalogItem](#type-catalogitem), its associated [CatalogCategory](#type-catalogcategory), [CatalogTax](#type-catalogtax)es, and [CatalogModifierList](#type-catalogmodifierlist)s will be returned in the `related_objects` field of the response. If the `object` field of the response contains a [CatalogItemVariation](#type-catalogitemvariation), its parent [CatalogItem](#type-catalogitem) will be returned in the `related_objects` field of the response. (optional) + /// If `true`, the response will include additional objects that are related to the requested object, as follows: If the `object` field of the response contains a [CatalogItem](#type-catalogitem), its associated [CatalogCategory](#type-catalogcategory), [CatalogTax](#type-catalogtax)es, and [CatalogModifierList](#type-catalogmodifierlist)s will be returned in the `related_objects` field of the response. If the `object` field of the response contains a [CatalogItemVariation](#type-catalogitemvariation), its parent [CatalogItem](#type-catalogitem) will be returned in the `related_objects` field of the response. Default value: `false` (optional) /// RetrieveCatalogObjectResponse RetrieveCatalogObjectResponse RetrieveCatalogObject (string objectId, bool? includeRelatedObjects = null); @@ -170,14 +170,14 @@ public interface ICatalogApi : IApiAccessor /// /// Thrown when fails to make API call /// The object ID of any type of [CatalogObject](#type-catalogobject)s to be retrieved. - /// If `true`, the response will include additional objects that are related to the requested object, as follows: If the `object` field of the response contains a [CatalogItem](#type-catalogitem), its associated [CatalogCategory](#type-catalogcategory), [CatalogTax](#type-catalogtax)es, and [CatalogModifierList](#type-catalogmodifierlist)s will be returned in the `related_objects` field of the response. If the `object` field of the response contains a [CatalogItemVariation](#type-catalogitemvariation), its parent [CatalogItem](#type-catalogitem) will be returned in the `related_objects` field of the response. (optional) + /// If `true`, the response will include additional objects that are related to the requested object, as follows: If the `object` field of the response contains a [CatalogItem](#type-catalogitem), its associated [CatalogCategory](#type-catalogcategory), [CatalogTax](#type-catalogtax)es, and [CatalogModifierList](#type-catalogmodifierlist)s will be returned in the `related_objects` field of the response. If the `object` field of the response contains a [CatalogItemVariation](#type-catalogitemvariation), its parent [CatalogItem](#type-catalogitem) will be returned in the `related_objects` field of the response. Default value: `false` (optional) /// ApiResponse of RetrieveCatalogObjectResponse ApiResponse RetrieveCatalogObjectWithHttpInfo (string objectId, bool? includeRelatedObjects = null); /// /// SearchCatalogObjects /// /// - /// Queries the targeted catalog using a variety of query types ([CatalogQuerySortedAttribute](#type-catalogquerysortedattribute), ([CatalogQueryExact](#type-catalogqueryexact, ([CatalogQueryRange](#type-catalogqueryrange), ([CatalogQueryText](#type-catalogquerytext), ([CatalogQueryItemsForTax](#type-catalogqueryitemsfortax), ([CatalogQueryItemsForModifierList](#type-catalogqueryitemsformodifierlist)). + /// Queries the targeted catalog using a variety of query types ([CatalogQuerySortedAttribute](#type-catalogquerysortedattribute), ([CatalogQueryExact](#type-catalogqueryexact), ([CatalogQueryRange](#type-catalogqueryrange), ([CatalogQueryText](#type-catalogquerytext), ([CatalogQueryItemsForTax](#type-catalogqueryitemsfortax), ([CatalogQueryItemsForModifierList](#type-catalogqueryitemsformodifierlist)). /// /// Thrown when fails to make API call /// An object containing the fields to POST for the request. See the corresponding object definition for field details. @@ -188,7 +188,7 @@ public interface ICatalogApi : IApiAccessor /// SearchCatalogObjects /// /// - /// Queries the targeted catalog using a variety of query types ([CatalogQuerySortedAttribute](#type-catalogquerysortedattribute), ([CatalogQueryExact](#type-catalogqueryexact, ([CatalogQueryRange](#type-catalogqueryrange), ([CatalogQueryText](#type-catalogquerytext), ([CatalogQueryItemsForTax](#type-catalogqueryitemsfortax), ([CatalogQueryItemsForModifierList](#type-catalogqueryitemsformodifierlist)). + /// Queries the targeted catalog using a variety of query types ([CatalogQuerySortedAttribute](#type-catalogquerysortedattribute), ([CatalogQueryExact](#type-catalogqueryexact), ([CatalogQueryRange](#type-catalogqueryrange), ([CatalogQueryText](#type-catalogquerytext), ([CatalogQueryItemsForTax](#type-catalogqueryitemsfortax), ([CatalogQueryItemsForModifierList](#type-catalogqueryitemsformodifierlist)). /// /// Thrown when fails to make API call /// An object containing the fields to POST for the request. See the corresponding object definition for field details. @@ -284,7 +284,7 @@ public interface ICatalogApi : IApiAccessor /// BatchRetrieveCatalogObjects /// /// - /// Returns a set of objects based on the provided ID. [CatalogItem](#type-catalogitem)s returned in the set include all of the child information including: all [CatalogItemVariation](#type-catalogitemvariation) objects, references to its [CatalogModifierList](#type-catalogmodifierlist) objects, and the ids of any [CatalogTax](#type-catalogtax) objects that apply to it. + /// Returns a set of objects based on the provided ID. Each [CatalogItem](#type-catalogitem) returned in the set includes all of its child information including: all of its [CatalogItemVariation](#type-catalogitemvariation) objects, references to its [CatalogModifierList](#type-catalogmodifierlist) objects, and the ids of any [CatalogTax](#type-catalogtax) objects that apply to it. /// /// Thrown when fails to make API call /// An object containing the fields to POST for the request. See the corresponding object definition for field details. @@ -295,7 +295,7 @@ public interface ICatalogApi : IApiAccessor /// BatchRetrieveCatalogObjects /// /// - /// Returns a set of objects based on the provided ID. [CatalogItem](#type-catalogitem)s returned in the set include all of the child information including: all [CatalogItemVariation](#type-catalogitemvariation) objects, references to its [CatalogModifierList](#type-catalogmodifierlist) objects, and the ids of any [CatalogTax](#type-catalogtax) objects that apply to it. + /// Returns a set of objects based on the provided ID. Each [CatalogItem](#type-catalogitem) returned in the set includes all of its child information including: all of its [CatalogItemVariation](#type-catalogitemvariation) objects, references to its [CatalogModifierList](#type-catalogmodifierlist) objects, and the ids of any [CatalogTax](#type-catalogtax) objects that apply to it. /// /// Thrown when fails to make API call /// An object containing the fields to POST for the request. See the corresponding object definition for field details. @@ -393,7 +393,7 @@ public interface ICatalogApi : IApiAccessor /// /// Thrown when fails to make API call /// The object ID of any type of [CatalogObject](#type-catalogobject)s to be retrieved. - /// If `true`, the response will include additional objects that are related to the requested object, as follows: If the `object` field of the response contains a [CatalogItem](#type-catalogitem), its associated [CatalogCategory](#type-catalogcategory), [CatalogTax](#type-catalogtax)es, and [CatalogModifierList](#type-catalogmodifierlist)s will be returned in the `related_objects` field of the response. If the `object` field of the response contains a [CatalogItemVariation](#type-catalogitemvariation), its parent [CatalogItem](#type-catalogitem) will be returned in the `related_objects` field of the response. (optional) + /// If `true`, the response will include additional objects that are related to the requested object, as follows: If the `object` field of the response contains a [CatalogItem](#type-catalogitem), its associated [CatalogCategory](#type-catalogcategory), [CatalogTax](#type-catalogtax)es, and [CatalogModifierList](#type-catalogmodifierlist)s will be returned in the `related_objects` field of the response. If the `object` field of the response contains a [CatalogItemVariation](#type-catalogitemvariation), its parent [CatalogItem](#type-catalogitem) will be returned in the `related_objects` field of the response. Default value: `false` (optional) /// Task of RetrieveCatalogObjectResponse System.Threading.Tasks.Task RetrieveCatalogObjectAsync (string objectId, bool? includeRelatedObjects = null); @@ -405,14 +405,14 @@ public interface ICatalogApi : IApiAccessor /// /// Thrown when fails to make API call /// The object ID of any type of [CatalogObject](#type-catalogobject)s to be retrieved. - /// If `true`, the response will include additional objects that are related to the requested object, as follows: If the `object` field of the response contains a [CatalogItem](#type-catalogitem), its associated [CatalogCategory](#type-catalogcategory), [CatalogTax](#type-catalogtax)es, and [CatalogModifierList](#type-catalogmodifierlist)s will be returned in the `related_objects` field of the response. If the `object` field of the response contains a [CatalogItemVariation](#type-catalogitemvariation), its parent [CatalogItem](#type-catalogitem) will be returned in the `related_objects` field of the response. (optional) + /// If `true`, the response will include additional objects that are related to the requested object, as follows: If the `object` field of the response contains a [CatalogItem](#type-catalogitem), its associated [CatalogCategory](#type-catalogcategory), [CatalogTax](#type-catalogtax)es, and [CatalogModifierList](#type-catalogmodifierlist)s will be returned in the `related_objects` field of the response. If the `object` field of the response contains a [CatalogItemVariation](#type-catalogitemvariation), its parent [CatalogItem](#type-catalogitem) will be returned in the `related_objects` field of the response. Default value: `false` (optional) /// Task of ApiResponse (RetrieveCatalogObjectResponse) System.Threading.Tasks.Task> RetrieveCatalogObjectAsyncWithHttpInfo (string objectId, bool? includeRelatedObjects = null); /// /// SearchCatalogObjects /// /// - /// Queries the targeted catalog using a variety of query types ([CatalogQuerySortedAttribute](#type-catalogquerysortedattribute), ([CatalogQueryExact](#type-catalogqueryexact, ([CatalogQueryRange](#type-catalogqueryrange), ([CatalogQueryText](#type-catalogquerytext), ([CatalogQueryItemsForTax](#type-catalogqueryitemsfortax), ([CatalogQueryItemsForModifierList](#type-catalogqueryitemsformodifierlist)). + /// Queries the targeted catalog using a variety of query types ([CatalogQuerySortedAttribute](#type-catalogquerysortedattribute), ([CatalogQueryExact](#type-catalogqueryexact), ([CatalogQueryRange](#type-catalogqueryrange), ([CatalogQueryText](#type-catalogquerytext), ([CatalogQueryItemsForTax](#type-catalogqueryitemsfortax), ([CatalogQueryItemsForModifierList](#type-catalogqueryitemsformodifierlist)). /// /// Thrown when fails to make API call /// An object containing the fields to POST for the request. See the corresponding object definition for field details. @@ -423,7 +423,7 @@ public interface ICatalogApi : IApiAccessor /// SearchCatalogObjects /// /// - /// Queries the targeted catalog using a variety of query types ([CatalogQuerySortedAttribute](#type-catalogquerysortedattribute), ([CatalogQueryExact](#type-catalogqueryexact, ([CatalogQueryRange](#type-catalogqueryrange), ([CatalogQueryText](#type-catalogquerytext), ([CatalogQueryItemsForTax](#type-catalogqueryitemsfortax), ([CatalogQueryItemsForModifierList](#type-catalogqueryitemsformodifierlist)). + /// Queries the targeted catalog using a variety of query types ([CatalogQuerySortedAttribute](#type-catalogquerysortedattribute), ([CatalogQueryExact](#type-catalogqueryexact), ([CatalogQueryRange](#type-catalogqueryrange), ([CatalogQueryText](#type-catalogquerytext), ([CatalogQueryItemsForTax](#type-catalogqueryitemsfortax), ([CatalogQueryItemsForModifierList](#type-catalogqueryitemsformodifierlist)). /// /// Thrown when fails to make API call /// An object containing the fields to POST for the request. See the corresponding object definition for field details. @@ -768,7 +768,7 @@ public async System.Threading.Tasks.Task - /// BatchRetrieveCatalogObjects Returns a set of objects based on the provided ID. [CatalogItem](#type-catalogitem)s returned in the set include all of the child information including: all [CatalogItemVariation](#type-catalogitemvariation) objects, references to its [CatalogModifierList](#type-catalogmodifierlist) objects, and the ids of any [CatalogTax](#type-catalogtax) objects that apply to it. + /// BatchRetrieveCatalogObjects Returns a set of objects based on the provided ID. Each [CatalogItem](#type-catalogitem) returned in the set includes all of its child information including: all of its [CatalogItemVariation](#type-catalogitemvariation) objects, references to its [CatalogModifierList](#type-catalogmodifierlist) objects, and the ids of any [CatalogTax](#type-catalogtax) objects that apply to it. /// /// Thrown when fails to make API call /// An object containing the fields to POST for the request. See the corresponding object definition for field details. @@ -780,7 +780,7 @@ public BatchRetrieveCatalogObjectsResponse BatchRetrieveCatalogObjects (BatchRet } /// - /// BatchRetrieveCatalogObjects Returns a set of objects based on the provided ID. [CatalogItem](#type-catalogitem)s returned in the set include all of the child information including: all [CatalogItemVariation](#type-catalogitemvariation) objects, references to its [CatalogModifierList](#type-catalogmodifierlist) objects, and the ids of any [CatalogTax](#type-catalogtax) objects that apply to it. + /// BatchRetrieveCatalogObjects Returns a set of objects based on the provided ID. Each [CatalogItem](#type-catalogitem) returned in the set includes all of its child information including: all of its [CatalogItemVariation](#type-catalogitemvariation) objects, references to its [CatalogModifierList](#type-catalogmodifierlist) objects, and the ids of any [CatalogTax](#type-catalogtax) objects that apply to it. /// /// Thrown when fails to make API call /// An object containing the fields to POST for the request. See the corresponding object definition for field details. @@ -849,7 +849,7 @@ public ApiResponse< BatchRetrieveCatalogObjectsResponse > BatchRetrieveCatalogOb } /// - /// BatchRetrieveCatalogObjects Returns a set of objects based on the provided ID. [CatalogItem](#type-catalogitem)s returned in the set include all of the child information including: all [CatalogItemVariation](#type-catalogitemvariation) objects, references to its [CatalogModifierList](#type-catalogmodifierlist) objects, and the ids of any [CatalogTax](#type-catalogtax) objects that apply to it. + /// BatchRetrieveCatalogObjects Returns a set of objects based on the provided ID. Each [CatalogItem](#type-catalogitem) returned in the set includes all of its child information including: all of its [CatalogItemVariation](#type-catalogitemvariation) objects, references to its [CatalogModifierList](#type-catalogmodifierlist) objects, and the ids of any [CatalogTax](#type-catalogtax) objects that apply to it. /// /// Thrown when fails to make API call /// An object containing the fields to POST for the request. See the corresponding object definition for field details. @@ -862,7 +862,7 @@ public async System.Threading.Tasks.Task Ba } /// - /// BatchRetrieveCatalogObjects Returns a set of objects based on the provided ID. [CatalogItem](#type-catalogitem)s returned in the set include all of the child information including: all [CatalogItemVariation](#type-catalogitemvariation) objects, references to its [CatalogModifierList](#type-catalogmodifierlist) objects, and the ids of any [CatalogTax](#type-catalogtax) objects that apply to it. + /// BatchRetrieveCatalogObjects Returns a set of objects based on the provided ID. Each [CatalogItem](#type-catalogitem) returned in the set includes all of its child information including: all of its [CatalogItemVariation](#type-catalogitemvariation) objects, references to its [CatalogModifierList](#type-catalogmodifierlist) objects, and the ids of any [CatalogTax](#type-catalogtax) objects that apply to it. /// /// Thrown when fails to make API call /// An object containing the fields to POST for the request. See the corresponding object definition for field details. @@ -1533,7 +1533,7 @@ public async System.Threading.Tasks.Task> ListC /// /// Thrown when fails to make API call /// The object ID of any type of [CatalogObject](#type-catalogobject)s to be retrieved. - /// If `true`, the response will include additional objects that are related to the requested object, as follows: If the `object` field of the response contains a [CatalogItem](#type-catalogitem), its associated [CatalogCategory](#type-catalogcategory), [CatalogTax](#type-catalogtax)es, and [CatalogModifierList](#type-catalogmodifierlist)s will be returned in the `related_objects` field of the response. If the `object` field of the response contains a [CatalogItemVariation](#type-catalogitemvariation), its parent [CatalogItem](#type-catalogitem) will be returned in the `related_objects` field of the response. (optional) + /// If `true`, the response will include additional objects that are related to the requested object, as follows: If the `object` field of the response contains a [CatalogItem](#type-catalogitem), its associated [CatalogCategory](#type-catalogcategory), [CatalogTax](#type-catalogtax)es, and [CatalogModifierList](#type-catalogmodifierlist)s will be returned in the `related_objects` field of the response. If the `object` field of the response contains a [CatalogItemVariation](#type-catalogitemvariation), its parent [CatalogItem](#type-catalogitem) will be returned in the `related_objects` field of the response. Default value: `false` (optional) /// RetrieveCatalogObjectResponse public RetrieveCatalogObjectResponse RetrieveCatalogObject (string objectId, bool? includeRelatedObjects = null) { @@ -1546,7 +1546,7 @@ public RetrieveCatalogObjectResponse RetrieveCatalogObject (string objectId, boo /// /// Thrown when fails to make API call /// The object ID of any type of [CatalogObject](#type-catalogobject)s to be retrieved. - /// If `true`, the response will include additional objects that are related to the requested object, as follows: If the `object` field of the response contains a [CatalogItem](#type-catalogitem), its associated [CatalogCategory](#type-catalogcategory), [CatalogTax](#type-catalogtax)es, and [CatalogModifierList](#type-catalogmodifierlist)s will be returned in the `related_objects` field of the response. If the `object` field of the response contains a [CatalogItemVariation](#type-catalogitemvariation), its parent [CatalogItem](#type-catalogitem) will be returned in the `related_objects` field of the response. (optional) + /// If `true`, the response will include additional objects that are related to the requested object, as follows: If the `object` field of the response contains a [CatalogItem](#type-catalogitem), its associated [CatalogCategory](#type-catalogcategory), [CatalogTax](#type-catalogtax)es, and [CatalogModifierList](#type-catalogmodifierlist)s will be returned in the `related_objects` field of the response. If the `object` field of the response contains a [CatalogItemVariation](#type-catalogitemvariation), its parent [CatalogItem](#type-catalogitem) will be returned in the `related_objects` field of the response. Default value: `false` (optional) /// ApiResponse of RetrieveCatalogObjectResponse public ApiResponse< RetrieveCatalogObjectResponse > RetrieveCatalogObjectWithHttpInfo (string objectId, bool? includeRelatedObjects = null) { @@ -1610,7 +1610,7 @@ public ApiResponse< RetrieveCatalogObjectResponse > RetrieveCatalogObjectWithHtt /// /// Thrown when fails to make API call /// The object ID of any type of [CatalogObject](#type-catalogobject)s to be retrieved. - /// If `true`, the response will include additional objects that are related to the requested object, as follows: If the `object` field of the response contains a [CatalogItem](#type-catalogitem), its associated [CatalogCategory](#type-catalogcategory), [CatalogTax](#type-catalogtax)es, and [CatalogModifierList](#type-catalogmodifierlist)s will be returned in the `related_objects` field of the response. If the `object` field of the response contains a [CatalogItemVariation](#type-catalogitemvariation), its parent [CatalogItem](#type-catalogitem) will be returned in the `related_objects` field of the response. (optional) + /// If `true`, the response will include additional objects that are related to the requested object, as follows: If the `object` field of the response contains a [CatalogItem](#type-catalogitem), its associated [CatalogCategory](#type-catalogcategory), [CatalogTax](#type-catalogtax)es, and [CatalogModifierList](#type-catalogmodifierlist)s will be returned in the `related_objects` field of the response. If the `object` field of the response contains a [CatalogItemVariation](#type-catalogitemvariation), its parent [CatalogItem](#type-catalogitem) will be returned in the `related_objects` field of the response. Default value: `false` (optional) /// Task of RetrieveCatalogObjectResponse public async System.Threading.Tasks.Task RetrieveCatalogObjectAsync (string objectId, bool? includeRelatedObjects = null) { @@ -1624,7 +1624,7 @@ public async System.Threading.Tasks.Task Retrieve /// /// Thrown when fails to make API call /// The object ID of any type of [CatalogObject](#type-catalogobject)s to be retrieved. - /// If `true`, the response will include additional objects that are related to the requested object, as follows: If the `object` field of the response contains a [CatalogItem](#type-catalogitem), its associated [CatalogCategory](#type-catalogcategory), [CatalogTax](#type-catalogtax)es, and [CatalogModifierList](#type-catalogmodifierlist)s will be returned in the `related_objects` field of the response. If the `object` field of the response contains a [CatalogItemVariation](#type-catalogitemvariation), its parent [CatalogItem](#type-catalogitem) will be returned in the `related_objects` field of the response. (optional) + /// If `true`, the response will include additional objects that are related to the requested object, as follows: If the `object` field of the response contains a [CatalogItem](#type-catalogitem), its associated [CatalogCategory](#type-catalogcategory), [CatalogTax](#type-catalogtax)es, and [CatalogModifierList](#type-catalogmodifierlist)s will be returned in the `related_objects` field of the response. If the `object` field of the response contains a [CatalogItemVariation](#type-catalogitemvariation), its parent [CatalogItem](#type-catalogitem) will be returned in the `related_objects` field of the response. Default value: `false` (optional) /// Task of ApiResponse (RetrieveCatalogObjectResponse) public async System.Threading.Tasks.Task> RetrieveCatalogObjectAsyncWithHttpInfo (string objectId, bool? includeRelatedObjects = null) { @@ -1684,7 +1684,7 @@ public async System.Threading.Tasks.Task - /// SearchCatalogObjects Queries the targeted catalog using a variety of query types ([CatalogQuerySortedAttribute](#type-catalogquerysortedattribute), ([CatalogQueryExact](#type-catalogqueryexact, ([CatalogQueryRange](#type-catalogqueryrange), ([CatalogQueryText](#type-catalogquerytext), ([CatalogQueryItemsForTax](#type-catalogqueryitemsfortax), ([CatalogQueryItemsForModifierList](#type-catalogqueryitemsformodifierlist)). + /// SearchCatalogObjects Queries the targeted catalog using a variety of query types ([CatalogQuerySortedAttribute](#type-catalogquerysortedattribute), ([CatalogQueryExact](#type-catalogqueryexact), ([CatalogQueryRange](#type-catalogqueryrange), ([CatalogQueryText](#type-catalogquerytext), ([CatalogQueryItemsForTax](#type-catalogqueryitemsfortax), ([CatalogQueryItemsForModifierList](#type-catalogqueryitemsformodifierlist)). /// /// Thrown when fails to make API call /// An object containing the fields to POST for the request. See the corresponding object definition for field details. @@ -1696,7 +1696,7 @@ public SearchCatalogObjectsResponse SearchCatalogObjects (SearchCatalogObjectsRe } /// - /// SearchCatalogObjects Queries the targeted catalog using a variety of query types ([CatalogQuerySortedAttribute](#type-catalogquerysortedattribute), ([CatalogQueryExact](#type-catalogqueryexact, ([CatalogQueryRange](#type-catalogqueryrange), ([CatalogQueryText](#type-catalogquerytext), ([CatalogQueryItemsForTax](#type-catalogqueryitemsfortax), ([CatalogQueryItemsForModifierList](#type-catalogqueryitemsformodifierlist)). + /// SearchCatalogObjects Queries the targeted catalog using a variety of query types ([CatalogQuerySortedAttribute](#type-catalogquerysortedattribute), ([CatalogQueryExact](#type-catalogqueryexact), ([CatalogQueryRange](#type-catalogqueryrange), ([CatalogQueryText](#type-catalogquerytext), ([CatalogQueryItemsForTax](#type-catalogqueryitemsfortax), ([CatalogQueryItemsForModifierList](#type-catalogqueryitemsformodifierlist)). /// /// Thrown when fails to make API call /// An object containing the fields to POST for the request. See the corresponding object definition for field details. @@ -1765,7 +1765,7 @@ public ApiResponse< SearchCatalogObjectsResponse > SearchCatalogObjectsWithHttpI } /// - /// SearchCatalogObjects Queries the targeted catalog using a variety of query types ([CatalogQuerySortedAttribute](#type-catalogquerysortedattribute), ([CatalogQueryExact](#type-catalogqueryexact, ([CatalogQueryRange](#type-catalogqueryrange), ([CatalogQueryText](#type-catalogquerytext), ([CatalogQueryItemsForTax](#type-catalogqueryitemsfortax), ([CatalogQueryItemsForModifierList](#type-catalogqueryitemsformodifierlist)). + /// SearchCatalogObjects Queries the targeted catalog using a variety of query types ([CatalogQuerySortedAttribute](#type-catalogquerysortedattribute), ([CatalogQueryExact](#type-catalogqueryexact), ([CatalogQueryRange](#type-catalogqueryrange), ([CatalogQueryText](#type-catalogquerytext), ([CatalogQueryItemsForTax](#type-catalogqueryitemsfortax), ([CatalogQueryItemsForModifierList](#type-catalogqueryitemsformodifierlist)). /// /// Thrown when fails to make API call /// An object containing the fields to POST for the request. See the corresponding object definition for field details. @@ -1778,7 +1778,7 @@ public async System.Threading.Tasks.Task SearchCat } /// - /// SearchCatalogObjects Queries the targeted catalog using a variety of query types ([CatalogQuerySortedAttribute](#type-catalogquerysortedattribute), ([CatalogQueryExact](#type-catalogqueryexact, ([CatalogQueryRange](#type-catalogqueryrange), ([CatalogQueryText](#type-catalogquerytext), ([CatalogQueryItemsForTax](#type-catalogqueryitemsfortax), ([CatalogQueryItemsForModifierList](#type-catalogqueryitemsformodifierlist)). + /// SearchCatalogObjects Queries the targeted catalog using a variety of query types ([CatalogQuerySortedAttribute](#type-catalogquerysortedattribute), ([CatalogQueryExact](#type-catalogqueryexact), ([CatalogQueryRange](#type-catalogqueryrange), ([CatalogQueryText](#type-catalogquerytext), ([CatalogQueryItemsForTax](#type-catalogqueryitemsfortax), ([CatalogQueryItemsForModifierList](#type-catalogqueryitemsformodifierlist)). /// /// Thrown when fails to make API call /// An object containing the fields to POST for the request. See the corresponding object definition for field details. diff --git a/src/Square.Connect/Api/CustomersApi.cs b/src/Square.Connect/Api/CustomersApi.cs index 06c023f..8907ffa 100644 --- a/src/Square.Connect/Api/CustomersApi.cs +++ b/src/Square.Connect/Api/CustomersApi.cs @@ -49,7 +49,7 @@ public interface ICustomersApi : IApiAccessor /// CreateCustomerCard /// /// - /// Adds a card on file to an existing customer. + /// Adds a card on file to an existing customer. In the United States Square takes care of automatically updating any cards on file that might have expired since you first attached them to a customer. /// /// Thrown when fails to make API call /// The ID of the customer to link the card on file to. @@ -61,7 +61,7 @@ public interface ICustomersApi : IApiAccessor /// CreateCustomerCard /// /// - /// Adds a card on file to an existing customer. + /// Adds a card on file to an existing customer. In the United States Square takes care of automatically updating any cards on file that might have expired since you first attached them to a customer. /// /// Thrown when fails to make API call /// The ID of the customer to link the card on file to. @@ -158,7 +158,7 @@ public interface ICustomersApi : IApiAccessor /// UpdateCustomer /// /// - /// Updates the details of an existing customer. You cannot edit a customer's cards on file with this endpoint. To make changes to a card on file, you must delete the existing card on file with the [DeleteCustomerCard](#endpoint-deletecustomercard) endpoint, then create a new one with the [CreateCustomerCard](#endpoint-createcustomercard) endpoint. + /// Updates the details of an existing customer. The ID of the customer may change if the customer has been merged into another customer. You cannot edit a customer's cards on file with this endpoint. To make changes to a card on file, you must delete the existing card on file with the [DeleteCustomerCard](#endpoint-deletecustomercard) endpoint, then create a new one with the [CreateCustomerCard](#endpoint-createcustomercard) endpoint. /// /// Thrown when fails to make API call /// The ID of the customer to update. @@ -170,7 +170,7 @@ public interface ICustomersApi : IApiAccessor /// UpdateCustomer /// /// - /// Updates the details of an existing customer. You cannot edit a customer's cards on file with this endpoint. To make changes to a card on file, you must delete the existing card on file with the [DeleteCustomerCard](#endpoint-deletecustomercard) endpoint, then create a new one with the [CreateCustomerCard](#endpoint-createcustomercard) endpoint. + /// Updates the details of an existing customer. The ID of the customer may change if the customer has been merged into another customer. You cannot edit a customer's cards on file with this endpoint. To make changes to a card on file, you must delete the existing card on file with the [DeleteCustomerCard](#endpoint-deletecustomercard) endpoint, then create a new one with the [CreateCustomerCard](#endpoint-createcustomercard) endpoint. /// /// Thrown when fails to make API call /// The ID of the customer to update. @@ -204,7 +204,7 @@ public interface ICustomersApi : IApiAccessor /// CreateCustomerCard /// /// - /// Adds a card on file to an existing customer. + /// Adds a card on file to an existing customer. In the United States Square takes care of automatically updating any cards on file that might have expired since you first attached them to a customer. /// /// Thrown when fails to make API call /// The ID of the customer to link the card on file to. @@ -216,7 +216,7 @@ public interface ICustomersApi : IApiAccessor /// CreateCustomerCard /// /// - /// Adds a card on file to an existing customer. + /// Adds a card on file to an existing customer. In the United States Square takes care of automatically updating any cards on file that might have expired since you first attached them to a customer. /// /// Thrown when fails to make API call /// The ID of the customer to link the card on file to. @@ -313,7 +313,7 @@ public interface ICustomersApi : IApiAccessor /// UpdateCustomer /// /// - /// Updates the details of an existing customer. You cannot edit a customer's cards on file with this endpoint. To make changes to a card on file, you must delete the existing card on file with the [DeleteCustomerCard](#endpoint-deletecustomercard) endpoint, then create a new one with the [CreateCustomerCard](#endpoint-createcustomercard) endpoint. + /// Updates the details of an existing customer. The ID of the customer may change if the customer has been merged into another customer. You cannot edit a customer's cards on file with this endpoint. To make changes to a card on file, you must delete the existing card on file with the [DeleteCustomerCard](#endpoint-deletecustomercard) endpoint, then create a new one with the [CreateCustomerCard](#endpoint-createcustomercard) endpoint. /// /// Thrown when fails to make API call /// The ID of the customer to update. @@ -325,7 +325,7 @@ public interface ICustomersApi : IApiAccessor /// UpdateCustomer /// /// - /// Updates the details of an existing customer. You cannot edit a customer's cards on file with this endpoint. To make changes to a card on file, you must delete the existing card on file with the [DeleteCustomerCard](#endpoint-deletecustomercard) endpoint, then create a new one with the [CreateCustomerCard](#endpoint-createcustomercard) endpoint. + /// Updates the details of an existing customer. The ID of the customer may change if the customer has been merged into another customer. You cannot edit a customer's cards on file with this endpoint. To make changes to a card on file, you must delete the existing card on file with the [DeleteCustomerCard](#endpoint-deletecustomercard) endpoint, then create a new one with the [CreateCustomerCard](#endpoint-createcustomercard) endpoint. /// /// Thrown when fails to make API call /// The ID of the customer to update. @@ -608,7 +608,7 @@ public async System.Threading.Tasks.Task> Cr } /// - /// CreateCustomerCard Adds a card on file to an existing customer. + /// CreateCustomerCard Adds a card on file to an existing customer. In the United States Square takes care of automatically updating any cards on file that might have expired since you first attached them to a customer. /// /// Thrown when fails to make API call /// The ID of the customer to link the card on file to. @@ -621,7 +621,7 @@ public CreateCustomerCardResponse CreateCustomerCard (string customerId, CreateC } /// - /// CreateCustomerCard Adds a card on file to an existing customer. + /// CreateCustomerCard Adds a card on file to an existing customer. In the United States Square takes care of automatically updating any cards on file that might have expired since you first attached them to a customer. /// /// Thrown when fails to make API call /// The ID of the customer to link the card on file to. @@ -695,7 +695,7 @@ public ApiResponse< CreateCustomerCardResponse > CreateCustomerCardWithHttpInfo } /// - /// CreateCustomerCard Adds a card on file to an existing customer. + /// CreateCustomerCard Adds a card on file to an existing customer. In the United States Square takes care of automatically updating any cards on file that might have expired since you first attached them to a customer. /// /// Thrown when fails to make API call /// The ID of the customer to link the card on file to. @@ -709,7 +709,7 @@ public async System.Threading.Tasks.Task CreateCusto } /// - /// CreateCustomerCard Adds a card on file to an existing customer. + /// CreateCustomerCard Adds a card on file to an existing customer. In the United States Square takes care of automatically updating any cards on file that might have expired since you first attached them to a customer. /// /// Thrown when fails to make API call /// The ID of the customer to link the card on file to. @@ -1385,7 +1385,7 @@ public async System.Threading.Tasks.Task> } /// - /// UpdateCustomer Updates the details of an existing customer. You cannot edit a customer's cards on file with this endpoint. To make changes to a card on file, you must delete the existing card on file with the [DeleteCustomerCard](#endpoint-deletecustomercard) endpoint, then create a new one with the [CreateCustomerCard](#endpoint-createcustomercard) endpoint. + /// UpdateCustomer Updates the details of an existing customer. The ID of the customer may change if the customer has been merged into another customer. You cannot edit a customer's cards on file with this endpoint. To make changes to a card on file, you must delete the existing card on file with the [DeleteCustomerCard](#endpoint-deletecustomercard) endpoint, then create a new one with the [CreateCustomerCard](#endpoint-createcustomercard) endpoint. /// /// Thrown when fails to make API call /// The ID of the customer to update. @@ -1398,7 +1398,7 @@ public UpdateCustomerResponse UpdateCustomer (string customerId, UpdateCustomerR } /// - /// UpdateCustomer Updates the details of an existing customer. You cannot edit a customer's cards on file with this endpoint. To make changes to a card on file, you must delete the existing card on file with the [DeleteCustomerCard](#endpoint-deletecustomercard) endpoint, then create a new one with the [CreateCustomerCard](#endpoint-createcustomercard) endpoint. + /// UpdateCustomer Updates the details of an existing customer. The ID of the customer may change if the customer has been merged into another customer. You cannot edit a customer's cards on file with this endpoint. To make changes to a card on file, you must delete the existing card on file with the [DeleteCustomerCard](#endpoint-deletecustomercard) endpoint, then create a new one with the [CreateCustomerCard](#endpoint-createcustomercard) endpoint. /// /// Thrown when fails to make API call /// The ID of the customer to update. @@ -1472,7 +1472,7 @@ public ApiResponse< UpdateCustomerResponse > UpdateCustomerWithHttpInfo (string } /// - /// UpdateCustomer Updates the details of an existing customer. You cannot edit a customer's cards on file with this endpoint. To make changes to a card on file, you must delete the existing card on file with the [DeleteCustomerCard](#endpoint-deletecustomercard) endpoint, then create a new one with the [CreateCustomerCard](#endpoint-createcustomercard) endpoint. + /// UpdateCustomer Updates the details of an existing customer. The ID of the customer may change if the customer has been merged into another customer. You cannot edit a customer's cards on file with this endpoint. To make changes to a card on file, you must delete the existing card on file with the [DeleteCustomerCard](#endpoint-deletecustomercard) endpoint, then create a new one with the [CreateCustomerCard](#endpoint-createcustomercard) endpoint. /// /// Thrown when fails to make API call /// The ID of the customer to update. @@ -1486,7 +1486,7 @@ public async System.Threading.Tasks.Task UpdateCustomerA } /// - /// UpdateCustomer Updates the details of an existing customer. You cannot edit a customer's cards on file with this endpoint. To make changes to a card on file, you must delete the existing card on file with the [DeleteCustomerCard](#endpoint-deletecustomercard) endpoint, then create a new one with the [CreateCustomerCard](#endpoint-createcustomercard) endpoint. + /// UpdateCustomer Updates the details of an existing customer. The ID of the customer may change if the customer has been merged into another customer. You cannot edit a customer's cards on file with this endpoint. To make changes to a card on file, you must delete the existing card on file with the [DeleteCustomerCard](#endpoint-deletecustomercard) endpoint, then create a new one with the [CreateCustomerCard](#endpoint-createcustomercard) endpoint. /// /// Thrown when fails to make API call /// The ID of the customer to update. diff --git a/src/Square.Connect/Api/TransactionsApi.cs b/src/Square.Connect/Api/TransactionsApi.cs index ba879bd..65fdd49 100644 --- a/src/Square.Connect/Api/TransactionsApi.cs +++ b/src/Square.Connect/Api/TransactionsApi.cs @@ -74,7 +74,7 @@ public interface ITransactionsApi : IApiAccessor /// CreateRefund /// /// - /// Initiates a refund for a previously charged tender. + /// Initiates a refund for a previously charged tender. You must issue a refund within 120 days of the associated payment. See (this article)[https://squareup.com/help/us/en/article/5060] for more information on refund behavior. /// /// Thrown when fails to make API call /// The ID of the original transaction's associated location. @@ -87,7 +87,7 @@ public interface ITransactionsApi : IApiAccessor /// CreateRefund /// /// - /// Initiates a refund for a previously charged tender. + /// Initiates a refund for a previously charged tender. You must issue a refund within 120 days of the associated payment. See (this article)[https://squareup.com/help/us/en/article/5060] for more information on refund behavior. /// /// Thrown when fails to make API call /// The ID of the original transaction's associated location. @@ -251,7 +251,7 @@ public interface ITransactionsApi : IApiAccessor /// CreateRefund /// /// - /// Initiates a refund for a previously charged tender. + /// Initiates a refund for a previously charged tender. You must issue a refund within 120 days of the associated payment. See (this article)[https://squareup.com/help/us/en/article/5060] for more information on refund behavior. /// /// Thrown when fails to make API call /// The ID of the original transaction's associated location. @@ -264,7 +264,7 @@ public interface ITransactionsApi : IApiAccessor /// CreateRefund /// /// - /// Initiates a refund for a previously charged tender. + /// Initiates a refund for a previously charged tender. You must issue a refund within 120 days of the associated payment. See (this article)[https://squareup.com/help/us/en/article/5060] for more information on refund behavior. /// /// Thrown when fails to make API call /// The ID of the original transaction's associated location. @@ -825,7 +825,7 @@ public async System.Threading.Tasks.Task> ChargeAsyn } /// - /// CreateRefund Initiates a refund for a previously charged tender. + /// CreateRefund Initiates a refund for a previously charged tender. You must issue a refund within 120 days of the associated payment. See (this article)[https://squareup.com/help/us/en/article/5060] for more information on refund behavior. /// /// Thrown when fails to make API call /// The ID of the original transaction's associated location. @@ -839,7 +839,7 @@ public CreateRefundResponse CreateRefund (string locationId, string transactionI } /// - /// CreateRefund Initiates a refund for a previously charged tender. + /// CreateRefund Initiates a refund for a previously charged tender. You must issue a refund within 120 days of the associated payment. See (this article)[https://squareup.com/help/us/en/article/5060] for more information on refund behavior. /// /// Thrown when fails to make API call /// The ID of the original transaction's associated location. @@ -918,7 +918,7 @@ public ApiResponse< CreateRefundResponse > CreateRefundWithHttpInfo (string loca } /// - /// CreateRefund Initiates a refund for a previously charged tender. + /// CreateRefund Initiates a refund for a previously charged tender. You must issue a refund within 120 days of the associated payment. See (this article)[https://squareup.com/help/us/en/article/5060] for more information on refund behavior. /// /// Thrown when fails to make API call /// The ID of the original transaction's associated location. @@ -933,7 +933,7 @@ public async System.Threading.Tasks.Task CreateRefundAsync } /// - /// CreateRefund Initiates a refund for a previously charged tender. + /// CreateRefund Initiates a refund for a previously charged tender. You must issue a refund within 120 days of the associated payment. See (this article)[https://squareup.com/help/us/en/article/5060] for more information on refund behavior. /// /// Thrown when fails to make API call /// The ID of the original transaction's associated location. diff --git a/src/Square.Connect/Client/Configuration.cs b/src/Square.Connect/Client/Configuration.cs index 65bc74e..c2817f6 100644 --- a/src/Square.Connect/Client/Configuration.cs +++ b/src/Square.Connect/Client/Configuration.cs @@ -46,7 +46,7 @@ public Configuration(ApiClient apiClient = null, string tempFolderPath = null, string dateTimeFormat = null, int timeout = 100000, - string userAgent = "Square-Connect-CSharp/2.1.0" + string userAgent = "Square-Connect-CSharp/2.2.0" ) { setApiClientUsingDefault(apiClient); @@ -81,7 +81,7 @@ public Configuration(ApiClient apiClient) /// Version of the package. /// /// Version of the package. - public const string Version = "2.1.0"; + public const string Version = "2.2.0"; /// /// Gets or sets the default Configuration. @@ -318,7 +318,7 @@ public static String ToDebugReport() .GetReferencedAssemblies() .Where(x => x.Name == "System.Core").First().Version.ToString() + "\n"; report += " Version of the API: 2.0\n"; - report += " SDK Package Version: 2.1.0\n"; + report += " SDK Package Version: 2.2.0\n"; return report; } diff --git a/src/Square.Connect/Model/Card.cs b/src/Square.Connect/Model/Card.cs index 9a372a7..c308fe8 100644 --- a/src/Square.Connect/Model/Card.cs +++ b/src/Square.Connect/Model/Card.cs @@ -108,7 +108,8 @@ public enum CardBrandEnum /// The four-digit year of the card's expiration date.. /// The cardholder name. This value is present only if this object represents a customer's card on file.. /// The card's billing address. This value is present only if this object represents a customer's card on file.. - public Card(string Id = default(string), CardBrandEnum? CardBrand = default(CardBrandEnum?), string Last4 = default(string), long? ExpMonth = default(long?), long? ExpYear = default(long?), string CardholderName = default(string), Address BillingAddress = default(Address)) + /// The unique string fingerprint for the card. The fingerprint is based on the credit card number and is unique to the merchant. If a card is used at multiple locations for the same merchant, it will have the same fingerprint in each case. Note: Fingerprint may not exist on old transactions.. + public Card(string Id = default(string), CardBrandEnum? CardBrand = default(CardBrandEnum?), string Last4 = default(string), long? ExpMonth = default(long?), long? ExpYear = default(long?), string CardholderName = default(string), Address BillingAddress = default(Address), string Fingerprint = default(string)) { this.Id = Id; this.CardBrand = CardBrand; @@ -117,6 +118,7 @@ public enum CardBrandEnum this.ExpYear = ExpYear; this.CardholderName = CardholderName; this.BillingAddress = BillingAddress; + this.Fingerprint = Fingerprint; } /// @@ -156,6 +158,12 @@ public enum CardBrandEnum [DataMember(Name="billing_address", EmitDefaultValue=false)] public Address BillingAddress { get; set; } /// + /// The unique string fingerprint for the card. The fingerprint is based on the credit card number and is unique to the merchant. If a card is used at multiple locations for the same merchant, it will have the same fingerprint in each case. Note: Fingerprint may not exist on old transactions. + /// + /// The unique string fingerprint for the card. The fingerprint is based on the credit card number and is unique to the merchant. If a card is used at multiple locations for the same merchant, it will have the same fingerprint in each case. Note: Fingerprint may not exist on old transactions. + [DataMember(Name="fingerprint", EmitDefaultValue=false)] + public string Fingerprint { get; set; } + /// /// Returns the string presentation of the object /// /// String presentation of the object @@ -170,6 +178,7 @@ public override string ToString() sb.Append(" ExpYear: ").Append(ExpYear).Append("\n"); sb.Append(" CardholderName: ").Append(CardholderName).Append("\n"); sb.Append(" BillingAddress: ").Append(BillingAddress).Append("\n"); + sb.Append(" Fingerprint: ").Append(Fingerprint).Append("\n"); sb.Append("}\n"); return sb.ToString(); } @@ -240,6 +249,11 @@ public bool Equals(Card other) this.BillingAddress == other.BillingAddress || this.BillingAddress != null && this.BillingAddress.Equals(other.BillingAddress) + ) && + ( + this.Fingerprint == other.Fingerprint || + this.Fingerprint != null && + this.Fingerprint.Equals(other.Fingerprint) ); } @@ -268,6 +282,8 @@ public override int GetHashCode() hash = hash * 59 + this.CardholderName.GetHashCode(); if (this.BillingAddress != null) hash = hash * 59 + this.BillingAddress.GetHashCode(); + if (this.Fingerprint != null) + hash = hash * 59 + this.Fingerprint.GetHashCode(); return hash; } } diff --git a/src/Square.Connect/Model/CatalogItem.cs b/src/Square.Connect/Model/CatalogItem.cs index 7211392..a3c748e 100644 --- a/src/Square.Connect/Model/CatalogItem.cs +++ b/src/Square.Connect/Model/CatalogItem.cs @@ -85,7 +85,7 @@ protected CatalogItem() { } /// The item's name. Searchable. (required). /// The item's description. Searchable.. /// 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.. - /// The color of the item's display label in the Square Point of Sale app. Searchable.. + /// The color of the item's display label in the Square Point of Sale app.. /// If `true`, the item can be added to shipping orders from the merchant's online store.. /// If `true`, the item can be added to pickup orders from the merchant's online store.. /// If `true`, the item can be added to electronically fulfilled orders from the merchant's online store.. @@ -141,9 +141,9 @@ protected CatalogItem() { } [DataMember(Name="abbreviation", EmitDefaultValue=false)] public string Abbreviation { get; set; } /// - /// The color of the item's display label in the Square Point of Sale app. Searchable. + /// The color of the item's display label in the Square Point of Sale app. /// - /// The color of the item's display label in the Square Point of Sale app. Searchable. + /// The color of the item's display label in the Square Point of Sale app. [DataMember(Name="label_color", EmitDefaultValue=false)] public string LabelColor { get; set; } /// diff --git a/src/Square.Connect/Model/CatalogItemProductType.cs b/src/Square.Connect/Model/CatalogItemProductType.cs index b2c8e80..410542e 100644 --- a/src/Square.Connect/Model/CatalogItemProductType.cs +++ b/src/Square.Connect/Model/CatalogItemProductType.cs @@ -24,9 +24,9 @@ namespace Square.Connect.Model { /// - /// The type of a [CatalogItem](#type-catalogitem). + /// The type of a [CatalogItem](#type-catalogitem). Connect V2 only allows the creation of `REGULAR` items. /// - /// The type of a [CatalogItem](#type-catalogitem). + /// The type of a [CatalogItem](#type-catalogitem). Connect V2 only allows the creation of `REGULAR` items. [JsonConverter(typeof(StringEnumConverter))] public enum CatalogItemProductType { diff --git a/src/Square.Connect/Model/CatalogItemVariation.cs b/src/Square.Connect/Model/CatalogItemVariation.cs index a396773..6acee22 100644 --- a/src/Square.Connect/Model/CatalogItemVariation.cs +++ b/src/Square.Connect/Model/CatalogItemVariation.cs @@ -92,7 +92,7 @@ public enum InventoryAlertTypeEnum /// The item variation's UPC, if any. Searchable.. /// Indicates whether the item variation's price is fixed or determined at the time of sale. See [CatalogPricingType](#type-catalogpricingtype) for all possible values.. /// The item variation's price, if fixed pricing is used.. - /// Per-location price and inventory overrides.. + /// Per-[location][#type-location] price and inventory overrides.. /// If `true`, inventory tracking is active for the variation.. /// Indicates whether the item variation displays an alert when its inventory quantity is less than or equal to its `inventory_alert_threshold`. See [InventoryAlertType](#type-inventoryalerttype) for all possible values.. /// If the inventory quantity for the variation is less than or equal to this value and `inventory_alert_type` is `LOW_QUANTITY`, the variation displays an alert in the merchant dashboard. This value is always an integer.. @@ -145,9 +145,9 @@ public enum InventoryAlertTypeEnum [DataMember(Name="price_money", EmitDefaultValue=false)] public Money PriceMoney { get; set; } /// - /// Per-location price and inventory overrides. + /// Per-[location][#type-location] price and inventory overrides. /// - /// Per-location price and inventory overrides. + /// Per-[location][#type-location] price and inventory overrides. [DataMember(Name="location_overrides", EmitDefaultValue=false)] public List LocationOverrides { get; set; } /// diff --git a/src/Square.Connect/Model/CatalogObject.cs b/src/Square.Connect/Model/CatalogObject.cs index a94d5cc..5f468f4 100644 --- a/src/Square.Connect/Model/CatalogObject.cs +++ b/src/Square.Connect/Model/CatalogObject.cs @@ -95,11 +95,11 @@ protected CatalogObject() { } /// Initializes a new instance of the class. /// /// 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 all possible values. (required). - /// A unique Square-assigned identifier to reference this object in the catalog. (required). + /// 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. (required). /// 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.. /// 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.. - /// 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. being inserted. When deleted, the `updated_at` field will equal the deletion time.. - /// The Connect V1 IDs for this object at each 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.. + /// 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.. + /// 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.. /// 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.. /// A list of locations where the object is present, even if `present_at_all_locations` is `false`.. /// A list of locations where the object is not present, even if `present_at_all_locations` is `true`.. @@ -147,9 +147,9 @@ protected CatalogObject() { } } /// - /// A unique Square-assigned identifier to reference this object in the catalog. + /// 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. /// - /// A unique Square-assigned identifier to reference this object in the catalog. + /// 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. [DataMember(Name="id", EmitDefaultValue=false)] public string Id { get; set; } /// @@ -165,15 +165,15 @@ protected CatalogObject() { } [DataMember(Name="version", EmitDefaultValue=false)] public long? Version { get; set; } /// - /// 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. being inserted. When deleted, the `updated_at` field will equal the deletion time. + /// 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. /// - /// 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. being inserted. When deleted, the `updated_at` field will equal the deletion time. + /// 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. [DataMember(Name="is_deleted", EmitDefaultValue=false)] public bool? IsDeleted { get; set; } /// - /// The Connect V1 IDs for this object at each 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. + /// 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. /// - /// The Connect V1 IDs for this object at each 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. + /// 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. [DataMember(Name="catalog_v1_ids", EmitDefaultValue=false)] public List CatalogV1Ids { get; set; } /// diff --git a/src/Square.Connect/Model/CatalogQuery.cs b/src/Square.Connect/Model/CatalogQuery.cs index 123713d..cb488c3 100644 --- a/src/Square.Connect/Model/CatalogQuery.cs +++ b/src/Square.Connect/Model/CatalogQuery.cs @@ -24,7 +24,7 @@ namespace Square.Connect.Model { /// - /// A query to be applied to a [SearchCatalogObjectsRequest](#type-searchcatalogobjectsrequest) 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), or [CatalogModifier](#type-catalogmodifier)). For example, a query that should return Items may specify an 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\"`. /// [DataContract] public partial class CatalogQuery : IEquatable, IValidatableObject @@ -36,7 +36,7 @@ public partial class CatalogQuery : IEquatable, IValidatableObjec /// A query that returns only objects for which the given (string-valued) attribute has the given case-insensitive value.. /// A query that returns only objects for which the given (string-valued) attribute has the given case-insensitive prefix.. /// A query that returns only objects for which the given (integer-valued) attribute lies in the given range.. - /// A query that returns only objects whose searchable attributes contain all of the given keywords as prefixes. For example, if a [CatalogItem](#type-catalogitem) contains attributes `{\"name\": \"t-shirt\"}` and `{\"description\": \"Small, Red\"}`, it will be matched by the query `{\"keywords\": [\"shirt\", \"sm\", \"re\"]}`.. + /// A query that returns only objects whose searchable attributes contain all of the given keywords as prefixes. For example, if a [CatalogItem](#type-catalogitem) contains attributes `{\"name\": \"t-shirt\"}` and `{\"description\": \"Small, Purple\"}`, it will be matched by the query `{\"keywords\": [\"shirt\", \"sma\", \"purp\"]}`.. /// A query that returns all [CatalogItem](#type-catalogitem)s that have any of the given [CatalogTax](#type-catalogtax)es enabled.. /// A query that returns all [CatalogItem](#type-catalogitem)s that have any of the given [CatalogModifierList](#type-catalogmodifierlist)s enabled.. public CatalogQuery(CatalogQuerySortedAttribute SortedAttributeQuery = default(CatalogQuerySortedAttribute), CatalogQueryExact ExactQuery = default(CatalogQueryExact), CatalogQueryPrefix PrefixQuery = default(CatalogQueryPrefix), CatalogQueryRange RangeQuery = default(CatalogQueryRange), CatalogQueryText TextQuery = default(CatalogQueryText), CatalogQueryItemsForTax ItemsForTaxQuery = default(CatalogQueryItemsForTax), CatalogQueryItemsForModifierList ItemsForModifierListQuery = default(CatalogQueryItemsForModifierList)) @@ -75,9 +75,9 @@ public partial class CatalogQuery : IEquatable, IValidatableObjec [DataMember(Name="range_query", EmitDefaultValue=false)] public CatalogQueryRange RangeQuery { get; set; } /// - /// A query that returns only objects whose searchable attributes contain all of the given keywords as prefixes. For example, if a [CatalogItem](#type-catalogitem) contains attributes `{\"name\": \"t-shirt\"}` and `{\"description\": \"Small, Red\"}`, it will be matched by the query `{\"keywords\": [\"shirt\", \"sm\", \"re\"]}`. + /// A query that returns only objects whose searchable attributes contain all of the given keywords as prefixes. For example, if a [CatalogItem](#type-catalogitem) contains attributes `{\"name\": \"t-shirt\"}` and `{\"description\": \"Small, Purple\"}`, it will be matched by the query `{\"keywords\": [\"shirt\", \"sma\", \"purp\"]}`. /// - /// A query that returns only objects whose searchable attributes contain all of the given keywords as prefixes. For example, if a [CatalogItem](#type-catalogitem) contains attributes `{\"name\": \"t-shirt\"}` and `{\"description\": \"Small, Red\"}`, it will be matched by the query `{\"keywords\": [\"shirt\", \"sm\", \"re\"]}`. + /// A query that returns only objects whose searchable attributes contain all of the given keywords as prefixes. For example, if a [CatalogItem](#type-catalogitem) contains attributes `{\"name\": \"t-shirt\"}` and `{\"description\": \"Small, Purple\"}`, it will be matched by the query `{\"keywords\": [\"shirt\", \"sma\", \"purp\"]}`. [DataMember(Name="text_query", EmitDefaultValue=false)] public CatalogQueryText TextQuery { get; set; } /// diff --git a/src/Square.Connect/Model/CatalogTax.cs b/src/Square.Connect/Model/CatalogTax.cs index 62d96d3..b69c672 100644 --- a/src/Square.Connect/Model/CatalogTax.cs +++ b/src/Square.Connect/Model/CatalogTax.cs @@ -94,7 +94,7 @@ protected CatalogTax() { } /// The tax's name. Searchable. (required). /// Whether the tax is calculated based on a payment's subtotal or total. See [TaxCalculationPhase](#type-taxcalculationphase) for all possible values.. /// Whether the tax is `ADDITIVE` or `INCLUSIVE`. See [TaxInclusionType](#type-taxinclusiontype) for all possible values.. - /// The percentage of the tax in decimal form, using a '.' as the decimal separator and without a '%' sign. A value of `7.5` corresponds to 7.5%.. + /// The percentage of the tax in decimal form, using a `'.'` as the decimal separator and without a `'%'` sign. A value of `7.5` corresponds to 7.5%.. /// If `true`, the fee applies to custom amounts entered into the Square Point of Sale app that are not associated with a particular [CatalogItem](#type-catalogitem).. /// If `true`, the tax will be shown as enabled in the Square Point of Sale app.. public CatalogTax(string Name = default(string), CalculationPhaseEnum? CalculationPhase = default(CalculationPhaseEnum?), InclusionTypeEnum? InclusionType = default(InclusionTypeEnum?), string Percentage = default(string), bool? AppliesToCustomAmounts = default(bool?), bool? Enabled = default(bool?)) @@ -122,9 +122,9 @@ protected CatalogTax() { } [DataMember(Name="name", EmitDefaultValue=false)] public string Name { get; set; } /// - /// The percentage of the tax in decimal form, using a '.' as the decimal separator and without a '%' sign. A value of `7.5` corresponds to 7.5%. + /// The percentage of the tax in decimal form, using a `'.'` as the decimal separator and without a `'%'` sign. A value of `7.5` corresponds to 7.5%. /// - /// The percentage of the tax in decimal form, using a '.' as the decimal separator and without a '%' sign. A value of `7.5` corresponds to 7.5%. + /// The percentage of the tax in decimal form, using a `'.'` as the decimal separator and without a `'%'` sign. A value of `7.5` corresponds to 7.5%. [DataMember(Name="percentage", EmitDefaultValue=false)] public string Percentage { get; set; } /// diff --git a/src/Square.Connect/Model/CatalogV1Id.cs b/src/Square.Connect/Model/CatalogV1Id.cs index 361bd94..a394040 100644 --- a/src/Square.Connect/Model/CatalogV1Id.cs +++ b/src/Square.Connect/Model/CatalogV1Id.cs @@ -24,7 +24,7 @@ namespace Square.Connect.Model { /// - /// An Items Connect V1 object ID along with its associated location ID. + /// An Items Connect V1 object ID along with its associated [location][#type-location] ID. /// [DataContract] public partial class CatalogV1Id : IEquatable, IValidatableObject @@ -33,7 +33,7 @@ public partial class CatalogV1Id : IEquatable, IValidatableObject /// Initializes a new instance of the class. /// /// The ID for an object in Connect V1, if different from its Connect V2 ID.. - /// The ID of the location this Connect V1 ID is associated with.. + /// The ID of the [location][#type-location] this Connect V1 ID is associated with.. public CatalogV1Id(string _CatalogV1Id = default(string), string LocationId = default(string)) { this._CatalogV1Id = _CatalogV1Id; @@ -47,9 +47,9 @@ public partial class CatalogV1Id : IEquatable, IValidatableObject [DataMember(Name="catalog_v1_id", EmitDefaultValue=false)] public string _CatalogV1Id { get; set; } /// - /// The ID of the location this Connect V1 ID is associated with. + /// The ID of the [location][#type-location] this Connect V1 ID is associated with. /// - /// The ID of the location this Connect V1 ID is associated with. + /// The ID of the [location][#type-location] this Connect V1 ID is associated with. [DataMember(Name="location_id", EmitDefaultValue=false)] public string LocationId { get; set; } /// diff --git a/src/Square.Connect/Model/CreateCheckoutRequest.cs b/src/Square.Connect/Model/CreateCheckoutRequest.cs index f6365ba..4bd791e 100644 --- a/src/Square.Connect/Model/CreateCheckoutRequest.cs +++ b/src/Square.Connect/Model/CreateCheckoutRequest.cs @@ -44,7 +44,7 @@ protected CreateCheckoutRequest() { } /// If provided, the buyer's email is pre-populated on the checkout page as an editable text field. Default: none; only exists if explicitly set.. /// If provided, the buyer's shipping info is pre-populated on the checkout page as editable text fields. Default: none; only exists if explicitly set.. /// The URL to redirect to after checkout is completed with `checkoutId`, Square's `orderId`, `transactionId`, and `referenceId` appended as URL parameters. For example, if the provided redirect_url is `http://www.example.com/order-complete`, a successful transaction redirects the customer to: `http://www.example.com/order-complete?checkoutId=xxxxxx&orderId=xxxxxx&referenceId=xxxxxx&transactionId=xxxxxx` If you do not provide a redirect URL, Square Checkout will display an order confirmation page on your behalf; however Square strongly recommends that you provide a redirect URL so you can verify the transaction results and finalize the order through your existing/normal confirmation workflow. Default: none; only exists if explicitly set.. - public CreateCheckoutRequest(string IdempotencyKey = default(string), CreateOrderRequestOrder Order = default(CreateOrderRequestOrder), bool? AskForShippingAddress = default(bool?), string MerchantSupportEmail = default(string), string PrePopulateBuyerEmail = default(string), Address PrePopulateShippingAddress = default(Address), string RedirectUrl = default(string)) + public CreateCheckoutRequest(string IdempotencyKey = default(string), CreateOrderRequest Order = default(CreateOrderRequest), bool? AskForShippingAddress = default(bool?), string MerchantSupportEmail = default(string), string PrePopulateBuyerEmail = default(string), Address PrePopulateShippingAddress = default(Address), string RedirectUrl = default(string)) { // to ensure "IdempotencyKey" is required (not null) if (IdempotencyKey == null) @@ -82,7 +82,7 @@ protected CreateCheckoutRequest() { } /// /// The order including line items to be checked out. [DataMember(Name="order", EmitDefaultValue=false)] - public CreateOrderRequestOrder Order { get; set; } + public CreateOrderRequest Order { get; set; } /// /// If `true`, Square Checkout will collect shipping information on your behalf and store that information with the transaction information in your Square Dashboard. Default: `false`. /// diff --git a/src/Square.Connect/Model/CreateOrderRequestOrder.cs b/src/Square.Connect/Model/CreateOrderRequest.cs similarity index 68% rename from src/Square.Connect/Model/CreateOrderRequestOrder.cs rename to src/Square.Connect/Model/CreateOrderRequest.cs index d056cf2..d33c62d 100644 --- a/src/Square.Connect/Model/CreateOrderRequestOrder.cs +++ b/src/Square.Connect/Model/CreateOrderRequest.cs @@ -24,33 +24,37 @@ namespace Square.Connect.Model { /// - /// The object describes the order. + /// Defines the parameters that can be included in the body of a request to the [CreateCheckout](#endpoint-createcheckout) endpoint. /// [DataContract] - public partial class CreateOrderRequestOrder : IEquatable, IValidatableObject + public partial class CreateOrderRequest : IEquatable, IValidatableObject { /// - /// Initializes a new instance of the class. + /// Initializes a new instance of the class. /// [JsonConstructorAttribute] - protected CreateOrderRequestOrder() { } + protected CreateOrderRequest() { } /// - /// Initializes a new instance of the class. + /// Initializes a new instance of the class. /// /// An optional ID you can associate with the order for your own purposes (such as to associate the order with an entity ID in your own database). This value cannot exceed 40 characters.. /// The line items to associate with this order. Each line item represents a different product (or a custom monetary amount) to include in a purchase. (required). - public CreateOrderRequestOrder(string ReferenceId = default(string), List LineItems = default(List)) + /// The taxes include the custom taxes.. + /// The discounts include the custom discounts .. + public CreateOrderRequest(string ReferenceId = default(string), List LineItems = default(List), List Taxes = default(List), List Discounts = default(List)) { // to ensure "LineItems" is required (not null) if (LineItems == null) { - throw new InvalidDataException("LineItems is a required property for CreateOrderRequestOrder and cannot be null"); + throw new InvalidDataException("LineItems is a required property for CreateOrderRequest and cannot be null"); } else { this.LineItems = LineItems; } this.ReferenceId = ReferenceId; + this.Taxes = Taxes; + this.Discounts = Discounts; } /// @@ -66,15 +70,29 @@ protected CreateOrderRequestOrder() { } [DataMember(Name="line_items", EmitDefaultValue=false)] public List LineItems { get; set; } /// + /// The taxes include the custom taxes. + /// + /// The taxes include the custom taxes. + [DataMember(Name="taxes", EmitDefaultValue=false)] + public List Taxes { get; set; } + /// + /// The discounts include the custom discounts . + /// + /// The discounts include the custom discounts . + [DataMember(Name="discounts", EmitDefaultValue=false)] + public List Discounts { get; set; } + /// /// Returns the string presentation of the object /// /// String presentation of the object public override string ToString() { var sb = new StringBuilder(); - sb.Append("class CreateOrderRequestOrder {\n"); + sb.Append("class CreateOrderRequest {\n"); sb.Append(" ReferenceId: ").Append(ReferenceId).Append("\n"); sb.Append(" LineItems: ").Append(LineItems).Append("\n"); + sb.Append(" Taxes: ").Append(Taxes).Append("\n"); + sb.Append(" Discounts: ").Append(Discounts).Append("\n"); sb.Append("}\n"); return sb.ToString(); } @@ -96,15 +114,15 @@ public string ToJson() public override bool Equals(object obj) { // credit: http://stackoverflow.com/a/10454552/677735 - return this.Equals(obj as CreateOrderRequestOrder); + return this.Equals(obj as CreateOrderRequest); } /// - /// Returns true if CreateOrderRequestOrder instances are equal + /// Returns true if CreateOrderRequest instances are equal /// - /// Instance of CreateOrderRequestOrder to be compared + /// Instance of CreateOrderRequest to be compared /// Boolean - public bool Equals(CreateOrderRequestOrder other) + public bool Equals(CreateOrderRequest other) { // credit: http://stackoverflow.com/a/10454552/677735 if (other == null) @@ -120,6 +138,16 @@ public bool Equals(CreateOrderRequestOrder other) this.LineItems == other.LineItems || this.LineItems != null && this.LineItems.SequenceEqual(other.LineItems) + ) && + ( + this.Taxes == other.Taxes || + this.Taxes != null && + this.Taxes.SequenceEqual(other.Taxes) + ) && + ( + this.Discounts == other.Discounts || + this.Discounts != null && + this.Discounts.SequenceEqual(other.Discounts) ); } @@ -138,6 +166,10 @@ public override int GetHashCode() hash = hash * 59 + this.ReferenceId.GetHashCode(); if (this.LineItems != null) hash = hash * 59 + this.LineItems.GetHashCode(); + if (this.Taxes != null) + hash = hash * 59 + this.Taxes.GetHashCode(); + if (this.Discounts != null) + hash = hash * 59 + this.Discounts.GetHashCode(); return hash; } } diff --git a/src/Square.Connect/Model/CreateOrderRequestDiscount.cs b/src/Square.Connect/Model/CreateOrderRequestDiscount.cs new file mode 100644 index 0000000..5e0cb59 --- /dev/null +++ b/src/Square.Connect/Model/CreateOrderRequestDiscount.cs @@ -0,0 +1,160 @@ +/* + * Square Connect API + * + * Client library for accessing the Square Connect APIs + * + * OpenAPI spec version: 2.0 + * Contact: developers@squareup.com + * Generated by: https://github.com/swagger-api/swagger-codegen.git + */ + +using System; +using System.Linq; +using System.IO; +using System.Text; +using System.Text.RegularExpressions; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Runtime.Serialization; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using System.ComponentModel.DataAnnotations; + +namespace Square.Connect.Model +{ + /// + /// Represents a discount that to either a single line item or an entire order. + /// + [DataContract] + public partial class CreateOrderRequestDiscount : IEquatable, IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + /// The discount's name.. + /// The percentage of the discount, as a string representation of a decimal number. A value of `7.25` corresponds to a percentage of 7.25%. This value range between 0.0 up to 100.0. + /// The monetary amount of the discount.. + public CreateOrderRequestDiscount(string Name = default(string), string Percentage = default(string), Money AmountMoney = default(Money)) + { + this.Name = Name; + this.Percentage = Percentage; + this.AmountMoney = AmountMoney; + } + + /// + /// The discount's name. + /// + /// The discount's name. + [DataMember(Name="name", EmitDefaultValue=false)] + public string Name { get; set; } + /// + /// The percentage of the discount, as a string representation of a decimal number. A value of `7.25` corresponds to a percentage of 7.25%. This value range between 0.0 up to 100.0 + /// + /// The percentage of the discount, as a string representation of a decimal number. A value of `7.25` corresponds to a percentage of 7.25%. This value range between 0.0 up to 100.0 + [DataMember(Name="percentage", EmitDefaultValue=false)] + public string Percentage { get; set; } + /// + /// The monetary amount of the discount. + /// + /// The monetary amount of the discount. + [DataMember(Name="amount_money", EmitDefaultValue=false)] + public Money AmountMoney { get; set; } + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + var sb = new StringBuilder(); + sb.Append("class CreateOrderRequestDiscount {\n"); + sb.Append(" Name: ").Append(Name).Append("\n"); + sb.Append(" Percentage: ").Append(Percentage).Append("\n"); + sb.Append(" AmountMoney: ").Append(AmountMoney).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public string ToJson() + { + return JsonConvert.SerializeObject(this, Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object obj) + { + // credit: http://stackoverflow.com/a/10454552/677735 + return this.Equals(obj as CreateOrderRequestDiscount); + } + + /// + /// Returns true if CreateOrderRequestDiscount instances are equal + /// + /// Instance of CreateOrderRequestDiscount to be compared + /// Boolean + public bool Equals(CreateOrderRequestDiscount other) + { + // credit: http://stackoverflow.com/a/10454552/677735 + if (other == null) + return false; + + return + ( + this.Name == other.Name || + this.Name != null && + this.Name.Equals(other.Name) + ) && + ( + this.Percentage == other.Percentage || + this.Percentage != null && + this.Percentage.Equals(other.Percentage) + ) && + ( + this.AmountMoney == other.AmountMoney || + this.AmountMoney != null && + this.AmountMoney.Equals(other.AmountMoney) + ); + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + // credit: http://stackoverflow.com/a/263416/677735 + unchecked // Overflow is fine, just wrap + { + int hash = 41; + // Suitable nullity checks etc, of course :) + if (this.Name != null) + hash = hash * 59 + this.Name.GetHashCode(); + if (this.Percentage != null) + hash = hash * 59 + this.Percentage.GetHashCode(); + if (this.AmountMoney != null) + hash = hash * 59 + this.AmountMoney.GetHashCode(); + return hash; + } + } + + public IEnumerable Validate(ValidationContext validationContext) + { + // Name (string) maxLength + if(this.Name != null && this.Name.Length > 255) + { + yield return new ValidationResult("Invalid value for Name, length must be less than 255.", new [] { "Name" }); + } + + yield break; + } + } + +} diff --git a/src/Square.Connect/Model/CreateOrderRequestLineItem.cs b/src/Square.Connect/Model/CreateOrderRequestLineItem.cs index 82c5444..a97f878 100644 --- a/src/Square.Connect/Model/CreateOrderRequestLineItem.cs +++ b/src/Square.Connect/Model/CreateOrderRequestLineItem.cs @@ -37,20 +37,13 @@ protected CreateOrderRequestLineItem() { } /// /// Initializes a new instance of the class. /// - /// The name of the line item. This value cannot exceed 500 characters. (required). + /// The name of the line item. This value cannot exceed 500 characters.. /// The quantity to purchase, as a string representation of a number. Currently, only integer values are supported. (required). - /// The base price for a single unit of the line item's associated variation. If a line item represents a Custom Amount instead of a particular product, this field indicates that amount. (required). - public CreateOrderRequestLineItem(string Name = default(string), string Quantity = default(string), Money BasePriceMoney = default(Money)) + /// The base price for a single unit of the line item's associated variation. If a line item represents a Custom Amount instead of a particular product, this field indicates that amount.. + /// The taxes include the custom taxes.. + /// The discounts include the custom discounts.. + public CreateOrderRequestLineItem(string Name = default(string), string Quantity = default(string), Money BasePriceMoney = default(Money), List Taxes = default(List), List Discounts = default(List)) { - // to ensure "Name" is required (not null) - if (Name == null) - { - throw new InvalidDataException("Name is a required property for CreateOrderRequestLineItem and cannot be null"); - } - else - { - this.Name = Name; - } // to ensure "Quantity" is required (not null) if (Quantity == null) { @@ -60,15 +53,10 @@ protected CreateOrderRequestLineItem() { } { this.Quantity = Quantity; } - // to ensure "BasePriceMoney" is required (not null) - if (BasePriceMoney == null) - { - throw new InvalidDataException("BasePriceMoney is a required property for CreateOrderRequestLineItem and cannot be null"); - } - else - { - this.BasePriceMoney = BasePriceMoney; - } + this.Name = Name; + this.BasePriceMoney = BasePriceMoney; + this.Taxes = Taxes; + this.Discounts = Discounts; } /// @@ -90,6 +78,18 @@ protected CreateOrderRequestLineItem() { } [DataMember(Name="base_price_money", EmitDefaultValue=false)] public Money BasePriceMoney { get; set; } /// + /// The taxes include the custom taxes. + /// + /// The taxes include the custom taxes. + [DataMember(Name="taxes", EmitDefaultValue=false)] + public List Taxes { get; set; } + /// + /// The discounts include the custom discounts. + /// + /// The discounts include the custom discounts. + [DataMember(Name="discounts", EmitDefaultValue=false)] + public List Discounts { get; set; } + /// /// Returns the string presentation of the object /// /// String presentation of the object @@ -100,6 +100,8 @@ public override string ToString() sb.Append(" Name: ").Append(Name).Append("\n"); sb.Append(" Quantity: ").Append(Quantity).Append("\n"); sb.Append(" BasePriceMoney: ").Append(BasePriceMoney).Append("\n"); + sb.Append(" Taxes: ").Append(Taxes).Append("\n"); + sb.Append(" Discounts: ").Append(Discounts).Append("\n"); sb.Append("}\n"); return sb.ToString(); } @@ -150,6 +152,16 @@ public bool Equals(CreateOrderRequestLineItem other) this.BasePriceMoney == other.BasePriceMoney || this.BasePriceMoney != null && this.BasePriceMoney.Equals(other.BasePriceMoney) + ) && + ( + this.Taxes == other.Taxes || + this.Taxes != null && + this.Taxes.SequenceEqual(other.Taxes) + ) && + ( + this.Discounts == other.Discounts || + this.Discounts != null && + this.Discounts.SequenceEqual(other.Discounts) ); } @@ -170,6 +182,10 @@ public override int GetHashCode() hash = hash * 59 + this.Quantity.GetHashCode(); if (this.BasePriceMoney != null) hash = hash * 59 + this.BasePriceMoney.GetHashCode(); + if (this.Taxes != null) + hash = hash * 59 + this.Taxes.GetHashCode(); + if (this.Discounts != null) + hash = hash * 59 + this.Discounts.GetHashCode(); return hash; } } @@ -182,12 +198,6 @@ public IEnumerable Validate(ValidationContext validationContex yield return new ValidationResult("Invalid value for Name, length must be less than 500.", new [] { "Name" }); } - // Name (string) minLength - if(this.Name != null && this.Name.Length < 1) - { - yield return new ValidationResult("Invalid value for Name, length must be greater than 1.", new [] { "Name" }); - } - // Quantity (string) minLength if(this.Quantity != null && this.Quantity.Length < 1) { diff --git a/src/Square.Connect/Model/CreateOrderRequestTax.cs b/src/Square.Connect/Model/CreateOrderRequestTax.cs new file mode 100644 index 0000000..92aab1a --- /dev/null +++ b/src/Square.Connect/Model/CreateOrderRequestTax.cs @@ -0,0 +1,187 @@ +/* + * Square Connect API + * + * Client library for accessing the Square Connect APIs + * + * OpenAPI spec version: 2.0 + * Contact: developers@squareup.com + * Generated by: https://github.com/swagger-api/swagger-codegen.git + */ + +using System; +using System.Linq; +using System.IO; +using System.Text; +using System.Text.RegularExpressions; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Runtime.Serialization; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using System.ComponentModel.DataAnnotations; + +namespace Square.Connect.Model +{ + /// + /// Represents a tax that applies to either a single line item or an entire order. + /// + [DataContract] + public partial class CreateOrderRequestTax : IEquatable, IValidatableObject + { + /// + /// Indicates the calculation method used to apply the line item tax. Default: `ADDITIVE`; See [OrderLineItemTaxType](#type-orderlineitemtaxtype) for possible values. + /// + /// Indicates the calculation method used to apply the line item tax. Default: `ADDITIVE`; See [OrderLineItemTaxType](#type-orderlineitemtaxtype) for possible values. + [JsonConverter(typeof(StringEnumConverter))] + public enum TypeEnum + { + + /// + /// Enum UNKNOWN for "UNKNOWN" + /// + [EnumMember(Value = "UNKNOWN")] + UNKNOWN, + + /// + /// Enum ADDITIVE for "ADDITIVE" + /// + [EnumMember(Value = "ADDITIVE")] + ADDITIVE, + + /// + /// Enum INCLUSIVE for "INCLUSIVE" + /// + [EnumMember(Value = "INCLUSIVE")] + INCLUSIVE + } + + /// + /// Indicates the calculation method used to apply the line item tax. Default: `ADDITIVE`; See [OrderLineItemTaxType](#type-orderlineitemtaxtype) for possible values. + /// + /// Indicates the calculation method used to apply the line item tax. Default: `ADDITIVE`; See [OrderLineItemTaxType](#type-orderlineitemtaxtype) for possible values. + [DataMember(Name="type", EmitDefaultValue=false)] + public TypeEnum? Type { get; set; } + /// + /// Initializes a new instance of the class. + /// + /// The tax's name.. + /// Indicates the calculation method used to apply the line item tax. Default: `ADDITIVE`; See [OrderLineItemTaxType](#type-orderlineitemtaxtype) for possible values.. + /// The percentage of the tax, as a string representation of a decimal number. A value of `7.25` corresponds to a percentage of 7.25%. This value range between 0.0 up to 100.0. + public CreateOrderRequestTax(string Name = default(string), TypeEnum? Type = default(TypeEnum?), string Percentage = default(string)) + { + this.Name = Name; + this.Type = Type; + this.Percentage = Percentage; + } + + /// + /// The tax's name. + /// + /// The tax's name. + [DataMember(Name="name", EmitDefaultValue=false)] + public string Name { get; set; } + /// + /// The percentage of the tax, as a string representation of a decimal number. A value of `7.25` corresponds to a percentage of 7.25%. This value range between 0.0 up to 100.0 + /// + /// The percentage of the tax, as a string representation of a decimal number. A value of `7.25` corresponds to a percentage of 7.25%. This value range between 0.0 up to 100.0 + [DataMember(Name="percentage", EmitDefaultValue=false)] + public string Percentage { get; set; } + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + var sb = new StringBuilder(); + sb.Append("class CreateOrderRequestTax {\n"); + sb.Append(" Name: ").Append(Name).Append("\n"); + sb.Append(" Type: ").Append(Type).Append("\n"); + sb.Append(" Percentage: ").Append(Percentage).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public string ToJson() + { + return JsonConvert.SerializeObject(this, Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object obj) + { + // credit: http://stackoverflow.com/a/10454552/677735 + return this.Equals(obj as CreateOrderRequestTax); + } + + /// + /// Returns true if CreateOrderRequestTax instances are equal + /// + /// Instance of CreateOrderRequestTax to be compared + /// Boolean + public bool Equals(CreateOrderRequestTax other) + { + // credit: http://stackoverflow.com/a/10454552/677735 + if (other == null) + return false; + + return + ( + this.Name == other.Name || + this.Name != null && + this.Name.Equals(other.Name) + ) && + ( + this.Type == other.Type || + this.Type != null && + this.Type.Equals(other.Type) + ) && + ( + this.Percentage == other.Percentage || + this.Percentage != null && + this.Percentage.Equals(other.Percentage) + ); + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + // credit: http://stackoverflow.com/a/263416/677735 + unchecked // Overflow is fine, just wrap + { + int hash = 41; + // Suitable nullity checks etc, of course :) + if (this.Name != null) + hash = hash * 59 + this.Name.GetHashCode(); + if (this.Type != null) + hash = hash * 59 + this.Type.GetHashCode(); + if (this.Percentage != null) + hash = hash * 59 + this.Percentage.GetHashCode(); + return hash; + } + } + + public IEnumerable Validate(ValidationContext validationContext) + { + // Name (string) maxLength + if(this.Name != null && this.Name.Length > 255) + { + yield return new ValidationResult("Invalid value for Name, length must be less than 255.", new [] { "Name" }); + } + + yield break; + } + } + +} diff --git a/src/Square.Connect/Model/Error.cs b/src/Square.Connect/Model/Error.cs index 2912206..18f58e1 100644 --- a/src/Square.Connect/Model/Error.cs +++ b/src/Square.Connect/Model/Error.cs @@ -460,6 +460,12 @@ public enum CodeEnum [EnumMember(Value = "INVALID_EMAIL_ADDRESS")] INVALIDEMAILADDRESS, + /// + /// Enum CHECKOUTEXPIRED for "CHECKOUT_EXPIRED" + /// + [EnumMember(Value = "CHECKOUT_EXPIRED")] + CHECKOUTEXPIRED, + /// /// Enum CARDDECLINED for "CARD_DECLINED" /// diff --git a/src/Square.Connect/Model/ErrorCode.cs b/src/Square.Connect/Model/ErrorCode.cs index 561cb13..34e61ae 100644 --- a/src/Square.Connect/Model/ErrorCode.cs +++ b/src/Square.Connect/Model/ErrorCode.cs @@ -409,6 +409,12 @@ public enum ErrorCode [EnumMember(Value = "INVALID_EMAIL_ADDRESS")] INVALIDEMAILADDRESS, + /// + /// Enum CHECKOUTEXPIRED for "CHECKOUT_EXPIRED" + /// + [EnumMember(Value = "CHECKOUT_EXPIRED")] + CHECKOUTEXPIRED, + /// /// Enum CARDDECLINED for "CARD_DECLINED" /// diff --git a/src/Square.Connect/Model/ItemVariationLocationOverrides.cs b/src/Square.Connect/Model/ItemVariationLocationOverrides.cs index 9824f15..4b92a03 100644 --- a/src/Square.Connect/Model/ItemVariationLocationOverrides.cs +++ b/src/Square.Connect/Model/ItemVariationLocationOverrides.cs @@ -24,15 +24,15 @@ namespace Square.Connect.Model { /// - /// Price and inventory overrides for a [CatalogItemVariation](#type-catalogitemvariation) at a specific location. + /// Price and inventory alerting overrides for a [CatalogItemVariation](#type-catalogitemvariation) at a specific [location][#type-location]. /// [DataContract] public partial class ItemVariationLocationOverrides : IEquatable, IValidatableObject { /// - /// The pricing type (fixed or variable) for the [CatalogItemVariation](#type-catalogitemvariation) at the given location. See [CatalogPricingType](#type-catalogpricingtype) for all possible values. + /// The pricing type (fixed or variable) for the [CatalogItemVariation](#type-catalogitemvariation) at the given [location][#type-location]. See [CatalogPricingType](#type-catalogpricingtype) for all possible values. /// - /// The pricing type (fixed or variable) for the [CatalogItemVariation](#type-catalogitemvariation) at the given location. See [CatalogPricingType](#type-catalogpricingtype) for all possible values. + /// The pricing type (fixed or variable) for the [CatalogItemVariation](#type-catalogitemvariation) at the given [location][#type-location]. See [CatalogPricingType](#type-catalogpricingtype) for all possible values. [JsonConverter(typeof(StringEnumConverter))] public enum PricingTypeEnum { @@ -72,9 +72,9 @@ public enum InventoryAlertTypeEnum } /// - /// The pricing type (fixed or variable) for the [CatalogItemVariation](#type-catalogitemvariation) at the given location. See [CatalogPricingType](#type-catalogpricingtype) for all possible values. + /// The pricing type (fixed or variable) for the [CatalogItemVariation](#type-catalogitemvariation) at the given [location][#type-location]. See [CatalogPricingType](#type-catalogpricingtype) for all possible values. /// - /// The pricing type (fixed or variable) for the [CatalogItemVariation](#type-catalogitemvariation) at the given location. See [CatalogPricingType](#type-catalogpricingtype) for all possible values. + /// The pricing type (fixed or variable) for the [CatalogItemVariation](#type-catalogitemvariation) at the given [location][#type-location]. See [CatalogPricingType](#type-catalogpricingtype) for all possible values. [DataMember(Name="pricing_type", EmitDefaultValue=false)] public PricingTypeEnum? PricingType { get; set; } /// @@ -86,10 +86,10 @@ public enum InventoryAlertTypeEnum /// /// Initializes a new instance of the class. /// - /// The ID of the location.. - /// The price of the [CatalogItemVariation](#type-catalogitemvariation) at the given location, or blank for variable pricing.. - /// The pricing type (fixed or variable) for the [CatalogItemVariation](#type-catalogitemvariation) at the given location. See [CatalogPricingType](#type-catalogpricingtype) for all possible values.. - /// If `true`, inventory tracking is active for the [CatalogItemVariation](#type-catalogitemvariation) at this location.. + /// The ID of the [location][#type-location].. + /// The price of the [CatalogItemVariation](#type-catalogitemvariation) at the given [location][#type-location], or blank for variable pricing.. + /// The pricing type (fixed or variable) for the [CatalogItemVariation](#type-catalogitemvariation) at the given [location][#type-location]. See [CatalogPricingType](#type-catalogpricingtype) for all possible values.. + /// If `true`, inventory tracking is active for the [CatalogItemVariation](#type-catalogitemvariation) at this [location][#type-location].. /// Indicates whether the [CatalogItemVariation](#type-catalogitemvariation) displays an alert when its inventory quantity is less than or equal to its `inventory_alert_threshold`. See [InventoryAlertType](#type-inventoryalerttype) for all possible values.. /// If the inventory quantity for the variation is less than or equal to this value and `inventory_alert_type` is `LOW_QUANTITY`, the variation displays an alert in the merchant dashboard. This value is always an integer.. public ItemVariationLocationOverrides(string LocationId = default(string), Money PriceMoney = default(Money), PricingTypeEnum? PricingType = default(PricingTypeEnum?), bool? TrackInventory = default(bool?), InventoryAlertTypeEnum? InventoryAlertType = default(InventoryAlertTypeEnum?), long? InventoryAlertThreshold = default(long?)) @@ -103,21 +103,21 @@ public enum InventoryAlertTypeEnum } /// - /// The ID of the location. + /// The ID of the [location][#type-location]. /// - /// The ID of the location. + /// The ID of the [location][#type-location]. [DataMember(Name="location_id", EmitDefaultValue=false)] public string LocationId { get; set; } /// - /// The price of the [CatalogItemVariation](#type-catalogitemvariation) at the given location, or blank for variable pricing. + /// The price of the [CatalogItemVariation](#type-catalogitemvariation) at the given [location][#type-location], or blank for variable pricing. /// - /// The price of the [CatalogItemVariation](#type-catalogitemvariation) at the given location, or blank for variable pricing. + /// The price of the [CatalogItemVariation](#type-catalogitemvariation) at the given [location][#type-location], or blank for variable pricing. [DataMember(Name="price_money", EmitDefaultValue=false)] public Money PriceMoney { get; set; } /// - /// If `true`, inventory tracking is active for the [CatalogItemVariation](#type-catalogitemvariation) at this location. + /// If `true`, inventory tracking is active for the [CatalogItemVariation](#type-catalogitemvariation) at this [location][#type-location]. /// - /// If `true`, inventory tracking is active for the [CatalogItemVariation](#type-catalogitemvariation) at this location. + /// If `true`, inventory tracking is active for the [CatalogItemVariation](#type-catalogitemvariation) at this [location][#type-location]. [DataMember(Name="track_inventory", EmitDefaultValue=false)] public bool? TrackInventory { get; set; } /// diff --git a/src/Square.Connect/Model/Order.cs b/src/Square.Connect/Model/Order.cs index 10c13a7..c289519 100644 --- a/src/Square.Connect/Model/Order.cs +++ b/src/Square.Connect/Model/Order.cs @@ -32,26 +32,22 @@ public partial class Order : IEquatable, IValidatableObject /// /// Initializes a new instance of the class. /// - /// The order's unique ID. This value is not present if the order was not created with the [CreateOrder](#endpoint-createorder) endpoint.. /// The ID of the merchant location this order is associated with.. /// A client specified identifier to associate an entity in another system with this order.. /// The line items included in the order. Every order has at least one line item.. /// The total amount of money to collect for the order.. - public Order(string Id = default(string), string LocationId = default(string), string ReferenceId = default(string), List LineItems = default(List), Money TotalMoney = default(Money)) + /// The total tax amount of money to collect for the order.. + /// The total discount amount of money to collect for the order.. + public Order(string LocationId = default(string), string ReferenceId = default(string), List LineItems = default(List), Money TotalMoney = default(Money), Money TotalTaxMoney = default(Money), Money TotalDiscountMoney = default(Money)) { - this.Id = Id; this.LocationId = LocationId; this.ReferenceId = ReferenceId; this.LineItems = LineItems; this.TotalMoney = TotalMoney; + this.TotalTaxMoney = TotalTaxMoney; + this.TotalDiscountMoney = TotalDiscountMoney; } - /// - /// The order's unique ID. This value is not present if the order was not created with the [CreateOrder](#endpoint-createorder) endpoint. - /// - /// The order's unique ID. This value is not present if the order was not created with the [CreateOrder](#endpoint-createorder) endpoint. - [DataMember(Name="id", EmitDefaultValue=false)] - public string Id { get; set; } /// /// The ID of the merchant location this order is associated with. /// @@ -77,6 +73,18 @@ public partial class Order : IEquatable, IValidatableObject [DataMember(Name="total_money", EmitDefaultValue=false)] public Money TotalMoney { get; set; } /// + /// The total tax amount of money to collect for the order. + /// + /// The total tax amount of money to collect for the order. + [DataMember(Name="total_tax_money", EmitDefaultValue=false)] + public Money TotalTaxMoney { get; set; } + /// + /// The total discount amount of money to collect for the order. + /// + /// The total discount amount of money to collect for the order. + [DataMember(Name="total_discount_money", EmitDefaultValue=false)] + public Money TotalDiscountMoney { get; set; } + /// /// Returns the string presentation of the object /// /// String presentation of the object @@ -84,11 +92,12 @@ public override string ToString() { var sb = new StringBuilder(); sb.Append("class Order {\n"); - sb.Append(" Id: ").Append(Id).Append("\n"); sb.Append(" LocationId: ").Append(LocationId).Append("\n"); sb.Append(" ReferenceId: ").Append(ReferenceId).Append("\n"); sb.Append(" LineItems: ").Append(LineItems).Append("\n"); sb.Append(" TotalMoney: ").Append(TotalMoney).Append("\n"); + sb.Append(" TotalTaxMoney: ").Append(TotalTaxMoney).Append("\n"); + sb.Append(" TotalDiscountMoney: ").Append(TotalDiscountMoney).Append("\n"); sb.Append("}\n"); return sb.ToString(); } @@ -125,11 +134,6 @@ public bool Equals(Order other) return false; return - ( - this.Id == other.Id || - this.Id != null && - this.Id.Equals(other.Id) - ) && ( this.LocationId == other.LocationId || this.LocationId != null && @@ -149,6 +153,16 @@ public bool Equals(Order other) this.TotalMoney == other.TotalMoney || this.TotalMoney != null && this.TotalMoney.Equals(other.TotalMoney) + ) && + ( + this.TotalTaxMoney == other.TotalTaxMoney || + this.TotalTaxMoney != null && + this.TotalTaxMoney.Equals(other.TotalTaxMoney) + ) && + ( + this.TotalDiscountMoney == other.TotalDiscountMoney || + this.TotalDiscountMoney != null && + this.TotalDiscountMoney.Equals(other.TotalDiscountMoney) ); } @@ -163,8 +177,6 @@ public override int GetHashCode() { int hash = 41; // Suitable nullity checks etc, of course :) - if (this.Id != null) - hash = hash * 59 + this.Id.GetHashCode(); if (this.LocationId != null) hash = hash * 59 + this.LocationId.GetHashCode(); if (this.ReferenceId != null) @@ -173,6 +185,10 @@ public override int GetHashCode() hash = hash * 59 + this.LineItems.GetHashCode(); if (this.TotalMoney != null) hash = hash * 59 + this.TotalMoney.GetHashCode(); + if (this.TotalTaxMoney != null) + hash = hash * 59 + this.TotalTaxMoney.GetHashCode(); + if (this.TotalDiscountMoney != null) + hash = hash * 59 + this.TotalDiscountMoney.GetHashCode(); return hash; } } diff --git a/src/Square.Connect/Model/OrderLineItem.cs b/src/Square.Connect/Model/OrderLineItem.cs index 7ec9359..dae53d6 100644 --- a/src/Square.Connect/Model/OrderLineItem.cs +++ b/src/Square.Connect/Model/OrderLineItem.cs @@ -32,26 +32,26 @@ public partial class OrderLineItem : IEquatable, IValidatableObj /// /// Initializes a new instance of the class. /// - /// The line item's ID, unique only within this order.. /// The name of the line item.. /// The quantity of the product to purchase. Currently, this string must have an integer value.. - /// The base price for a single unit of the line item's associated variation. If a line item represents a Custom Amount instead of a particular product, this field indicates that amount.. + /// The taxes applied to this line item.. + /// The discounts applied to this line item.. + /// The base price for a single unit of the line item.. + /// The total tax amount of money to collect for the line item.. + /// The total discount amount of money to collect for the line item.. /// The total amount of money to collect for this line item.. - public OrderLineItem(string Id = default(string), string Name = default(string), string Quantity = default(string), Money BasePriceMoney = default(Money), Money TotalMoney = default(Money)) + public OrderLineItem(string Name = default(string), string Quantity = default(string), List Taxes = default(List), List Discounts = default(List), Money BasePriceMoney = default(Money), Money TotalTaxMoney = default(Money), Money TotalDiscountMoney = default(Money), Money TotalMoney = default(Money)) { - this.Id = Id; this.Name = Name; this.Quantity = Quantity; + this.Taxes = Taxes; + this.Discounts = Discounts; this.BasePriceMoney = BasePriceMoney; + this.TotalTaxMoney = TotalTaxMoney; + this.TotalDiscountMoney = TotalDiscountMoney; this.TotalMoney = TotalMoney; } - /// - /// The line item's ID, unique only within this order. - /// - /// The line item's ID, unique only within this order. - [DataMember(Name="id", EmitDefaultValue=false)] - public string Id { get; set; } /// /// The name of the line item. /// @@ -65,12 +65,36 @@ public partial class OrderLineItem : IEquatable, IValidatableObj [DataMember(Name="quantity", EmitDefaultValue=false)] public string Quantity { get; set; } /// - /// The base price for a single unit of the line item's associated variation. If a line item represents a Custom Amount instead of a particular product, this field indicates that amount. + /// The taxes applied to this line item. + /// + /// The taxes applied to this line item. + [DataMember(Name="taxes", EmitDefaultValue=false)] + public List Taxes { get; set; } + /// + /// The discounts applied to this line item. + /// + /// The discounts applied to this line item. + [DataMember(Name="discounts", EmitDefaultValue=false)] + public List Discounts { get; set; } + /// + /// The base price for a single unit of the line item. /// - /// The base price for a single unit of the line item's associated variation. If a line item represents a Custom Amount instead of a particular product, this field indicates that amount. + /// The base price for a single unit of the line item. [DataMember(Name="base_price_money", EmitDefaultValue=false)] public Money BasePriceMoney { get; set; } /// + /// The total tax amount of money to collect for the line item. + /// + /// The total tax amount of money to collect for the line item. + [DataMember(Name="total_tax_money", EmitDefaultValue=false)] + public Money TotalTaxMoney { get; set; } + /// + /// The total discount amount of money to collect for the line item. + /// + /// The total discount amount of money to collect for the line item. + [DataMember(Name="total_discount_money", EmitDefaultValue=false)] + public Money TotalDiscountMoney { get; set; } + /// /// The total amount of money to collect for this line item. /// /// The total amount of money to collect for this line item. @@ -84,10 +108,13 @@ public override string ToString() { var sb = new StringBuilder(); sb.Append("class OrderLineItem {\n"); - sb.Append(" Id: ").Append(Id).Append("\n"); sb.Append(" Name: ").Append(Name).Append("\n"); sb.Append(" Quantity: ").Append(Quantity).Append("\n"); + sb.Append(" Taxes: ").Append(Taxes).Append("\n"); + sb.Append(" Discounts: ").Append(Discounts).Append("\n"); sb.Append(" BasePriceMoney: ").Append(BasePriceMoney).Append("\n"); + sb.Append(" TotalTaxMoney: ").Append(TotalTaxMoney).Append("\n"); + sb.Append(" TotalDiscountMoney: ").Append(TotalDiscountMoney).Append("\n"); sb.Append(" TotalMoney: ").Append(TotalMoney).Append("\n"); sb.Append("}\n"); return sb.ToString(); @@ -125,11 +152,6 @@ public bool Equals(OrderLineItem other) return false; return - ( - this.Id == other.Id || - this.Id != null && - this.Id.Equals(other.Id) - ) && ( this.Name == other.Name || this.Name != null && @@ -140,11 +162,31 @@ public bool Equals(OrderLineItem other) this.Quantity != null && this.Quantity.Equals(other.Quantity) ) && + ( + this.Taxes == other.Taxes || + this.Taxes != null && + this.Taxes.SequenceEqual(other.Taxes) + ) && + ( + this.Discounts == other.Discounts || + this.Discounts != null && + this.Discounts.SequenceEqual(other.Discounts) + ) && ( this.BasePriceMoney == other.BasePriceMoney || this.BasePriceMoney != null && this.BasePriceMoney.Equals(other.BasePriceMoney) ) && + ( + this.TotalTaxMoney == other.TotalTaxMoney || + this.TotalTaxMoney != null && + this.TotalTaxMoney.Equals(other.TotalTaxMoney) + ) && + ( + this.TotalDiscountMoney == other.TotalDiscountMoney || + this.TotalDiscountMoney != null && + this.TotalDiscountMoney.Equals(other.TotalDiscountMoney) + ) && ( this.TotalMoney == other.TotalMoney || this.TotalMoney != null && @@ -163,14 +205,20 @@ public override int GetHashCode() { int hash = 41; // Suitable nullity checks etc, of course :) - if (this.Id != null) - hash = hash * 59 + this.Id.GetHashCode(); if (this.Name != null) hash = hash * 59 + this.Name.GetHashCode(); if (this.Quantity != null) hash = hash * 59 + this.Quantity.GetHashCode(); + if (this.Taxes != null) + hash = hash * 59 + this.Taxes.GetHashCode(); + if (this.Discounts != null) + hash = hash * 59 + this.Discounts.GetHashCode(); if (this.BasePriceMoney != null) hash = hash * 59 + this.BasePriceMoney.GetHashCode(); + if (this.TotalTaxMoney != null) + hash = hash * 59 + this.TotalTaxMoney.GetHashCode(); + if (this.TotalDiscountMoney != null) + hash = hash * 59 + this.TotalDiscountMoney.GetHashCode(); if (this.TotalMoney != null) hash = hash * 59 + this.TotalMoney.GetHashCode(); return hash; diff --git a/src/Square.Connect/Model/OrderLineItemDiscount.cs b/src/Square.Connect/Model/OrderLineItemDiscount.cs new file mode 100644 index 0000000..da02ea7 --- /dev/null +++ b/src/Square.Connect/Model/OrderLineItemDiscount.cs @@ -0,0 +1,262 @@ +/* + * Square Connect API + * + * Client library for accessing the Square Connect APIs + * + * OpenAPI spec version: 2.0 + * Contact: developers@squareup.com + * Generated by: https://github.com/swagger-api/swagger-codegen.git + */ + +using System; +using System.Linq; +using System.IO; +using System.Text; +using System.Text.RegularExpressions; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Runtime.Serialization; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using System.ComponentModel.DataAnnotations; + +namespace Square.Connect.Model +{ + /// + /// Represents a discount that applies to one or more line items in an order. Fixed-amount, order-level discounts are distributed across all non-zero line item totals. The amount distributed to each line item is relative to that item’s contribution to the order subtotal. + /// + [DataContract] + public partial class OrderLineItemDiscount : IEquatable, IValidatableObject + { + /// + /// The type of the discount. If it is created by API, it would be either `FIXED_PERCENTAGE` or `FIXED_AMOUNT`. VARIABLE_* is not supported in API because the order is created at the time of sale and either percentage or amount has to be specified. See [OrderLineItemDiscountType](#type-orderlineitemdiscounttype) for possible values. + /// + /// The type of the discount. If it is created by API, it would be either `FIXED_PERCENTAGE` or `FIXED_AMOUNT`. VARIABLE_* is not supported in API because the order is created at the time of sale and either percentage or amount has to be specified. See [OrderLineItemDiscountType](#type-orderlineitemdiscounttype) for possible values. + [JsonConverter(typeof(StringEnumConverter))] + public enum TypeEnum + { + + /// + /// Enum UNKNOWN for "UNKNOWN" + /// + [EnumMember(Value = "UNKNOWN")] + UNKNOWN, + + /// + /// Enum FIXEDPERCENTAGE for "FIXED_PERCENTAGE" + /// + [EnumMember(Value = "FIXED_PERCENTAGE")] + FIXEDPERCENTAGE, + + /// + /// Enum FIXEDAMOUNT for "FIXED_AMOUNT" + /// + [EnumMember(Value = "FIXED_AMOUNT")] + FIXEDAMOUNT, + + /// + /// Enum VARIABLEPERCENTAGE for "VARIABLE_PERCENTAGE" + /// + [EnumMember(Value = "VARIABLE_PERCENTAGE")] + VARIABLEPERCENTAGE, + + /// + /// Enum VARIABLEAMOUNT for "VARIABLE_AMOUNT" + /// + [EnumMember(Value = "VARIABLE_AMOUNT")] + VARIABLEAMOUNT + } + + /// + /// Indicates the level at which the discount applies. See [OrderLineItemDiscountScope](#type-orderlineitemdiscountscope) for possible values. + /// + /// Indicates the level at which the discount applies. See [OrderLineItemDiscountScope](#type-orderlineitemdiscountscope) for possible values. + [JsonConverter(typeof(StringEnumConverter))] + public enum ScopeEnum + { + + /// + /// Enum LINEITEM for "LINE_ITEM" + /// + [EnumMember(Value = "LINE_ITEM")] + LINEITEM, + + /// + /// Enum ORDER for "ORDER" + /// + [EnumMember(Value = "ORDER")] + ORDER + } + + /// + /// The type of the discount. If it is created by API, it would be either `FIXED_PERCENTAGE` or `FIXED_AMOUNT`. VARIABLE_* is not supported in API because the order is created at the time of sale and either percentage or amount has to be specified. See [OrderLineItemDiscountType](#type-orderlineitemdiscounttype) for possible values. + /// + /// The type of the discount. If it is created by API, it would be either `FIXED_PERCENTAGE` or `FIXED_AMOUNT`. VARIABLE_* is not supported in API because the order is created at the time of sale and either percentage or amount has to be specified. See [OrderLineItemDiscountType](#type-orderlineitemdiscounttype) for possible values. + [DataMember(Name="type", EmitDefaultValue=false)] + public TypeEnum? Type { get; set; } + /// + /// Indicates the level at which the discount applies. See [OrderLineItemDiscountScope](#type-orderlineitemdiscountscope) for possible values. + /// + /// Indicates the level at which the discount applies. See [OrderLineItemDiscountScope](#type-orderlineitemdiscountscope) for possible values. + [DataMember(Name="scope", EmitDefaultValue=false)] + public ScopeEnum? Scope { get; set; } + /// + /// Initializes a new instance of the class. + /// + /// The discount's name.. + /// The type of the discount. If it is created by API, it would be either `FIXED_PERCENTAGE` or `FIXED_AMOUNT`. VARIABLE_* is not supported in API because the order is created at the time of sale and either percentage or amount has to be specified. See [OrderLineItemDiscountType](#type-orderlineitemdiscounttype) for possible values.. + /// The percentage of the tax, as a string representation of a decimal number. A value of `7.25` corresponds to a percentage of 7.25%. The percentage won't be set for an amount-based discount.. + /// The total monetary amount of the applicable discount. If it is at order level, it is the value of the order level discount. If it is at line item level, it is the value of the line item level discount. The amount_money won't be set for a percentage-based discount.. + /// The amount of discount actually applied to this line item. Represents the amount of money applied to a line item as a discount When an amount-based discount is at order-level, this value is different from `amount_money` because the discount is distributed across the line items.. + /// Indicates the level at which the discount applies. See [OrderLineItemDiscountScope](#type-orderlineitemdiscountscope) for possible values.. + public OrderLineItemDiscount(string Name = default(string), TypeEnum? Type = default(TypeEnum?), string Percentage = default(string), Money AmountMoney = default(Money), Money AppliedMoney = default(Money), ScopeEnum? Scope = default(ScopeEnum?)) + { + this.Name = Name; + this.Type = Type; + this.Percentage = Percentage; + this.AmountMoney = AmountMoney; + this.AppliedMoney = AppliedMoney; + this.Scope = Scope; + } + + /// + /// The discount's name. + /// + /// The discount's name. + [DataMember(Name="name", EmitDefaultValue=false)] + public string Name { get; set; } + /// + /// The percentage of the tax, as a string representation of a decimal number. A value of `7.25` corresponds to a percentage of 7.25%. The percentage won't be set for an amount-based discount. + /// + /// The percentage of the tax, as a string representation of a decimal number. A value of `7.25` corresponds to a percentage of 7.25%. The percentage won't be set for an amount-based discount. + [DataMember(Name="percentage", EmitDefaultValue=false)] + public string Percentage { get; set; } + /// + /// The total monetary amount of the applicable discount. If it is at order level, it is the value of the order level discount. If it is at line item level, it is the value of the line item level discount. The amount_money won't be set for a percentage-based discount. + /// + /// The total monetary amount of the applicable discount. If it is at order level, it is the value of the order level discount. If it is at line item level, it is the value of the line item level discount. The amount_money won't be set for a percentage-based discount. + [DataMember(Name="amount_money", EmitDefaultValue=false)] + public Money AmountMoney { get; set; } + /// + /// The amount of discount actually applied to this line item. Represents the amount of money applied to a line item as a discount When an amount-based discount is at order-level, this value is different from `amount_money` because the discount is distributed across the line items. + /// + /// The amount of discount actually applied to this line item. Represents the amount of money applied to a line item as a discount When an amount-based discount is at order-level, this value is different from `amount_money` because the discount is distributed across the line items. + [DataMember(Name="applied_money", EmitDefaultValue=false)] + public Money AppliedMoney { get; set; } + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + var sb = new StringBuilder(); + sb.Append("class OrderLineItemDiscount {\n"); + sb.Append(" Name: ").Append(Name).Append("\n"); + sb.Append(" Type: ").Append(Type).Append("\n"); + sb.Append(" Percentage: ").Append(Percentage).Append("\n"); + sb.Append(" AmountMoney: ").Append(AmountMoney).Append("\n"); + sb.Append(" AppliedMoney: ").Append(AppliedMoney).Append("\n"); + sb.Append(" Scope: ").Append(Scope).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public string ToJson() + { + return JsonConvert.SerializeObject(this, Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object obj) + { + // credit: http://stackoverflow.com/a/10454552/677735 + return this.Equals(obj as OrderLineItemDiscount); + } + + /// + /// Returns true if OrderLineItemDiscount instances are equal + /// + /// Instance of OrderLineItemDiscount to be compared + /// Boolean + public bool Equals(OrderLineItemDiscount other) + { + // credit: http://stackoverflow.com/a/10454552/677735 + if (other == null) + return false; + + return + ( + this.Name == other.Name || + this.Name != null && + this.Name.Equals(other.Name) + ) && + ( + this.Type == other.Type || + this.Type != null && + this.Type.Equals(other.Type) + ) && + ( + this.Percentage == other.Percentage || + this.Percentage != null && + this.Percentage.Equals(other.Percentage) + ) && + ( + this.AmountMoney == other.AmountMoney || + this.AmountMoney != null && + this.AmountMoney.Equals(other.AmountMoney) + ) && + ( + this.AppliedMoney == other.AppliedMoney || + this.AppliedMoney != null && + this.AppliedMoney.Equals(other.AppliedMoney) + ) && + ( + this.Scope == other.Scope || + this.Scope != null && + this.Scope.Equals(other.Scope) + ); + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + // credit: http://stackoverflow.com/a/263416/677735 + unchecked // Overflow is fine, just wrap + { + int hash = 41; + // Suitable nullity checks etc, of course :) + if (this.Name != null) + hash = hash * 59 + this.Name.GetHashCode(); + if (this.Type != null) + hash = hash * 59 + this.Type.GetHashCode(); + if (this.Percentage != null) + hash = hash * 59 + this.Percentage.GetHashCode(); + if (this.AmountMoney != null) + hash = hash * 59 + this.AmountMoney.GetHashCode(); + if (this.AppliedMoney != null) + hash = hash * 59 + this.AppliedMoney.GetHashCode(); + if (this.Scope != null) + hash = hash * 59 + this.Scope.GetHashCode(); + return hash; + } + } + + public IEnumerable Validate(ValidationContext validationContext) + { + yield break; + } + } + +} diff --git a/src/Square.Connect/Model/OrderLineItemDiscountScope.cs b/src/Square.Connect/Model/OrderLineItemDiscountScope.cs new file mode 100644 index 0000000..437c10b --- /dev/null +++ b/src/Square.Connect/Model/OrderLineItemDiscountScope.cs @@ -0,0 +1,47 @@ +/* + * Square Connect API + * + * Client library for accessing the Square Connect APIs + * + * OpenAPI spec version: 2.0 + * Contact: developers@squareup.com + * Generated by: https://github.com/swagger-api/swagger-codegen.git + */ + +using System; +using System.Linq; +using System.IO; +using System.Text; +using System.Text.RegularExpressions; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Runtime.Serialization; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using System.ComponentModel.DataAnnotations; + +namespace Square.Connect.Model +{ + /// + /// Indicates whether this is a line item or order-level discount. + /// + /// Indicates whether this is a line item or order-level discount. + [JsonConverter(typeof(StringEnumConverter))] + public enum OrderLineItemDiscountScope + { + + /// + /// Enum LINEITEM for "LINE_ITEM" + /// + [EnumMember(Value = "LINE_ITEM")] + LINEITEM, + + /// + /// Enum ORDER for "ORDER" + /// + [EnumMember(Value = "ORDER")] + ORDER + } + +} diff --git a/src/Square.Connect/Model/OrderLineItemDiscountType.cs b/src/Square.Connect/Model/OrderLineItemDiscountType.cs new file mode 100644 index 0000000..8fd40d3 --- /dev/null +++ b/src/Square.Connect/Model/OrderLineItemDiscountType.cs @@ -0,0 +1,65 @@ +/* + * Square Connect API + * + * Client library for accessing the Square Connect APIs + * + * OpenAPI spec version: 2.0 + * Contact: developers@squareup.com + * Generated by: https://github.com/swagger-api/swagger-codegen.git + */ + +using System; +using System.Linq; +using System.IO; +using System.Text; +using System.Text.RegularExpressions; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Runtime.Serialization; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using System.ComponentModel.DataAnnotations; + +namespace Square.Connect.Model +{ + /// + /// Indicates how the discount is applied to the associated line item or order. + /// + /// Indicates how the discount is applied to the associated line item or order. + [JsonConverter(typeof(StringEnumConverter))] + public enum OrderLineItemDiscountType + { + + /// + /// Enum UNKNOWN for "UNKNOWN" + /// + [EnumMember(Value = "UNKNOWN")] + UNKNOWN, + + /// + /// Enum FIXEDPERCENTAGE for "FIXED_PERCENTAGE" + /// + [EnumMember(Value = "FIXED_PERCENTAGE")] + FIXEDPERCENTAGE, + + /// + /// Enum FIXEDAMOUNT for "FIXED_AMOUNT" + /// + [EnumMember(Value = "FIXED_AMOUNT")] + FIXEDAMOUNT, + + /// + /// Enum VARIABLEPERCENTAGE for "VARIABLE_PERCENTAGE" + /// + [EnumMember(Value = "VARIABLE_PERCENTAGE")] + VARIABLEPERCENTAGE, + + /// + /// Enum VARIABLEAMOUNT for "VARIABLE_AMOUNT" + /// + [EnumMember(Value = "VARIABLE_AMOUNT")] + VARIABLEAMOUNT + } + +} diff --git a/src/Square.Connect/Model/OrderLineItemTax.cs b/src/Square.Connect/Model/OrderLineItemTax.cs new file mode 100644 index 0000000..c9f02d4 --- /dev/null +++ b/src/Square.Connect/Model/OrderLineItemTax.cs @@ -0,0 +1,197 @@ +/* + * Square Connect API + * + * Client library for accessing the Square Connect APIs + * + * OpenAPI spec version: 2.0 + * Contact: developers@squareup.com + * Generated by: https://github.com/swagger-api/swagger-codegen.git + */ + +using System; +using System.Linq; +using System.IO; +using System.Text; +using System.Text.RegularExpressions; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Runtime.Serialization; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using System.ComponentModel.DataAnnotations; + +namespace Square.Connect.Model +{ + /// + /// Represents a tax that applies to one or more line items in an order. + /// + [DataContract] + public partial class OrderLineItemTax : IEquatable, IValidatableObject + { + /// + /// Indicates the calculation method used to apply the tax. See [OrderLineItemTaxType](#type-orderlineitemtaxtype) for possible values. + /// + /// Indicates the calculation method used to apply the tax. See [OrderLineItemTaxType](#type-orderlineitemtaxtype) for possible values. + [JsonConverter(typeof(StringEnumConverter))] + public enum TypeEnum + { + + /// + /// Enum UNKNOWN for "UNKNOWN" + /// + [EnumMember(Value = "UNKNOWN")] + UNKNOWN, + + /// + /// Enum ADDITIVE for "ADDITIVE" + /// + [EnumMember(Value = "ADDITIVE")] + ADDITIVE, + + /// + /// Enum INCLUSIVE for "INCLUSIVE" + /// + [EnumMember(Value = "INCLUSIVE")] + INCLUSIVE + } + + /// + /// Indicates the calculation method used to apply the tax. See [OrderLineItemTaxType](#type-orderlineitemtaxtype) for possible values. + /// + /// Indicates the calculation method used to apply the tax. See [OrderLineItemTaxType](#type-orderlineitemtaxtype) for possible values. + [DataMember(Name="type", EmitDefaultValue=false)] + public TypeEnum? Type { get; set; } + /// + /// Initializes a new instance of the class. + /// + /// The tax's name.. + /// Indicates the calculation method used to apply the tax. See [OrderLineItemTaxType](#type-orderlineitemtaxtype) for possible values.. + /// The percentage of the tax, as a string representation of a decimal number. A value of `7.25` corresponds to a percentage of 7.25%.. + /// The amount of the money applied by the tax in an order.. + public OrderLineItemTax(string Name = default(string), TypeEnum? Type = default(TypeEnum?), string Percentage = default(string), Money AppliedMoney = default(Money)) + { + this.Name = Name; + this.Type = Type; + this.Percentage = Percentage; + this.AppliedMoney = AppliedMoney; + } + + /// + /// The tax's name. + /// + /// The tax's name. + [DataMember(Name="name", EmitDefaultValue=false)] + public string Name { get; set; } + /// + /// The percentage of the tax, as a string representation of a decimal number. A value of `7.25` corresponds to a percentage of 7.25%. + /// + /// The percentage of the tax, as a string representation of a decimal number. A value of `7.25` corresponds to a percentage of 7.25%. + [DataMember(Name="percentage", EmitDefaultValue=false)] + public string Percentage { get; set; } + /// + /// The amount of the money applied by the tax in an order. + /// + /// The amount of the money applied by the tax in an order. + [DataMember(Name="applied_money", EmitDefaultValue=false)] + public Money AppliedMoney { get; set; } + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + var sb = new StringBuilder(); + sb.Append("class OrderLineItemTax {\n"); + sb.Append(" Name: ").Append(Name).Append("\n"); + sb.Append(" Type: ").Append(Type).Append("\n"); + sb.Append(" Percentage: ").Append(Percentage).Append("\n"); + sb.Append(" AppliedMoney: ").Append(AppliedMoney).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public string ToJson() + { + return JsonConvert.SerializeObject(this, Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object obj) + { + // credit: http://stackoverflow.com/a/10454552/677735 + return this.Equals(obj as OrderLineItemTax); + } + + /// + /// Returns true if OrderLineItemTax instances are equal + /// + /// Instance of OrderLineItemTax to be compared + /// Boolean + public bool Equals(OrderLineItemTax other) + { + // credit: http://stackoverflow.com/a/10454552/677735 + if (other == null) + return false; + + return + ( + this.Name == other.Name || + this.Name != null && + this.Name.Equals(other.Name) + ) && + ( + this.Type == other.Type || + this.Type != null && + this.Type.Equals(other.Type) + ) && + ( + this.Percentage == other.Percentage || + this.Percentage != null && + this.Percentage.Equals(other.Percentage) + ) && + ( + this.AppliedMoney == other.AppliedMoney || + this.AppliedMoney != null && + this.AppliedMoney.Equals(other.AppliedMoney) + ); + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + // credit: http://stackoverflow.com/a/263416/677735 + unchecked // Overflow is fine, just wrap + { + int hash = 41; + // Suitable nullity checks etc, of course :) + if (this.Name != null) + hash = hash * 59 + this.Name.GetHashCode(); + if (this.Type != null) + hash = hash * 59 + this.Type.GetHashCode(); + if (this.Percentage != null) + hash = hash * 59 + this.Percentage.GetHashCode(); + if (this.AppliedMoney != null) + hash = hash * 59 + this.AppliedMoney.GetHashCode(); + return hash; + } + } + + public IEnumerable Validate(ValidationContext validationContext) + { + yield break; + } + } + +} diff --git a/src/Square.Connect/Model/OrderLineItemTaxType.cs b/src/Square.Connect/Model/OrderLineItemTaxType.cs new file mode 100644 index 0000000..9a2501b --- /dev/null +++ b/src/Square.Connect/Model/OrderLineItemTaxType.cs @@ -0,0 +1,53 @@ +/* + * Square Connect API + * + * Client library for accessing the Square Connect APIs + * + * OpenAPI spec version: 2.0 + * Contact: developers@squareup.com + * Generated by: https://github.com/swagger-api/swagger-codegen.git + */ + +using System; +using System.Linq; +using System.IO; +using System.Text; +using System.Text.RegularExpressions; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Runtime.Serialization; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using System.ComponentModel.DataAnnotations; + +namespace Square.Connect.Model +{ + /// + /// Indicates how the tax is applied to the associated line item or order. + /// + /// Indicates how the tax is applied to the associated line item or order. + [JsonConverter(typeof(StringEnumConverter))] + public enum OrderLineItemTaxType + { + + /// + /// Enum UNKNOWN for "UNKNOWN" + /// + [EnumMember(Value = "UNKNOWN")] + UNKNOWN, + + /// + /// Enum ADDITIVE for "ADDITIVE" + /// + [EnumMember(Value = "ADDITIVE")] + ADDITIVE, + + /// + /// Enum INCLUSIVE for "INCLUSIVE" + /// + [EnumMember(Value = "INCLUSIVE")] + INCLUSIVE + } + +} diff --git a/src/Square.Connect/Model/RetrieveCatalogObjectRequest.cs b/src/Square.Connect/Model/RetrieveCatalogObjectRequest.cs index 8bccf56..824af07 100644 --- a/src/Square.Connect/Model/RetrieveCatalogObjectRequest.cs +++ b/src/Square.Connect/Model/RetrieveCatalogObjectRequest.cs @@ -32,16 +32,16 @@ public partial class RetrieveCatalogObjectRequest : IEquatable /// Initializes a new instance of the class. /// - /// If `true`, the response will include additional objects that are related to the requested object, as follows: If the `object` field of the response contains a [CatalogItem](#type-catalogitem), its associated [CatalogCategory](#type-catalogcategory), [CatalogTax](#type-catalogtax)es, and [CatalogModifierList](#type-catalogmodifierlist)s will be returned in the `related_objects` field of the response. If the `object` field of the response contains a [CatalogItemVariation](#type-catalogitemvariation), its parent [CatalogItem](#type-catalogitem) will be returned in the `related_objects` field of the response.. + /// If `true`, the response will include additional objects that are related to the requested object, as follows: If the `object` field of the response contains a [CatalogItem](#type-catalogitem), its associated [CatalogCategory](#type-catalogcategory), [CatalogTax](#type-catalogtax)es, and [CatalogModifierList](#type-catalogmodifierlist)s will be returned in the `related_objects` field of the response. If the `object` field of the response contains a [CatalogItemVariation](#type-catalogitemvariation), its parent [CatalogItem](#type-catalogitem) will be returned in the `related_objects` field of the response. Default value: `false`. public RetrieveCatalogObjectRequest(bool? IncludeRelatedObjects = default(bool?)) { this.IncludeRelatedObjects = IncludeRelatedObjects; } /// - /// If `true`, the response will include additional objects that are related to the requested object, as follows: If the `object` field of the response contains a [CatalogItem](#type-catalogitem), its associated [CatalogCategory](#type-catalogcategory), [CatalogTax](#type-catalogtax)es, and [CatalogModifierList](#type-catalogmodifierlist)s will be returned in the `related_objects` field of the response. If the `object` field of the response contains a [CatalogItemVariation](#type-catalogitemvariation), its parent [CatalogItem](#type-catalogitem) will be returned in the `related_objects` field of the response. + /// If `true`, the response will include additional objects that are related to the requested object, as follows: If the `object` field of the response contains a [CatalogItem](#type-catalogitem), its associated [CatalogCategory](#type-catalogcategory), [CatalogTax](#type-catalogtax)es, and [CatalogModifierList](#type-catalogmodifierlist)s will be returned in the `related_objects` field of the response. If the `object` field of the response contains a [CatalogItemVariation](#type-catalogitemvariation), its parent [CatalogItem](#type-catalogitem) will be returned in the `related_objects` field of the response. Default value: `false` /// - /// If `true`, the response will include additional objects that are related to the requested object, as follows: If the `object` field of the response contains a [CatalogItem](#type-catalogitem), its associated [CatalogCategory](#type-catalogcategory), [CatalogTax](#type-catalogtax)es, and [CatalogModifierList](#type-catalogmodifierlist)s will be returned in the `related_objects` field of the response. If the `object` field of the response contains a [CatalogItemVariation](#type-catalogitemvariation), its parent [CatalogItem](#type-catalogitem) will be returned in the `related_objects` field of the response. + /// If `true`, the response will include additional objects that are related to the requested object, as follows: If the `object` field of the response contains a [CatalogItem](#type-catalogitem), its associated [CatalogCategory](#type-catalogcategory), [CatalogTax](#type-catalogtax)es, and [CatalogModifierList](#type-catalogmodifierlist)s will be returned in the `related_objects` field of the response. If the `object` field of the response contains a [CatalogItemVariation](#type-catalogitemvariation), its parent [CatalogItem](#type-catalogitem) will be returned in the `related_objects` field of the response. Default value: `false` [DataMember(Name="include_related_objects", EmitDefaultValue=false)] public bool? IncludeRelatedObjects { get; set; } /// diff --git a/src/Square.Connect/Model/SearchCatalogObjectsRequest.cs b/src/Square.Connect/Model/SearchCatalogObjectsRequest.cs index 29b915a..4309a3a 100644 --- a/src/Square.Connect/Model/SearchCatalogObjectsRequest.cs +++ b/src/Square.Connect/Model/SearchCatalogObjectsRequest.cs @@ -93,7 +93,7 @@ public enum ObjectTypesEnum /// The desired set of object types to apper in the search results. The legal values are taken from the [CatalogObjectType](#type-catalogobjecttype) enumeration, namely `\"ITEM\"`, `\"ITEM_VARIATION\"`, `\"CATEGORY\"`, `\"DISCOUNT\"`, `\"TAX\"`, `\"MODIFIER\"`, or `\"MODIFIER_LIST\"`.. /// If `true`, deleted objects will be included in the results. Deleted objects will have their `is_deleted` field set to `true`.. /// If `true`, the response will include additional objects that are related to the requested object, as follows: If a [CatalogItem](#type-catalogitem) is returned in the object field of the response, its associated [CatalogCategory](#type-catalogcategory), [CatalogTax](#type-catalogtax)es, and [CatalogModifierList](#type-catalogmodifierlist)s will be included in the `related_objects` field of the response. If a [CatalogItemVariation](#type-catalogitemvariation) is returned in the object field of the response, its parent [CatalogItem](#type-catalogitem) will be included in the `related_objects` field of the response.. - /// Return only objects that have been modified after this [timestamp](#workingwithdates) (in RFC 3339 format, e.g., \"2016-09-04T23:59:33.123Z\").. + /// Return only objects that have been modified after this [timestamp](#workingwithdates) (in RFC 3339 format, e.g., \"2016-09-04T23:59:33.123Z\"). The timestamp is exclusive - objects whose timestamp is equal to `begin_time` will not be included in the response.. /// A query to be used to filter or sort the results. If no query is specified, the entire catalog will be returned.. /// A limit on the number of results to be returned in a single page. The limit is advisory - the implementation may return more or fewer results. If the supplied limit is negative, zero, or is higher than the maximum limit of 1,000, it will be ignored.. public SearchCatalogObjectsRequest(string Cursor = default(string), List ObjectTypes = default(List), bool? IncludeDeletedObjects = default(bool?), bool? IncludeRelatedObjects = default(bool?), string BeginTime = default(string), CatalogQuery Query = default(CatalogQuery), int? Limit = default(int?)) @@ -126,9 +126,9 @@ public enum ObjectTypesEnum [DataMember(Name="include_related_objects", EmitDefaultValue=false)] public bool? IncludeRelatedObjects { get; set; } /// - /// Return only objects that have been modified after this [timestamp](#workingwithdates) (in RFC 3339 format, e.g., \"2016-09-04T23:59:33.123Z\"). + /// Return only objects that have been modified after this [timestamp](#workingwithdates) (in RFC 3339 format, e.g., \"2016-09-04T23:59:33.123Z\"). The timestamp is exclusive - objects whose timestamp is equal to `begin_time` will not be included in the response. /// - /// Return only objects that have been modified after this [timestamp](#workingwithdates) (in RFC 3339 format, e.g., \"2016-09-04T23:59:33.123Z\"). + /// Return only objects that have been modified after this [timestamp](#workingwithdates) (in RFC 3339 format, e.g., \"2016-09-04T23:59:33.123Z\"). The timestamp is exclusive - objects whose timestamp is equal to `begin_time` will not be included in the response. [DataMember(Name="begin_time", EmitDefaultValue=false)] public string BeginTime { get; set; } /// diff --git a/src/Square.Connect/Model/Transaction.cs b/src/Square.Connect/Model/Transaction.cs index 0fe2d8a..8e25b2b 100644 --- a/src/Square.Connect/Model/Transaction.cs +++ b/src/Square.Connect/Model/Transaction.cs @@ -24,7 +24,7 @@ namespace Square.Connect.Model { /// - /// Represents a transaction processed with Square, either with the Connect API or with Square Register. The `tenders` field of this object lists all methods of payment used to pay in the transaction. + /// Represents a transaction processed with Square, either with the Connect API or with Square Point of Sale. The `tenders` field of this object lists all methods of payment used to pay in the transaction. /// [DataContract] public partial class Transaction : IEquatable, IValidatableObject @@ -102,7 +102,7 @@ public enum ProductEnum /// Refunds that have been applied to any tender in the transaction.. /// If the transaction was created with the [Charge](#endpoint-charge) endpoint, this value is the same as the value provided for the `reference_id` parameter in the request to that endpoint. Otherwise, it is not set.. /// The Square product that processed the transaction.. - /// If the transaction was created in the Square Register app, this value is the ID generated for the transaction by Square Register. This ID has no relationship to the transaction's canonical `id`, which is generated by Square's backend servers. This value is generated for bookkeeping purposes, in case the transaction cannot immediately be completed (for example, if the transaction is processed in offline mode). It is not currently possible with the Connect API to perform a transaction lookup by this value.. + /// If the transaction was created in the Square Point of Sale app, this value is the ID generated for the transaction by Square Point of Sale. This ID has no relationship to the transaction's canonical `id`, which is generated by Square's backend servers. This value is generated for bookkeeping purposes, in case the transaction cannot immediately be completed (for example, if the transaction is processed in offline mode). It is not currently possible with the Connect API to perform a transaction lookup by this value.. /// The order associated with this transaction, if any.. /// The shipping address provided in the request, if any.. public Transaction(string Id = default(string), string LocationId = default(string), string CreatedAt = default(string), List Tenders = default(List), List Refunds = default(List), string ReferenceId = default(string), ProductEnum? Product = default(ProductEnum?), string ClientId = default(string), Order Order = default(Order), Address ShippingAddress = default(Address)) @@ -156,9 +156,9 @@ public enum ProductEnum [DataMember(Name="reference_id", EmitDefaultValue=false)] public string ReferenceId { get; set; } /// - /// If the transaction was created in the Square Register app, this value is the ID generated for the transaction by Square Register. This ID has no relationship to the transaction's canonical `id`, which is generated by Square's backend servers. This value is generated for bookkeeping purposes, in case the transaction cannot immediately be completed (for example, if the transaction is processed in offline mode). It is not currently possible with the Connect API to perform a transaction lookup by this value. + /// If the transaction was created in the Square Point of Sale app, this value is the ID generated for the transaction by Square Point of Sale. This ID has no relationship to the transaction's canonical `id`, which is generated by Square's backend servers. This value is generated for bookkeeping purposes, in case the transaction cannot immediately be completed (for example, if the transaction is processed in offline mode). It is not currently possible with the Connect API to perform a transaction lookup by this value. /// - /// If the transaction was created in the Square Register app, this value is the ID generated for the transaction by Square Register. This ID has no relationship to the transaction's canonical `id`, which is generated by Square's backend servers. This value is generated for bookkeeping purposes, in case the transaction cannot immediately be completed (for example, if the transaction is processed in offline mode). It is not currently possible with the Connect API to perform a transaction lookup by this value. + /// If the transaction was created in the Square Point of Sale app, this value is the ID generated for the transaction by Square Point of Sale. This ID has no relationship to the transaction's canonical `id`, which is generated by Square's backend servers. This value is generated for bookkeeping purposes, in case the transaction cannot immediately be completed (for example, if the transaction is processed in offline mode). It is not currently possible with the Connect API to perform a transaction lookup by this value. [DataMember(Name="client_id", EmitDefaultValue=false)] public string ClientId { get; set; } /// diff --git a/src/Square.Connect/Model/V1Payment.cs b/src/Square.Connect/Model/V1Payment.cs index 873fae8..13a591f 100644 --- a/src/Square.Connect/Model/V1Payment.cs +++ b/src/Square.Connect/Model/V1Payment.cs @@ -56,7 +56,7 @@ public partial class V1Payment : IEquatable, IValidatableObject /// All of the additive taxes associated with the payment.. /// All of the refunds applied to the payment.. /// The items purchased in the payment.. - public V1Payment(string Id = default(string), string MerchantId = default(string), string CreatedAt = default(string), bool? CreatorId = default(bool?), Device Device = default(Device), string PaymentUrl = default(string), string ReceiptUrl = default(string), V1Money InclusiveTaxMoney = default(V1Money), V1Money AdditiveTaxMoney = default(V1Money), V1Money TaxMoney = default(V1Money), V1Money TipMoney = default(V1Money), V1Money DiscountMoney = default(V1Money), V1Money TotalCollectedMoney = default(V1Money), V1Money ProcessingFeeMoney = default(V1Money), V1Money NetTotalMoney = default(V1Money), V1Money RefundedMoney = default(V1Money), V1Money SwedishRoundingMoney = default(V1Money), V1Money GrossSalesMoney = default(V1Money), V1Money NetSalesMoney = default(V1Money), List InclusiveTax = default(List), List AdditiveTax = default(List), List Tender = default(List), List Refunds = default(List), List Itemizations = default(List)) + public V1Payment(string Id = default(string), string MerchantId = default(string), string CreatedAt = default(string), string CreatorId = default(string), Device Device = default(Device), string PaymentUrl = default(string), string ReceiptUrl = default(string), V1Money InclusiveTaxMoney = default(V1Money), V1Money AdditiveTaxMoney = default(V1Money), V1Money TaxMoney = default(V1Money), V1Money TipMoney = default(V1Money), V1Money DiscountMoney = default(V1Money), V1Money TotalCollectedMoney = default(V1Money), V1Money ProcessingFeeMoney = default(V1Money), V1Money NetTotalMoney = default(V1Money), V1Money RefundedMoney = default(V1Money), V1Money SwedishRoundingMoney = default(V1Money), V1Money GrossSalesMoney = default(V1Money), V1Money NetSalesMoney = default(V1Money), List InclusiveTax = default(List), List AdditiveTax = default(List), List Tender = default(List), List Refunds = default(List), List Itemizations = default(List)) { this.Id = Id; this.MerchantId = MerchantId; @@ -107,7 +107,7 @@ public partial class V1Payment : IEquatable, IValidatableObject /// /// The unique identifier of the Square account that took the payment. [DataMember(Name="creator_id", EmitDefaultValue=false)] - public bool? CreatorId { get; set; } + public string CreatorId { get; set; } /// /// The device that took the payment. /// diff --git a/src/Square.Connect/Properties/AssemblyInfo.cs b/src/Square.Connect/Properties/AssemblyInfo.cs index ff19eac..1a3138b 100644 --- a/src/Square.Connect/Properties/AssemblyInfo.cs +++ b/src/Square.Connect/Properties/AssemblyInfo.cs @@ -28,5 +28,5 @@ // You can specify all the values or you can default the Build and Revision Numbers // by using the '*' as shown below: // [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("2.1.0")] -[assembly: AssemblyFileVersion("2.1.0")] +[assembly: AssemblyVersion("2.2.0")] +[assembly: AssemblyFileVersion("2.2.0")] diff --git a/src/Square.Connect/Square.Connect.nuspec b/src/Square.Connect/Square.Connect.nuspec index 9b28666..20c0e36 100644 --- a/src/Square.Connect/Square.Connect.nuspec +++ b/src/Square.Connect/Square.Connect.nuspec @@ -6,7 +6,7 @@ Square.Connect - 2.1.0 + 2.2.0 Square