From 634f3c287621d0996a3f9c055112e1d9cbfc3ab8 Mon Sep 17 00:00:00 2001 From: fern-api <115122769+fern-api[bot]@users.noreply.github.com> Date: Tue, 6 May 2025 13:29:40 +0000 Subject: [PATCH 1/3] SDK regeneration --- .mock/definition/__package__.yml | 2703 +++++++++++++++-- .mock/definition/catalog.yml | 35 +- .mock/definition/catalog/object.yml | 35 +- .mock/definition/invoices.yml | 2 +- poetry.lock | 36 +- pyproject.toml | 2 +- reference.md | 10 +- src/square/catalog/client.py | 12 +- src/square/catalog/object/client.py | 4 +- src/square/core/client_wrapper.py | 4 +- src/square/invoices/client.py | 9 +- src/square/invoices/raw_client.py | 9 +- src/square/requests/catalog_object.py | 26 +- src/square/requests/catalog_object_address.py | 7 - .../catalog_object_availability_period.py | 91 +- .../requests/catalog_object_category.py | 9 +- .../requests/catalog_object_checkout_link.py | 7 - .../requests/catalog_object_component.py | 7 - .../requests/catalog_object_composition.py | 7 - ...alog_object_custom_attribute_definition.py | 91 +- .../requests/catalog_object_dining_option.py | 7 - .../requests/catalog_object_discount.py | 91 +- src/square/requests/catalog_object_image.py | 91 +- src/square/requests/catalog_object_item.py | 91 +- .../requests/catalog_object_item_option.py | 91 +- .../catalog_object_item_option_value.py | 91 +- .../requests/catalog_object_item_variation.py | 91 +- .../catalog_object_measurement_unit.py | 91 +- .../requests/catalog_object_modifier.py | 91 +- .../requests/catalog_object_modifier_list.py | 91 +- .../requests/catalog_object_pricing_rule.py | 91 +- .../requests/catalog_object_product_set.py | 91 +- .../catalog_object_quick_amounts_settings.py | 91 +- .../requests/catalog_object_resource.py | 7 - .../requests/catalog_object_service_charge.py | 7 - .../catalog_object_subscription_plan.py | 91 +- ...alog_object_subscription_plan_variation.py | 91 +- .../catalog_object_subscription_product.py | 7 - src/square/requests/catalog_object_tax.py | 91 +- .../requests/catalog_object_tax_exemption.py | 7 - .../requests/catalog_object_time_period.py | 91 +- .../create_invoice_attachment_request_data.py | 21 + src/square/types/catalog_object.py | 26 +- src/square/types/catalog_object_address.py | 17 - .../catalog_object_availability_period.py | 93 +- src/square/types/catalog_object_category.py | 9 +- .../types/catalog_object_checkout_link.py | 17 - src/square/types/catalog_object_component.py | 17 - .../types/catalog_object_composition.py | 17 - ...alog_object_custom_attribute_definition.py | 93 +- .../types/catalog_object_dining_option.py | 17 - src/square/types/catalog_object_discount.py | 93 +- src/square/types/catalog_object_image.py | 93 +- src/square/types/catalog_object_item.py | 93 +- .../types/catalog_object_item_option.py | 93 +- .../types/catalog_object_item_option_value.py | 93 +- .../types/catalog_object_item_variation.py | 93 +- .../types/catalog_object_measurement_unit.py | 93 +- src/square/types/catalog_object_modifier.py | 93 +- .../types/catalog_object_modifier_list.py | 93 +- .../types/catalog_object_pricing_rule.py | 93 +- .../types/catalog_object_product_set.py | 93 +- .../catalog_object_quick_amounts_settings.py | 93 +- src/square/types/catalog_object_resource.py | 17 - .../types/catalog_object_service_charge.py | 17 - .../types/catalog_object_subscription_plan.py | 93 +- ...alog_object_subscription_plan_variation.py | 93 +- .../catalog_object_subscription_product.py | 17 - src/square/types/catalog_object_tax.py | 93 +- .../types/catalog_object_tax_exemption.py | 17 - .../types/catalog_object_time_period.py | 93 +- .../create_invoice_attachment_request_data.py | 32 + 72 files changed, 5876 insertions(+), 636 deletions(-) delete mode 100644 src/square/requests/catalog_object_address.py delete mode 100644 src/square/requests/catalog_object_checkout_link.py delete mode 100644 src/square/requests/catalog_object_component.py delete mode 100644 src/square/requests/catalog_object_composition.py delete mode 100644 src/square/requests/catalog_object_dining_option.py delete mode 100644 src/square/requests/catalog_object_resource.py delete mode 100644 src/square/requests/catalog_object_service_charge.py delete mode 100644 src/square/requests/catalog_object_subscription_product.py delete mode 100644 src/square/requests/catalog_object_tax_exemption.py create mode 100644 src/square/requests/create_invoice_attachment_request_data.py delete mode 100644 src/square/types/catalog_object_address.py delete mode 100644 src/square/types/catalog_object_checkout_link.py delete mode 100644 src/square/types/catalog_object_component.py delete mode 100644 src/square/types/catalog_object_composition.py delete mode 100644 src/square/types/catalog_object_dining_option.py delete mode 100644 src/square/types/catalog_object_resource.py delete mode 100644 src/square/types/catalog_object_service_charge.py delete mode 100644 src/square/types/catalog_object_subscription_product.py delete mode 100644 src/square/types/catalog_object_tax_exemption.py create mode 100644 src/square/types/create_invoice_attachment_request_data.py diff --git a/.mock/definition/__package__.yml b/.mock/definition/__package__.yml index a18da480..19a3e9a6 100644 --- a/.mock/definition/__package__.yml +++ b/.mock/definition/__package__.yml @@ -5155,25 +5155,16 @@ types: - CatalogObjectDiscount - CatalogObjectModifierList - CatalogObjectModifier - - CatalogObjectDiningOption - - CatalogObjectTaxExemption - - CatalogObjectServiceCharge - CatalogObjectPricingRule - CatalogObjectProductSet - CatalogObjectTimePeriod - CatalogObjectMeasurementUnit - - CatalogObjectSubscriptionPlan + - CatalogObjectSubscriptionPlanVariation - CatalogObjectItemOption - CatalogObjectItemOptionValue - CatalogObjectCustomAttributeDefinition - CatalogObjectQuickAmountsSettings - - CatalogObjectComponent - - CatalogObjectComposition - - CatalogObjectResource - - CatalogObjectCheckoutLink - - CatalogObjectAddress - - CatalogObjectSubscriptionProduct - - CatalogObjectSubscriptionPlanVariation + - CatalogObjectSubscriptionPlan - CatalogObjectAvailabilityPeriod source: openapi: openapi/openapi.json @@ -5201,20 +5192,12 @@ types: ordinal: type: optional> docs: The order of the object within the context of the category. + type: literal<"CATEGORY"> category_data: type: optional docs: >- Structured data for a `CatalogCategory`, set for CatalogObjects of type `CATEGORY`. - type: - type: CatalogObjectType - docs: >- - The type of this object. Each object type has expected - - properties expressed in a structured format within its corresponding - `*_data` field below. - - See [CatalogObjectType](#type-catalogobjecttype) for possible values updated_at: type: optional docs: >- @@ -7381,6 +7364,28 @@ types: docs: The new gift card. source: openapi: openapi/openapi.json + CreateInvoiceAttachmentRequestData: + docs: >- + Represents a + [CreateInvoiceAttachment](api-endpoint:Invoices-CreateInvoiceAttachment) + request. + properties: + idempotency_key: + type: optional + docs: >- + A unique string that identifies the `CreateInvoiceAttachment` request. + + For more information, see + [Idempotency](https://developer.squareup.com/docs/build-basics/common-api-patterns/idempotency). + validation: + maxLength: 128 + description: + type: optional + docs: The description of the attachment to display on the invoice. + validation: + maxLength: 128 + source: + openapi: openapi/openapi.json CreateInvoiceAttachmentResponse: docs: >- Represents a @@ -26846,256 +26851,2488 @@ types: openapi: openapi/openapi.json CatalogObjectItem: properties: + type: literal<"ITEM"> item_data: type: optional docs: >- Structured data for a `CatalogItem`, set for CatalogObjects of type `ITEM`. - extends: - - CatalogObjectBase - source: - openapi: openapi/openapi.json - CatalogObjectItemVariation: - properties: - item_variation_data: - type: optional + id: + type: string docs: >- - Structured data for a `CatalogItemVariation`, set for CatalogObjects - of type `ITEM_VARIATION`. - extends: - - CatalogObjectBase - source: - openapi: openapi/openapi.json - CatalogObjectTax: - properties: - tax_data: - type: optional + 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. + validation: + minLength: 1 + updated_at: + type: optional docs: >- - Structured data for a `CatalogTax`, set for CatalogObjects of type - `TAX`. - extends: - - CatalogObjectBase - source: - openapi: openapi/openapi.json - CatalogObjectDiscount: - properties: - discount_data: - type: optional + Last modification + [timestamp](https://developer.squareup.com/docs/build-basics/working-with-dates) + 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. + version: + type: optional docs: >- - Structured data for a `CatalogDiscount`, set for CatalogObjects of - type `DISCOUNT`. - extends: - - CatalogObjectBase - source: - openapi: openapi/openapi.json - CatalogObjectModifierList: - properties: - modifier_list_data: - type: optional + The version of the object. When updating an object, the version + supplied + + must match the version in the database, otherwise the write will be + rejected as conflicting. + is_deleted: + type: optional docs: >- - Structured data for a `CatalogModifierList`, set for CatalogObjects of - type `MODIFIER_LIST`. - extends: - - CatalogObjectBase - source: - openapi: openapi/openapi.json - CatalogObjectModifier: - properties: - modifier_data: - type: optional + 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. + custom_attribute_values: + type: optional> docs: >- - Structured data for a `CatalogModifier`, set for CatalogObjects of - type `MODIFIER`. - extends: - - CatalogObjectBase - source: - openapi: openapi/openapi.json - CatalogObjectDiningOption: - properties: {} - extends: - - CatalogObjectBase - source: - openapi: openapi/openapi.json - CatalogObjectTaxExemption: - properties: {} - extends: - - CatalogObjectBase - source: - openapi: openapi/openapi.json - CatalogObjectServiceCharge: - properties: {} - extends: - - CatalogObjectBase - source: - openapi: openapi/openapi.json - CatalogObjectTimePeriod: - properties: - time_period_data: - type: optional + A map (key-value pairs) of application-defined custom attribute + values. The value of a key-value pair + + is a [CatalogCustomAttributeValue](entity:CatalogCustomAttributeValue) + object. The key is the `key` attribute + + value defined in the associated + [CatalogCustomAttributeDefinition](entity:CatalogCustomAttributeDefinition) + + object defined by the application making the request. + + + If the `CatalogCustomAttributeDefinition` object is + + defined by another application, the + `CatalogCustomAttributeDefinition`'s key attribute value is prefixed + by + + the defining application ID. For example, if the + `CatalogCustomAttributeDefinition` has a `key` attribute of + + `"cocoa_brand"` and the defining application ID is `"abcd1234"`, the + key in the map is `"abcd1234:cocoa_brand"` + + if the application making the request is different from the + application defining the custom attribute definition. + + Otherwise, the key used in the map is simply `"cocoa_brand"`. + + + Application-defined custom attributes are set at a global + (location-independent) level. + + Custom attribute values are intended to store additional information + about a catalog object + + or associations with an entity in another system. Do not use custom + attributes + + to store any sensitive information (personally identifiable + information, card details, etc.). + catalog_v1_ids: + type: optional> docs: >- - Structured data for a `CatalogTimePeriod`, set for CatalogObjects of - type `TIME_PERIOD`. - extends: - - CatalogObjectBase - source: - openapi: openapi/openapi.json - CatalogObjectProductSet: - properties: - product_set_data: - type: optional + 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. + present_at_all_locations: + type: optional docs: >- - Structured data for a `CatalogProductSet`, set for CatalogObjects of - type `PRODUCT_SET`. - extends: - - CatalogObjectBase - source: - openapi: openapi/openapi.json - CatalogObjectPricingRule: - properties: - pricing_rule_data: - type: optional + If `true`, this object is present at all locations (including future + locations), except where specified in + + the `absent_at_location_ids` field. If `false`, this object is not + present at any locations (including future locations), + + except where specified in the `present_at_location_ids` field. If not + specified, defaults to `true`. + present_at_location_ids: + type: optional> docs: >- - Structured data for a `CatalogPricingRule`, set for CatalogObjects of - type `PRICING_RULE`. + A list of locations where the object is present, even if + `present_at_all_locations` is `false`. - A `CatalogPricingRule` object often works with a `CatalogProductSet` - object or a `CatalogTimePeriod` object. - extends: - - CatalogObjectBase + This can include locations that are deactivated. + absent_at_location_ids: + type: optional> + docs: >- + A list of locations where the object is not present, even if + `present_at_all_locations` is `true`. + + This can include locations that are deactivated. + image_id: + type: optional + docs: Identifies the `CatalogImage` attached to this `CatalogObject`. source: openapi: openapi/openapi.json CatalogObjectImage: properties: + type: literal<"IMAGE"> image_data: type: optional docs: >- Structured data for a `CatalogImage`, set for CatalogObjects of type `IMAGE`. - extends: - - CatalogObjectBase - source: - openapi: openapi/openapi.json - CatalogObjectMeasurementUnit: - properties: - measurement_unit_data: - type: optional - docs: >- - Structured data for a `CatalogMeasurementUnit`, set for CatalogObjects - of type `MEASUREMENT_UNIT`. - extends: - - CatalogObjectBase - source: - openapi: openapi/openapi.json - CatalogObjectSubscriptionPlan: - properties: - subscription_plan_data: - type: optional - docs: >- - Structured data for a `CatalogSubscriptionPlan`, set for - CatalogObjects of type `SUBSCRIPTION_PLAN`. - extends: - - CatalogObjectBase - source: - openapi: openapi/openapi.json - CatalogObjectItemOption: - properties: - item_option_data: - type: optional + id: + type: string docs: >- - Structured data for a `CatalogItemOption`, set for CatalogObjects of - type `ITEM_OPTION`. - extends: - - CatalogObjectBase - source: - openapi: openapi/openapi.json - CatalogObjectItemOptionValue: - properties: - item_option_value_data: + 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. + validation: + minLength: 1 + updated_at: + type: optional + docs: >- + Last modification + [timestamp](https://developer.squareup.com/docs/build-basics/working-with-dates) + 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. + version: + type: optional + docs: >- + The version of the object. When updating an object, the version + supplied + + must match the version in the database, otherwise the write will be + rejected as conflicting. + is_deleted: + type: optional + docs: >- + 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. + custom_attribute_values: + type: optional> + docs: >- + A map (key-value pairs) of application-defined custom attribute + values. The value of a key-value pair + + is a [CatalogCustomAttributeValue](entity:CatalogCustomAttributeValue) + object. The key is the `key` attribute + + value defined in the associated + [CatalogCustomAttributeDefinition](entity:CatalogCustomAttributeDefinition) + + object defined by the application making the request. + + + If the `CatalogCustomAttributeDefinition` object is + + defined by another application, the + `CatalogCustomAttributeDefinition`'s key attribute value is prefixed + by + + the defining application ID. For example, if the + `CatalogCustomAttributeDefinition` has a `key` attribute of + + `"cocoa_brand"` and the defining application ID is `"abcd1234"`, the + key in the map is `"abcd1234:cocoa_brand"` + + if the application making the request is different from the + application defining the custom attribute definition. + + Otherwise, the key used in the map is simply `"cocoa_brand"`. + + + Application-defined custom attributes are set at a global + (location-independent) level. + + Custom attribute values are intended to store additional information + about a catalog object + + or associations with an entity in another system. Do not use custom + attributes + + to store any sensitive information (personally identifiable + information, card details, etc.). + catalog_v1_ids: + type: optional> + docs: >- + 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. + present_at_all_locations: + type: optional + docs: >- + If `true`, this object is present at all locations (including future + locations), except where specified in + + the `absent_at_location_ids` field. If `false`, this object is not + present at any locations (including future locations), + + except where specified in the `present_at_location_ids` field. If not + specified, defaults to `true`. + present_at_location_ids: + type: optional> + docs: >- + A list of locations where the object is present, even if + `present_at_all_locations` is `false`. + + This can include locations that are deactivated. + absent_at_location_ids: + type: optional> + docs: >- + A list of locations where the object is not present, even if + `present_at_all_locations` is `true`. + + This can include locations that are deactivated. + image_id: + type: optional + docs: Identifies the `CatalogImage` attached to this `CatalogObject`. + source: + openapi: openapi/openapi.json + CatalogObjectItemVariation: + properties: + type: literal<"ITEM_VARIATION"> + item_variation_data: + type: optional + docs: >- + Structured data for a `CatalogItemVariation`, set for CatalogObjects + of type `ITEM_VARIATION`. + id: + type: string + docs: >- + 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. + validation: + minLength: 1 + updated_at: + type: optional + docs: >- + Last modification + [timestamp](https://developer.squareup.com/docs/build-basics/working-with-dates) + 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. + version: + type: optional + docs: >- + The version of the object. When updating an object, the version + supplied + + must match the version in the database, otherwise the write will be + rejected as conflicting. + is_deleted: + type: optional + docs: >- + 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. + custom_attribute_values: + type: optional> + docs: >- + A map (key-value pairs) of application-defined custom attribute + values. The value of a key-value pair + + is a [CatalogCustomAttributeValue](entity:CatalogCustomAttributeValue) + object. The key is the `key` attribute + + value defined in the associated + [CatalogCustomAttributeDefinition](entity:CatalogCustomAttributeDefinition) + + object defined by the application making the request. + + + If the `CatalogCustomAttributeDefinition` object is + + defined by another application, the + `CatalogCustomAttributeDefinition`'s key attribute value is prefixed + by + + the defining application ID. For example, if the + `CatalogCustomAttributeDefinition` has a `key` attribute of + + `"cocoa_brand"` and the defining application ID is `"abcd1234"`, the + key in the map is `"abcd1234:cocoa_brand"` + + if the application making the request is different from the + application defining the custom attribute definition. + + Otherwise, the key used in the map is simply `"cocoa_brand"`. + + + Application-defined custom attributes are set at a global + (location-independent) level. + + Custom attribute values are intended to store additional information + about a catalog object + + or associations with an entity in another system. Do not use custom + attributes + + to store any sensitive information (personally identifiable + information, card details, etc.). + catalog_v1_ids: + type: optional> + docs: >- + 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. + present_at_all_locations: + type: optional + docs: >- + If `true`, this object is present at all locations (including future + locations), except where specified in + + the `absent_at_location_ids` field. If `false`, this object is not + present at any locations (including future locations), + + except where specified in the `present_at_location_ids` field. If not + specified, defaults to `true`. + present_at_location_ids: + type: optional> + docs: >- + A list of locations where the object is present, even if + `present_at_all_locations` is `false`. + + This can include locations that are deactivated. + absent_at_location_ids: + type: optional> + docs: >- + A list of locations where the object is not present, even if + `present_at_all_locations` is `true`. + + This can include locations that are deactivated. + image_id: + type: optional + docs: Identifies the `CatalogImage` attached to this `CatalogObject`. + source: + openapi: openapi/openapi.json + CatalogObjectTax: + properties: + type: literal<"TAX"> + tax_data: + type: optional + docs: >- + Structured data for a `CatalogTax`, set for CatalogObjects of type + `TAX`. + id: + type: string + docs: >- + 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. + validation: + minLength: 1 + updated_at: + type: optional + docs: >- + Last modification + [timestamp](https://developer.squareup.com/docs/build-basics/working-with-dates) + 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. + version: + type: optional + docs: >- + The version of the object. When updating an object, the version + supplied + + must match the version in the database, otherwise the write will be + rejected as conflicting. + is_deleted: + type: optional + docs: >- + 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. + custom_attribute_values: + type: optional> + docs: >- + A map (key-value pairs) of application-defined custom attribute + values. The value of a key-value pair + + is a [CatalogCustomAttributeValue](entity:CatalogCustomAttributeValue) + object. The key is the `key` attribute + + value defined in the associated + [CatalogCustomAttributeDefinition](entity:CatalogCustomAttributeDefinition) + + object defined by the application making the request. + + + If the `CatalogCustomAttributeDefinition` object is + + defined by another application, the + `CatalogCustomAttributeDefinition`'s key attribute value is prefixed + by + + the defining application ID. For example, if the + `CatalogCustomAttributeDefinition` has a `key` attribute of + + `"cocoa_brand"` and the defining application ID is `"abcd1234"`, the + key in the map is `"abcd1234:cocoa_brand"` + + if the application making the request is different from the + application defining the custom attribute definition. + + Otherwise, the key used in the map is simply `"cocoa_brand"`. + + + Application-defined custom attributes are set at a global + (location-independent) level. + + Custom attribute values are intended to store additional information + about a catalog object + + or associations with an entity in another system. Do not use custom + attributes + + to store any sensitive information (personally identifiable + information, card details, etc.). + catalog_v1_ids: + type: optional> + docs: >- + 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. + present_at_all_locations: + type: optional + docs: >- + If `true`, this object is present at all locations (including future + locations), except where specified in + + the `absent_at_location_ids` field. If `false`, this object is not + present at any locations (including future locations), + + except where specified in the `present_at_location_ids` field. If not + specified, defaults to `true`. + present_at_location_ids: + type: optional> + docs: >- + A list of locations where the object is present, even if + `present_at_all_locations` is `false`. + + This can include locations that are deactivated. + absent_at_location_ids: + type: optional> + docs: >- + A list of locations where the object is not present, even if + `present_at_all_locations` is `true`. + + This can include locations that are deactivated. + image_id: + type: optional + docs: Identifies the `CatalogImage` attached to this `CatalogObject`. + source: + openapi: openapi/openapi.json + CatalogObjectDiscount: + properties: + type: literal<"DISCOUNT"> + discount_data: + type: optional + docs: >- + Structured data for a `CatalogDiscount`, set for CatalogObjects of + type `DISCOUNT`. + id: + type: string + docs: >- + 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. + validation: + minLength: 1 + updated_at: + type: optional + docs: >- + Last modification + [timestamp](https://developer.squareup.com/docs/build-basics/working-with-dates) + 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. + version: + type: optional + docs: >- + The version of the object. When updating an object, the version + supplied + + must match the version in the database, otherwise the write will be + rejected as conflicting. + is_deleted: + type: optional + docs: >- + 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. + custom_attribute_values: + type: optional> + docs: >- + A map (key-value pairs) of application-defined custom attribute + values. The value of a key-value pair + + is a [CatalogCustomAttributeValue](entity:CatalogCustomAttributeValue) + object. The key is the `key` attribute + + value defined in the associated + [CatalogCustomAttributeDefinition](entity:CatalogCustomAttributeDefinition) + + object defined by the application making the request. + + + If the `CatalogCustomAttributeDefinition` object is + + defined by another application, the + `CatalogCustomAttributeDefinition`'s key attribute value is prefixed + by + + the defining application ID. For example, if the + `CatalogCustomAttributeDefinition` has a `key` attribute of + + `"cocoa_brand"` and the defining application ID is `"abcd1234"`, the + key in the map is `"abcd1234:cocoa_brand"` + + if the application making the request is different from the + application defining the custom attribute definition. + + Otherwise, the key used in the map is simply `"cocoa_brand"`. + + + Application-defined custom attributes are set at a global + (location-independent) level. + + Custom attribute values are intended to store additional information + about a catalog object + + or associations with an entity in another system. Do not use custom + attributes + + to store any sensitive information (personally identifiable + information, card details, etc.). + catalog_v1_ids: + type: optional> + docs: >- + 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. + present_at_all_locations: + type: optional + docs: >- + If `true`, this object is present at all locations (including future + locations), except where specified in + + the `absent_at_location_ids` field. If `false`, this object is not + present at any locations (including future locations), + + except where specified in the `present_at_location_ids` field. If not + specified, defaults to `true`. + present_at_location_ids: + type: optional> + docs: >- + A list of locations where the object is present, even if + `present_at_all_locations` is `false`. + + This can include locations that are deactivated. + absent_at_location_ids: + type: optional> + docs: >- + A list of locations where the object is not present, even if + `present_at_all_locations` is `true`. + + This can include locations that are deactivated. + image_id: + type: optional + docs: Identifies the `CatalogImage` attached to this `CatalogObject`. + source: + openapi: openapi/openapi.json + CatalogObjectModifierList: + properties: + type: literal<"MODIFIER_LIST"> + modifier_list_data: + type: optional + docs: >- + Structured data for a `CatalogModifierList`, set for CatalogObjects of + type `MODIFIER_LIST`. + id: + type: string + docs: >- + 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. + validation: + minLength: 1 + updated_at: + type: optional + docs: >- + Last modification + [timestamp](https://developer.squareup.com/docs/build-basics/working-with-dates) + 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. + version: + type: optional + docs: >- + The version of the object. When updating an object, the version + supplied + + must match the version in the database, otherwise the write will be + rejected as conflicting. + is_deleted: + type: optional + docs: >- + 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. + custom_attribute_values: + type: optional> + docs: >- + A map (key-value pairs) of application-defined custom attribute + values. The value of a key-value pair + + is a [CatalogCustomAttributeValue](entity:CatalogCustomAttributeValue) + object. The key is the `key` attribute + + value defined in the associated + [CatalogCustomAttributeDefinition](entity:CatalogCustomAttributeDefinition) + + object defined by the application making the request. + + + If the `CatalogCustomAttributeDefinition` object is + + defined by another application, the + `CatalogCustomAttributeDefinition`'s key attribute value is prefixed + by + + the defining application ID. For example, if the + `CatalogCustomAttributeDefinition` has a `key` attribute of + + `"cocoa_brand"` and the defining application ID is `"abcd1234"`, the + key in the map is `"abcd1234:cocoa_brand"` + + if the application making the request is different from the + application defining the custom attribute definition. + + Otherwise, the key used in the map is simply `"cocoa_brand"`. + + + Application-defined custom attributes are set at a global + (location-independent) level. + + Custom attribute values are intended to store additional information + about a catalog object + + or associations with an entity in another system. Do not use custom + attributes + + to store any sensitive information (personally identifiable + information, card details, etc.). + catalog_v1_ids: + type: optional> + docs: >- + 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. + present_at_all_locations: + type: optional + docs: >- + If `true`, this object is present at all locations (including future + locations), except where specified in + + the `absent_at_location_ids` field. If `false`, this object is not + present at any locations (including future locations), + + except where specified in the `present_at_location_ids` field. If not + specified, defaults to `true`. + present_at_location_ids: + type: optional> + docs: >- + A list of locations where the object is present, even if + `present_at_all_locations` is `false`. + + This can include locations that are deactivated. + absent_at_location_ids: + type: optional> + docs: >- + A list of locations where the object is not present, even if + `present_at_all_locations` is `true`. + + This can include locations that are deactivated. + image_id: + type: optional + docs: Identifies the `CatalogImage` attached to this `CatalogObject`. + source: + openapi: openapi/openapi.json + CatalogObjectModifier: + properties: + type: literal<"MODIFIER"> + modifier_data: + type: optional + docs: >- + Structured data for a `CatalogModifier`, set for CatalogObjects of + type `MODIFIER`. + id: + type: string + docs: >- + 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. + validation: + minLength: 1 + updated_at: + type: optional + docs: >- + Last modification + [timestamp](https://developer.squareup.com/docs/build-basics/working-with-dates) + 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. + version: + type: optional + docs: >- + The version of the object. When updating an object, the version + supplied + + must match the version in the database, otherwise the write will be + rejected as conflicting. + is_deleted: + type: optional + docs: >- + 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. + custom_attribute_values: + type: optional> + docs: >- + A map (key-value pairs) of application-defined custom attribute + values. The value of a key-value pair + + is a [CatalogCustomAttributeValue](entity:CatalogCustomAttributeValue) + object. The key is the `key` attribute + + value defined in the associated + [CatalogCustomAttributeDefinition](entity:CatalogCustomAttributeDefinition) + + object defined by the application making the request. + + + If the `CatalogCustomAttributeDefinition` object is + + defined by another application, the + `CatalogCustomAttributeDefinition`'s key attribute value is prefixed + by + + the defining application ID. For example, if the + `CatalogCustomAttributeDefinition` has a `key` attribute of + + `"cocoa_brand"` and the defining application ID is `"abcd1234"`, the + key in the map is `"abcd1234:cocoa_brand"` + + if the application making the request is different from the + application defining the custom attribute definition. + + Otherwise, the key used in the map is simply `"cocoa_brand"`. + + + Application-defined custom attributes are set at a global + (location-independent) level. + + Custom attribute values are intended to store additional information + about a catalog object + + or associations with an entity in another system. Do not use custom + attributes + + to store any sensitive information (personally identifiable + information, card details, etc.). + catalog_v1_ids: + type: optional> + docs: >- + 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. + present_at_all_locations: + type: optional + docs: >- + If `true`, this object is present at all locations (including future + locations), except where specified in + + the `absent_at_location_ids` field. If `false`, this object is not + present at any locations (including future locations), + + except where specified in the `present_at_location_ids` field. If not + specified, defaults to `true`. + present_at_location_ids: + type: optional> + docs: >- + A list of locations where the object is present, even if + `present_at_all_locations` is `false`. + + This can include locations that are deactivated. + absent_at_location_ids: + type: optional> + docs: >- + A list of locations where the object is not present, even if + `present_at_all_locations` is `true`. + + This can include locations that are deactivated. + image_id: + type: optional + docs: Identifies the `CatalogImage` attached to this `CatalogObject`. + source: + openapi: openapi/openapi.json + CatalogObjectPricingRule: + properties: + type: literal<"PRICING_RULE"> + pricing_rule_data: + type: optional + docs: >- + Structured data for a `CatalogPricingRule`, set for CatalogObjects of + type `PRICING_RULE`. + + A `CatalogPricingRule` object often works with a `CatalogProductSet` + object or a `CatalogTimePeriod` object. + id: + type: string + docs: >- + 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. + validation: + minLength: 1 + updated_at: + type: optional + docs: >- + Last modification + [timestamp](https://developer.squareup.com/docs/build-basics/working-with-dates) + 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. + version: + type: optional + docs: >- + The version of the object. When updating an object, the version + supplied + + must match the version in the database, otherwise the write will be + rejected as conflicting. + is_deleted: + type: optional + docs: >- + 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. + custom_attribute_values: + type: optional> + docs: >- + A map (key-value pairs) of application-defined custom attribute + values. The value of a key-value pair + + is a [CatalogCustomAttributeValue](entity:CatalogCustomAttributeValue) + object. The key is the `key` attribute + + value defined in the associated + [CatalogCustomAttributeDefinition](entity:CatalogCustomAttributeDefinition) + + object defined by the application making the request. + + + If the `CatalogCustomAttributeDefinition` object is + + defined by another application, the + `CatalogCustomAttributeDefinition`'s key attribute value is prefixed + by + + the defining application ID. For example, if the + `CatalogCustomAttributeDefinition` has a `key` attribute of + + `"cocoa_brand"` and the defining application ID is `"abcd1234"`, the + key in the map is `"abcd1234:cocoa_brand"` + + if the application making the request is different from the + application defining the custom attribute definition. + + Otherwise, the key used in the map is simply `"cocoa_brand"`. + + + Application-defined custom attributes are set at a global + (location-independent) level. + + Custom attribute values are intended to store additional information + about a catalog object + + or associations with an entity in another system. Do not use custom + attributes + + to store any sensitive information (personally identifiable + information, card details, etc.). + catalog_v1_ids: + type: optional> + docs: >- + 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. + present_at_all_locations: + type: optional + docs: >- + If `true`, this object is present at all locations (including future + locations), except where specified in + + the `absent_at_location_ids` field. If `false`, this object is not + present at any locations (including future locations), + + except where specified in the `present_at_location_ids` field. If not + specified, defaults to `true`. + present_at_location_ids: + type: optional> + docs: >- + A list of locations where the object is present, even if + `present_at_all_locations` is `false`. + + This can include locations that are deactivated. + absent_at_location_ids: + type: optional> + docs: >- + A list of locations where the object is not present, even if + `present_at_all_locations` is `true`. + + This can include locations that are deactivated. + image_id: + type: optional + docs: Identifies the `CatalogImage` attached to this `CatalogObject`. + source: + openapi: openapi/openapi.json + CatalogObjectProductSet: + properties: + type: literal<"PRODUCT_SET"> + product_set_data: + type: optional + docs: >- + Structured data for a `CatalogProductSet`, set for CatalogObjects of + type `PRODUCT_SET`. + id: + type: string + docs: >- + 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. + validation: + minLength: 1 + updated_at: + type: optional + docs: >- + Last modification + [timestamp](https://developer.squareup.com/docs/build-basics/working-with-dates) + 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. + version: + type: optional + docs: >- + The version of the object. When updating an object, the version + supplied + + must match the version in the database, otherwise the write will be + rejected as conflicting. + is_deleted: + type: optional + docs: >- + 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. + custom_attribute_values: + type: optional> + docs: >- + A map (key-value pairs) of application-defined custom attribute + values. The value of a key-value pair + + is a [CatalogCustomAttributeValue](entity:CatalogCustomAttributeValue) + object. The key is the `key` attribute + + value defined in the associated + [CatalogCustomAttributeDefinition](entity:CatalogCustomAttributeDefinition) + + object defined by the application making the request. + + + If the `CatalogCustomAttributeDefinition` object is + + defined by another application, the + `CatalogCustomAttributeDefinition`'s key attribute value is prefixed + by + + the defining application ID. For example, if the + `CatalogCustomAttributeDefinition` has a `key` attribute of + + `"cocoa_brand"` and the defining application ID is `"abcd1234"`, the + key in the map is `"abcd1234:cocoa_brand"` + + if the application making the request is different from the + application defining the custom attribute definition. + + Otherwise, the key used in the map is simply `"cocoa_brand"`. + + + Application-defined custom attributes are set at a global + (location-independent) level. + + Custom attribute values are intended to store additional information + about a catalog object + + or associations with an entity in another system. Do not use custom + attributes + + to store any sensitive information (personally identifiable + information, card details, etc.). + catalog_v1_ids: + type: optional> + docs: >- + 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. + present_at_all_locations: + type: optional + docs: >- + If `true`, this object is present at all locations (including future + locations), except where specified in + + the `absent_at_location_ids` field. If `false`, this object is not + present at any locations (including future locations), + + except where specified in the `present_at_location_ids` field. If not + specified, defaults to `true`. + present_at_location_ids: + type: optional> + docs: >- + A list of locations where the object is present, even if + `present_at_all_locations` is `false`. + + This can include locations that are deactivated. + absent_at_location_ids: + type: optional> + docs: >- + A list of locations where the object is not present, even if + `present_at_all_locations` is `true`. + + This can include locations that are deactivated. + image_id: + type: optional + docs: Identifies the `CatalogImage` attached to this `CatalogObject`. + source: + openapi: openapi/openapi.json + CatalogObjectTimePeriod: + properties: + type: literal<"TIME_PERIOD"> + time_period_data: + type: optional + docs: >- + Structured data for a `CatalogTimePeriod`, set for CatalogObjects of + type `TIME_PERIOD`. + id: + type: string + docs: >- + 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. + validation: + minLength: 1 + updated_at: + type: optional + docs: >- + Last modification + [timestamp](https://developer.squareup.com/docs/build-basics/working-with-dates) + 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. + version: + type: optional + docs: >- + The version of the object. When updating an object, the version + supplied + + must match the version in the database, otherwise the write will be + rejected as conflicting. + is_deleted: + type: optional + docs: >- + 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. + custom_attribute_values: + type: optional> + docs: >- + A map (key-value pairs) of application-defined custom attribute + values. The value of a key-value pair + + is a [CatalogCustomAttributeValue](entity:CatalogCustomAttributeValue) + object. The key is the `key` attribute + + value defined in the associated + [CatalogCustomAttributeDefinition](entity:CatalogCustomAttributeDefinition) + + object defined by the application making the request. + + + If the `CatalogCustomAttributeDefinition` object is + + defined by another application, the + `CatalogCustomAttributeDefinition`'s key attribute value is prefixed + by + + the defining application ID. For example, if the + `CatalogCustomAttributeDefinition` has a `key` attribute of + + `"cocoa_brand"` and the defining application ID is `"abcd1234"`, the + key in the map is `"abcd1234:cocoa_brand"` + + if the application making the request is different from the + application defining the custom attribute definition. + + Otherwise, the key used in the map is simply `"cocoa_brand"`. + + + Application-defined custom attributes are set at a global + (location-independent) level. + + Custom attribute values are intended to store additional information + about a catalog object + + or associations with an entity in another system. Do not use custom + attributes + + to store any sensitive information (personally identifiable + information, card details, etc.). + catalog_v1_ids: + type: optional> + docs: >- + 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. + present_at_all_locations: + type: optional + docs: >- + If `true`, this object is present at all locations (including future + locations), except where specified in + + the `absent_at_location_ids` field. If `false`, this object is not + present at any locations (including future locations), + + except where specified in the `present_at_location_ids` field. If not + specified, defaults to `true`. + present_at_location_ids: + type: optional> + docs: >- + A list of locations where the object is present, even if + `present_at_all_locations` is `false`. + + This can include locations that are deactivated. + absent_at_location_ids: + type: optional> + docs: >- + A list of locations where the object is not present, even if + `present_at_all_locations` is `true`. + + This can include locations that are deactivated. + image_id: + type: optional + docs: Identifies the `CatalogImage` attached to this `CatalogObject`. + source: + openapi: openapi/openapi.json + CatalogObjectMeasurementUnit: + properties: + type: literal<"MEASUREMENT_UNIT"> + measurement_unit_data: + type: optional + docs: >- + Structured data for a `CatalogMeasurementUnit`, set for CatalogObjects + of type `MEASUREMENT_UNIT`. + id: + type: string + docs: >- + 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. + validation: + minLength: 1 + updated_at: + type: optional + docs: >- + Last modification + [timestamp](https://developer.squareup.com/docs/build-basics/working-with-dates) + 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. + version: + type: optional + docs: >- + The version of the object. When updating an object, the version + supplied + + must match the version in the database, otherwise the write will be + rejected as conflicting. + is_deleted: + type: optional + docs: >- + 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. + custom_attribute_values: + type: optional> + docs: >- + A map (key-value pairs) of application-defined custom attribute + values. The value of a key-value pair + + is a [CatalogCustomAttributeValue](entity:CatalogCustomAttributeValue) + object. The key is the `key` attribute + + value defined in the associated + [CatalogCustomAttributeDefinition](entity:CatalogCustomAttributeDefinition) + + object defined by the application making the request. + + + If the `CatalogCustomAttributeDefinition` object is + + defined by another application, the + `CatalogCustomAttributeDefinition`'s key attribute value is prefixed + by + + the defining application ID. For example, if the + `CatalogCustomAttributeDefinition` has a `key` attribute of + + `"cocoa_brand"` and the defining application ID is `"abcd1234"`, the + key in the map is `"abcd1234:cocoa_brand"` + + if the application making the request is different from the + application defining the custom attribute definition. + + Otherwise, the key used in the map is simply `"cocoa_brand"`. + + + Application-defined custom attributes are set at a global + (location-independent) level. + + Custom attribute values are intended to store additional information + about a catalog object + + or associations with an entity in another system. Do not use custom + attributes + + to store any sensitive information (personally identifiable + information, card details, etc.). + catalog_v1_ids: + type: optional> + docs: >- + 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. + present_at_all_locations: + type: optional + docs: >- + If `true`, this object is present at all locations (including future + locations), except where specified in + + the `absent_at_location_ids` field. If `false`, this object is not + present at any locations (including future locations), + + except where specified in the `present_at_location_ids` field. If not + specified, defaults to `true`. + present_at_location_ids: + type: optional> + docs: >- + A list of locations where the object is present, even if + `present_at_all_locations` is `false`. + + This can include locations that are deactivated. + absent_at_location_ids: + type: optional> + docs: >- + A list of locations where the object is not present, even if + `present_at_all_locations` is `true`. + + This can include locations that are deactivated. + image_id: + type: optional + docs: Identifies the `CatalogImage` attached to this `CatalogObject`. + source: + openapi: openapi/openapi.json + CatalogObjectSubscriptionPlanVariation: + properties: + type: literal<"SUBSCRIPTION_PLAN_VARIATION"> + subscription_plan_variation_data: + type: optional + docs: >- + Structured data for a `CatalogSubscriptionPlanVariation`, set for + CatalogObjects of type `SUBSCRIPTION_PLAN_VARIATION`. + id: + type: string + docs: >- + 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. + validation: + minLength: 1 + updated_at: + type: optional + docs: >- + Last modification + [timestamp](https://developer.squareup.com/docs/build-basics/working-with-dates) + 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. + version: + type: optional + docs: >- + The version of the object. When updating an object, the version + supplied + + must match the version in the database, otherwise the write will be + rejected as conflicting. + is_deleted: + type: optional + docs: >- + 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. + custom_attribute_values: + type: optional> + docs: >- + A map (key-value pairs) of application-defined custom attribute + values. The value of a key-value pair + + is a [CatalogCustomAttributeValue](entity:CatalogCustomAttributeValue) + object. The key is the `key` attribute + + value defined in the associated + [CatalogCustomAttributeDefinition](entity:CatalogCustomAttributeDefinition) + + object defined by the application making the request. + + + If the `CatalogCustomAttributeDefinition` object is + + defined by another application, the + `CatalogCustomAttributeDefinition`'s key attribute value is prefixed + by + + the defining application ID. For example, if the + `CatalogCustomAttributeDefinition` has a `key` attribute of + + `"cocoa_brand"` and the defining application ID is `"abcd1234"`, the + key in the map is `"abcd1234:cocoa_brand"` + + if the application making the request is different from the + application defining the custom attribute definition. + + Otherwise, the key used in the map is simply `"cocoa_brand"`. + + + Application-defined custom attributes are set at a global + (location-independent) level. + + Custom attribute values are intended to store additional information + about a catalog object + + or associations with an entity in another system. Do not use custom + attributes + + to store any sensitive information (personally identifiable + information, card details, etc.). + catalog_v1_ids: + type: optional> + docs: >- + 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. + present_at_all_locations: + type: optional + docs: >- + If `true`, this object is present at all locations (including future + locations), except where specified in + + the `absent_at_location_ids` field. If `false`, this object is not + present at any locations (including future locations), + + except where specified in the `present_at_location_ids` field. If not + specified, defaults to `true`. + present_at_location_ids: + type: optional> + docs: >- + A list of locations where the object is present, even if + `present_at_all_locations` is `false`. + + This can include locations that are deactivated. + absent_at_location_ids: + type: optional> + docs: >- + A list of locations where the object is not present, even if + `present_at_all_locations` is `true`. + + This can include locations that are deactivated. + image_id: + type: optional + docs: Identifies the `CatalogImage` attached to this `CatalogObject`. + source: + openapi: openapi/openapi.json + CatalogObjectItemOption: + properties: + type: literal<"ITEM_OPTION"> + item_option_data: + type: optional + docs: >- + Structured data for a `CatalogItemOption`, set for CatalogObjects of + type `ITEM_OPTION`. + id: + type: string + docs: >- + 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. + validation: + minLength: 1 + updated_at: + type: optional + docs: >- + Last modification + [timestamp](https://developer.squareup.com/docs/build-basics/working-with-dates) + 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. + version: + type: optional + docs: >- + The version of the object. When updating an object, the version + supplied + + must match the version in the database, otherwise the write will be + rejected as conflicting. + is_deleted: + type: optional + docs: >- + 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. + custom_attribute_values: + type: optional> + docs: >- + A map (key-value pairs) of application-defined custom attribute + values. The value of a key-value pair + + is a [CatalogCustomAttributeValue](entity:CatalogCustomAttributeValue) + object. The key is the `key` attribute + + value defined in the associated + [CatalogCustomAttributeDefinition](entity:CatalogCustomAttributeDefinition) + + object defined by the application making the request. + + + If the `CatalogCustomAttributeDefinition` object is + + defined by another application, the + `CatalogCustomAttributeDefinition`'s key attribute value is prefixed + by + + the defining application ID. For example, if the + `CatalogCustomAttributeDefinition` has a `key` attribute of + + `"cocoa_brand"` and the defining application ID is `"abcd1234"`, the + key in the map is `"abcd1234:cocoa_brand"` + + if the application making the request is different from the + application defining the custom attribute definition. + + Otherwise, the key used in the map is simply `"cocoa_brand"`. + + + Application-defined custom attributes are set at a global + (location-independent) level. + + Custom attribute values are intended to store additional information + about a catalog object + + or associations with an entity in another system. Do not use custom + attributes + + to store any sensitive information (personally identifiable + information, card details, etc.). + catalog_v1_ids: + type: optional> + docs: >- + 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. + present_at_all_locations: + type: optional + docs: >- + If `true`, this object is present at all locations (including future + locations), except where specified in + + the `absent_at_location_ids` field. If `false`, this object is not + present at any locations (including future locations), + + except where specified in the `present_at_location_ids` field. If not + specified, defaults to `true`. + present_at_location_ids: + type: optional> + docs: >- + A list of locations where the object is present, even if + `present_at_all_locations` is `false`. + + This can include locations that are deactivated. + absent_at_location_ids: + type: optional> + docs: >- + A list of locations where the object is not present, even if + `present_at_all_locations` is `true`. + + This can include locations that are deactivated. + image_id: + type: optional + docs: Identifies the `CatalogImage` attached to this `CatalogObject`. + source: + openapi: openapi/openapi.json + CatalogObjectItemOptionValue: + properties: + type: literal<"ITEM_OPTION_VAL"> + item_option_value_data: type: optional docs: >- - Structured data for a `CatalogItemOptionValue`, set for CatalogObjects - of type `ITEM_OPTION_VAL`. - extends: - - CatalogObjectBase - source: - openapi: openapi/openapi.json - CatalogObjectCustomAttributeDefinition: - properties: - custom_attribute_definition_data: - type: optional + Structured data for a `CatalogItemOptionValue`, set for CatalogObjects + of type `ITEM_OPTION_VAL`. + id: + type: string + docs: >- + 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. + validation: + minLength: 1 + updated_at: + type: optional + docs: >- + Last modification + [timestamp](https://developer.squareup.com/docs/build-basics/working-with-dates) + 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. + version: + type: optional + docs: >- + The version of the object. When updating an object, the version + supplied + + must match the version in the database, otherwise the write will be + rejected as conflicting. + is_deleted: + type: optional + docs: >- + 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. + custom_attribute_values: + type: optional> + docs: >- + A map (key-value pairs) of application-defined custom attribute + values. The value of a key-value pair + + is a [CatalogCustomAttributeValue](entity:CatalogCustomAttributeValue) + object. The key is the `key` attribute + + value defined in the associated + [CatalogCustomAttributeDefinition](entity:CatalogCustomAttributeDefinition) + + object defined by the application making the request. + + + If the `CatalogCustomAttributeDefinition` object is + + defined by another application, the + `CatalogCustomAttributeDefinition`'s key attribute value is prefixed + by + + the defining application ID. For example, if the + `CatalogCustomAttributeDefinition` has a `key` attribute of + + `"cocoa_brand"` and the defining application ID is `"abcd1234"`, the + key in the map is `"abcd1234:cocoa_brand"` + + if the application making the request is different from the + application defining the custom attribute definition. + + Otherwise, the key used in the map is simply `"cocoa_brand"`. + + + Application-defined custom attributes are set at a global + (location-independent) level. + + Custom attribute values are intended to store additional information + about a catalog object + + or associations with an entity in another system. Do not use custom + attributes + + to store any sensitive information (personally identifiable + information, card details, etc.). + catalog_v1_ids: + type: optional> + docs: >- + 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. + present_at_all_locations: + type: optional + docs: >- + If `true`, this object is present at all locations (including future + locations), except where specified in + + the `absent_at_location_ids` field. If `false`, this object is not + present at any locations (including future locations), + + except where specified in the `present_at_location_ids` field. If not + specified, defaults to `true`. + present_at_location_ids: + type: optional> + docs: >- + A list of locations where the object is present, even if + `present_at_all_locations` is `false`. + + This can include locations that are deactivated. + absent_at_location_ids: + type: optional> + docs: >- + A list of locations where the object is not present, even if + `present_at_all_locations` is `true`. + + This can include locations that are deactivated. + image_id: + type: optional + docs: Identifies the `CatalogImage` attached to this `CatalogObject`. + source: + openapi: openapi/openapi.json + CatalogObjectCustomAttributeDefinition: + properties: + type: literal<"CUSTOM_ATTRIBUTE_DEFINITION"> + custom_attribute_definition_data: + type: optional + docs: >- + Structured data for a `CatalogCustomAttributeDefinition`, set for + CatalogObjects of type `CUSTOM_ATTRIBUTE_DEFINITION`. + id: + type: string + docs: >- + 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. + validation: + minLength: 1 + updated_at: + type: optional + docs: >- + Last modification + [timestamp](https://developer.squareup.com/docs/build-basics/working-with-dates) + 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. + version: + type: optional + docs: >- + The version of the object. When updating an object, the version + supplied + + must match the version in the database, otherwise the write will be + rejected as conflicting. + is_deleted: + type: optional + docs: >- + 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. + custom_attribute_values: + type: optional> + docs: >- + A map (key-value pairs) of application-defined custom attribute + values. The value of a key-value pair + + is a [CatalogCustomAttributeValue](entity:CatalogCustomAttributeValue) + object. The key is the `key` attribute + + value defined in the associated + [CatalogCustomAttributeDefinition](entity:CatalogCustomAttributeDefinition) + + object defined by the application making the request. + + + If the `CatalogCustomAttributeDefinition` object is + + defined by another application, the + `CatalogCustomAttributeDefinition`'s key attribute value is prefixed + by + + the defining application ID. For example, if the + `CatalogCustomAttributeDefinition` has a `key` attribute of + + `"cocoa_brand"` and the defining application ID is `"abcd1234"`, the + key in the map is `"abcd1234:cocoa_brand"` + + if the application making the request is different from the + application defining the custom attribute definition. + + Otherwise, the key used in the map is simply `"cocoa_brand"`. + + + Application-defined custom attributes are set at a global + (location-independent) level. + + Custom attribute values are intended to store additional information + about a catalog object + + or associations with an entity in another system. Do not use custom + attributes + + to store any sensitive information (personally identifiable + information, card details, etc.). + catalog_v1_ids: + type: optional> + docs: >- + 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. + present_at_all_locations: + type: optional + docs: >- + If `true`, this object is present at all locations (including future + locations), except where specified in + + the `absent_at_location_ids` field. If `false`, this object is not + present at any locations (including future locations), + + except where specified in the `present_at_location_ids` field. If not + specified, defaults to `true`. + present_at_location_ids: + type: optional> + docs: >- + A list of locations where the object is present, even if + `present_at_all_locations` is `false`. + + This can include locations that are deactivated. + absent_at_location_ids: + type: optional> + docs: >- + A list of locations where the object is not present, even if + `present_at_all_locations` is `true`. + + This can include locations that are deactivated. + image_id: + type: optional + docs: Identifies the `CatalogImage` attached to this `CatalogObject`. + source: + openapi: openapi/openapi.json + CatalogObjectQuickAmountsSettings: + properties: + type: literal<"QUICK_AMOUNTS_SETTINGS"> + quick_amounts_settings_data: + type: optional + docs: >- + Structured data for a `CatalogQuickAmountsSettings`, set for + CatalogObjects of type `QUICK_AMOUNTS_SETTINGS`. + id: + type: string + docs: >- + 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. + validation: + minLength: 1 + updated_at: + type: optional + docs: >- + Last modification + [timestamp](https://developer.squareup.com/docs/build-basics/working-with-dates) + 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. + version: + type: optional + docs: >- + The version of the object. When updating an object, the version + supplied + + must match the version in the database, otherwise the write will be + rejected as conflicting. + is_deleted: + type: optional + docs: >- + 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. + custom_attribute_values: + type: optional> + docs: >- + A map (key-value pairs) of application-defined custom attribute + values. The value of a key-value pair + + is a [CatalogCustomAttributeValue](entity:CatalogCustomAttributeValue) + object. The key is the `key` attribute + + value defined in the associated + [CatalogCustomAttributeDefinition](entity:CatalogCustomAttributeDefinition) + + object defined by the application making the request. + + + If the `CatalogCustomAttributeDefinition` object is + + defined by another application, the + `CatalogCustomAttributeDefinition`'s key attribute value is prefixed + by + + the defining application ID. For example, if the + `CatalogCustomAttributeDefinition` has a `key` attribute of + + `"cocoa_brand"` and the defining application ID is `"abcd1234"`, the + key in the map is `"abcd1234:cocoa_brand"` + + if the application making the request is different from the + application defining the custom attribute definition. + + Otherwise, the key used in the map is simply `"cocoa_brand"`. + + + Application-defined custom attributes are set at a global + (location-independent) level. + + Custom attribute values are intended to store additional information + about a catalog object + + or associations with an entity in another system. Do not use custom + attributes + + to store any sensitive information (personally identifiable + information, card details, etc.). + catalog_v1_ids: + type: optional> + docs: >- + 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. + present_at_all_locations: + type: optional + docs: >- + If `true`, this object is present at all locations (including future + locations), except where specified in + + the `absent_at_location_ids` field. If `false`, this object is not + present at any locations (including future locations), + + except where specified in the `present_at_location_ids` field. If not + specified, defaults to `true`. + present_at_location_ids: + type: optional> + docs: >- + A list of locations where the object is present, even if + `present_at_all_locations` is `false`. + + This can include locations that are deactivated. + absent_at_location_ids: + type: optional> + docs: >- + A list of locations where the object is not present, even if + `present_at_all_locations` is `true`. + + This can include locations that are deactivated. + image_id: + type: optional + docs: Identifies the `CatalogImage` attached to this `CatalogObject`. + source: + openapi: openapi/openapi.json + CatalogObjectSubscriptionPlan: + properties: + type: literal<"SUBSCRIPTION_PLAN"> + subscription_plan_data: + type: optional + docs: >- + Structured data for a `CatalogSubscriptionPlan`, set for + CatalogObjects of type `SUBSCRIPTION_PLAN`. + id: + type: string + docs: >- + 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. + validation: + minLength: 1 + updated_at: + type: optional + docs: >- + Last modification + [timestamp](https://developer.squareup.com/docs/build-basics/working-with-dates) + 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. + version: + type: optional + docs: >- + The version of the object. When updating an object, the version + supplied + + must match the version in the database, otherwise the write will be + rejected as conflicting. + is_deleted: + type: optional + docs: >- + 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. + custom_attribute_values: + type: optional> docs: >- - Structured data for a `CatalogCustomAttributeDefinition`, set for - CatalogObjects of type `CUSTOM_ATTRIBUTE_DEFINITION`. - extends: - - CatalogObjectBase - source: - openapi: openapi/openapi.json - CatalogObjectQuickAmountsSettings: - properties: - quick_amounts_settings_data: - type: optional + A map (key-value pairs) of application-defined custom attribute + values. The value of a key-value pair + + is a [CatalogCustomAttributeValue](entity:CatalogCustomAttributeValue) + object. The key is the `key` attribute + + value defined in the associated + [CatalogCustomAttributeDefinition](entity:CatalogCustomAttributeDefinition) + + object defined by the application making the request. + + + If the `CatalogCustomAttributeDefinition` object is + + defined by another application, the + `CatalogCustomAttributeDefinition`'s key attribute value is prefixed + by + + the defining application ID. For example, if the + `CatalogCustomAttributeDefinition` has a `key` attribute of + + `"cocoa_brand"` and the defining application ID is `"abcd1234"`, the + key in the map is `"abcd1234:cocoa_brand"` + + if the application making the request is different from the + application defining the custom attribute definition. + + Otherwise, the key used in the map is simply `"cocoa_brand"`. + + + Application-defined custom attributes are set at a global + (location-independent) level. + + Custom attribute values are intended to store additional information + about a catalog object + + or associations with an entity in another system. Do not use custom + attributes + + to store any sensitive information (personally identifiable + information, card details, etc.). + catalog_v1_ids: + type: optional> docs: >- - Structured data for a `CatalogQuickAmountsSettings`, set for - CatalogObjects of type `QUICK_AMOUNTS_SETTINGS`. - extends: - - CatalogObjectBase - source: - openapi: openapi/openapi.json - CatalogObjectSubscriptionPlanVariation: - properties: - subscription_plan_variation_data: - type: optional + 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. + present_at_all_locations: + type: optional docs: >- - Structured data for a `CatalogSubscriptionPlanVariation`, set for - CatalogObjects of type `SUBSCRIPTION_PLAN_VARIATION`. - extends: - - CatalogObjectBase + If `true`, this object is present at all locations (including future + locations), except where specified in + + the `absent_at_location_ids` field. If `false`, this object is not + present at any locations (including future locations), + + except where specified in the `present_at_location_ids` field. If not + specified, defaults to `true`. + present_at_location_ids: + type: optional> + docs: >- + A list of locations where the object is present, even if + `present_at_all_locations` is `false`. + + This can include locations that are deactivated. + absent_at_location_ids: + type: optional> + docs: >- + A list of locations where the object is not present, even if + `present_at_all_locations` is `true`. + + This can include locations that are deactivated. + image_id: + type: optional + docs: Identifies the `CatalogImage` attached to this `CatalogObject`. source: openapi: openapi/openapi.json CatalogObjectAvailabilityPeriod: properties: + type: literal<"AVAILABILITY_PERIOD"> availability_period_data: type: optional docs: >- Structured data for a `CatalogAvailabilityPeriod`, set for CatalogObjects of type `AVAILABILITY_PERIOD`. - extends: - - CatalogObjectBase - source: - openapi: openapi/openapi.json - CatalogObjectComponent: - properties: {} - extends: - - CatalogObjectBase - source: - openapi: openapi/openapi.json - CatalogObjectComposition: - properties: {} - extends: - - CatalogObjectBase - source: - openapi: openapi/openapi.json - CatalogObjectResource: - properties: {} - extends: - - CatalogObjectBase - source: - openapi: openapi/openapi.json - CatalogObjectCheckoutLink: - properties: {} - extends: - - CatalogObjectBase - source: - openapi: openapi/openapi.json - CatalogObjectAddress: - properties: {} - extends: - - CatalogObjectBase - source: - openapi: openapi/openapi.json - CatalogObjectSubscriptionProduct: - properties: {} - extends: - - CatalogObjectBase + id: + type: string + docs: >- + 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. + validation: + minLength: 1 + updated_at: + type: optional + docs: >- + Last modification + [timestamp](https://developer.squareup.com/docs/build-basics/working-with-dates) + 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. + version: + type: optional + docs: >- + The version of the object. When updating an object, the version + supplied + + must match the version in the database, otherwise the write will be + rejected as conflicting. + is_deleted: + type: optional + docs: >- + 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. + custom_attribute_values: + type: optional> + docs: >- + A map (key-value pairs) of application-defined custom attribute + values. The value of a key-value pair + + is a [CatalogCustomAttributeValue](entity:CatalogCustomAttributeValue) + object. The key is the `key` attribute + + value defined in the associated + [CatalogCustomAttributeDefinition](entity:CatalogCustomAttributeDefinition) + + object defined by the application making the request. + + + If the `CatalogCustomAttributeDefinition` object is + + defined by another application, the + `CatalogCustomAttributeDefinition`'s key attribute value is prefixed + by + + the defining application ID. For example, if the + `CatalogCustomAttributeDefinition` has a `key` attribute of + + `"cocoa_brand"` and the defining application ID is `"abcd1234"`, the + key in the map is `"abcd1234:cocoa_brand"` + + if the application making the request is different from the + application defining the custom attribute definition. + + Otherwise, the key used in the map is simply `"cocoa_brand"`. + + + Application-defined custom attributes are set at a global + (location-independent) level. + + Custom attribute values are intended to store additional information + about a catalog object + + or associations with an entity in another system. Do not use custom + attributes + + to store any sensitive information (personally identifiable + information, card details, etc.). + catalog_v1_ids: + type: optional> + docs: >- + 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. + present_at_all_locations: + type: optional + docs: >- + If `true`, this object is present at all locations (including future + locations), except where specified in + + the `absent_at_location_ids` field. If `false`, this object is not + present at any locations (including future locations), + + except where specified in the `present_at_location_ids` field. If not + specified, defaults to `true`. + present_at_location_ids: + type: optional> + docs: >- + A list of locations where the object is present, even if + `present_at_all_locations` is `false`. + + This can include locations that are deactivated. + absent_at_location_ids: + type: optional> + docs: >- + A list of locations where the object is not present, even if + `present_at_all_locations` is `true`. + + This can include locations that are deactivated. + image_id: + type: optional + docs: Identifies the `CatalogImage` attached to this `CatalogObject`. source: openapi: openapi/openapi.json diff --git a/.mock/definition/catalog.yml b/.mock/definition/catalog.yml index 4807d267..9d9feba2 100644 --- a/.mock/definition/catalog.yml +++ b/.mock/definition/catalog.yml @@ -215,6 +215,15 @@ service: absent_at_location_ids: - absent_at_location_ids image_id: image_id + item_data: + name: Tea + description: Hot Leaf Juice + tax_ids: + - HURXQOOAIC4IZSI2BEXQRYFY + categories: + - type: CATEGORY + id: BJNQCF2FJ6S6UIDT65ABHLRX + ordinal: 0 - type: ITEM id: AA27W3M2GGTF3H6AVPNB77CK updated_at: '2016-11-16T22:25:24.878Z' @@ -236,11 +245,11 @@ service: tax_ids: - HURXQOOAIC4IZSI2BEXQRYFY categories: - - type: ITEM + - type: CATEGORY id: BJNQCF2FJ6S6UIDT65ABHLRX ordinal: 0 related_objects: - - type: CATEGORY + - type: ITEM id: BJNQCF2FJ6S6UIDT65ABHLRX updated_at: '2016-11-16T22:25:24.878Z' version: 1479335124878 @@ -408,13 +417,13 @@ service: idempotency_key: 789ff020-f723-43a9-b4b5-43b5dc1fa3dc batches: - objects: - - type: ITEM + - type: IMAGE id: '#Tea' present_at_all_locations: true - - type: ITEM + - type: IMAGE id: '#Coffee' present_at_all_locations: true - - type: CATEGORY + - type: ITEM id: '#Beverages' present_at_all_locations: true - type: TAX @@ -458,7 +467,7 @@ service: - HP5VNYPKZKTNCKZ2Z5NPUH6A product_type: REGULAR categories: - - type: ITEM + - type: CATEGORY id: XCS4SCGN4WQYE2VU4U3TKXEH ordinal: -2251731094208512 description_html:

Hot Leaf Juice

@@ -487,7 +496,7 @@ service: - HP5VNYPKZKTNCKZ2Z5NPUH6A product_type: REGULAR categories: - - type: ITEM + - type: CATEGORY id: XCS4SCGN4WQYE2VU4U3TKXEH ordinal: -2251662374731776 description_html:

Hot Bean Juice

@@ -508,6 +517,12 @@ service: absent_at_location_ids: - absent_at_location_ids image_id: image_id + ordinal: 1000000 + category_data: + name: Beverages + category_type: REGULAR_CATEGORY + is_top_level: true + online_visibility: true - type: TAX id: HP5VNYPKZKTNCKZ2Z5NPUH6A updated_at: '2023-11-30T19:24:35.4Z' @@ -687,7 +702,7 @@ service: field: field cursor: cursor objects: - - type: CATEGORY + - type: ITEM id: 5ZYQZZ2IECPVJ2IJ5KQPRDC3 updated_at: '2017-02-21T14:50:26.495Z' version: 1487688626495 @@ -934,7 +949,7 @@ service: - ZXITPM6RWHZ7GZ7EIP3YKECM product_type: REGULAR categories: - - type: ITEM + - type: CATEGORY id: E7CLE5RZZ744BHWVQQEAHI2C ordinal: 0 - type: ITEM @@ -959,7 +974,7 @@ service: - ZXITPM6RWHZ7GZ7EIP3YKECM product_type: REGULAR categories: - - type: ITEM + - type: CATEGORY id: E7CLE5RZZ744BHWVQQEAHI2C ordinal: 0 related_objects: diff --git a/.mock/definition/catalog/object.yml b/.mock/definition/catalog/object.yml index 9f508687..70452634 100644 --- a/.mock/definition/catalog/object.yml +++ b/.mock/definition/catalog/object.yml @@ -72,7 +72,7 @@ service: - request: idempotency_key: af3d1afc-7212-4300-b463-0bfc5314a5ae object: - type: ITEM + type: IMAGE id: '#Cocoa' response: body: @@ -259,8 +259,39 @@ service: absent_at_location_ids: - absent_at_location_ids image_id: image_id + item_data: + name: Tea + description: Hot Leaf Juice + abbreviation: abbreviation + label_color: label_color + is_taxable: true + category_id: category_id + tax_ids: + - HURXQOOAIC4IZSI2BEXQRYFY + modifier_list_info: + - modifier_list_id: modifier_list_id + product_type: REGULAR + skip_modifier_screen: true + item_options: + - {} + ecom_uri: ecom_uri + ecom_image_uris: + - ecom_image_uris + image_ids: + - image_ids + sort_name: sort_name + categories: + - type: CATEGORY + id: BJNQCF2FJ6S6UIDT65ABHLRX + ordinal: 0 + description_html: description_html + description_plaintext: description_plaintext + channels: + - channels + is_archived: true + is_alcoholic: true related_objects: - - type: CATEGORY + - type: ITEM id: BJNQCF2FJ6S6UIDT65ABHLRX updated_at: '2016-11-16T22:25:24.878Z' version: 1479335124878 diff --git a/.mock/definition/invoices.yml b/.mock/definition/invoices.yml index 969d6381..4ca40bd9 100644 --- a/.mock/definition/invoices.yml +++ b/.mock/definition/invoices.yml @@ -854,7 +854,7 @@ service: body: properties: request: - type: optional + type: optional content-type: application/json; charset=utf-8 image_file: type: optional diff --git a/poetry.lock b/poetry.lock index b284569a..451995a4 100644 --- a/poetry.lock +++ b/poetry.lock @@ -38,13 +38,13 @@ trio = ["trio (>=0.26.1)"] [[package]] name = "certifi" -version = "2025.1.31" +version = "2025.4.26" description = "Python package for providing Mozilla's CA Bundle." optional = false python-versions = ">=3.6" files = [ - {file = "certifi-2025.1.31-py3-none-any.whl", hash = "sha256:ca78db4565a652026a4db2bcdf68f2fb589ea80d0be70e03929ed730746b84fe"}, - {file = "certifi-2025.1.31.tar.gz", hash = "sha256:3d5da6925056f6f18f119200434a4780a94263f10d1c21d032a6f6b2baa20651"}, + {file = "certifi-2025.4.26-py3-none-any.whl", hash = "sha256:30350364dfe371162649852c63336a15c70c6510c2ad5015b21c2345311805f3"}, + {file = "certifi-2025.4.26.tar.gz", hash = "sha256:0a816057ea3cdefcef70270d2c515e4506bbc954f417fa5ade2021213bb8f0c6"}, ] [[package]] @@ -74,29 +74,29 @@ test = ["pytest (>=6)"] [[package]] name = "h11" -version = "0.14.0" +version = "0.16.0" description = "A pure-Python, bring-your-own-I/O implementation of HTTP/1.1" optional = false -python-versions = ">=3.7" +python-versions = ">=3.8" files = [ - {file = "h11-0.14.0-py3-none-any.whl", hash = "sha256:e3fe4ac4b851c468cc8363d500db52c2ead036020723024a109d37346efaa761"}, - {file = "h11-0.14.0.tar.gz", hash = "sha256:8f19fbbe99e72420ff35c00b27a34cb9937e902a8b810e2c88300c6f0a3b699d"}, + {file = "h11-0.16.0-py3-none-any.whl", hash = "sha256:63cf8bbe7522de3bf65932fda1d9c2772064ffb3dae62d55932da54b31cb6c86"}, + {file = "h11-0.16.0.tar.gz", hash = "sha256:4e35b956cf45792e4caa5885e69fba00bdbc6ffafbfa020300e549b208ee5ff1"}, ] [[package]] name = "httpcore" -version = "1.0.8" +version = "1.0.9" description = "A minimal low-level HTTP client." optional = false python-versions = ">=3.8" files = [ - {file = "httpcore-1.0.8-py3-none-any.whl", hash = "sha256:5254cf149bcb5f75e9d1b2b9f729ea4a4b883d1ad7379fc632b727cec23674be"}, - {file = "httpcore-1.0.8.tar.gz", hash = "sha256:86e94505ed24ea06514883fd44d2bc02d90e77e7979c8eb71b90f41d364a1bad"}, + {file = "httpcore-1.0.9-py3-none-any.whl", hash = "sha256:2d400746a40668fc9dec9810239072b40b4484b640a8c38fd654a024c7a1bf55"}, + {file = "httpcore-1.0.9.tar.gz", hash = "sha256:6e34463af53fd2ab5d807f399a9b45ea31c3dfa2276f15a2c3f00afff6e176e8"}, ] [package.dependencies] certifi = "*" -h11 = ">=0.13,<0.15" +h11 = ">=0.16" [package.extras] asyncio = ["anyio (>=4.0,<5.0)"] @@ -201,24 +201,24 @@ reports = ["lxml"] [[package]] name = "mypy-extensions" -version = "1.0.0" +version = "1.1.0" description = "Type system extensions for programs checked with the mypy type checker." optional = false -python-versions = ">=3.5" +python-versions = ">=3.8" files = [ - {file = "mypy_extensions-1.0.0-py3-none-any.whl", hash = "sha256:4392f6c0eb8a5668a69e23d168ffa70f0be9ccfd32b5cc2d26a34ae5b844552d"}, - {file = "mypy_extensions-1.0.0.tar.gz", hash = "sha256:75dbf8955dc00442a438fc4d0666508a9a97b6bd41aa2f0ffe9d2f2725af0782"}, + {file = "mypy_extensions-1.1.0-py3-none-any.whl", hash = "sha256:1be4cccdb0f2482337c4743e60421de3a356cd97508abadd57d47403e94f5505"}, + {file = "mypy_extensions-1.1.0.tar.gz", hash = "sha256:52e68efc3284861e772bbcd66823fde5ae21fd2fdb51c62a211403730b916558"}, ] [[package]] name = "packaging" -version = "24.2" +version = "25.0" description = "Core utilities for Python packages" optional = false python-versions = ">=3.8" files = [ - {file = "packaging-24.2-py3-none-any.whl", hash = "sha256:09abb1bccd265c01f4a3aa3f7a7db064b36514d2cba19a2f694fe6150451a759"}, - {file = "packaging-24.2.tar.gz", hash = "sha256:c228a6dc5e932d346bc5739379109d49e8853dd8223571c7c5b55260edc0b97f"}, + {file = "packaging-25.0-py3-none-any.whl", hash = "sha256:29572ef2b1f17581046b3a2227d5c611fb25ec70ca1ba8554b24b0e69331a484"}, + {file = "packaging-25.0.tar.gz", hash = "sha256:d443872c98d677bf60f6a1f2f8c1cb748e8fe762d2bf9d3148b5599295b0fc4f"}, ] [[package]] diff --git a/pyproject.toml b/pyproject.toml index 2c294cf5..cb845219 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -3,7 +3,7 @@ name = "squareup" [tool.poetry] name = "squareup" -version = "42.0.0.20250416" +version = "42.1.0.20250416" description = "" readme = "README.md" authors = [] diff --git a/reference.md b/reference.md index 1c65cbfb..0a9eab00 100644 --- a/reference.md +++ b/reference.md @@ -2653,17 +2653,17 @@ client.catalog.batch_upsert( { "objects": [ { - "type": "ITEM", + "type": "IMAGE", "id": "#Tea", "present_at_all_locations": True, }, { - "type": "ITEM", + "type": "IMAGE", "id": "#Coffee", "present_at_all_locations": True, }, { - "type": "CATEGORY", + "type": "ITEM", "id": "#Beverages", "present_at_all_locations": True, }, @@ -8571,7 +8571,7 @@ client.invoices.create_invoice_attachment(
-**request:** `typing.Optional[typing.Optional[typing.Any]]` +**request:** `typing.Optional[CreateInvoiceAttachmentRequestDataParams]`
@@ -17988,7 +17988,7 @@ client = Square( ) client.catalog.object.upsert( idempotency_key="af3d1afc-7212-4300-b463-0bfc5314a5ae", - object={"type": "ITEM", "id": "#Cocoa"}, + object={"type": "IMAGE", "id": "#Cocoa"}, ) ``` diff --git a/src/square/catalog/client.py b/src/square/catalog/client.py index ef1eb13b..1e1c149c 100644 --- a/src/square/catalog/client.py +++ b/src/square/catalog/client.py @@ -267,17 +267,17 @@ def batch_upsert( { "objects": [ { - "type": "ITEM", + "type": "IMAGE", "id": "#Tea", "present_at_all_locations": True, }, { - "type": "ITEM", + "type": "IMAGE", "id": "#Coffee", "present_at_all_locations": True, }, { - "type": "CATEGORY", + "type": "ITEM", "id": "#Beverages", "present_at_all_locations": True, }, @@ -1034,17 +1034,17 @@ async def main() -> None: { "objects": [ { - "type": "ITEM", + "type": "IMAGE", "id": "#Tea", "present_at_all_locations": True, }, { - "type": "ITEM", + "type": "IMAGE", "id": "#Coffee", "present_at_all_locations": True, }, { - "type": "CATEGORY", + "type": "ITEM", "id": "#Beverages", "present_at_all_locations": True, }, diff --git a/src/square/catalog/object/client.py b/src/square/catalog/object/client.py index e75d9131..cfa7fa0e 100644 --- a/src/square/catalog/object/client.py +++ b/src/square/catalog/object/client.py @@ -81,7 +81,7 @@ def upsert( ) client.catalog.object.upsert( idempotency_key="af3d1afc-7212-4300-b463-0bfc5314a5ae", - object={"type": "ITEM", "id": "#Cocoa"}, + object={"type": "IMAGE", "id": "#Cocoa"}, ) """ response = self._raw_client.upsert( @@ -284,7 +284,7 @@ async def upsert( async def main() -> None: await client.catalog.object.upsert( idempotency_key="af3d1afc-7212-4300-b463-0bfc5314a5ae", - object={"type": "ITEM", "id": "#Cocoa"}, + object={"type": "IMAGE", "id": "#Cocoa"}, ) diff --git a/src/square/core/client_wrapper.py b/src/square/core/client_wrapper.py index 3ed6476d..2e99323b 100644 --- a/src/square/core/client_wrapper.py +++ b/src/square/core/client_wrapper.py @@ -22,10 +22,10 @@ def __init__( def get_headers(self) -> typing.Dict[str, str]: headers: typing.Dict[str, str] = { - "User-Agent": "squareup/42.0.0.20250416", + "User-Agent": "squareup/42.1.0.20250416", "X-Fern-Language": "Python", "X-Fern-SDK-Name": "squareup", - "X-Fern-SDK-Version": "42.0.0.20250416", + "X-Fern-SDK-Version": "42.1.0.20250416", } token = self._get_token() if token is not None: diff --git a/src/square/invoices/client.py b/src/square/invoices/client.py index 5fb73a6b..63c64a33 100644 --- a/src/square/invoices/client.py +++ b/src/square/invoices/client.py @@ -17,6 +17,7 @@ from ..types.get_invoice_response import GetInvoiceResponse from ..types.update_invoice_response import UpdateInvoiceResponse from ..types.delete_invoice_response import DeleteInvoiceResponse +from ..requests.create_invoice_attachment_request_data import CreateInvoiceAttachmentRequestDataParams from .. import core from ..types.create_invoice_attachment_response import CreateInvoiceAttachmentResponse from ..types.delete_invoice_attachment_response import DeleteInvoiceAttachmentResponse @@ -442,7 +443,7 @@ def create_invoice_attachment( self, invoice_id: str, *, - request: typing.Optional[typing.Optional[typing.Any]] = OMIT, + request: typing.Optional[CreateInvoiceAttachmentRequestDataParams] = OMIT, image_file: typing.Optional[core.File] = OMIT, request_options: typing.Optional[RequestOptions] = None, ) -> CreateInvoiceAttachmentResponse: @@ -461,7 +462,7 @@ def create_invoice_attachment( invoice_id : str The ID of the [invoice](entity:Invoice) to attach the file to. - request : typing.Optional[typing.Optional[typing.Any]] + request : typing.Optional[CreateInvoiceAttachmentRequestDataParams] image_file : typing.Optional[core.File] See core.File for more documentation @@ -1103,7 +1104,7 @@ async def create_invoice_attachment( self, invoice_id: str, *, - request: typing.Optional[typing.Optional[typing.Any]] = OMIT, + request: typing.Optional[CreateInvoiceAttachmentRequestDataParams] = OMIT, image_file: typing.Optional[core.File] = OMIT, request_options: typing.Optional[RequestOptions] = None, ) -> CreateInvoiceAttachmentResponse: @@ -1122,7 +1123,7 @@ async def create_invoice_attachment( invoice_id : str The ID of the [invoice](entity:Invoice) to attach the file to. - request : typing.Optional[typing.Optional[typing.Any]] + request : typing.Optional[CreateInvoiceAttachmentRequestDataParams] image_file : typing.Optional[core.File] See core.File for more documentation diff --git a/src/square/invoices/raw_client.py b/src/square/invoices/raw_client.py index 608d8b59..e1ad5440 100644 --- a/src/square/invoices/raw_client.py +++ b/src/square/invoices/raw_client.py @@ -16,6 +16,7 @@ from ..core.jsonable_encoder import jsonable_encoder from ..types.update_invoice_response import UpdateInvoiceResponse from ..types.delete_invoice_response import DeleteInvoiceResponse +from ..requests.create_invoice_attachment_request_data import CreateInvoiceAttachmentRequestDataParams from .. import core from ..types.create_invoice_attachment_response import CreateInvoiceAttachmentResponse import json @@ -341,7 +342,7 @@ def create_invoice_attachment( self, invoice_id: str, *, - request: typing.Optional[typing.Optional[typing.Any]] = OMIT, + request: typing.Optional[CreateInvoiceAttachmentRequestDataParams] = OMIT, image_file: typing.Optional[core.File] = OMIT, request_options: typing.Optional[RequestOptions] = None, ) -> HttpResponse[CreateInvoiceAttachmentResponse]: @@ -360,7 +361,7 @@ def create_invoice_attachment( invoice_id : str The ID of the [invoice](entity:Invoice) to attach the file to. - request : typing.Optional[typing.Optional[typing.Any]] + request : typing.Optional[CreateInvoiceAttachmentRequestDataParams] image_file : typing.Optional[core.File] See core.File for more documentation @@ -893,7 +894,7 @@ async def create_invoice_attachment( self, invoice_id: str, *, - request: typing.Optional[typing.Optional[typing.Any]] = OMIT, + request: typing.Optional[CreateInvoiceAttachmentRequestDataParams] = OMIT, image_file: typing.Optional[core.File] = OMIT, request_options: typing.Optional[RequestOptions] = None, ) -> AsyncHttpResponse[CreateInvoiceAttachmentResponse]: @@ -912,7 +913,7 @@ async def create_invoice_attachment( invoice_id : str The ID of the [invoice](entity:Invoice) to attach the file to. - request : typing.Optional[typing.Optional[typing.Any]] + request : typing.Optional[CreateInvoiceAttachmentRequestDataParams] image_file : typing.Optional[core.File] See core.File for more documentation diff --git a/src/square/requests/catalog_object.py b/src/square/requests/catalog_object.py index 2b2c085d..43f63843 100644 --- a/src/square/requests/catalog_object.py +++ b/src/square/requests/catalog_object.py @@ -8,31 +8,22 @@ from .catalog_object_tax import CatalogObjectTaxParams from .catalog_object_discount import CatalogObjectDiscountParams from .catalog_object_modifier import CatalogObjectModifierParams -from .catalog_object_dining_option import CatalogObjectDiningOptionParams -from .catalog_object_tax_exemption import CatalogObjectTaxExemptionParams -from .catalog_object_service_charge import CatalogObjectServiceChargeParams from .catalog_object_pricing_rule import CatalogObjectPricingRuleParams from .catalog_object_product_set import CatalogObjectProductSetParams from .catalog_object_time_period import CatalogObjectTimePeriodParams from .catalog_object_measurement_unit import CatalogObjectMeasurementUnitParams +from .catalog_object_subscription_plan_variation import CatalogObjectSubscriptionPlanVariationParams from .catalog_object_item_option_value import CatalogObjectItemOptionValueParams from .catalog_object_custom_attribute_definition import CatalogObjectCustomAttributeDefinitionParams from .catalog_object_quick_amounts_settings import CatalogObjectQuickAmountsSettingsParams -from .catalog_object_component import CatalogObjectComponentParams -from .catalog_object_composition import CatalogObjectCompositionParams -from .catalog_object_resource import CatalogObjectResourceParams -from .catalog_object_checkout_link import CatalogObjectCheckoutLinkParams -from .catalog_object_address import CatalogObjectAddressParams -from .catalog_object_subscription_product import CatalogObjectSubscriptionProductParams -from .catalog_object_subscription_plan_variation import CatalogObjectSubscriptionPlanVariationParams from .catalog_object_availability_period import CatalogObjectAvailabilityPeriodParams import typing if typing.TYPE_CHECKING: from .catalog_object_item import CatalogObjectItemParams from .catalog_object_modifier_list import CatalogObjectModifierListParams - from .catalog_object_subscription_plan import CatalogObjectSubscriptionPlanParams from .catalog_object_item_option import CatalogObjectItemOptionParams + from .catalog_object_subscription_plan import CatalogObjectSubscriptionPlanParams CatalogObjectParams = typing.Union[ "CatalogObjectItemParams", CatalogObjectImageParams, @@ -42,24 +33,15 @@ CatalogObjectDiscountParams, "CatalogObjectModifierListParams", CatalogObjectModifierParams, - CatalogObjectDiningOptionParams, - CatalogObjectTaxExemptionParams, - CatalogObjectServiceChargeParams, CatalogObjectPricingRuleParams, CatalogObjectProductSetParams, CatalogObjectTimePeriodParams, CatalogObjectMeasurementUnitParams, - "CatalogObjectSubscriptionPlanParams", + CatalogObjectSubscriptionPlanVariationParams, "CatalogObjectItemOptionParams", CatalogObjectItemOptionValueParams, CatalogObjectCustomAttributeDefinitionParams, CatalogObjectQuickAmountsSettingsParams, - CatalogObjectComponentParams, - CatalogObjectCompositionParams, - CatalogObjectResourceParams, - CatalogObjectCheckoutLinkParams, - CatalogObjectAddressParams, - CatalogObjectSubscriptionProductParams, - CatalogObjectSubscriptionPlanVariationParams, + "CatalogObjectSubscriptionPlanParams", CatalogObjectAvailabilityPeriodParams, ] diff --git a/src/square/requests/catalog_object_address.py b/src/square/requests/catalog_object_address.py deleted file mode 100644 index e561795f..00000000 --- a/src/square/requests/catalog_object_address.py +++ /dev/null @@ -1,7 +0,0 @@ -# This file was auto-generated by Fern from our API Definition. - -from .catalog_object_base import CatalogObjectBaseParams - - -class CatalogObjectAddressParams(CatalogObjectBaseParams): - pass diff --git a/src/square/requests/catalog_object_availability_period.py b/src/square/requests/catalog_object_availability_period.py index 7045a6b5..a4cc7824 100644 --- a/src/square/requests/catalog_object_availability_period.py +++ b/src/square/requests/catalog_object_availability_period.py @@ -1,12 +1,99 @@ # This file was auto-generated by Fern from our API Definition. -from .catalog_object_base import CatalogObjectBaseParams +import typing_extensions +import typing import typing_extensions from .catalog_availability_period import CatalogAvailabilityPeriodParams +from .catalog_custom_attribute_value import CatalogCustomAttributeValueParams +from .catalog_v1id import CatalogV1IdParams +from ..core.serialization import FieldMetadata -class CatalogObjectAvailabilityPeriodParams(CatalogObjectBaseParams): +class CatalogObjectAvailabilityPeriodParams(typing_extensions.TypedDict): + type: typing.Literal["AVAILABILITY_PERIOD"] availability_period_data: typing_extensions.NotRequired[CatalogAvailabilityPeriodParams] """ Structured data for a `CatalogAvailabilityPeriod`, set for CatalogObjects of type `AVAILABILITY_PERIOD`. """ + + id: str + """ + 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. + """ + + updated_at: typing_extensions.NotRequired[str] + """ + Last modification [timestamp](https://developer.squareup.com/docs/build-basics/working-with-dates) 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. + """ + + version: typing_extensions.NotRequired[int] + """ + The version of the object. When updating an object, the version supplied + must match the version in the database, otherwise the write will be rejected as conflicting. + """ + + is_deleted: typing_extensions.NotRequired[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. + """ + + custom_attribute_values: typing_extensions.NotRequired[typing.Dict[str, CatalogCustomAttributeValueParams]] + """ + A map (key-value pairs) of application-defined custom attribute values. The value of a key-value pair + is a [CatalogCustomAttributeValue](entity:CatalogCustomAttributeValue) object. The key is the `key` attribute + value defined in the associated [CatalogCustomAttributeDefinition](entity:CatalogCustomAttributeDefinition) + object defined by the application making the request. + + If the `CatalogCustomAttributeDefinition` object is + defined by another application, the `CatalogCustomAttributeDefinition`'s key attribute value is prefixed by + the defining application ID. For example, if the `CatalogCustomAttributeDefinition` has a `key` attribute of + `"cocoa_brand"` and the defining application ID is `"abcd1234"`, the key in the map is `"abcd1234:cocoa_brand"` + if the application making the request is different from the application defining the custom attribute definition. + Otherwise, the key used in the map is simply `"cocoa_brand"`. + + Application-defined custom attributes are set at a global (location-independent) level. + Custom attribute values are intended to store additional information about a catalog object + or associations with an entity in another system. Do not use custom attributes + to store any sensitive information (personally identifiable information, card details, etc.). + """ + + catalog_v1ids: typing_extensions.NotRequired[ + typing_extensions.Annotated[typing.Sequence[CatalogV1IdParams], FieldMetadata(alias="catalog_v1_ids")] + ] + """ + 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. + """ + + present_at_all_locations: typing_extensions.NotRequired[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. If not specified, defaults to `true`. + """ + + present_at_location_ids: typing_extensions.NotRequired[typing.Sequence[str]] + """ + A list of locations where the object is present, even if `present_at_all_locations` is `false`. + This can include locations that are deactivated. + """ + + absent_at_location_ids: typing_extensions.NotRequired[typing.Sequence[str]] + """ + A list of locations where the object is not present, even if `present_at_all_locations` is `true`. + This can include locations that are deactivated. + """ + + image_id: typing_extensions.NotRequired[str] + """ + Identifies the `CatalogImage` attached to this `CatalogObject`. + """ diff --git a/src/square/requests/catalog_object_category.py b/src/square/requests/catalog_object_category.py index e18c25b1..2514aa3b 100644 --- a/src/square/requests/catalog_object_category.py +++ b/src/square/requests/catalog_object_category.py @@ -4,7 +4,6 @@ import typing_extensions import typing_extensions import typing -from ..types.catalog_object_type import CatalogObjectType from .catalog_custom_attribute_value import CatalogCustomAttributeValueParams from .catalog_v1id import CatalogV1IdParams from ..core.serialization import FieldMetadata @@ -31,18 +30,12 @@ class CatalogObjectCategoryParams(typing_extensions.TypedDict): The order of the object within the context of the category. """ + type: typing.Literal["CATEGORY"] category_data: typing_extensions.NotRequired["CatalogCategoryParams"] """ Structured data for a `CatalogCategory`, set for CatalogObjects of type `CATEGORY`. """ - type: CatalogObjectType - """ - The type of this object. Each object type has expected - properties expressed in a structured format within its corresponding `*_data` field below. - See [CatalogObjectType](#type-catalogobjecttype) for possible values - """ - updated_at: typing_extensions.NotRequired[str] """ Last modification [timestamp](https://developer.squareup.com/docs/build-basics/working-with-dates) in RFC 3339 format, e.g., `"2016-08-15T23:59:33.123Z"` diff --git a/src/square/requests/catalog_object_checkout_link.py b/src/square/requests/catalog_object_checkout_link.py deleted file mode 100644 index a9356521..00000000 --- a/src/square/requests/catalog_object_checkout_link.py +++ /dev/null @@ -1,7 +0,0 @@ -# This file was auto-generated by Fern from our API Definition. - -from .catalog_object_base import CatalogObjectBaseParams - - -class CatalogObjectCheckoutLinkParams(CatalogObjectBaseParams): - pass diff --git a/src/square/requests/catalog_object_component.py b/src/square/requests/catalog_object_component.py deleted file mode 100644 index 0eeedb00..00000000 --- a/src/square/requests/catalog_object_component.py +++ /dev/null @@ -1,7 +0,0 @@ -# This file was auto-generated by Fern from our API Definition. - -from .catalog_object_base import CatalogObjectBaseParams - - -class CatalogObjectComponentParams(CatalogObjectBaseParams): - pass diff --git a/src/square/requests/catalog_object_composition.py b/src/square/requests/catalog_object_composition.py deleted file mode 100644 index 6eafb16c..00000000 --- a/src/square/requests/catalog_object_composition.py +++ /dev/null @@ -1,7 +0,0 @@ -# This file was auto-generated by Fern from our API Definition. - -from .catalog_object_base import CatalogObjectBaseParams - - -class CatalogObjectCompositionParams(CatalogObjectBaseParams): - pass diff --git a/src/square/requests/catalog_object_custom_attribute_definition.py b/src/square/requests/catalog_object_custom_attribute_definition.py index 7c31cc5d..17e89b30 100644 --- a/src/square/requests/catalog_object_custom_attribute_definition.py +++ b/src/square/requests/catalog_object_custom_attribute_definition.py @@ -1,12 +1,99 @@ # This file was auto-generated by Fern from our API Definition. -from .catalog_object_base import CatalogObjectBaseParams +import typing_extensions +import typing import typing_extensions from .catalog_custom_attribute_definition import CatalogCustomAttributeDefinitionParams +from .catalog_custom_attribute_value import CatalogCustomAttributeValueParams +from .catalog_v1id import CatalogV1IdParams +from ..core.serialization import FieldMetadata -class CatalogObjectCustomAttributeDefinitionParams(CatalogObjectBaseParams): +class CatalogObjectCustomAttributeDefinitionParams(typing_extensions.TypedDict): + type: typing.Literal["CUSTOM_ATTRIBUTE_DEFINITION"] custom_attribute_definition_data: typing_extensions.NotRequired[CatalogCustomAttributeDefinitionParams] """ Structured data for a `CatalogCustomAttributeDefinition`, set for CatalogObjects of type `CUSTOM_ATTRIBUTE_DEFINITION`. """ + + id: str + """ + 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. + """ + + updated_at: typing_extensions.NotRequired[str] + """ + Last modification [timestamp](https://developer.squareup.com/docs/build-basics/working-with-dates) 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. + """ + + version: typing_extensions.NotRequired[int] + """ + The version of the object. When updating an object, the version supplied + must match the version in the database, otherwise the write will be rejected as conflicting. + """ + + is_deleted: typing_extensions.NotRequired[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. + """ + + custom_attribute_values: typing_extensions.NotRequired[typing.Dict[str, CatalogCustomAttributeValueParams]] + """ + A map (key-value pairs) of application-defined custom attribute values. The value of a key-value pair + is a [CatalogCustomAttributeValue](entity:CatalogCustomAttributeValue) object. The key is the `key` attribute + value defined in the associated [CatalogCustomAttributeDefinition](entity:CatalogCustomAttributeDefinition) + object defined by the application making the request. + + If the `CatalogCustomAttributeDefinition` object is + defined by another application, the `CatalogCustomAttributeDefinition`'s key attribute value is prefixed by + the defining application ID. For example, if the `CatalogCustomAttributeDefinition` has a `key` attribute of + `"cocoa_brand"` and the defining application ID is `"abcd1234"`, the key in the map is `"abcd1234:cocoa_brand"` + if the application making the request is different from the application defining the custom attribute definition. + Otherwise, the key used in the map is simply `"cocoa_brand"`. + + Application-defined custom attributes are set at a global (location-independent) level. + Custom attribute values are intended to store additional information about a catalog object + or associations with an entity in another system. Do not use custom attributes + to store any sensitive information (personally identifiable information, card details, etc.). + """ + + catalog_v1ids: typing_extensions.NotRequired[ + typing_extensions.Annotated[typing.Sequence[CatalogV1IdParams], FieldMetadata(alias="catalog_v1_ids")] + ] + """ + 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. + """ + + present_at_all_locations: typing_extensions.NotRequired[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. If not specified, defaults to `true`. + """ + + present_at_location_ids: typing_extensions.NotRequired[typing.Sequence[str]] + """ + A list of locations where the object is present, even if `present_at_all_locations` is `false`. + This can include locations that are deactivated. + """ + + absent_at_location_ids: typing_extensions.NotRequired[typing.Sequence[str]] + """ + A list of locations where the object is not present, even if `present_at_all_locations` is `true`. + This can include locations that are deactivated. + """ + + image_id: typing_extensions.NotRequired[str] + """ + Identifies the `CatalogImage` attached to this `CatalogObject`. + """ diff --git a/src/square/requests/catalog_object_dining_option.py b/src/square/requests/catalog_object_dining_option.py deleted file mode 100644 index 28d6ba9e..00000000 --- a/src/square/requests/catalog_object_dining_option.py +++ /dev/null @@ -1,7 +0,0 @@ -# This file was auto-generated by Fern from our API Definition. - -from .catalog_object_base import CatalogObjectBaseParams - - -class CatalogObjectDiningOptionParams(CatalogObjectBaseParams): - pass diff --git a/src/square/requests/catalog_object_discount.py b/src/square/requests/catalog_object_discount.py index 2c2807fa..cab74f86 100644 --- a/src/square/requests/catalog_object_discount.py +++ b/src/square/requests/catalog_object_discount.py @@ -1,12 +1,99 @@ # This file was auto-generated by Fern from our API Definition. -from .catalog_object_base import CatalogObjectBaseParams +import typing_extensions +import typing import typing_extensions from .catalog_discount import CatalogDiscountParams +from .catalog_custom_attribute_value import CatalogCustomAttributeValueParams +from .catalog_v1id import CatalogV1IdParams +from ..core.serialization import FieldMetadata -class CatalogObjectDiscountParams(CatalogObjectBaseParams): +class CatalogObjectDiscountParams(typing_extensions.TypedDict): + type: typing.Literal["DISCOUNT"] discount_data: typing_extensions.NotRequired[CatalogDiscountParams] """ Structured data for a `CatalogDiscount`, set for CatalogObjects of type `DISCOUNT`. """ + + id: str + """ + 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. + """ + + updated_at: typing_extensions.NotRequired[str] + """ + Last modification [timestamp](https://developer.squareup.com/docs/build-basics/working-with-dates) 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. + """ + + version: typing_extensions.NotRequired[int] + """ + The version of the object. When updating an object, the version supplied + must match the version in the database, otherwise the write will be rejected as conflicting. + """ + + is_deleted: typing_extensions.NotRequired[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. + """ + + custom_attribute_values: typing_extensions.NotRequired[typing.Dict[str, CatalogCustomAttributeValueParams]] + """ + A map (key-value pairs) of application-defined custom attribute values. The value of a key-value pair + is a [CatalogCustomAttributeValue](entity:CatalogCustomAttributeValue) object. The key is the `key` attribute + value defined in the associated [CatalogCustomAttributeDefinition](entity:CatalogCustomAttributeDefinition) + object defined by the application making the request. + + If the `CatalogCustomAttributeDefinition` object is + defined by another application, the `CatalogCustomAttributeDefinition`'s key attribute value is prefixed by + the defining application ID. For example, if the `CatalogCustomAttributeDefinition` has a `key` attribute of + `"cocoa_brand"` and the defining application ID is `"abcd1234"`, the key in the map is `"abcd1234:cocoa_brand"` + if the application making the request is different from the application defining the custom attribute definition. + Otherwise, the key used in the map is simply `"cocoa_brand"`. + + Application-defined custom attributes are set at a global (location-independent) level. + Custom attribute values are intended to store additional information about a catalog object + or associations with an entity in another system. Do not use custom attributes + to store any sensitive information (personally identifiable information, card details, etc.). + """ + + catalog_v1ids: typing_extensions.NotRequired[ + typing_extensions.Annotated[typing.Sequence[CatalogV1IdParams], FieldMetadata(alias="catalog_v1_ids")] + ] + """ + 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. + """ + + present_at_all_locations: typing_extensions.NotRequired[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. If not specified, defaults to `true`. + """ + + present_at_location_ids: typing_extensions.NotRequired[typing.Sequence[str]] + """ + A list of locations where the object is present, even if `present_at_all_locations` is `false`. + This can include locations that are deactivated. + """ + + absent_at_location_ids: typing_extensions.NotRequired[typing.Sequence[str]] + """ + A list of locations where the object is not present, even if `present_at_all_locations` is `true`. + This can include locations that are deactivated. + """ + + image_id: typing_extensions.NotRequired[str] + """ + Identifies the `CatalogImage` attached to this `CatalogObject`. + """ diff --git a/src/square/requests/catalog_object_image.py b/src/square/requests/catalog_object_image.py index 85d43b80..54f9d6b9 100644 --- a/src/square/requests/catalog_object_image.py +++ b/src/square/requests/catalog_object_image.py @@ -1,12 +1,99 @@ # This file was auto-generated by Fern from our API Definition. -from .catalog_object_base import CatalogObjectBaseParams +import typing_extensions +import typing import typing_extensions from .catalog_image import CatalogImageParams +from .catalog_custom_attribute_value import CatalogCustomAttributeValueParams +from .catalog_v1id import CatalogV1IdParams +from ..core.serialization import FieldMetadata -class CatalogObjectImageParams(CatalogObjectBaseParams): +class CatalogObjectImageParams(typing_extensions.TypedDict): + type: typing.Literal["IMAGE"] image_data: typing_extensions.NotRequired[CatalogImageParams] """ Structured data for a `CatalogImage`, set for CatalogObjects of type `IMAGE`. """ + + id: str + """ + 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. + """ + + updated_at: typing_extensions.NotRequired[str] + """ + Last modification [timestamp](https://developer.squareup.com/docs/build-basics/working-with-dates) 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. + """ + + version: typing_extensions.NotRequired[int] + """ + The version of the object. When updating an object, the version supplied + must match the version in the database, otherwise the write will be rejected as conflicting. + """ + + is_deleted: typing_extensions.NotRequired[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. + """ + + custom_attribute_values: typing_extensions.NotRequired[typing.Dict[str, CatalogCustomAttributeValueParams]] + """ + A map (key-value pairs) of application-defined custom attribute values. The value of a key-value pair + is a [CatalogCustomAttributeValue](entity:CatalogCustomAttributeValue) object. The key is the `key` attribute + value defined in the associated [CatalogCustomAttributeDefinition](entity:CatalogCustomAttributeDefinition) + object defined by the application making the request. + + If the `CatalogCustomAttributeDefinition` object is + defined by another application, the `CatalogCustomAttributeDefinition`'s key attribute value is prefixed by + the defining application ID. For example, if the `CatalogCustomAttributeDefinition` has a `key` attribute of + `"cocoa_brand"` and the defining application ID is `"abcd1234"`, the key in the map is `"abcd1234:cocoa_brand"` + if the application making the request is different from the application defining the custom attribute definition. + Otherwise, the key used in the map is simply `"cocoa_brand"`. + + Application-defined custom attributes are set at a global (location-independent) level. + Custom attribute values are intended to store additional information about a catalog object + or associations with an entity in another system. Do not use custom attributes + to store any sensitive information (personally identifiable information, card details, etc.). + """ + + catalog_v1ids: typing_extensions.NotRequired[ + typing_extensions.Annotated[typing.Sequence[CatalogV1IdParams], FieldMetadata(alias="catalog_v1_ids")] + ] + """ + 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. + """ + + present_at_all_locations: typing_extensions.NotRequired[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. If not specified, defaults to `true`. + """ + + present_at_location_ids: typing_extensions.NotRequired[typing.Sequence[str]] + """ + A list of locations where the object is present, even if `present_at_all_locations` is `false`. + This can include locations that are deactivated. + """ + + absent_at_location_ids: typing_extensions.NotRequired[typing.Sequence[str]] + """ + A list of locations where the object is not present, even if `present_at_all_locations` is `true`. + This can include locations that are deactivated. + """ + + image_id: typing_extensions.NotRequired[str] + """ + Identifies the `CatalogImage` attached to this `CatalogObject`. + """ diff --git a/src/square/requests/catalog_object_item.py b/src/square/requests/catalog_object_item.py index 588c6466..dba33fed 100644 --- a/src/square/requests/catalog_object_item.py +++ b/src/square/requests/catalog_object_item.py @@ -1,16 +1,103 @@ # This file was auto-generated by Fern from our API Definition. from __future__ import annotations -from .catalog_object_base import CatalogObjectBaseParams import typing_extensions import typing +import typing_extensions +from .catalog_custom_attribute_value import CatalogCustomAttributeValueParams +from .catalog_v1id import CatalogV1IdParams +from ..core.serialization import FieldMetadata +import typing if typing.TYPE_CHECKING: from .catalog_item import CatalogItemParams -class CatalogObjectItemParams(CatalogObjectBaseParams): +class CatalogObjectItemParams(typing_extensions.TypedDict): + type: typing.Literal["ITEM"] item_data: typing_extensions.NotRequired["CatalogItemParams"] """ Structured data for a `CatalogItem`, set for CatalogObjects of type `ITEM`. """ + + id: str + """ + 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. + """ + + updated_at: typing_extensions.NotRequired[str] + """ + Last modification [timestamp](https://developer.squareup.com/docs/build-basics/working-with-dates) 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. + """ + + version: typing_extensions.NotRequired[int] + """ + The version of the object. When updating an object, the version supplied + must match the version in the database, otherwise the write will be rejected as conflicting. + """ + + is_deleted: typing_extensions.NotRequired[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. + """ + + custom_attribute_values: typing_extensions.NotRequired[typing.Dict[str, CatalogCustomAttributeValueParams]] + """ + A map (key-value pairs) of application-defined custom attribute values. The value of a key-value pair + is a [CatalogCustomAttributeValue](entity:CatalogCustomAttributeValue) object. The key is the `key` attribute + value defined in the associated [CatalogCustomAttributeDefinition](entity:CatalogCustomAttributeDefinition) + object defined by the application making the request. + + If the `CatalogCustomAttributeDefinition` object is + defined by another application, the `CatalogCustomAttributeDefinition`'s key attribute value is prefixed by + the defining application ID. For example, if the `CatalogCustomAttributeDefinition` has a `key` attribute of + `"cocoa_brand"` and the defining application ID is `"abcd1234"`, the key in the map is `"abcd1234:cocoa_brand"` + if the application making the request is different from the application defining the custom attribute definition. + Otherwise, the key used in the map is simply `"cocoa_brand"`. + + Application-defined custom attributes are set at a global (location-independent) level. + Custom attribute values are intended to store additional information about a catalog object + or associations with an entity in another system. Do not use custom attributes + to store any sensitive information (personally identifiable information, card details, etc.). + """ + + catalog_v1ids: typing_extensions.NotRequired[ + typing_extensions.Annotated[typing.Sequence[CatalogV1IdParams], FieldMetadata(alias="catalog_v1_ids")] + ] + """ + 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. + """ + + present_at_all_locations: typing_extensions.NotRequired[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. If not specified, defaults to `true`. + """ + + present_at_location_ids: typing_extensions.NotRequired[typing.Sequence[str]] + """ + A list of locations where the object is present, even if `present_at_all_locations` is `false`. + This can include locations that are deactivated. + """ + + absent_at_location_ids: typing_extensions.NotRequired[typing.Sequence[str]] + """ + A list of locations where the object is not present, even if `present_at_all_locations` is `true`. + This can include locations that are deactivated. + """ + + image_id: typing_extensions.NotRequired[str] + """ + Identifies the `CatalogImage` attached to this `CatalogObject`. + """ diff --git a/src/square/requests/catalog_object_item_option.py b/src/square/requests/catalog_object_item_option.py index 210f3a58..b02cb27c 100644 --- a/src/square/requests/catalog_object_item_option.py +++ b/src/square/requests/catalog_object_item_option.py @@ -1,16 +1,103 @@ # This file was auto-generated by Fern from our API Definition. from __future__ import annotations -from .catalog_object_base import CatalogObjectBaseParams import typing_extensions import typing +import typing_extensions +from .catalog_custom_attribute_value import CatalogCustomAttributeValueParams +from .catalog_v1id import CatalogV1IdParams +from ..core.serialization import FieldMetadata +import typing if typing.TYPE_CHECKING: from .catalog_item_option import CatalogItemOptionParams -class CatalogObjectItemOptionParams(CatalogObjectBaseParams): +class CatalogObjectItemOptionParams(typing_extensions.TypedDict): + type: typing.Literal["ITEM_OPTION"] item_option_data: typing_extensions.NotRequired["CatalogItemOptionParams"] """ Structured data for a `CatalogItemOption`, set for CatalogObjects of type `ITEM_OPTION`. """ + + id: str + """ + 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. + """ + + updated_at: typing_extensions.NotRequired[str] + """ + Last modification [timestamp](https://developer.squareup.com/docs/build-basics/working-with-dates) 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. + """ + + version: typing_extensions.NotRequired[int] + """ + The version of the object. When updating an object, the version supplied + must match the version in the database, otherwise the write will be rejected as conflicting. + """ + + is_deleted: typing_extensions.NotRequired[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. + """ + + custom_attribute_values: typing_extensions.NotRequired[typing.Dict[str, CatalogCustomAttributeValueParams]] + """ + A map (key-value pairs) of application-defined custom attribute values. The value of a key-value pair + is a [CatalogCustomAttributeValue](entity:CatalogCustomAttributeValue) object. The key is the `key` attribute + value defined in the associated [CatalogCustomAttributeDefinition](entity:CatalogCustomAttributeDefinition) + object defined by the application making the request. + + If the `CatalogCustomAttributeDefinition` object is + defined by another application, the `CatalogCustomAttributeDefinition`'s key attribute value is prefixed by + the defining application ID. For example, if the `CatalogCustomAttributeDefinition` has a `key` attribute of + `"cocoa_brand"` and the defining application ID is `"abcd1234"`, the key in the map is `"abcd1234:cocoa_brand"` + if the application making the request is different from the application defining the custom attribute definition. + Otherwise, the key used in the map is simply `"cocoa_brand"`. + + Application-defined custom attributes are set at a global (location-independent) level. + Custom attribute values are intended to store additional information about a catalog object + or associations with an entity in another system. Do not use custom attributes + to store any sensitive information (personally identifiable information, card details, etc.). + """ + + catalog_v1ids: typing_extensions.NotRequired[ + typing_extensions.Annotated[typing.Sequence[CatalogV1IdParams], FieldMetadata(alias="catalog_v1_ids")] + ] + """ + 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. + """ + + present_at_all_locations: typing_extensions.NotRequired[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. If not specified, defaults to `true`. + """ + + present_at_location_ids: typing_extensions.NotRequired[typing.Sequence[str]] + """ + A list of locations where the object is present, even if `present_at_all_locations` is `false`. + This can include locations that are deactivated. + """ + + absent_at_location_ids: typing_extensions.NotRequired[typing.Sequence[str]] + """ + A list of locations where the object is not present, even if `present_at_all_locations` is `true`. + This can include locations that are deactivated. + """ + + image_id: typing_extensions.NotRequired[str] + """ + Identifies the `CatalogImage` attached to this `CatalogObject`. + """ diff --git a/src/square/requests/catalog_object_item_option_value.py b/src/square/requests/catalog_object_item_option_value.py index c675c724..e2a3707f 100644 --- a/src/square/requests/catalog_object_item_option_value.py +++ b/src/square/requests/catalog_object_item_option_value.py @@ -1,12 +1,99 @@ # This file was auto-generated by Fern from our API Definition. -from .catalog_object_base import CatalogObjectBaseParams +import typing_extensions +import typing import typing_extensions from .catalog_item_option_value import CatalogItemOptionValueParams +from .catalog_custom_attribute_value import CatalogCustomAttributeValueParams +from .catalog_v1id import CatalogV1IdParams +from ..core.serialization import FieldMetadata -class CatalogObjectItemOptionValueParams(CatalogObjectBaseParams): +class CatalogObjectItemOptionValueParams(typing_extensions.TypedDict): + type: typing.Literal["ITEM_OPTION_VAL"] item_option_value_data: typing_extensions.NotRequired[CatalogItemOptionValueParams] """ Structured data for a `CatalogItemOptionValue`, set for CatalogObjects of type `ITEM_OPTION_VAL`. """ + + id: str + """ + 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. + """ + + updated_at: typing_extensions.NotRequired[str] + """ + Last modification [timestamp](https://developer.squareup.com/docs/build-basics/working-with-dates) 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. + """ + + version: typing_extensions.NotRequired[int] + """ + The version of the object. When updating an object, the version supplied + must match the version in the database, otherwise the write will be rejected as conflicting. + """ + + is_deleted: typing_extensions.NotRequired[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. + """ + + custom_attribute_values: typing_extensions.NotRequired[typing.Dict[str, CatalogCustomAttributeValueParams]] + """ + A map (key-value pairs) of application-defined custom attribute values. The value of a key-value pair + is a [CatalogCustomAttributeValue](entity:CatalogCustomAttributeValue) object. The key is the `key` attribute + value defined in the associated [CatalogCustomAttributeDefinition](entity:CatalogCustomAttributeDefinition) + object defined by the application making the request. + + If the `CatalogCustomAttributeDefinition` object is + defined by another application, the `CatalogCustomAttributeDefinition`'s key attribute value is prefixed by + the defining application ID. For example, if the `CatalogCustomAttributeDefinition` has a `key` attribute of + `"cocoa_brand"` and the defining application ID is `"abcd1234"`, the key in the map is `"abcd1234:cocoa_brand"` + if the application making the request is different from the application defining the custom attribute definition. + Otherwise, the key used in the map is simply `"cocoa_brand"`. + + Application-defined custom attributes are set at a global (location-independent) level. + Custom attribute values are intended to store additional information about a catalog object + or associations with an entity in another system. Do not use custom attributes + to store any sensitive information (personally identifiable information, card details, etc.). + """ + + catalog_v1ids: typing_extensions.NotRequired[ + typing_extensions.Annotated[typing.Sequence[CatalogV1IdParams], FieldMetadata(alias="catalog_v1_ids")] + ] + """ + 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. + """ + + present_at_all_locations: typing_extensions.NotRequired[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. If not specified, defaults to `true`. + """ + + present_at_location_ids: typing_extensions.NotRequired[typing.Sequence[str]] + """ + A list of locations where the object is present, even if `present_at_all_locations` is `false`. + This can include locations that are deactivated. + """ + + absent_at_location_ids: typing_extensions.NotRequired[typing.Sequence[str]] + """ + A list of locations where the object is not present, even if `present_at_all_locations` is `true`. + This can include locations that are deactivated. + """ + + image_id: typing_extensions.NotRequired[str] + """ + Identifies the `CatalogImage` attached to this `CatalogObject`. + """ diff --git a/src/square/requests/catalog_object_item_variation.py b/src/square/requests/catalog_object_item_variation.py index 7e1e7d56..5365db2a 100644 --- a/src/square/requests/catalog_object_item_variation.py +++ b/src/square/requests/catalog_object_item_variation.py @@ -1,12 +1,99 @@ # This file was auto-generated by Fern from our API Definition. -from .catalog_object_base import CatalogObjectBaseParams +import typing_extensions +import typing import typing_extensions from .catalog_item_variation import CatalogItemVariationParams +from .catalog_custom_attribute_value import CatalogCustomAttributeValueParams +from .catalog_v1id import CatalogV1IdParams +from ..core.serialization import FieldMetadata -class CatalogObjectItemVariationParams(CatalogObjectBaseParams): +class CatalogObjectItemVariationParams(typing_extensions.TypedDict): + type: typing.Literal["ITEM_VARIATION"] item_variation_data: typing_extensions.NotRequired[CatalogItemVariationParams] """ Structured data for a `CatalogItemVariation`, set for CatalogObjects of type `ITEM_VARIATION`. """ + + id: str + """ + 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. + """ + + updated_at: typing_extensions.NotRequired[str] + """ + Last modification [timestamp](https://developer.squareup.com/docs/build-basics/working-with-dates) 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. + """ + + version: typing_extensions.NotRequired[int] + """ + The version of the object. When updating an object, the version supplied + must match the version in the database, otherwise the write will be rejected as conflicting. + """ + + is_deleted: typing_extensions.NotRequired[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. + """ + + custom_attribute_values: typing_extensions.NotRequired[typing.Dict[str, CatalogCustomAttributeValueParams]] + """ + A map (key-value pairs) of application-defined custom attribute values. The value of a key-value pair + is a [CatalogCustomAttributeValue](entity:CatalogCustomAttributeValue) object. The key is the `key` attribute + value defined in the associated [CatalogCustomAttributeDefinition](entity:CatalogCustomAttributeDefinition) + object defined by the application making the request. + + If the `CatalogCustomAttributeDefinition` object is + defined by another application, the `CatalogCustomAttributeDefinition`'s key attribute value is prefixed by + the defining application ID. For example, if the `CatalogCustomAttributeDefinition` has a `key` attribute of + `"cocoa_brand"` and the defining application ID is `"abcd1234"`, the key in the map is `"abcd1234:cocoa_brand"` + if the application making the request is different from the application defining the custom attribute definition. + Otherwise, the key used in the map is simply `"cocoa_brand"`. + + Application-defined custom attributes are set at a global (location-independent) level. + Custom attribute values are intended to store additional information about a catalog object + or associations with an entity in another system. Do not use custom attributes + to store any sensitive information (personally identifiable information, card details, etc.). + """ + + catalog_v1ids: typing_extensions.NotRequired[ + typing_extensions.Annotated[typing.Sequence[CatalogV1IdParams], FieldMetadata(alias="catalog_v1_ids")] + ] + """ + 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. + """ + + present_at_all_locations: typing_extensions.NotRequired[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. If not specified, defaults to `true`. + """ + + present_at_location_ids: typing_extensions.NotRequired[typing.Sequence[str]] + """ + A list of locations where the object is present, even if `present_at_all_locations` is `false`. + This can include locations that are deactivated. + """ + + absent_at_location_ids: typing_extensions.NotRequired[typing.Sequence[str]] + """ + A list of locations where the object is not present, even if `present_at_all_locations` is `true`. + This can include locations that are deactivated. + """ + + image_id: typing_extensions.NotRequired[str] + """ + Identifies the `CatalogImage` attached to this `CatalogObject`. + """ diff --git a/src/square/requests/catalog_object_measurement_unit.py b/src/square/requests/catalog_object_measurement_unit.py index e529b7dc..eac517ed 100644 --- a/src/square/requests/catalog_object_measurement_unit.py +++ b/src/square/requests/catalog_object_measurement_unit.py @@ -1,12 +1,99 @@ # This file was auto-generated by Fern from our API Definition. -from .catalog_object_base import CatalogObjectBaseParams +import typing_extensions +import typing import typing_extensions from .catalog_measurement_unit import CatalogMeasurementUnitParams +from .catalog_custom_attribute_value import CatalogCustomAttributeValueParams +from .catalog_v1id import CatalogV1IdParams +from ..core.serialization import FieldMetadata -class CatalogObjectMeasurementUnitParams(CatalogObjectBaseParams): +class CatalogObjectMeasurementUnitParams(typing_extensions.TypedDict): + type: typing.Literal["MEASUREMENT_UNIT"] measurement_unit_data: typing_extensions.NotRequired[CatalogMeasurementUnitParams] """ Structured data for a `CatalogMeasurementUnit`, set for CatalogObjects of type `MEASUREMENT_UNIT`. """ + + id: str + """ + 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. + """ + + updated_at: typing_extensions.NotRequired[str] + """ + Last modification [timestamp](https://developer.squareup.com/docs/build-basics/working-with-dates) 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. + """ + + version: typing_extensions.NotRequired[int] + """ + The version of the object. When updating an object, the version supplied + must match the version in the database, otherwise the write will be rejected as conflicting. + """ + + is_deleted: typing_extensions.NotRequired[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. + """ + + custom_attribute_values: typing_extensions.NotRequired[typing.Dict[str, CatalogCustomAttributeValueParams]] + """ + A map (key-value pairs) of application-defined custom attribute values. The value of a key-value pair + is a [CatalogCustomAttributeValue](entity:CatalogCustomAttributeValue) object. The key is the `key` attribute + value defined in the associated [CatalogCustomAttributeDefinition](entity:CatalogCustomAttributeDefinition) + object defined by the application making the request. + + If the `CatalogCustomAttributeDefinition` object is + defined by another application, the `CatalogCustomAttributeDefinition`'s key attribute value is prefixed by + the defining application ID. For example, if the `CatalogCustomAttributeDefinition` has a `key` attribute of + `"cocoa_brand"` and the defining application ID is `"abcd1234"`, the key in the map is `"abcd1234:cocoa_brand"` + if the application making the request is different from the application defining the custom attribute definition. + Otherwise, the key used in the map is simply `"cocoa_brand"`. + + Application-defined custom attributes are set at a global (location-independent) level. + Custom attribute values are intended to store additional information about a catalog object + or associations with an entity in another system. Do not use custom attributes + to store any sensitive information (personally identifiable information, card details, etc.). + """ + + catalog_v1ids: typing_extensions.NotRequired[ + typing_extensions.Annotated[typing.Sequence[CatalogV1IdParams], FieldMetadata(alias="catalog_v1_ids")] + ] + """ + 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. + """ + + present_at_all_locations: typing_extensions.NotRequired[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. If not specified, defaults to `true`. + """ + + present_at_location_ids: typing_extensions.NotRequired[typing.Sequence[str]] + """ + A list of locations where the object is present, even if `present_at_all_locations` is `false`. + This can include locations that are deactivated. + """ + + absent_at_location_ids: typing_extensions.NotRequired[typing.Sequence[str]] + """ + A list of locations where the object is not present, even if `present_at_all_locations` is `true`. + This can include locations that are deactivated. + """ + + image_id: typing_extensions.NotRequired[str] + """ + Identifies the `CatalogImage` attached to this `CatalogObject`. + """ diff --git a/src/square/requests/catalog_object_modifier.py b/src/square/requests/catalog_object_modifier.py index 2e384dcf..62bb81ab 100644 --- a/src/square/requests/catalog_object_modifier.py +++ b/src/square/requests/catalog_object_modifier.py @@ -1,12 +1,99 @@ # This file was auto-generated by Fern from our API Definition. -from .catalog_object_base import CatalogObjectBaseParams +import typing_extensions +import typing import typing_extensions from .catalog_modifier import CatalogModifierParams +from .catalog_custom_attribute_value import CatalogCustomAttributeValueParams +from .catalog_v1id import CatalogV1IdParams +from ..core.serialization import FieldMetadata -class CatalogObjectModifierParams(CatalogObjectBaseParams): +class CatalogObjectModifierParams(typing_extensions.TypedDict): + type: typing.Literal["MODIFIER"] modifier_data: typing_extensions.NotRequired[CatalogModifierParams] """ Structured data for a `CatalogModifier`, set for CatalogObjects of type `MODIFIER`. """ + + id: str + """ + 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. + """ + + updated_at: typing_extensions.NotRequired[str] + """ + Last modification [timestamp](https://developer.squareup.com/docs/build-basics/working-with-dates) 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. + """ + + version: typing_extensions.NotRequired[int] + """ + The version of the object. When updating an object, the version supplied + must match the version in the database, otherwise the write will be rejected as conflicting. + """ + + is_deleted: typing_extensions.NotRequired[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. + """ + + custom_attribute_values: typing_extensions.NotRequired[typing.Dict[str, CatalogCustomAttributeValueParams]] + """ + A map (key-value pairs) of application-defined custom attribute values. The value of a key-value pair + is a [CatalogCustomAttributeValue](entity:CatalogCustomAttributeValue) object. The key is the `key` attribute + value defined in the associated [CatalogCustomAttributeDefinition](entity:CatalogCustomAttributeDefinition) + object defined by the application making the request. + + If the `CatalogCustomAttributeDefinition` object is + defined by another application, the `CatalogCustomAttributeDefinition`'s key attribute value is prefixed by + the defining application ID. For example, if the `CatalogCustomAttributeDefinition` has a `key` attribute of + `"cocoa_brand"` and the defining application ID is `"abcd1234"`, the key in the map is `"abcd1234:cocoa_brand"` + if the application making the request is different from the application defining the custom attribute definition. + Otherwise, the key used in the map is simply `"cocoa_brand"`. + + Application-defined custom attributes are set at a global (location-independent) level. + Custom attribute values are intended to store additional information about a catalog object + or associations with an entity in another system. Do not use custom attributes + to store any sensitive information (personally identifiable information, card details, etc.). + """ + + catalog_v1ids: typing_extensions.NotRequired[ + typing_extensions.Annotated[typing.Sequence[CatalogV1IdParams], FieldMetadata(alias="catalog_v1_ids")] + ] + """ + 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. + """ + + present_at_all_locations: typing_extensions.NotRequired[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. If not specified, defaults to `true`. + """ + + present_at_location_ids: typing_extensions.NotRequired[typing.Sequence[str]] + """ + A list of locations where the object is present, even if `present_at_all_locations` is `false`. + This can include locations that are deactivated. + """ + + absent_at_location_ids: typing_extensions.NotRequired[typing.Sequence[str]] + """ + A list of locations where the object is not present, even if `present_at_all_locations` is `true`. + This can include locations that are deactivated. + """ + + image_id: typing_extensions.NotRequired[str] + """ + Identifies the `CatalogImage` attached to this `CatalogObject`. + """ diff --git a/src/square/requests/catalog_object_modifier_list.py b/src/square/requests/catalog_object_modifier_list.py index 783d5e57..8d613b19 100644 --- a/src/square/requests/catalog_object_modifier_list.py +++ b/src/square/requests/catalog_object_modifier_list.py @@ -1,16 +1,103 @@ # This file was auto-generated by Fern from our API Definition. from __future__ import annotations -from .catalog_object_base import CatalogObjectBaseParams import typing_extensions import typing +import typing_extensions +from .catalog_custom_attribute_value import CatalogCustomAttributeValueParams +from .catalog_v1id import CatalogV1IdParams +from ..core.serialization import FieldMetadata +import typing if typing.TYPE_CHECKING: from .catalog_modifier_list import CatalogModifierListParams -class CatalogObjectModifierListParams(CatalogObjectBaseParams): +class CatalogObjectModifierListParams(typing_extensions.TypedDict): + type: typing.Literal["MODIFIER_LIST"] modifier_list_data: typing_extensions.NotRequired["CatalogModifierListParams"] """ Structured data for a `CatalogModifierList`, set for CatalogObjects of type `MODIFIER_LIST`. """ + + id: str + """ + 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. + """ + + updated_at: typing_extensions.NotRequired[str] + """ + Last modification [timestamp](https://developer.squareup.com/docs/build-basics/working-with-dates) 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. + """ + + version: typing_extensions.NotRequired[int] + """ + The version of the object. When updating an object, the version supplied + must match the version in the database, otherwise the write will be rejected as conflicting. + """ + + is_deleted: typing_extensions.NotRequired[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. + """ + + custom_attribute_values: typing_extensions.NotRequired[typing.Dict[str, CatalogCustomAttributeValueParams]] + """ + A map (key-value pairs) of application-defined custom attribute values. The value of a key-value pair + is a [CatalogCustomAttributeValue](entity:CatalogCustomAttributeValue) object. The key is the `key` attribute + value defined in the associated [CatalogCustomAttributeDefinition](entity:CatalogCustomAttributeDefinition) + object defined by the application making the request. + + If the `CatalogCustomAttributeDefinition` object is + defined by another application, the `CatalogCustomAttributeDefinition`'s key attribute value is prefixed by + the defining application ID. For example, if the `CatalogCustomAttributeDefinition` has a `key` attribute of + `"cocoa_brand"` and the defining application ID is `"abcd1234"`, the key in the map is `"abcd1234:cocoa_brand"` + if the application making the request is different from the application defining the custom attribute definition. + Otherwise, the key used in the map is simply `"cocoa_brand"`. + + Application-defined custom attributes are set at a global (location-independent) level. + Custom attribute values are intended to store additional information about a catalog object + or associations with an entity in another system. Do not use custom attributes + to store any sensitive information (personally identifiable information, card details, etc.). + """ + + catalog_v1ids: typing_extensions.NotRequired[ + typing_extensions.Annotated[typing.Sequence[CatalogV1IdParams], FieldMetadata(alias="catalog_v1_ids")] + ] + """ + 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. + """ + + present_at_all_locations: typing_extensions.NotRequired[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. If not specified, defaults to `true`. + """ + + present_at_location_ids: typing_extensions.NotRequired[typing.Sequence[str]] + """ + A list of locations where the object is present, even if `present_at_all_locations` is `false`. + This can include locations that are deactivated. + """ + + absent_at_location_ids: typing_extensions.NotRequired[typing.Sequence[str]] + """ + A list of locations where the object is not present, even if `present_at_all_locations` is `true`. + This can include locations that are deactivated. + """ + + image_id: typing_extensions.NotRequired[str] + """ + Identifies the `CatalogImage` attached to this `CatalogObject`. + """ diff --git a/src/square/requests/catalog_object_pricing_rule.py b/src/square/requests/catalog_object_pricing_rule.py index b70343b8..1374d5a9 100644 --- a/src/square/requests/catalog_object_pricing_rule.py +++ b/src/square/requests/catalog_object_pricing_rule.py @@ -1,13 +1,100 @@ # This file was auto-generated by Fern from our API Definition. -from .catalog_object_base import CatalogObjectBaseParams +import typing_extensions +import typing import typing_extensions from .catalog_pricing_rule import CatalogPricingRuleParams +from .catalog_custom_attribute_value import CatalogCustomAttributeValueParams +from .catalog_v1id import CatalogV1IdParams +from ..core.serialization import FieldMetadata -class CatalogObjectPricingRuleParams(CatalogObjectBaseParams): +class CatalogObjectPricingRuleParams(typing_extensions.TypedDict): + type: typing.Literal["PRICING_RULE"] pricing_rule_data: typing_extensions.NotRequired[CatalogPricingRuleParams] """ Structured data for a `CatalogPricingRule`, set for CatalogObjects of type `PRICING_RULE`. A `CatalogPricingRule` object often works with a `CatalogProductSet` object or a `CatalogTimePeriod` object. """ + + id: str + """ + 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. + """ + + updated_at: typing_extensions.NotRequired[str] + """ + Last modification [timestamp](https://developer.squareup.com/docs/build-basics/working-with-dates) 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. + """ + + version: typing_extensions.NotRequired[int] + """ + The version of the object. When updating an object, the version supplied + must match the version in the database, otherwise the write will be rejected as conflicting. + """ + + is_deleted: typing_extensions.NotRequired[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. + """ + + custom_attribute_values: typing_extensions.NotRequired[typing.Dict[str, CatalogCustomAttributeValueParams]] + """ + A map (key-value pairs) of application-defined custom attribute values. The value of a key-value pair + is a [CatalogCustomAttributeValue](entity:CatalogCustomAttributeValue) object. The key is the `key` attribute + value defined in the associated [CatalogCustomAttributeDefinition](entity:CatalogCustomAttributeDefinition) + object defined by the application making the request. + + If the `CatalogCustomAttributeDefinition` object is + defined by another application, the `CatalogCustomAttributeDefinition`'s key attribute value is prefixed by + the defining application ID. For example, if the `CatalogCustomAttributeDefinition` has a `key` attribute of + `"cocoa_brand"` and the defining application ID is `"abcd1234"`, the key in the map is `"abcd1234:cocoa_brand"` + if the application making the request is different from the application defining the custom attribute definition. + Otherwise, the key used in the map is simply `"cocoa_brand"`. + + Application-defined custom attributes are set at a global (location-independent) level. + Custom attribute values are intended to store additional information about a catalog object + or associations with an entity in another system. Do not use custom attributes + to store any sensitive information (personally identifiable information, card details, etc.). + """ + + catalog_v1ids: typing_extensions.NotRequired[ + typing_extensions.Annotated[typing.Sequence[CatalogV1IdParams], FieldMetadata(alias="catalog_v1_ids")] + ] + """ + 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. + """ + + present_at_all_locations: typing_extensions.NotRequired[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. If not specified, defaults to `true`. + """ + + present_at_location_ids: typing_extensions.NotRequired[typing.Sequence[str]] + """ + A list of locations where the object is present, even if `present_at_all_locations` is `false`. + This can include locations that are deactivated. + """ + + absent_at_location_ids: typing_extensions.NotRequired[typing.Sequence[str]] + """ + A list of locations where the object is not present, even if `present_at_all_locations` is `true`. + This can include locations that are deactivated. + """ + + image_id: typing_extensions.NotRequired[str] + """ + Identifies the `CatalogImage` attached to this `CatalogObject`. + """ diff --git a/src/square/requests/catalog_object_product_set.py b/src/square/requests/catalog_object_product_set.py index 77c45baa..2b02c044 100644 --- a/src/square/requests/catalog_object_product_set.py +++ b/src/square/requests/catalog_object_product_set.py @@ -1,12 +1,99 @@ # This file was auto-generated by Fern from our API Definition. -from .catalog_object_base import CatalogObjectBaseParams +import typing_extensions +import typing import typing_extensions from .catalog_product_set import CatalogProductSetParams +from .catalog_custom_attribute_value import CatalogCustomAttributeValueParams +from .catalog_v1id import CatalogV1IdParams +from ..core.serialization import FieldMetadata -class CatalogObjectProductSetParams(CatalogObjectBaseParams): +class CatalogObjectProductSetParams(typing_extensions.TypedDict): + type: typing.Literal["PRODUCT_SET"] product_set_data: typing_extensions.NotRequired[CatalogProductSetParams] """ Structured data for a `CatalogProductSet`, set for CatalogObjects of type `PRODUCT_SET`. """ + + id: str + """ + 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. + """ + + updated_at: typing_extensions.NotRequired[str] + """ + Last modification [timestamp](https://developer.squareup.com/docs/build-basics/working-with-dates) 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. + """ + + version: typing_extensions.NotRequired[int] + """ + The version of the object. When updating an object, the version supplied + must match the version in the database, otherwise the write will be rejected as conflicting. + """ + + is_deleted: typing_extensions.NotRequired[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. + """ + + custom_attribute_values: typing_extensions.NotRequired[typing.Dict[str, CatalogCustomAttributeValueParams]] + """ + A map (key-value pairs) of application-defined custom attribute values. The value of a key-value pair + is a [CatalogCustomAttributeValue](entity:CatalogCustomAttributeValue) object. The key is the `key` attribute + value defined in the associated [CatalogCustomAttributeDefinition](entity:CatalogCustomAttributeDefinition) + object defined by the application making the request. + + If the `CatalogCustomAttributeDefinition` object is + defined by another application, the `CatalogCustomAttributeDefinition`'s key attribute value is prefixed by + the defining application ID. For example, if the `CatalogCustomAttributeDefinition` has a `key` attribute of + `"cocoa_brand"` and the defining application ID is `"abcd1234"`, the key in the map is `"abcd1234:cocoa_brand"` + if the application making the request is different from the application defining the custom attribute definition. + Otherwise, the key used in the map is simply `"cocoa_brand"`. + + Application-defined custom attributes are set at a global (location-independent) level. + Custom attribute values are intended to store additional information about a catalog object + or associations with an entity in another system. Do not use custom attributes + to store any sensitive information (personally identifiable information, card details, etc.). + """ + + catalog_v1ids: typing_extensions.NotRequired[ + typing_extensions.Annotated[typing.Sequence[CatalogV1IdParams], FieldMetadata(alias="catalog_v1_ids")] + ] + """ + 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. + """ + + present_at_all_locations: typing_extensions.NotRequired[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. If not specified, defaults to `true`. + """ + + present_at_location_ids: typing_extensions.NotRequired[typing.Sequence[str]] + """ + A list of locations where the object is present, even if `present_at_all_locations` is `false`. + This can include locations that are deactivated. + """ + + absent_at_location_ids: typing_extensions.NotRequired[typing.Sequence[str]] + """ + A list of locations where the object is not present, even if `present_at_all_locations` is `true`. + This can include locations that are deactivated. + """ + + image_id: typing_extensions.NotRequired[str] + """ + Identifies the `CatalogImage` attached to this `CatalogObject`. + """ diff --git a/src/square/requests/catalog_object_quick_amounts_settings.py b/src/square/requests/catalog_object_quick_amounts_settings.py index 5a44595d..ccc508fb 100644 --- a/src/square/requests/catalog_object_quick_amounts_settings.py +++ b/src/square/requests/catalog_object_quick_amounts_settings.py @@ -1,12 +1,99 @@ # This file was auto-generated by Fern from our API Definition. -from .catalog_object_base import CatalogObjectBaseParams +import typing_extensions +import typing import typing_extensions from .catalog_quick_amounts_settings import CatalogQuickAmountsSettingsParams +from .catalog_custom_attribute_value import CatalogCustomAttributeValueParams +from .catalog_v1id import CatalogV1IdParams +from ..core.serialization import FieldMetadata -class CatalogObjectQuickAmountsSettingsParams(CatalogObjectBaseParams): +class CatalogObjectQuickAmountsSettingsParams(typing_extensions.TypedDict): + type: typing.Literal["QUICK_AMOUNTS_SETTINGS"] quick_amounts_settings_data: typing_extensions.NotRequired[CatalogQuickAmountsSettingsParams] """ Structured data for a `CatalogQuickAmountsSettings`, set for CatalogObjects of type `QUICK_AMOUNTS_SETTINGS`. """ + + id: str + """ + 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. + """ + + updated_at: typing_extensions.NotRequired[str] + """ + Last modification [timestamp](https://developer.squareup.com/docs/build-basics/working-with-dates) 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. + """ + + version: typing_extensions.NotRequired[int] + """ + The version of the object. When updating an object, the version supplied + must match the version in the database, otherwise the write will be rejected as conflicting. + """ + + is_deleted: typing_extensions.NotRequired[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. + """ + + custom_attribute_values: typing_extensions.NotRequired[typing.Dict[str, CatalogCustomAttributeValueParams]] + """ + A map (key-value pairs) of application-defined custom attribute values. The value of a key-value pair + is a [CatalogCustomAttributeValue](entity:CatalogCustomAttributeValue) object. The key is the `key` attribute + value defined in the associated [CatalogCustomAttributeDefinition](entity:CatalogCustomAttributeDefinition) + object defined by the application making the request. + + If the `CatalogCustomAttributeDefinition` object is + defined by another application, the `CatalogCustomAttributeDefinition`'s key attribute value is prefixed by + the defining application ID. For example, if the `CatalogCustomAttributeDefinition` has a `key` attribute of + `"cocoa_brand"` and the defining application ID is `"abcd1234"`, the key in the map is `"abcd1234:cocoa_brand"` + if the application making the request is different from the application defining the custom attribute definition. + Otherwise, the key used in the map is simply `"cocoa_brand"`. + + Application-defined custom attributes are set at a global (location-independent) level. + Custom attribute values are intended to store additional information about a catalog object + or associations with an entity in another system. Do not use custom attributes + to store any sensitive information (personally identifiable information, card details, etc.). + """ + + catalog_v1ids: typing_extensions.NotRequired[ + typing_extensions.Annotated[typing.Sequence[CatalogV1IdParams], FieldMetadata(alias="catalog_v1_ids")] + ] + """ + 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. + """ + + present_at_all_locations: typing_extensions.NotRequired[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. If not specified, defaults to `true`. + """ + + present_at_location_ids: typing_extensions.NotRequired[typing.Sequence[str]] + """ + A list of locations where the object is present, even if `present_at_all_locations` is `false`. + This can include locations that are deactivated. + """ + + absent_at_location_ids: typing_extensions.NotRequired[typing.Sequence[str]] + """ + A list of locations where the object is not present, even if `present_at_all_locations` is `true`. + This can include locations that are deactivated. + """ + + image_id: typing_extensions.NotRequired[str] + """ + Identifies the `CatalogImage` attached to this `CatalogObject`. + """ diff --git a/src/square/requests/catalog_object_resource.py b/src/square/requests/catalog_object_resource.py deleted file mode 100644 index 8ecc7bcc..00000000 --- a/src/square/requests/catalog_object_resource.py +++ /dev/null @@ -1,7 +0,0 @@ -# This file was auto-generated by Fern from our API Definition. - -from .catalog_object_base import CatalogObjectBaseParams - - -class CatalogObjectResourceParams(CatalogObjectBaseParams): - pass diff --git a/src/square/requests/catalog_object_service_charge.py b/src/square/requests/catalog_object_service_charge.py deleted file mode 100644 index 4694a110..00000000 --- a/src/square/requests/catalog_object_service_charge.py +++ /dev/null @@ -1,7 +0,0 @@ -# This file was auto-generated by Fern from our API Definition. - -from .catalog_object_base import CatalogObjectBaseParams - - -class CatalogObjectServiceChargeParams(CatalogObjectBaseParams): - pass diff --git a/src/square/requests/catalog_object_subscription_plan.py b/src/square/requests/catalog_object_subscription_plan.py index 12d8032b..340b9d27 100644 --- a/src/square/requests/catalog_object_subscription_plan.py +++ b/src/square/requests/catalog_object_subscription_plan.py @@ -1,16 +1,103 @@ # This file was auto-generated by Fern from our API Definition. from __future__ import annotations -from .catalog_object_base import CatalogObjectBaseParams import typing_extensions import typing +import typing_extensions +from .catalog_custom_attribute_value import CatalogCustomAttributeValueParams +from .catalog_v1id import CatalogV1IdParams +from ..core.serialization import FieldMetadata +import typing if typing.TYPE_CHECKING: from .catalog_subscription_plan import CatalogSubscriptionPlanParams -class CatalogObjectSubscriptionPlanParams(CatalogObjectBaseParams): +class CatalogObjectSubscriptionPlanParams(typing_extensions.TypedDict): + type: typing.Literal["SUBSCRIPTION_PLAN"] subscription_plan_data: typing_extensions.NotRequired["CatalogSubscriptionPlanParams"] """ Structured data for a `CatalogSubscriptionPlan`, set for CatalogObjects of type `SUBSCRIPTION_PLAN`. """ + + id: str + """ + 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. + """ + + updated_at: typing_extensions.NotRequired[str] + """ + Last modification [timestamp](https://developer.squareup.com/docs/build-basics/working-with-dates) 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. + """ + + version: typing_extensions.NotRequired[int] + """ + The version of the object. When updating an object, the version supplied + must match the version in the database, otherwise the write will be rejected as conflicting. + """ + + is_deleted: typing_extensions.NotRequired[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. + """ + + custom_attribute_values: typing_extensions.NotRequired[typing.Dict[str, CatalogCustomAttributeValueParams]] + """ + A map (key-value pairs) of application-defined custom attribute values. The value of a key-value pair + is a [CatalogCustomAttributeValue](entity:CatalogCustomAttributeValue) object. The key is the `key` attribute + value defined in the associated [CatalogCustomAttributeDefinition](entity:CatalogCustomAttributeDefinition) + object defined by the application making the request. + + If the `CatalogCustomAttributeDefinition` object is + defined by another application, the `CatalogCustomAttributeDefinition`'s key attribute value is prefixed by + the defining application ID. For example, if the `CatalogCustomAttributeDefinition` has a `key` attribute of + `"cocoa_brand"` and the defining application ID is `"abcd1234"`, the key in the map is `"abcd1234:cocoa_brand"` + if the application making the request is different from the application defining the custom attribute definition. + Otherwise, the key used in the map is simply `"cocoa_brand"`. + + Application-defined custom attributes are set at a global (location-independent) level. + Custom attribute values are intended to store additional information about a catalog object + or associations with an entity in another system. Do not use custom attributes + to store any sensitive information (personally identifiable information, card details, etc.). + """ + + catalog_v1ids: typing_extensions.NotRequired[ + typing_extensions.Annotated[typing.Sequence[CatalogV1IdParams], FieldMetadata(alias="catalog_v1_ids")] + ] + """ + 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. + """ + + present_at_all_locations: typing_extensions.NotRequired[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. If not specified, defaults to `true`. + """ + + present_at_location_ids: typing_extensions.NotRequired[typing.Sequence[str]] + """ + A list of locations where the object is present, even if `present_at_all_locations` is `false`. + This can include locations that are deactivated. + """ + + absent_at_location_ids: typing_extensions.NotRequired[typing.Sequence[str]] + """ + A list of locations where the object is not present, even if `present_at_all_locations` is `true`. + This can include locations that are deactivated. + """ + + image_id: typing_extensions.NotRequired[str] + """ + Identifies the `CatalogImage` attached to this `CatalogObject`. + """ diff --git a/src/square/requests/catalog_object_subscription_plan_variation.py b/src/square/requests/catalog_object_subscription_plan_variation.py index 4b0bf2f5..21a29d3d 100644 --- a/src/square/requests/catalog_object_subscription_plan_variation.py +++ b/src/square/requests/catalog_object_subscription_plan_variation.py @@ -1,12 +1,99 @@ # This file was auto-generated by Fern from our API Definition. -from .catalog_object_base import CatalogObjectBaseParams +import typing_extensions +import typing import typing_extensions from .catalog_subscription_plan_variation import CatalogSubscriptionPlanVariationParams +from .catalog_custom_attribute_value import CatalogCustomAttributeValueParams +from .catalog_v1id import CatalogV1IdParams +from ..core.serialization import FieldMetadata -class CatalogObjectSubscriptionPlanVariationParams(CatalogObjectBaseParams): +class CatalogObjectSubscriptionPlanVariationParams(typing_extensions.TypedDict): + type: typing.Literal["SUBSCRIPTION_PLAN_VARIATION"] subscription_plan_variation_data: typing_extensions.NotRequired[CatalogSubscriptionPlanVariationParams] """ Structured data for a `CatalogSubscriptionPlanVariation`, set for CatalogObjects of type `SUBSCRIPTION_PLAN_VARIATION`. """ + + id: str + """ + 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. + """ + + updated_at: typing_extensions.NotRequired[str] + """ + Last modification [timestamp](https://developer.squareup.com/docs/build-basics/working-with-dates) 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. + """ + + version: typing_extensions.NotRequired[int] + """ + The version of the object. When updating an object, the version supplied + must match the version in the database, otherwise the write will be rejected as conflicting. + """ + + is_deleted: typing_extensions.NotRequired[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. + """ + + custom_attribute_values: typing_extensions.NotRequired[typing.Dict[str, CatalogCustomAttributeValueParams]] + """ + A map (key-value pairs) of application-defined custom attribute values. The value of a key-value pair + is a [CatalogCustomAttributeValue](entity:CatalogCustomAttributeValue) object. The key is the `key` attribute + value defined in the associated [CatalogCustomAttributeDefinition](entity:CatalogCustomAttributeDefinition) + object defined by the application making the request. + + If the `CatalogCustomAttributeDefinition` object is + defined by another application, the `CatalogCustomAttributeDefinition`'s key attribute value is prefixed by + the defining application ID. For example, if the `CatalogCustomAttributeDefinition` has a `key` attribute of + `"cocoa_brand"` and the defining application ID is `"abcd1234"`, the key in the map is `"abcd1234:cocoa_brand"` + if the application making the request is different from the application defining the custom attribute definition. + Otherwise, the key used in the map is simply `"cocoa_brand"`. + + Application-defined custom attributes are set at a global (location-independent) level. + Custom attribute values are intended to store additional information about a catalog object + or associations with an entity in another system. Do not use custom attributes + to store any sensitive information (personally identifiable information, card details, etc.). + """ + + catalog_v1ids: typing_extensions.NotRequired[ + typing_extensions.Annotated[typing.Sequence[CatalogV1IdParams], FieldMetadata(alias="catalog_v1_ids")] + ] + """ + 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. + """ + + present_at_all_locations: typing_extensions.NotRequired[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. If not specified, defaults to `true`. + """ + + present_at_location_ids: typing_extensions.NotRequired[typing.Sequence[str]] + """ + A list of locations where the object is present, even if `present_at_all_locations` is `false`. + This can include locations that are deactivated. + """ + + absent_at_location_ids: typing_extensions.NotRequired[typing.Sequence[str]] + """ + A list of locations where the object is not present, even if `present_at_all_locations` is `true`. + This can include locations that are deactivated. + """ + + image_id: typing_extensions.NotRequired[str] + """ + Identifies the `CatalogImage` attached to this `CatalogObject`. + """ diff --git a/src/square/requests/catalog_object_subscription_product.py b/src/square/requests/catalog_object_subscription_product.py deleted file mode 100644 index fcf859fa..00000000 --- a/src/square/requests/catalog_object_subscription_product.py +++ /dev/null @@ -1,7 +0,0 @@ -# This file was auto-generated by Fern from our API Definition. - -from .catalog_object_base import CatalogObjectBaseParams - - -class CatalogObjectSubscriptionProductParams(CatalogObjectBaseParams): - pass diff --git a/src/square/requests/catalog_object_tax.py b/src/square/requests/catalog_object_tax.py index 060b9bba..c5eefa1c 100644 --- a/src/square/requests/catalog_object_tax.py +++ b/src/square/requests/catalog_object_tax.py @@ -1,12 +1,99 @@ # This file was auto-generated by Fern from our API Definition. -from .catalog_object_base import CatalogObjectBaseParams +import typing_extensions +import typing import typing_extensions from .catalog_tax import CatalogTaxParams +from .catalog_custom_attribute_value import CatalogCustomAttributeValueParams +from .catalog_v1id import CatalogV1IdParams +from ..core.serialization import FieldMetadata -class CatalogObjectTaxParams(CatalogObjectBaseParams): +class CatalogObjectTaxParams(typing_extensions.TypedDict): + type: typing.Literal["TAX"] tax_data: typing_extensions.NotRequired[CatalogTaxParams] """ Structured data for a `CatalogTax`, set for CatalogObjects of type `TAX`. """ + + id: str + """ + 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. + """ + + updated_at: typing_extensions.NotRequired[str] + """ + Last modification [timestamp](https://developer.squareup.com/docs/build-basics/working-with-dates) 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. + """ + + version: typing_extensions.NotRequired[int] + """ + The version of the object. When updating an object, the version supplied + must match the version in the database, otherwise the write will be rejected as conflicting. + """ + + is_deleted: typing_extensions.NotRequired[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. + """ + + custom_attribute_values: typing_extensions.NotRequired[typing.Dict[str, CatalogCustomAttributeValueParams]] + """ + A map (key-value pairs) of application-defined custom attribute values. The value of a key-value pair + is a [CatalogCustomAttributeValue](entity:CatalogCustomAttributeValue) object. The key is the `key` attribute + value defined in the associated [CatalogCustomAttributeDefinition](entity:CatalogCustomAttributeDefinition) + object defined by the application making the request. + + If the `CatalogCustomAttributeDefinition` object is + defined by another application, the `CatalogCustomAttributeDefinition`'s key attribute value is prefixed by + the defining application ID. For example, if the `CatalogCustomAttributeDefinition` has a `key` attribute of + `"cocoa_brand"` and the defining application ID is `"abcd1234"`, the key in the map is `"abcd1234:cocoa_brand"` + if the application making the request is different from the application defining the custom attribute definition. + Otherwise, the key used in the map is simply `"cocoa_brand"`. + + Application-defined custom attributes are set at a global (location-independent) level. + Custom attribute values are intended to store additional information about a catalog object + or associations with an entity in another system. Do not use custom attributes + to store any sensitive information (personally identifiable information, card details, etc.). + """ + + catalog_v1ids: typing_extensions.NotRequired[ + typing_extensions.Annotated[typing.Sequence[CatalogV1IdParams], FieldMetadata(alias="catalog_v1_ids")] + ] + """ + 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. + """ + + present_at_all_locations: typing_extensions.NotRequired[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. If not specified, defaults to `true`. + """ + + present_at_location_ids: typing_extensions.NotRequired[typing.Sequence[str]] + """ + A list of locations where the object is present, even if `present_at_all_locations` is `false`. + This can include locations that are deactivated. + """ + + absent_at_location_ids: typing_extensions.NotRequired[typing.Sequence[str]] + """ + A list of locations where the object is not present, even if `present_at_all_locations` is `true`. + This can include locations that are deactivated. + """ + + image_id: typing_extensions.NotRequired[str] + """ + Identifies the `CatalogImage` attached to this `CatalogObject`. + """ diff --git a/src/square/requests/catalog_object_tax_exemption.py b/src/square/requests/catalog_object_tax_exemption.py deleted file mode 100644 index 14307439..00000000 --- a/src/square/requests/catalog_object_tax_exemption.py +++ /dev/null @@ -1,7 +0,0 @@ -# This file was auto-generated by Fern from our API Definition. - -from .catalog_object_base import CatalogObjectBaseParams - - -class CatalogObjectTaxExemptionParams(CatalogObjectBaseParams): - pass diff --git a/src/square/requests/catalog_object_time_period.py b/src/square/requests/catalog_object_time_period.py index 77007105..0200c33e 100644 --- a/src/square/requests/catalog_object_time_period.py +++ b/src/square/requests/catalog_object_time_period.py @@ -1,12 +1,99 @@ # This file was auto-generated by Fern from our API Definition. -from .catalog_object_base import CatalogObjectBaseParams +import typing_extensions +import typing import typing_extensions from .catalog_time_period import CatalogTimePeriodParams +from .catalog_custom_attribute_value import CatalogCustomAttributeValueParams +from .catalog_v1id import CatalogV1IdParams +from ..core.serialization import FieldMetadata -class CatalogObjectTimePeriodParams(CatalogObjectBaseParams): +class CatalogObjectTimePeriodParams(typing_extensions.TypedDict): + type: typing.Literal["TIME_PERIOD"] time_period_data: typing_extensions.NotRequired[CatalogTimePeriodParams] """ Structured data for a `CatalogTimePeriod`, set for CatalogObjects of type `TIME_PERIOD`. """ + + id: str + """ + 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. + """ + + updated_at: typing_extensions.NotRequired[str] + """ + Last modification [timestamp](https://developer.squareup.com/docs/build-basics/working-with-dates) 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. + """ + + version: typing_extensions.NotRequired[int] + """ + The version of the object. When updating an object, the version supplied + must match the version in the database, otherwise the write will be rejected as conflicting. + """ + + is_deleted: typing_extensions.NotRequired[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. + """ + + custom_attribute_values: typing_extensions.NotRequired[typing.Dict[str, CatalogCustomAttributeValueParams]] + """ + A map (key-value pairs) of application-defined custom attribute values. The value of a key-value pair + is a [CatalogCustomAttributeValue](entity:CatalogCustomAttributeValue) object. The key is the `key` attribute + value defined in the associated [CatalogCustomAttributeDefinition](entity:CatalogCustomAttributeDefinition) + object defined by the application making the request. + + If the `CatalogCustomAttributeDefinition` object is + defined by another application, the `CatalogCustomAttributeDefinition`'s key attribute value is prefixed by + the defining application ID. For example, if the `CatalogCustomAttributeDefinition` has a `key` attribute of + `"cocoa_brand"` and the defining application ID is `"abcd1234"`, the key in the map is `"abcd1234:cocoa_brand"` + if the application making the request is different from the application defining the custom attribute definition. + Otherwise, the key used in the map is simply `"cocoa_brand"`. + + Application-defined custom attributes are set at a global (location-independent) level. + Custom attribute values are intended to store additional information about a catalog object + or associations with an entity in another system. Do not use custom attributes + to store any sensitive information (personally identifiable information, card details, etc.). + """ + + catalog_v1ids: typing_extensions.NotRequired[ + typing_extensions.Annotated[typing.Sequence[CatalogV1IdParams], FieldMetadata(alias="catalog_v1_ids")] + ] + """ + 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. + """ + + present_at_all_locations: typing_extensions.NotRequired[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. If not specified, defaults to `true`. + """ + + present_at_location_ids: typing_extensions.NotRequired[typing.Sequence[str]] + """ + A list of locations where the object is present, even if `present_at_all_locations` is `false`. + This can include locations that are deactivated. + """ + + absent_at_location_ids: typing_extensions.NotRequired[typing.Sequence[str]] + """ + A list of locations where the object is not present, even if `present_at_all_locations` is `true`. + This can include locations that are deactivated. + """ + + image_id: typing_extensions.NotRequired[str] + """ + Identifies the `CatalogImage` attached to this `CatalogObject`. + """ diff --git a/src/square/requests/create_invoice_attachment_request_data.py b/src/square/requests/create_invoice_attachment_request_data.py new file mode 100644 index 00000000..37e08336 --- /dev/null +++ b/src/square/requests/create_invoice_attachment_request_data.py @@ -0,0 +1,21 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing_extensions +import typing_extensions + + +class CreateInvoiceAttachmentRequestDataParams(typing_extensions.TypedDict): + """ + Represents a [CreateInvoiceAttachment](api-endpoint:Invoices-CreateInvoiceAttachment) request. + """ + + idempotency_key: typing_extensions.NotRequired[str] + """ + A unique string that identifies the `CreateInvoiceAttachment` request. + For more information, see [Idempotency](https://developer.squareup.com/docs/build-basics/common-api-patterns/idempotency). + """ + + description: typing_extensions.NotRequired[str] + """ + The description of the attachment to display on the invoice. + """ diff --git a/src/square/types/catalog_object.py b/src/square/types/catalog_object.py index 1ec9fd1e..d1415888 100644 --- a/src/square/types/catalog_object.py +++ b/src/square/types/catalog_object.py @@ -8,31 +8,22 @@ from .catalog_object_tax import CatalogObjectTax from .catalog_object_discount import CatalogObjectDiscount from .catalog_object_modifier import CatalogObjectModifier -from .catalog_object_dining_option import CatalogObjectDiningOption -from .catalog_object_tax_exemption import CatalogObjectTaxExemption -from .catalog_object_service_charge import CatalogObjectServiceCharge from .catalog_object_pricing_rule import CatalogObjectPricingRule from .catalog_object_product_set import CatalogObjectProductSet from .catalog_object_time_period import CatalogObjectTimePeriod from .catalog_object_measurement_unit import CatalogObjectMeasurementUnit +from .catalog_object_subscription_plan_variation import CatalogObjectSubscriptionPlanVariation from .catalog_object_item_option_value import CatalogObjectItemOptionValue from .catalog_object_custom_attribute_definition import CatalogObjectCustomAttributeDefinition from .catalog_object_quick_amounts_settings import CatalogObjectQuickAmountsSettings -from .catalog_object_component import CatalogObjectComponent -from .catalog_object_composition import CatalogObjectComposition -from .catalog_object_resource import CatalogObjectResource -from .catalog_object_checkout_link import CatalogObjectCheckoutLink -from .catalog_object_address import CatalogObjectAddress -from .catalog_object_subscription_product import CatalogObjectSubscriptionProduct -from .catalog_object_subscription_plan_variation import CatalogObjectSubscriptionPlanVariation from .catalog_object_availability_period import CatalogObjectAvailabilityPeriod import typing if typing.TYPE_CHECKING: from .catalog_object_item import CatalogObjectItem from .catalog_object_modifier_list import CatalogObjectModifierList - from .catalog_object_subscription_plan import CatalogObjectSubscriptionPlan from .catalog_object_item_option import CatalogObjectItemOption + from .catalog_object_subscription_plan import CatalogObjectSubscriptionPlan CatalogObject = typing.Union[ "CatalogObjectItem", CatalogObjectImage, @@ -42,24 +33,15 @@ CatalogObjectDiscount, "CatalogObjectModifierList", CatalogObjectModifier, - CatalogObjectDiningOption, - CatalogObjectTaxExemption, - CatalogObjectServiceCharge, CatalogObjectPricingRule, CatalogObjectProductSet, CatalogObjectTimePeriod, CatalogObjectMeasurementUnit, - "CatalogObjectSubscriptionPlan", + CatalogObjectSubscriptionPlanVariation, "CatalogObjectItemOption", CatalogObjectItemOptionValue, CatalogObjectCustomAttributeDefinition, CatalogObjectQuickAmountsSettings, - CatalogObjectComponent, - CatalogObjectComposition, - CatalogObjectResource, - CatalogObjectCheckoutLink, - CatalogObjectAddress, - CatalogObjectSubscriptionProduct, - CatalogObjectSubscriptionPlanVariation, + "CatalogObjectSubscriptionPlan", CatalogObjectAvailabilityPeriod, ] diff --git a/src/square/types/catalog_object_address.py b/src/square/types/catalog_object_address.py deleted file mode 100644 index 3ed110ec..00000000 --- a/src/square/types/catalog_object_address.py +++ /dev/null @@ -1,17 +0,0 @@ -# This file was auto-generated by Fern from our API Definition. - -from .catalog_object_base import CatalogObjectBase -from ..core.pydantic_utilities import IS_PYDANTIC_V2 -import typing -import pydantic - - -class CatalogObjectAddress(CatalogObjectBase): - if IS_PYDANTIC_V2: - model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 - else: - - class Config: - frozen = True - smart_union = True - extra = pydantic.Extra.allow diff --git a/src/square/types/catalog_object_availability_period.py b/src/square/types/catalog_object_availability_period.py index 0b8417a2..32a9532a 100644 --- a/src/square/types/catalog_object_availability_period.py +++ b/src/square/types/catalog_object_availability_period.py @@ -1,18 +1,107 @@ # This file was auto-generated by Fern from our API Definition. -from .catalog_object_base import CatalogObjectBase +from ..core.unchecked_base_model import UncheckedBaseModel import typing from .catalog_availability_period import CatalogAvailabilityPeriod import pydantic +from .catalog_custom_attribute_value import CatalogCustomAttributeValue +import typing_extensions +from .catalog_v1id import CatalogV1Id +from ..core.serialization import FieldMetadata from ..core.pydantic_utilities import IS_PYDANTIC_V2 -class CatalogObjectAvailabilityPeriod(CatalogObjectBase): +class CatalogObjectAvailabilityPeriod(UncheckedBaseModel): + type: typing.Literal["AVAILABILITY_PERIOD"] = "AVAILABILITY_PERIOD" availability_period_data: typing.Optional[CatalogAvailabilityPeriod] = pydantic.Field(default=None) """ Structured data for a `CatalogAvailabilityPeriod`, set for CatalogObjects of type `AVAILABILITY_PERIOD`. """ + id: str = pydantic.Field() + """ + 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. + """ + + updated_at: typing.Optional[str] = pydantic.Field(default=None) + """ + Last modification [timestamp](https://developer.squareup.com/docs/build-basics/working-with-dates) 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. + """ + + version: typing.Optional[int] = pydantic.Field(default=None) + """ + The version of the object. When updating an object, the version supplied + must match the version in the database, otherwise the write will be rejected as conflicting. + """ + + is_deleted: typing.Optional[bool] = pydantic.Field(default=None) + """ + 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. + """ + + custom_attribute_values: typing.Optional[typing.Dict[str, CatalogCustomAttributeValue]] = pydantic.Field( + default=None + ) + """ + A map (key-value pairs) of application-defined custom attribute values. The value of a key-value pair + is a [CatalogCustomAttributeValue](entity:CatalogCustomAttributeValue) object. The key is the `key` attribute + value defined in the associated [CatalogCustomAttributeDefinition](entity:CatalogCustomAttributeDefinition) + object defined by the application making the request. + + If the `CatalogCustomAttributeDefinition` object is + defined by another application, the `CatalogCustomAttributeDefinition`'s key attribute value is prefixed by + the defining application ID. For example, if the `CatalogCustomAttributeDefinition` has a `key` attribute of + `"cocoa_brand"` and the defining application ID is `"abcd1234"`, the key in the map is `"abcd1234:cocoa_brand"` + if the application making the request is different from the application defining the custom attribute definition. + Otherwise, the key used in the map is simply `"cocoa_brand"`. + + Application-defined custom attributes are set at a global (location-independent) level. + Custom attribute values are intended to store additional information about a catalog object + or associations with an entity in another system. Do not use custom attributes + to store any sensitive information (personally identifiable information, card details, etc.). + """ + + catalog_v1ids: typing_extensions.Annotated[ + typing.Optional[typing.List[CatalogV1Id]], FieldMetadata(alias="catalog_v1_ids") + ] = pydantic.Field(default=None) + """ + 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. + """ + + present_at_all_locations: typing.Optional[bool] = pydantic.Field(default=None) + """ + If `true`, this object is present at all locations (including future locations), except where specified in + the `absent_at_location_ids` field. If `false`, this object is not present at any locations (including future locations), + except where specified in the `present_at_location_ids` field. If not specified, defaults to `true`. + """ + + present_at_location_ids: typing.Optional[typing.List[str]] = pydantic.Field(default=None) + """ + A list of locations where the object is present, even if `present_at_all_locations` is `false`. + This can include locations that are deactivated. + """ + + absent_at_location_ids: typing.Optional[typing.List[str]] = pydantic.Field(default=None) + """ + A list of locations where the object is not present, even if `present_at_all_locations` is `true`. + This can include locations that are deactivated. + """ + + image_id: typing.Optional[str] = pydantic.Field(default=None) + """ + Identifies the `CatalogImage` attached to this `CatalogObject`. + """ + if IS_PYDANTIC_V2: model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 else: diff --git a/src/square/types/catalog_object_category.py b/src/square/types/catalog_object_category.py index 17ad0089..750a10fa 100644 --- a/src/square/types/catalog_object_category.py +++ b/src/square/types/catalog_object_category.py @@ -4,7 +4,6 @@ from ..core.unchecked_base_model import UncheckedBaseModel import typing import pydantic -from .catalog_object_type import CatalogObjectType from .catalog_custom_attribute_value import CatalogCustomAttributeValue import typing_extensions from .catalog_v1id import CatalogV1Id @@ -30,18 +29,12 @@ class CatalogObjectCategory(UncheckedBaseModel): The order of the object within the context of the category. """ + type: typing.Literal["CATEGORY"] = "CATEGORY" category_data: typing.Optional["CatalogCategory"] = pydantic.Field(default=None) """ Structured data for a `CatalogCategory`, set for CatalogObjects of type `CATEGORY`. """ - type: CatalogObjectType = pydantic.Field() - """ - The type of this object. Each object type has expected - properties expressed in a structured format within its corresponding `*_data` field below. - See [CatalogObjectType](#type-catalogobjecttype) for possible values - """ - updated_at: typing.Optional[str] = pydantic.Field(default=None) """ Last modification [timestamp](https://developer.squareup.com/docs/build-basics/working-with-dates) in RFC 3339 format, e.g., `"2016-08-15T23:59:33.123Z"` diff --git a/src/square/types/catalog_object_checkout_link.py b/src/square/types/catalog_object_checkout_link.py deleted file mode 100644 index ce46ed0b..00000000 --- a/src/square/types/catalog_object_checkout_link.py +++ /dev/null @@ -1,17 +0,0 @@ -# This file was auto-generated by Fern from our API Definition. - -from .catalog_object_base import CatalogObjectBase -from ..core.pydantic_utilities import IS_PYDANTIC_V2 -import typing -import pydantic - - -class CatalogObjectCheckoutLink(CatalogObjectBase): - if IS_PYDANTIC_V2: - model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 - else: - - class Config: - frozen = True - smart_union = True - extra = pydantic.Extra.allow diff --git a/src/square/types/catalog_object_component.py b/src/square/types/catalog_object_component.py deleted file mode 100644 index 0dc0a061..00000000 --- a/src/square/types/catalog_object_component.py +++ /dev/null @@ -1,17 +0,0 @@ -# This file was auto-generated by Fern from our API Definition. - -from .catalog_object_base import CatalogObjectBase -from ..core.pydantic_utilities import IS_PYDANTIC_V2 -import typing -import pydantic - - -class CatalogObjectComponent(CatalogObjectBase): - if IS_PYDANTIC_V2: - model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 - else: - - class Config: - frozen = True - smart_union = True - extra = pydantic.Extra.allow diff --git a/src/square/types/catalog_object_composition.py b/src/square/types/catalog_object_composition.py deleted file mode 100644 index f4a31909..00000000 --- a/src/square/types/catalog_object_composition.py +++ /dev/null @@ -1,17 +0,0 @@ -# This file was auto-generated by Fern from our API Definition. - -from .catalog_object_base import CatalogObjectBase -from ..core.pydantic_utilities import IS_PYDANTIC_V2 -import typing -import pydantic - - -class CatalogObjectComposition(CatalogObjectBase): - if IS_PYDANTIC_V2: - model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 - else: - - class Config: - frozen = True - smart_union = True - extra = pydantic.Extra.allow diff --git a/src/square/types/catalog_object_custom_attribute_definition.py b/src/square/types/catalog_object_custom_attribute_definition.py index d88f60c2..b80f70b6 100644 --- a/src/square/types/catalog_object_custom_attribute_definition.py +++ b/src/square/types/catalog_object_custom_attribute_definition.py @@ -1,18 +1,107 @@ # This file was auto-generated by Fern from our API Definition. -from .catalog_object_base import CatalogObjectBase +from ..core.unchecked_base_model import UncheckedBaseModel import typing from .catalog_custom_attribute_definition import CatalogCustomAttributeDefinition import pydantic +from .catalog_custom_attribute_value import CatalogCustomAttributeValue +import typing_extensions +from .catalog_v1id import CatalogV1Id +from ..core.serialization import FieldMetadata from ..core.pydantic_utilities import IS_PYDANTIC_V2 -class CatalogObjectCustomAttributeDefinition(CatalogObjectBase): +class CatalogObjectCustomAttributeDefinition(UncheckedBaseModel): + type: typing.Literal["CUSTOM_ATTRIBUTE_DEFINITION"] = "CUSTOM_ATTRIBUTE_DEFINITION" custom_attribute_definition_data: typing.Optional[CatalogCustomAttributeDefinition] = pydantic.Field(default=None) """ Structured data for a `CatalogCustomAttributeDefinition`, set for CatalogObjects of type `CUSTOM_ATTRIBUTE_DEFINITION`. """ + id: str = pydantic.Field() + """ + 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. + """ + + updated_at: typing.Optional[str] = pydantic.Field(default=None) + """ + Last modification [timestamp](https://developer.squareup.com/docs/build-basics/working-with-dates) 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. + """ + + version: typing.Optional[int] = pydantic.Field(default=None) + """ + The version of the object. When updating an object, the version supplied + must match the version in the database, otherwise the write will be rejected as conflicting. + """ + + is_deleted: typing.Optional[bool] = pydantic.Field(default=None) + """ + 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. + """ + + custom_attribute_values: typing.Optional[typing.Dict[str, CatalogCustomAttributeValue]] = pydantic.Field( + default=None + ) + """ + A map (key-value pairs) of application-defined custom attribute values. The value of a key-value pair + is a [CatalogCustomAttributeValue](entity:CatalogCustomAttributeValue) object. The key is the `key` attribute + value defined in the associated [CatalogCustomAttributeDefinition](entity:CatalogCustomAttributeDefinition) + object defined by the application making the request. + + If the `CatalogCustomAttributeDefinition` object is + defined by another application, the `CatalogCustomAttributeDefinition`'s key attribute value is prefixed by + the defining application ID. For example, if the `CatalogCustomAttributeDefinition` has a `key` attribute of + `"cocoa_brand"` and the defining application ID is `"abcd1234"`, the key in the map is `"abcd1234:cocoa_brand"` + if the application making the request is different from the application defining the custom attribute definition. + Otherwise, the key used in the map is simply `"cocoa_brand"`. + + Application-defined custom attributes are set at a global (location-independent) level. + Custom attribute values are intended to store additional information about a catalog object + or associations with an entity in another system. Do not use custom attributes + to store any sensitive information (personally identifiable information, card details, etc.). + """ + + catalog_v1ids: typing_extensions.Annotated[ + typing.Optional[typing.List[CatalogV1Id]], FieldMetadata(alias="catalog_v1_ids") + ] = pydantic.Field(default=None) + """ + 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. + """ + + present_at_all_locations: typing.Optional[bool] = pydantic.Field(default=None) + """ + If `true`, this object is present at all locations (including future locations), except where specified in + the `absent_at_location_ids` field. If `false`, this object is not present at any locations (including future locations), + except where specified in the `present_at_location_ids` field. If not specified, defaults to `true`. + """ + + present_at_location_ids: typing.Optional[typing.List[str]] = pydantic.Field(default=None) + """ + A list of locations where the object is present, even if `present_at_all_locations` is `false`. + This can include locations that are deactivated. + """ + + absent_at_location_ids: typing.Optional[typing.List[str]] = pydantic.Field(default=None) + """ + A list of locations where the object is not present, even if `present_at_all_locations` is `true`. + This can include locations that are deactivated. + """ + + image_id: typing.Optional[str] = pydantic.Field(default=None) + """ + Identifies the `CatalogImage` attached to this `CatalogObject`. + """ + if IS_PYDANTIC_V2: model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 else: diff --git a/src/square/types/catalog_object_dining_option.py b/src/square/types/catalog_object_dining_option.py deleted file mode 100644 index 43226db3..00000000 --- a/src/square/types/catalog_object_dining_option.py +++ /dev/null @@ -1,17 +0,0 @@ -# This file was auto-generated by Fern from our API Definition. - -from .catalog_object_base import CatalogObjectBase -from ..core.pydantic_utilities import IS_PYDANTIC_V2 -import typing -import pydantic - - -class CatalogObjectDiningOption(CatalogObjectBase): - if IS_PYDANTIC_V2: - model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 - else: - - class Config: - frozen = True - smart_union = True - extra = pydantic.Extra.allow diff --git a/src/square/types/catalog_object_discount.py b/src/square/types/catalog_object_discount.py index 41d7bb70..ea534797 100644 --- a/src/square/types/catalog_object_discount.py +++ b/src/square/types/catalog_object_discount.py @@ -1,18 +1,107 @@ # This file was auto-generated by Fern from our API Definition. -from .catalog_object_base import CatalogObjectBase +from ..core.unchecked_base_model import UncheckedBaseModel import typing from .catalog_discount import CatalogDiscount import pydantic +from .catalog_custom_attribute_value import CatalogCustomAttributeValue +import typing_extensions +from .catalog_v1id import CatalogV1Id +from ..core.serialization import FieldMetadata from ..core.pydantic_utilities import IS_PYDANTIC_V2 -class CatalogObjectDiscount(CatalogObjectBase): +class CatalogObjectDiscount(UncheckedBaseModel): + type: typing.Literal["DISCOUNT"] = "DISCOUNT" discount_data: typing.Optional[CatalogDiscount] = pydantic.Field(default=None) """ Structured data for a `CatalogDiscount`, set for CatalogObjects of type `DISCOUNT`. """ + id: str = pydantic.Field() + """ + 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. + """ + + updated_at: typing.Optional[str] = pydantic.Field(default=None) + """ + Last modification [timestamp](https://developer.squareup.com/docs/build-basics/working-with-dates) 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. + """ + + version: typing.Optional[int] = pydantic.Field(default=None) + """ + The version of the object. When updating an object, the version supplied + must match the version in the database, otherwise the write will be rejected as conflicting. + """ + + is_deleted: typing.Optional[bool] = pydantic.Field(default=None) + """ + 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. + """ + + custom_attribute_values: typing.Optional[typing.Dict[str, CatalogCustomAttributeValue]] = pydantic.Field( + default=None + ) + """ + A map (key-value pairs) of application-defined custom attribute values. The value of a key-value pair + is a [CatalogCustomAttributeValue](entity:CatalogCustomAttributeValue) object. The key is the `key` attribute + value defined in the associated [CatalogCustomAttributeDefinition](entity:CatalogCustomAttributeDefinition) + object defined by the application making the request. + + If the `CatalogCustomAttributeDefinition` object is + defined by another application, the `CatalogCustomAttributeDefinition`'s key attribute value is prefixed by + the defining application ID. For example, if the `CatalogCustomAttributeDefinition` has a `key` attribute of + `"cocoa_brand"` and the defining application ID is `"abcd1234"`, the key in the map is `"abcd1234:cocoa_brand"` + if the application making the request is different from the application defining the custom attribute definition. + Otherwise, the key used in the map is simply `"cocoa_brand"`. + + Application-defined custom attributes are set at a global (location-independent) level. + Custom attribute values are intended to store additional information about a catalog object + or associations with an entity in another system. Do not use custom attributes + to store any sensitive information (personally identifiable information, card details, etc.). + """ + + catalog_v1ids: typing_extensions.Annotated[ + typing.Optional[typing.List[CatalogV1Id]], FieldMetadata(alias="catalog_v1_ids") + ] = pydantic.Field(default=None) + """ + 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. + """ + + present_at_all_locations: typing.Optional[bool] = pydantic.Field(default=None) + """ + If `true`, this object is present at all locations (including future locations), except where specified in + the `absent_at_location_ids` field. If `false`, this object is not present at any locations (including future locations), + except where specified in the `present_at_location_ids` field. If not specified, defaults to `true`. + """ + + present_at_location_ids: typing.Optional[typing.List[str]] = pydantic.Field(default=None) + """ + A list of locations where the object is present, even if `present_at_all_locations` is `false`. + This can include locations that are deactivated. + """ + + absent_at_location_ids: typing.Optional[typing.List[str]] = pydantic.Field(default=None) + """ + A list of locations where the object is not present, even if `present_at_all_locations` is `true`. + This can include locations that are deactivated. + """ + + image_id: typing.Optional[str] = pydantic.Field(default=None) + """ + Identifies the `CatalogImage` attached to this `CatalogObject`. + """ + if IS_PYDANTIC_V2: model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 else: diff --git a/src/square/types/catalog_object_image.py b/src/square/types/catalog_object_image.py index cce313d7..0f638d49 100644 --- a/src/square/types/catalog_object_image.py +++ b/src/square/types/catalog_object_image.py @@ -1,18 +1,107 @@ # This file was auto-generated by Fern from our API Definition. -from .catalog_object_base import CatalogObjectBase +from ..core.unchecked_base_model import UncheckedBaseModel import typing from .catalog_image import CatalogImage import pydantic +from .catalog_custom_attribute_value import CatalogCustomAttributeValue +import typing_extensions +from .catalog_v1id import CatalogV1Id +from ..core.serialization import FieldMetadata from ..core.pydantic_utilities import IS_PYDANTIC_V2 -class CatalogObjectImage(CatalogObjectBase): +class CatalogObjectImage(UncheckedBaseModel): + type: typing.Literal["IMAGE"] = "IMAGE" image_data: typing.Optional[CatalogImage] = pydantic.Field(default=None) """ Structured data for a `CatalogImage`, set for CatalogObjects of type `IMAGE`. """ + id: str = pydantic.Field() + """ + 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. + """ + + updated_at: typing.Optional[str] = pydantic.Field(default=None) + """ + Last modification [timestamp](https://developer.squareup.com/docs/build-basics/working-with-dates) 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. + """ + + version: typing.Optional[int] = pydantic.Field(default=None) + """ + The version of the object. When updating an object, the version supplied + must match the version in the database, otherwise the write will be rejected as conflicting. + """ + + is_deleted: typing.Optional[bool] = pydantic.Field(default=None) + """ + 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. + """ + + custom_attribute_values: typing.Optional[typing.Dict[str, CatalogCustomAttributeValue]] = pydantic.Field( + default=None + ) + """ + A map (key-value pairs) of application-defined custom attribute values. The value of a key-value pair + is a [CatalogCustomAttributeValue](entity:CatalogCustomAttributeValue) object. The key is the `key` attribute + value defined in the associated [CatalogCustomAttributeDefinition](entity:CatalogCustomAttributeDefinition) + object defined by the application making the request. + + If the `CatalogCustomAttributeDefinition` object is + defined by another application, the `CatalogCustomAttributeDefinition`'s key attribute value is prefixed by + the defining application ID. For example, if the `CatalogCustomAttributeDefinition` has a `key` attribute of + `"cocoa_brand"` and the defining application ID is `"abcd1234"`, the key in the map is `"abcd1234:cocoa_brand"` + if the application making the request is different from the application defining the custom attribute definition. + Otherwise, the key used in the map is simply `"cocoa_brand"`. + + Application-defined custom attributes are set at a global (location-independent) level. + Custom attribute values are intended to store additional information about a catalog object + or associations with an entity in another system. Do not use custom attributes + to store any sensitive information (personally identifiable information, card details, etc.). + """ + + catalog_v1ids: typing_extensions.Annotated[ + typing.Optional[typing.List[CatalogV1Id]], FieldMetadata(alias="catalog_v1_ids") + ] = pydantic.Field(default=None) + """ + 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. + """ + + present_at_all_locations: typing.Optional[bool] = pydantic.Field(default=None) + """ + If `true`, this object is present at all locations (including future locations), except where specified in + the `absent_at_location_ids` field. If `false`, this object is not present at any locations (including future locations), + except where specified in the `present_at_location_ids` field. If not specified, defaults to `true`. + """ + + present_at_location_ids: typing.Optional[typing.List[str]] = pydantic.Field(default=None) + """ + A list of locations where the object is present, even if `present_at_all_locations` is `false`. + This can include locations that are deactivated. + """ + + absent_at_location_ids: typing.Optional[typing.List[str]] = pydantic.Field(default=None) + """ + A list of locations where the object is not present, even if `present_at_all_locations` is `true`. + This can include locations that are deactivated. + """ + + image_id: typing.Optional[str] = pydantic.Field(default=None) + """ + Identifies the `CatalogImage` attached to this `CatalogObject`. + """ + if IS_PYDANTIC_V2: model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 else: diff --git a/src/square/types/catalog_object_item.py b/src/square/types/catalog_object_item.py index 49c706b4..7f334f6e 100644 --- a/src/square/types/catalog_object_item.py +++ b/src/square/types/catalog_object_item.py @@ -1,21 +1,110 @@ # This file was auto-generated by Fern from our API Definition. from __future__ import annotations -from .catalog_object_base import CatalogObjectBase +from ..core.unchecked_base_model import UncheckedBaseModel from .catalog_category import CatalogCategory from .catalog_object_category import CatalogObjectCategory import typing import pydantic +from .catalog_custom_attribute_value import CatalogCustomAttributeValue +import typing_extensions +from .catalog_v1id import CatalogV1Id +from ..core.serialization import FieldMetadata from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.pydantic_utilities import update_forward_refs -class CatalogObjectItem(CatalogObjectBase): +class CatalogObjectItem(UncheckedBaseModel): + type: typing.Literal["ITEM"] = "ITEM" item_data: typing.Optional["CatalogItem"] = pydantic.Field(default=None) """ Structured data for a `CatalogItem`, set for CatalogObjects of type `ITEM`. """ + id: str = pydantic.Field() + """ + 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. + """ + + updated_at: typing.Optional[str] = pydantic.Field(default=None) + """ + Last modification [timestamp](https://developer.squareup.com/docs/build-basics/working-with-dates) 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. + """ + + version: typing.Optional[int] = pydantic.Field(default=None) + """ + The version of the object. When updating an object, the version supplied + must match the version in the database, otherwise the write will be rejected as conflicting. + """ + + is_deleted: typing.Optional[bool] = pydantic.Field(default=None) + """ + 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. + """ + + custom_attribute_values: typing.Optional[typing.Dict[str, CatalogCustomAttributeValue]] = pydantic.Field( + default=None + ) + """ + A map (key-value pairs) of application-defined custom attribute values. The value of a key-value pair + is a [CatalogCustomAttributeValue](entity:CatalogCustomAttributeValue) object. The key is the `key` attribute + value defined in the associated [CatalogCustomAttributeDefinition](entity:CatalogCustomAttributeDefinition) + object defined by the application making the request. + + If the `CatalogCustomAttributeDefinition` object is + defined by another application, the `CatalogCustomAttributeDefinition`'s key attribute value is prefixed by + the defining application ID. For example, if the `CatalogCustomAttributeDefinition` has a `key` attribute of + `"cocoa_brand"` and the defining application ID is `"abcd1234"`, the key in the map is `"abcd1234:cocoa_brand"` + if the application making the request is different from the application defining the custom attribute definition. + Otherwise, the key used in the map is simply `"cocoa_brand"`. + + Application-defined custom attributes are set at a global (location-independent) level. + Custom attribute values are intended to store additional information about a catalog object + or associations with an entity in another system. Do not use custom attributes + to store any sensitive information (personally identifiable information, card details, etc.). + """ + + catalog_v1ids: typing_extensions.Annotated[ + typing.Optional[typing.List[CatalogV1Id]], FieldMetadata(alias="catalog_v1_ids") + ] = pydantic.Field(default=None) + """ + 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. + """ + + present_at_all_locations: typing.Optional[bool] = pydantic.Field(default=None) + """ + If `true`, this object is present at all locations (including future locations), except where specified in + the `absent_at_location_ids` field. If `false`, this object is not present at any locations (including future locations), + except where specified in the `present_at_location_ids` field. If not specified, defaults to `true`. + """ + + present_at_location_ids: typing.Optional[typing.List[str]] = pydantic.Field(default=None) + """ + A list of locations where the object is present, even if `present_at_all_locations` is `false`. + This can include locations that are deactivated. + """ + + absent_at_location_ids: typing.Optional[typing.List[str]] = pydantic.Field(default=None) + """ + A list of locations where the object is not present, even if `present_at_all_locations` is `true`. + This can include locations that are deactivated. + """ + + image_id: typing.Optional[str] = pydantic.Field(default=None) + """ + Identifies the `CatalogImage` attached to this `CatalogObject`. + """ + if IS_PYDANTIC_V2: model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 else: diff --git a/src/square/types/catalog_object_item_option.py b/src/square/types/catalog_object_item_option.py index 4341458d..f01bb65e 100644 --- a/src/square/types/catalog_object_item_option.py +++ b/src/square/types/catalog_object_item_option.py @@ -1,21 +1,110 @@ # This file was auto-generated by Fern from our API Definition. from __future__ import annotations -from .catalog_object_base import CatalogObjectBase +from ..core.unchecked_base_model import UncheckedBaseModel from .catalog_category import CatalogCategory from .catalog_object_category import CatalogObjectCategory import typing import pydantic +from .catalog_custom_attribute_value import CatalogCustomAttributeValue +import typing_extensions +from .catalog_v1id import CatalogV1Id +from ..core.serialization import FieldMetadata from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.pydantic_utilities import update_forward_refs -class CatalogObjectItemOption(CatalogObjectBase): +class CatalogObjectItemOption(UncheckedBaseModel): + type: typing.Literal["ITEM_OPTION"] = "ITEM_OPTION" item_option_data: typing.Optional["CatalogItemOption"] = pydantic.Field(default=None) """ Structured data for a `CatalogItemOption`, set for CatalogObjects of type `ITEM_OPTION`. """ + id: str = pydantic.Field() + """ + 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. + """ + + updated_at: typing.Optional[str] = pydantic.Field(default=None) + """ + Last modification [timestamp](https://developer.squareup.com/docs/build-basics/working-with-dates) 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. + """ + + version: typing.Optional[int] = pydantic.Field(default=None) + """ + The version of the object. When updating an object, the version supplied + must match the version in the database, otherwise the write will be rejected as conflicting. + """ + + is_deleted: typing.Optional[bool] = pydantic.Field(default=None) + """ + 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. + """ + + custom_attribute_values: typing.Optional[typing.Dict[str, CatalogCustomAttributeValue]] = pydantic.Field( + default=None + ) + """ + A map (key-value pairs) of application-defined custom attribute values. The value of a key-value pair + is a [CatalogCustomAttributeValue](entity:CatalogCustomAttributeValue) object. The key is the `key` attribute + value defined in the associated [CatalogCustomAttributeDefinition](entity:CatalogCustomAttributeDefinition) + object defined by the application making the request. + + If the `CatalogCustomAttributeDefinition` object is + defined by another application, the `CatalogCustomAttributeDefinition`'s key attribute value is prefixed by + the defining application ID. For example, if the `CatalogCustomAttributeDefinition` has a `key` attribute of + `"cocoa_brand"` and the defining application ID is `"abcd1234"`, the key in the map is `"abcd1234:cocoa_brand"` + if the application making the request is different from the application defining the custom attribute definition. + Otherwise, the key used in the map is simply `"cocoa_brand"`. + + Application-defined custom attributes are set at a global (location-independent) level. + Custom attribute values are intended to store additional information about a catalog object + or associations with an entity in another system. Do not use custom attributes + to store any sensitive information (personally identifiable information, card details, etc.). + """ + + catalog_v1ids: typing_extensions.Annotated[ + typing.Optional[typing.List[CatalogV1Id]], FieldMetadata(alias="catalog_v1_ids") + ] = pydantic.Field(default=None) + """ + 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. + """ + + present_at_all_locations: typing.Optional[bool] = pydantic.Field(default=None) + """ + If `true`, this object is present at all locations (including future locations), except where specified in + the `absent_at_location_ids` field. If `false`, this object is not present at any locations (including future locations), + except where specified in the `present_at_location_ids` field. If not specified, defaults to `true`. + """ + + present_at_location_ids: typing.Optional[typing.List[str]] = pydantic.Field(default=None) + """ + A list of locations where the object is present, even if `present_at_all_locations` is `false`. + This can include locations that are deactivated. + """ + + absent_at_location_ids: typing.Optional[typing.List[str]] = pydantic.Field(default=None) + """ + A list of locations where the object is not present, even if `present_at_all_locations` is `true`. + This can include locations that are deactivated. + """ + + image_id: typing.Optional[str] = pydantic.Field(default=None) + """ + Identifies the `CatalogImage` attached to this `CatalogObject`. + """ + if IS_PYDANTIC_V2: model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 else: diff --git a/src/square/types/catalog_object_item_option_value.py b/src/square/types/catalog_object_item_option_value.py index c41e11ab..ec9e294b 100644 --- a/src/square/types/catalog_object_item_option_value.py +++ b/src/square/types/catalog_object_item_option_value.py @@ -1,18 +1,107 @@ # This file was auto-generated by Fern from our API Definition. -from .catalog_object_base import CatalogObjectBase +from ..core.unchecked_base_model import UncheckedBaseModel import typing from .catalog_item_option_value import CatalogItemOptionValue import pydantic +from .catalog_custom_attribute_value import CatalogCustomAttributeValue +import typing_extensions +from .catalog_v1id import CatalogV1Id +from ..core.serialization import FieldMetadata from ..core.pydantic_utilities import IS_PYDANTIC_V2 -class CatalogObjectItemOptionValue(CatalogObjectBase): +class CatalogObjectItemOptionValue(UncheckedBaseModel): + type: typing.Literal["ITEM_OPTION_VAL"] = "ITEM_OPTION_VAL" item_option_value_data: typing.Optional[CatalogItemOptionValue] = pydantic.Field(default=None) """ Structured data for a `CatalogItemOptionValue`, set for CatalogObjects of type `ITEM_OPTION_VAL`. """ + id: str = pydantic.Field() + """ + 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. + """ + + updated_at: typing.Optional[str] = pydantic.Field(default=None) + """ + Last modification [timestamp](https://developer.squareup.com/docs/build-basics/working-with-dates) 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. + """ + + version: typing.Optional[int] = pydantic.Field(default=None) + """ + The version of the object. When updating an object, the version supplied + must match the version in the database, otherwise the write will be rejected as conflicting. + """ + + is_deleted: typing.Optional[bool] = pydantic.Field(default=None) + """ + 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. + """ + + custom_attribute_values: typing.Optional[typing.Dict[str, CatalogCustomAttributeValue]] = pydantic.Field( + default=None + ) + """ + A map (key-value pairs) of application-defined custom attribute values. The value of a key-value pair + is a [CatalogCustomAttributeValue](entity:CatalogCustomAttributeValue) object. The key is the `key` attribute + value defined in the associated [CatalogCustomAttributeDefinition](entity:CatalogCustomAttributeDefinition) + object defined by the application making the request. + + If the `CatalogCustomAttributeDefinition` object is + defined by another application, the `CatalogCustomAttributeDefinition`'s key attribute value is prefixed by + the defining application ID. For example, if the `CatalogCustomAttributeDefinition` has a `key` attribute of + `"cocoa_brand"` and the defining application ID is `"abcd1234"`, the key in the map is `"abcd1234:cocoa_brand"` + if the application making the request is different from the application defining the custom attribute definition. + Otherwise, the key used in the map is simply `"cocoa_brand"`. + + Application-defined custom attributes are set at a global (location-independent) level. + Custom attribute values are intended to store additional information about a catalog object + or associations with an entity in another system. Do not use custom attributes + to store any sensitive information (personally identifiable information, card details, etc.). + """ + + catalog_v1ids: typing_extensions.Annotated[ + typing.Optional[typing.List[CatalogV1Id]], FieldMetadata(alias="catalog_v1_ids") + ] = pydantic.Field(default=None) + """ + 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. + """ + + present_at_all_locations: typing.Optional[bool] = pydantic.Field(default=None) + """ + If `true`, this object is present at all locations (including future locations), except where specified in + the `absent_at_location_ids` field. If `false`, this object is not present at any locations (including future locations), + except where specified in the `present_at_location_ids` field. If not specified, defaults to `true`. + """ + + present_at_location_ids: typing.Optional[typing.List[str]] = pydantic.Field(default=None) + """ + A list of locations where the object is present, even if `present_at_all_locations` is `false`. + This can include locations that are deactivated. + """ + + absent_at_location_ids: typing.Optional[typing.List[str]] = pydantic.Field(default=None) + """ + A list of locations where the object is not present, even if `present_at_all_locations` is `true`. + This can include locations that are deactivated. + """ + + image_id: typing.Optional[str] = pydantic.Field(default=None) + """ + Identifies the `CatalogImage` attached to this `CatalogObject`. + """ + if IS_PYDANTIC_V2: model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 else: diff --git a/src/square/types/catalog_object_item_variation.py b/src/square/types/catalog_object_item_variation.py index 0b0e6d9a..66bc0ef9 100644 --- a/src/square/types/catalog_object_item_variation.py +++ b/src/square/types/catalog_object_item_variation.py @@ -1,18 +1,107 @@ # This file was auto-generated by Fern from our API Definition. -from .catalog_object_base import CatalogObjectBase +from ..core.unchecked_base_model import UncheckedBaseModel import typing from .catalog_item_variation import CatalogItemVariation import pydantic +from .catalog_custom_attribute_value import CatalogCustomAttributeValue +import typing_extensions +from .catalog_v1id import CatalogV1Id +from ..core.serialization import FieldMetadata from ..core.pydantic_utilities import IS_PYDANTIC_V2 -class CatalogObjectItemVariation(CatalogObjectBase): +class CatalogObjectItemVariation(UncheckedBaseModel): + type: typing.Literal["ITEM_VARIATION"] = "ITEM_VARIATION" item_variation_data: typing.Optional[CatalogItemVariation] = pydantic.Field(default=None) """ Structured data for a `CatalogItemVariation`, set for CatalogObjects of type `ITEM_VARIATION`. """ + id: str = pydantic.Field() + """ + 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. + """ + + updated_at: typing.Optional[str] = pydantic.Field(default=None) + """ + Last modification [timestamp](https://developer.squareup.com/docs/build-basics/working-with-dates) 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. + """ + + version: typing.Optional[int] = pydantic.Field(default=None) + """ + The version of the object. When updating an object, the version supplied + must match the version in the database, otherwise the write will be rejected as conflicting. + """ + + is_deleted: typing.Optional[bool] = pydantic.Field(default=None) + """ + 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. + """ + + custom_attribute_values: typing.Optional[typing.Dict[str, CatalogCustomAttributeValue]] = pydantic.Field( + default=None + ) + """ + A map (key-value pairs) of application-defined custom attribute values. The value of a key-value pair + is a [CatalogCustomAttributeValue](entity:CatalogCustomAttributeValue) object. The key is the `key` attribute + value defined in the associated [CatalogCustomAttributeDefinition](entity:CatalogCustomAttributeDefinition) + object defined by the application making the request. + + If the `CatalogCustomAttributeDefinition` object is + defined by another application, the `CatalogCustomAttributeDefinition`'s key attribute value is prefixed by + the defining application ID. For example, if the `CatalogCustomAttributeDefinition` has a `key` attribute of + `"cocoa_brand"` and the defining application ID is `"abcd1234"`, the key in the map is `"abcd1234:cocoa_brand"` + if the application making the request is different from the application defining the custom attribute definition. + Otherwise, the key used in the map is simply `"cocoa_brand"`. + + Application-defined custom attributes are set at a global (location-independent) level. + Custom attribute values are intended to store additional information about a catalog object + or associations with an entity in another system. Do not use custom attributes + to store any sensitive information (personally identifiable information, card details, etc.). + """ + + catalog_v1ids: typing_extensions.Annotated[ + typing.Optional[typing.List[CatalogV1Id]], FieldMetadata(alias="catalog_v1_ids") + ] = pydantic.Field(default=None) + """ + 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. + """ + + present_at_all_locations: typing.Optional[bool] = pydantic.Field(default=None) + """ + If `true`, this object is present at all locations (including future locations), except where specified in + the `absent_at_location_ids` field. If `false`, this object is not present at any locations (including future locations), + except where specified in the `present_at_location_ids` field. If not specified, defaults to `true`. + """ + + present_at_location_ids: typing.Optional[typing.List[str]] = pydantic.Field(default=None) + """ + A list of locations where the object is present, even if `present_at_all_locations` is `false`. + This can include locations that are deactivated. + """ + + absent_at_location_ids: typing.Optional[typing.List[str]] = pydantic.Field(default=None) + """ + A list of locations where the object is not present, even if `present_at_all_locations` is `true`. + This can include locations that are deactivated. + """ + + image_id: typing.Optional[str] = pydantic.Field(default=None) + """ + Identifies the `CatalogImage` attached to this `CatalogObject`. + """ + if IS_PYDANTIC_V2: model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 else: diff --git a/src/square/types/catalog_object_measurement_unit.py b/src/square/types/catalog_object_measurement_unit.py index 95cf47de..ef2fc943 100644 --- a/src/square/types/catalog_object_measurement_unit.py +++ b/src/square/types/catalog_object_measurement_unit.py @@ -1,18 +1,107 @@ # This file was auto-generated by Fern from our API Definition. -from .catalog_object_base import CatalogObjectBase +from ..core.unchecked_base_model import UncheckedBaseModel import typing from .catalog_measurement_unit import CatalogMeasurementUnit import pydantic +from .catalog_custom_attribute_value import CatalogCustomAttributeValue +import typing_extensions +from .catalog_v1id import CatalogV1Id +from ..core.serialization import FieldMetadata from ..core.pydantic_utilities import IS_PYDANTIC_V2 -class CatalogObjectMeasurementUnit(CatalogObjectBase): +class CatalogObjectMeasurementUnit(UncheckedBaseModel): + type: typing.Literal["MEASUREMENT_UNIT"] = "MEASUREMENT_UNIT" measurement_unit_data: typing.Optional[CatalogMeasurementUnit] = pydantic.Field(default=None) """ Structured data for a `CatalogMeasurementUnit`, set for CatalogObjects of type `MEASUREMENT_UNIT`. """ + id: str = pydantic.Field() + """ + 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. + """ + + updated_at: typing.Optional[str] = pydantic.Field(default=None) + """ + Last modification [timestamp](https://developer.squareup.com/docs/build-basics/working-with-dates) 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. + """ + + version: typing.Optional[int] = pydantic.Field(default=None) + """ + The version of the object. When updating an object, the version supplied + must match the version in the database, otherwise the write will be rejected as conflicting. + """ + + is_deleted: typing.Optional[bool] = pydantic.Field(default=None) + """ + 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. + """ + + custom_attribute_values: typing.Optional[typing.Dict[str, CatalogCustomAttributeValue]] = pydantic.Field( + default=None + ) + """ + A map (key-value pairs) of application-defined custom attribute values. The value of a key-value pair + is a [CatalogCustomAttributeValue](entity:CatalogCustomAttributeValue) object. The key is the `key` attribute + value defined in the associated [CatalogCustomAttributeDefinition](entity:CatalogCustomAttributeDefinition) + object defined by the application making the request. + + If the `CatalogCustomAttributeDefinition` object is + defined by another application, the `CatalogCustomAttributeDefinition`'s key attribute value is prefixed by + the defining application ID. For example, if the `CatalogCustomAttributeDefinition` has a `key` attribute of + `"cocoa_brand"` and the defining application ID is `"abcd1234"`, the key in the map is `"abcd1234:cocoa_brand"` + if the application making the request is different from the application defining the custom attribute definition. + Otherwise, the key used in the map is simply `"cocoa_brand"`. + + Application-defined custom attributes are set at a global (location-independent) level. + Custom attribute values are intended to store additional information about a catalog object + or associations with an entity in another system. Do not use custom attributes + to store any sensitive information (personally identifiable information, card details, etc.). + """ + + catalog_v1ids: typing_extensions.Annotated[ + typing.Optional[typing.List[CatalogV1Id]], FieldMetadata(alias="catalog_v1_ids") + ] = pydantic.Field(default=None) + """ + 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. + """ + + present_at_all_locations: typing.Optional[bool] = pydantic.Field(default=None) + """ + If `true`, this object is present at all locations (including future locations), except where specified in + the `absent_at_location_ids` field. If `false`, this object is not present at any locations (including future locations), + except where specified in the `present_at_location_ids` field. If not specified, defaults to `true`. + """ + + present_at_location_ids: typing.Optional[typing.List[str]] = pydantic.Field(default=None) + """ + A list of locations where the object is present, even if `present_at_all_locations` is `false`. + This can include locations that are deactivated. + """ + + absent_at_location_ids: typing.Optional[typing.List[str]] = pydantic.Field(default=None) + """ + A list of locations where the object is not present, even if `present_at_all_locations` is `true`. + This can include locations that are deactivated. + """ + + image_id: typing.Optional[str] = pydantic.Field(default=None) + """ + Identifies the `CatalogImage` attached to this `CatalogObject`. + """ + if IS_PYDANTIC_V2: model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 else: diff --git a/src/square/types/catalog_object_modifier.py b/src/square/types/catalog_object_modifier.py index d2a8750c..a73e8e47 100644 --- a/src/square/types/catalog_object_modifier.py +++ b/src/square/types/catalog_object_modifier.py @@ -1,18 +1,107 @@ # This file was auto-generated by Fern from our API Definition. -from .catalog_object_base import CatalogObjectBase +from ..core.unchecked_base_model import UncheckedBaseModel import typing from .catalog_modifier import CatalogModifier import pydantic +from .catalog_custom_attribute_value import CatalogCustomAttributeValue +import typing_extensions +from .catalog_v1id import CatalogV1Id +from ..core.serialization import FieldMetadata from ..core.pydantic_utilities import IS_PYDANTIC_V2 -class CatalogObjectModifier(CatalogObjectBase): +class CatalogObjectModifier(UncheckedBaseModel): + type: typing.Literal["MODIFIER"] = "MODIFIER" modifier_data: typing.Optional[CatalogModifier] = pydantic.Field(default=None) """ Structured data for a `CatalogModifier`, set for CatalogObjects of type `MODIFIER`. """ + id: str = pydantic.Field() + """ + 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. + """ + + updated_at: typing.Optional[str] = pydantic.Field(default=None) + """ + Last modification [timestamp](https://developer.squareup.com/docs/build-basics/working-with-dates) 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. + """ + + version: typing.Optional[int] = pydantic.Field(default=None) + """ + The version of the object. When updating an object, the version supplied + must match the version in the database, otherwise the write will be rejected as conflicting. + """ + + is_deleted: typing.Optional[bool] = pydantic.Field(default=None) + """ + 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. + """ + + custom_attribute_values: typing.Optional[typing.Dict[str, CatalogCustomAttributeValue]] = pydantic.Field( + default=None + ) + """ + A map (key-value pairs) of application-defined custom attribute values. The value of a key-value pair + is a [CatalogCustomAttributeValue](entity:CatalogCustomAttributeValue) object. The key is the `key` attribute + value defined in the associated [CatalogCustomAttributeDefinition](entity:CatalogCustomAttributeDefinition) + object defined by the application making the request. + + If the `CatalogCustomAttributeDefinition` object is + defined by another application, the `CatalogCustomAttributeDefinition`'s key attribute value is prefixed by + the defining application ID. For example, if the `CatalogCustomAttributeDefinition` has a `key` attribute of + `"cocoa_brand"` and the defining application ID is `"abcd1234"`, the key in the map is `"abcd1234:cocoa_brand"` + if the application making the request is different from the application defining the custom attribute definition. + Otherwise, the key used in the map is simply `"cocoa_brand"`. + + Application-defined custom attributes are set at a global (location-independent) level. + Custom attribute values are intended to store additional information about a catalog object + or associations with an entity in another system. Do not use custom attributes + to store any sensitive information (personally identifiable information, card details, etc.). + """ + + catalog_v1ids: typing_extensions.Annotated[ + typing.Optional[typing.List[CatalogV1Id]], FieldMetadata(alias="catalog_v1_ids") + ] = pydantic.Field(default=None) + """ + 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. + """ + + present_at_all_locations: typing.Optional[bool] = pydantic.Field(default=None) + """ + If `true`, this object is present at all locations (including future locations), except where specified in + the `absent_at_location_ids` field. If `false`, this object is not present at any locations (including future locations), + except where specified in the `present_at_location_ids` field. If not specified, defaults to `true`. + """ + + present_at_location_ids: typing.Optional[typing.List[str]] = pydantic.Field(default=None) + """ + A list of locations where the object is present, even if `present_at_all_locations` is `false`. + This can include locations that are deactivated. + """ + + absent_at_location_ids: typing.Optional[typing.List[str]] = pydantic.Field(default=None) + """ + A list of locations where the object is not present, even if `present_at_all_locations` is `true`. + This can include locations that are deactivated. + """ + + image_id: typing.Optional[str] = pydantic.Field(default=None) + """ + Identifies the `CatalogImage` attached to this `CatalogObject`. + """ + if IS_PYDANTIC_V2: model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 else: diff --git a/src/square/types/catalog_object_modifier_list.py b/src/square/types/catalog_object_modifier_list.py index 15e95381..5c89ee17 100644 --- a/src/square/types/catalog_object_modifier_list.py +++ b/src/square/types/catalog_object_modifier_list.py @@ -1,21 +1,110 @@ # This file was auto-generated by Fern from our API Definition. from __future__ import annotations -from .catalog_object_base import CatalogObjectBase +from ..core.unchecked_base_model import UncheckedBaseModel from .catalog_category import CatalogCategory from .catalog_object_category import CatalogObjectCategory import typing import pydantic +from .catalog_custom_attribute_value import CatalogCustomAttributeValue +import typing_extensions +from .catalog_v1id import CatalogV1Id +from ..core.serialization import FieldMetadata from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.pydantic_utilities import update_forward_refs -class CatalogObjectModifierList(CatalogObjectBase): +class CatalogObjectModifierList(UncheckedBaseModel): + type: typing.Literal["MODIFIER_LIST"] = "MODIFIER_LIST" modifier_list_data: typing.Optional["CatalogModifierList"] = pydantic.Field(default=None) """ Structured data for a `CatalogModifierList`, set for CatalogObjects of type `MODIFIER_LIST`. """ + id: str = pydantic.Field() + """ + 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. + """ + + updated_at: typing.Optional[str] = pydantic.Field(default=None) + """ + Last modification [timestamp](https://developer.squareup.com/docs/build-basics/working-with-dates) 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. + """ + + version: typing.Optional[int] = pydantic.Field(default=None) + """ + The version of the object. When updating an object, the version supplied + must match the version in the database, otherwise the write will be rejected as conflicting. + """ + + is_deleted: typing.Optional[bool] = pydantic.Field(default=None) + """ + 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. + """ + + custom_attribute_values: typing.Optional[typing.Dict[str, CatalogCustomAttributeValue]] = pydantic.Field( + default=None + ) + """ + A map (key-value pairs) of application-defined custom attribute values. The value of a key-value pair + is a [CatalogCustomAttributeValue](entity:CatalogCustomAttributeValue) object. The key is the `key` attribute + value defined in the associated [CatalogCustomAttributeDefinition](entity:CatalogCustomAttributeDefinition) + object defined by the application making the request. + + If the `CatalogCustomAttributeDefinition` object is + defined by another application, the `CatalogCustomAttributeDefinition`'s key attribute value is prefixed by + the defining application ID. For example, if the `CatalogCustomAttributeDefinition` has a `key` attribute of + `"cocoa_brand"` and the defining application ID is `"abcd1234"`, the key in the map is `"abcd1234:cocoa_brand"` + if the application making the request is different from the application defining the custom attribute definition. + Otherwise, the key used in the map is simply `"cocoa_brand"`. + + Application-defined custom attributes are set at a global (location-independent) level. + Custom attribute values are intended to store additional information about a catalog object + or associations with an entity in another system. Do not use custom attributes + to store any sensitive information (personally identifiable information, card details, etc.). + """ + + catalog_v1ids: typing_extensions.Annotated[ + typing.Optional[typing.List[CatalogV1Id]], FieldMetadata(alias="catalog_v1_ids") + ] = pydantic.Field(default=None) + """ + 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. + """ + + present_at_all_locations: typing.Optional[bool] = pydantic.Field(default=None) + """ + If `true`, this object is present at all locations (including future locations), except where specified in + the `absent_at_location_ids` field. If `false`, this object is not present at any locations (including future locations), + except where specified in the `present_at_location_ids` field. If not specified, defaults to `true`. + """ + + present_at_location_ids: typing.Optional[typing.List[str]] = pydantic.Field(default=None) + """ + A list of locations where the object is present, even if `present_at_all_locations` is `false`. + This can include locations that are deactivated. + """ + + absent_at_location_ids: typing.Optional[typing.List[str]] = pydantic.Field(default=None) + """ + A list of locations where the object is not present, even if `present_at_all_locations` is `true`. + This can include locations that are deactivated. + """ + + image_id: typing.Optional[str] = pydantic.Field(default=None) + """ + Identifies the `CatalogImage` attached to this `CatalogObject`. + """ + if IS_PYDANTIC_V2: model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 else: diff --git a/src/square/types/catalog_object_pricing_rule.py b/src/square/types/catalog_object_pricing_rule.py index 7630e738..ed3ecf78 100644 --- a/src/square/types/catalog_object_pricing_rule.py +++ b/src/square/types/catalog_object_pricing_rule.py @@ -1,19 +1,108 @@ # This file was auto-generated by Fern from our API Definition. -from .catalog_object_base import CatalogObjectBase +from ..core.unchecked_base_model import UncheckedBaseModel import typing from .catalog_pricing_rule import CatalogPricingRule import pydantic +from .catalog_custom_attribute_value import CatalogCustomAttributeValue +import typing_extensions +from .catalog_v1id import CatalogV1Id +from ..core.serialization import FieldMetadata from ..core.pydantic_utilities import IS_PYDANTIC_V2 -class CatalogObjectPricingRule(CatalogObjectBase): +class CatalogObjectPricingRule(UncheckedBaseModel): + type: typing.Literal["PRICING_RULE"] = "PRICING_RULE" pricing_rule_data: typing.Optional[CatalogPricingRule] = pydantic.Field(default=None) """ Structured data for a `CatalogPricingRule`, set for CatalogObjects of type `PRICING_RULE`. A `CatalogPricingRule` object often works with a `CatalogProductSet` object or a `CatalogTimePeriod` object. """ + id: str = pydantic.Field() + """ + 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. + """ + + updated_at: typing.Optional[str] = pydantic.Field(default=None) + """ + Last modification [timestamp](https://developer.squareup.com/docs/build-basics/working-with-dates) 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. + """ + + version: typing.Optional[int] = pydantic.Field(default=None) + """ + The version of the object. When updating an object, the version supplied + must match the version in the database, otherwise the write will be rejected as conflicting. + """ + + is_deleted: typing.Optional[bool] = pydantic.Field(default=None) + """ + 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. + """ + + custom_attribute_values: typing.Optional[typing.Dict[str, CatalogCustomAttributeValue]] = pydantic.Field( + default=None + ) + """ + A map (key-value pairs) of application-defined custom attribute values. The value of a key-value pair + is a [CatalogCustomAttributeValue](entity:CatalogCustomAttributeValue) object. The key is the `key` attribute + value defined in the associated [CatalogCustomAttributeDefinition](entity:CatalogCustomAttributeDefinition) + object defined by the application making the request. + + If the `CatalogCustomAttributeDefinition` object is + defined by another application, the `CatalogCustomAttributeDefinition`'s key attribute value is prefixed by + the defining application ID. For example, if the `CatalogCustomAttributeDefinition` has a `key` attribute of + `"cocoa_brand"` and the defining application ID is `"abcd1234"`, the key in the map is `"abcd1234:cocoa_brand"` + if the application making the request is different from the application defining the custom attribute definition. + Otherwise, the key used in the map is simply `"cocoa_brand"`. + + Application-defined custom attributes are set at a global (location-independent) level. + Custom attribute values are intended to store additional information about a catalog object + or associations with an entity in another system. Do not use custom attributes + to store any sensitive information (personally identifiable information, card details, etc.). + """ + + catalog_v1ids: typing_extensions.Annotated[ + typing.Optional[typing.List[CatalogV1Id]], FieldMetadata(alias="catalog_v1_ids") + ] = pydantic.Field(default=None) + """ + 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. + """ + + present_at_all_locations: typing.Optional[bool] = pydantic.Field(default=None) + """ + If `true`, this object is present at all locations (including future locations), except where specified in + the `absent_at_location_ids` field. If `false`, this object is not present at any locations (including future locations), + except where specified in the `present_at_location_ids` field. If not specified, defaults to `true`. + """ + + present_at_location_ids: typing.Optional[typing.List[str]] = pydantic.Field(default=None) + """ + A list of locations where the object is present, even if `present_at_all_locations` is `false`. + This can include locations that are deactivated. + """ + + absent_at_location_ids: typing.Optional[typing.List[str]] = pydantic.Field(default=None) + """ + A list of locations where the object is not present, even if `present_at_all_locations` is `true`. + This can include locations that are deactivated. + """ + + image_id: typing.Optional[str] = pydantic.Field(default=None) + """ + Identifies the `CatalogImage` attached to this `CatalogObject`. + """ + if IS_PYDANTIC_V2: model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 else: diff --git a/src/square/types/catalog_object_product_set.py b/src/square/types/catalog_object_product_set.py index 56ba2313..323a16d1 100644 --- a/src/square/types/catalog_object_product_set.py +++ b/src/square/types/catalog_object_product_set.py @@ -1,18 +1,107 @@ # This file was auto-generated by Fern from our API Definition. -from .catalog_object_base import CatalogObjectBase +from ..core.unchecked_base_model import UncheckedBaseModel import typing from .catalog_product_set import CatalogProductSet import pydantic +from .catalog_custom_attribute_value import CatalogCustomAttributeValue +import typing_extensions +from .catalog_v1id import CatalogV1Id +from ..core.serialization import FieldMetadata from ..core.pydantic_utilities import IS_PYDANTIC_V2 -class CatalogObjectProductSet(CatalogObjectBase): +class CatalogObjectProductSet(UncheckedBaseModel): + type: typing.Literal["PRODUCT_SET"] = "PRODUCT_SET" product_set_data: typing.Optional[CatalogProductSet] = pydantic.Field(default=None) """ Structured data for a `CatalogProductSet`, set for CatalogObjects of type `PRODUCT_SET`. """ + id: str = pydantic.Field() + """ + 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. + """ + + updated_at: typing.Optional[str] = pydantic.Field(default=None) + """ + Last modification [timestamp](https://developer.squareup.com/docs/build-basics/working-with-dates) 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. + """ + + version: typing.Optional[int] = pydantic.Field(default=None) + """ + The version of the object. When updating an object, the version supplied + must match the version in the database, otherwise the write will be rejected as conflicting. + """ + + is_deleted: typing.Optional[bool] = pydantic.Field(default=None) + """ + 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. + """ + + custom_attribute_values: typing.Optional[typing.Dict[str, CatalogCustomAttributeValue]] = pydantic.Field( + default=None + ) + """ + A map (key-value pairs) of application-defined custom attribute values. The value of a key-value pair + is a [CatalogCustomAttributeValue](entity:CatalogCustomAttributeValue) object. The key is the `key` attribute + value defined in the associated [CatalogCustomAttributeDefinition](entity:CatalogCustomAttributeDefinition) + object defined by the application making the request. + + If the `CatalogCustomAttributeDefinition` object is + defined by another application, the `CatalogCustomAttributeDefinition`'s key attribute value is prefixed by + the defining application ID. For example, if the `CatalogCustomAttributeDefinition` has a `key` attribute of + `"cocoa_brand"` and the defining application ID is `"abcd1234"`, the key in the map is `"abcd1234:cocoa_brand"` + if the application making the request is different from the application defining the custom attribute definition. + Otherwise, the key used in the map is simply `"cocoa_brand"`. + + Application-defined custom attributes are set at a global (location-independent) level. + Custom attribute values are intended to store additional information about a catalog object + or associations with an entity in another system. Do not use custom attributes + to store any sensitive information (personally identifiable information, card details, etc.). + """ + + catalog_v1ids: typing_extensions.Annotated[ + typing.Optional[typing.List[CatalogV1Id]], FieldMetadata(alias="catalog_v1_ids") + ] = pydantic.Field(default=None) + """ + 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. + """ + + present_at_all_locations: typing.Optional[bool] = pydantic.Field(default=None) + """ + If `true`, this object is present at all locations (including future locations), except where specified in + the `absent_at_location_ids` field. If `false`, this object is not present at any locations (including future locations), + except where specified in the `present_at_location_ids` field. If not specified, defaults to `true`. + """ + + present_at_location_ids: typing.Optional[typing.List[str]] = pydantic.Field(default=None) + """ + A list of locations where the object is present, even if `present_at_all_locations` is `false`. + This can include locations that are deactivated. + """ + + absent_at_location_ids: typing.Optional[typing.List[str]] = pydantic.Field(default=None) + """ + A list of locations where the object is not present, even if `present_at_all_locations` is `true`. + This can include locations that are deactivated. + """ + + image_id: typing.Optional[str] = pydantic.Field(default=None) + """ + Identifies the `CatalogImage` attached to this `CatalogObject`. + """ + if IS_PYDANTIC_V2: model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 else: diff --git a/src/square/types/catalog_object_quick_amounts_settings.py b/src/square/types/catalog_object_quick_amounts_settings.py index c95cfdd3..bf58cacb 100644 --- a/src/square/types/catalog_object_quick_amounts_settings.py +++ b/src/square/types/catalog_object_quick_amounts_settings.py @@ -1,18 +1,107 @@ # This file was auto-generated by Fern from our API Definition. -from .catalog_object_base import CatalogObjectBase +from ..core.unchecked_base_model import UncheckedBaseModel import typing from .catalog_quick_amounts_settings import CatalogQuickAmountsSettings import pydantic +from .catalog_custom_attribute_value import CatalogCustomAttributeValue +import typing_extensions +from .catalog_v1id import CatalogV1Id +from ..core.serialization import FieldMetadata from ..core.pydantic_utilities import IS_PYDANTIC_V2 -class CatalogObjectQuickAmountsSettings(CatalogObjectBase): +class CatalogObjectQuickAmountsSettings(UncheckedBaseModel): + type: typing.Literal["QUICK_AMOUNTS_SETTINGS"] = "QUICK_AMOUNTS_SETTINGS" quick_amounts_settings_data: typing.Optional[CatalogQuickAmountsSettings] = pydantic.Field(default=None) """ Structured data for a `CatalogQuickAmountsSettings`, set for CatalogObjects of type `QUICK_AMOUNTS_SETTINGS`. """ + id: str = pydantic.Field() + """ + 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. + """ + + updated_at: typing.Optional[str] = pydantic.Field(default=None) + """ + Last modification [timestamp](https://developer.squareup.com/docs/build-basics/working-with-dates) 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. + """ + + version: typing.Optional[int] = pydantic.Field(default=None) + """ + The version of the object. When updating an object, the version supplied + must match the version in the database, otherwise the write will be rejected as conflicting. + """ + + is_deleted: typing.Optional[bool] = pydantic.Field(default=None) + """ + 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. + """ + + custom_attribute_values: typing.Optional[typing.Dict[str, CatalogCustomAttributeValue]] = pydantic.Field( + default=None + ) + """ + A map (key-value pairs) of application-defined custom attribute values. The value of a key-value pair + is a [CatalogCustomAttributeValue](entity:CatalogCustomAttributeValue) object. The key is the `key` attribute + value defined in the associated [CatalogCustomAttributeDefinition](entity:CatalogCustomAttributeDefinition) + object defined by the application making the request. + + If the `CatalogCustomAttributeDefinition` object is + defined by another application, the `CatalogCustomAttributeDefinition`'s key attribute value is prefixed by + the defining application ID. For example, if the `CatalogCustomAttributeDefinition` has a `key` attribute of + `"cocoa_brand"` and the defining application ID is `"abcd1234"`, the key in the map is `"abcd1234:cocoa_brand"` + if the application making the request is different from the application defining the custom attribute definition. + Otherwise, the key used in the map is simply `"cocoa_brand"`. + + Application-defined custom attributes are set at a global (location-independent) level. + Custom attribute values are intended to store additional information about a catalog object + or associations with an entity in another system. Do not use custom attributes + to store any sensitive information (personally identifiable information, card details, etc.). + """ + + catalog_v1ids: typing_extensions.Annotated[ + typing.Optional[typing.List[CatalogV1Id]], FieldMetadata(alias="catalog_v1_ids") + ] = pydantic.Field(default=None) + """ + 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. + """ + + present_at_all_locations: typing.Optional[bool] = pydantic.Field(default=None) + """ + If `true`, this object is present at all locations (including future locations), except where specified in + the `absent_at_location_ids` field. If `false`, this object is not present at any locations (including future locations), + except where specified in the `present_at_location_ids` field. If not specified, defaults to `true`. + """ + + present_at_location_ids: typing.Optional[typing.List[str]] = pydantic.Field(default=None) + """ + A list of locations where the object is present, even if `present_at_all_locations` is `false`. + This can include locations that are deactivated. + """ + + absent_at_location_ids: typing.Optional[typing.List[str]] = pydantic.Field(default=None) + """ + A list of locations where the object is not present, even if `present_at_all_locations` is `true`. + This can include locations that are deactivated. + """ + + image_id: typing.Optional[str] = pydantic.Field(default=None) + """ + Identifies the `CatalogImage` attached to this `CatalogObject`. + """ + if IS_PYDANTIC_V2: model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 else: diff --git a/src/square/types/catalog_object_resource.py b/src/square/types/catalog_object_resource.py deleted file mode 100644 index debf6aa5..00000000 --- a/src/square/types/catalog_object_resource.py +++ /dev/null @@ -1,17 +0,0 @@ -# This file was auto-generated by Fern from our API Definition. - -from .catalog_object_base import CatalogObjectBase -from ..core.pydantic_utilities import IS_PYDANTIC_V2 -import typing -import pydantic - - -class CatalogObjectResource(CatalogObjectBase): - if IS_PYDANTIC_V2: - model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 - else: - - class Config: - frozen = True - smart_union = True - extra = pydantic.Extra.allow diff --git a/src/square/types/catalog_object_service_charge.py b/src/square/types/catalog_object_service_charge.py deleted file mode 100644 index 0b2897c8..00000000 --- a/src/square/types/catalog_object_service_charge.py +++ /dev/null @@ -1,17 +0,0 @@ -# This file was auto-generated by Fern from our API Definition. - -from .catalog_object_base import CatalogObjectBase -from ..core.pydantic_utilities import IS_PYDANTIC_V2 -import typing -import pydantic - - -class CatalogObjectServiceCharge(CatalogObjectBase): - if IS_PYDANTIC_V2: - model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 - else: - - class Config: - frozen = True - smart_union = True - extra = pydantic.Extra.allow diff --git a/src/square/types/catalog_object_subscription_plan.py b/src/square/types/catalog_object_subscription_plan.py index bd039e22..62abc245 100644 --- a/src/square/types/catalog_object_subscription_plan.py +++ b/src/square/types/catalog_object_subscription_plan.py @@ -1,21 +1,110 @@ # This file was auto-generated by Fern from our API Definition. from __future__ import annotations -from .catalog_object_base import CatalogObjectBase +from ..core.unchecked_base_model import UncheckedBaseModel from .catalog_category import CatalogCategory from .catalog_object_category import CatalogObjectCategory import typing import pydantic +from .catalog_custom_attribute_value import CatalogCustomAttributeValue +import typing_extensions +from .catalog_v1id import CatalogV1Id +from ..core.serialization import FieldMetadata from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.pydantic_utilities import update_forward_refs -class CatalogObjectSubscriptionPlan(CatalogObjectBase): +class CatalogObjectSubscriptionPlan(UncheckedBaseModel): + type: typing.Literal["SUBSCRIPTION_PLAN"] = "SUBSCRIPTION_PLAN" subscription_plan_data: typing.Optional["CatalogSubscriptionPlan"] = pydantic.Field(default=None) """ Structured data for a `CatalogSubscriptionPlan`, set for CatalogObjects of type `SUBSCRIPTION_PLAN`. """ + id: str = pydantic.Field() + """ + 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. + """ + + updated_at: typing.Optional[str] = pydantic.Field(default=None) + """ + Last modification [timestamp](https://developer.squareup.com/docs/build-basics/working-with-dates) 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. + """ + + version: typing.Optional[int] = pydantic.Field(default=None) + """ + The version of the object. When updating an object, the version supplied + must match the version in the database, otherwise the write will be rejected as conflicting. + """ + + is_deleted: typing.Optional[bool] = pydantic.Field(default=None) + """ + 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. + """ + + custom_attribute_values: typing.Optional[typing.Dict[str, CatalogCustomAttributeValue]] = pydantic.Field( + default=None + ) + """ + A map (key-value pairs) of application-defined custom attribute values. The value of a key-value pair + is a [CatalogCustomAttributeValue](entity:CatalogCustomAttributeValue) object. The key is the `key` attribute + value defined in the associated [CatalogCustomAttributeDefinition](entity:CatalogCustomAttributeDefinition) + object defined by the application making the request. + + If the `CatalogCustomAttributeDefinition` object is + defined by another application, the `CatalogCustomAttributeDefinition`'s key attribute value is prefixed by + the defining application ID. For example, if the `CatalogCustomAttributeDefinition` has a `key` attribute of + `"cocoa_brand"` and the defining application ID is `"abcd1234"`, the key in the map is `"abcd1234:cocoa_brand"` + if the application making the request is different from the application defining the custom attribute definition. + Otherwise, the key used in the map is simply `"cocoa_brand"`. + + Application-defined custom attributes are set at a global (location-independent) level. + Custom attribute values are intended to store additional information about a catalog object + or associations with an entity in another system. Do not use custom attributes + to store any sensitive information (personally identifiable information, card details, etc.). + """ + + catalog_v1ids: typing_extensions.Annotated[ + typing.Optional[typing.List[CatalogV1Id]], FieldMetadata(alias="catalog_v1_ids") + ] = pydantic.Field(default=None) + """ + 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. + """ + + present_at_all_locations: typing.Optional[bool] = pydantic.Field(default=None) + """ + If `true`, this object is present at all locations (including future locations), except where specified in + the `absent_at_location_ids` field. If `false`, this object is not present at any locations (including future locations), + except where specified in the `present_at_location_ids` field. If not specified, defaults to `true`. + """ + + present_at_location_ids: typing.Optional[typing.List[str]] = pydantic.Field(default=None) + """ + A list of locations where the object is present, even if `present_at_all_locations` is `false`. + This can include locations that are deactivated. + """ + + absent_at_location_ids: typing.Optional[typing.List[str]] = pydantic.Field(default=None) + """ + A list of locations where the object is not present, even if `present_at_all_locations` is `true`. + This can include locations that are deactivated. + """ + + image_id: typing.Optional[str] = pydantic.Field(default=None) + """ + Identifies the `CatalogImage` attached to this `CatalogObject`. + """ + if IS_PYDANTIC_V2: model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 else: diff --git a/src/square/types/catalog_object_subscription_plan_variation.py b/src/square/types/catalog_object_subscription_plan_variation.py index 99795306..c44d936f 100644 --- a/src/square/types/catalog_object_subscription_plan_variation.py +++ b/src/square/types/catalog_object_subscription_plan_variation.py @@ -1,18 +1,107 @@ # This file was auto-generated by Fern from our API Definition. -from .catalog_object_base import CatalogObjectBase +from ..core.unchecked_base_model import UncheckedBaseModel import typing from .catalog_subscription_plan_variation import CatalogSubscriptionPlanVariation import pydantic +from .catalog_custom_attribute_value import CatalogCustomAttributeValue +import typing_extensions +from .catalog_v1id import CatalogV1Id +from ..core.serialization import FieldMetadata from ..core.pydantic_utilities import IS_PYDANTIC_V2 -class CatalogObjectSubscriptionPlanVariation(CatalogObjectBase): +class CatalogObjectSubscriptionPlanVariation(UncheckedBaseModel): + type: typing.Literal["SUBSCRIPTION_PLAN_VARIATION"] = "SUBSCRIPTION_PLAN_VARIATION" subscription_plan_variation_data: typing.Optional[CatalogSubscriptionPlanVariation] = pydantic.Field(default=None) """ Structured data for a `CatalogSubscriptionPlanVariation`, set for CatalogObjects of type `SUBSCRIPTION_PLAN_VARIATION`. """ + id: str = pydantic.Field() + """ + 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. + """ + + updated_at: typing.Optional[str] = pydantic.Field(default=None) + """ + Last modification [timestamp](https://developer.squareup.com/docs/build-basics/working-with-dates) 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. + """ + + version: typing.Optional[int] = pydantic.Field(default=None) + """ + The version of the object. When updating an object, the version supplied + must match the version in the database, otherwise the write will be rejected as conflicting. + """ + + is_deleted: typing.Optional[bool] = pydantic.Field(default=None) + """ + 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. + """ + + custom_attribute_values: typing.Optional[typing.Dict[str, CatalogCustomAttributeValue]] = pydantic.Field( + default=None + ) + """ + A map (key-value pairs) of application-defined custom attribute values. The value of a key-value pair + is a [CatalogCustomAttributeValue](entity:CatalogCustomAttributeValue) object. The key is the `key` attribute + value defined in the associated [CatalogCustomAttributeDefinition](entity:CatalogCustomAttributeDefinition) + object defined by the application making the request. + + If the `CatalogCustomAttributeDefinition` object is + defined by another application, the `CatalogCustomAttributeDefinition`'s key attribute value is prefixed by + the defining application ID. For example, if the `CatalogCustomAttributeDefinition` has a `key` attribute of + `"cocoa_brand"` and the defining application ID is `"abcd1234"`, the key in the map is `"abcd1234:cocoa_brand"` + if the application making the request is different from the application defining the custom attribute definition. + Otherwise, the key used in the map is simply `"cocoa_brand"`. + + Application-defined custom attributes are set at a global (location-independent) level. + Custom attribute values are intended to store additional information about a catalog object + or associations with an entity in another system. Do not use custom attributes + to store any sensitive information (personally identifiable information, card details, etc.). + """ + + catalog_v1ids: typing_extensions.Annotated[ + typing.Optional[typing.List[CatalogV1Id]], FieldMetadata(alias="catalog_v1_ids") + ] = pydantic.Field(default=None) + """ + 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. + """ + + present_at_all_locations: typing.Optional[bool] = pydantic.Field(default=None) + """ + If `true`, this object is present at all locations (including future locations), except where specified in + the `absent_at_location_ids` field. If `false`, this object is not present at any locations (including future locations), + except where specified in the `present_at_location_ids` field. If not specified, defaults to `true`. + """ + + present_at_location_ids: typing.Optional[typing.List[str]] = pydantic.Field(default=None) + """ + A list of locations where the object is present, even if `present_at_all_locations` is `false`. + This can include locations that are deactivated. + """ + + absent_at_location_ids: typing.Optional[typing.List[str]] = pydantic.Field(default=None) + """ + A list of locations where the object is not present, even if `present_at_all_locations` is `true`. + This can include locations that are deactivated. + """ + + image_id: typing.Optional[str] = pydantic.Field(default=None) + """ + Identifies the `CatalogImage` attached to this `CatalogObject`. + """ + if IS_PYDANTIC_V2: model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 else: diff --git a/src/square/types/catalog_object_subscription_product.py b/src/square/types/catalog_object_subscription_product.py deleted file mode 100644 index bb91c161..00000000 --- a/src/square/types/catalog_object_subscription_product.py +++ /dev/null @@ -1,17 +0,0 @@ -# This file was auto-generated by Fern from our API Definition. - -from .catalog_object_base import CatalogObjectBase -from ..core.pydantic_utilities import IS_PYDANTIC_V2 -import typing -import pydantic - - -class CatalogObjectSubscriptionProduct(CatalogObjectBase): - if IS_PYDANTIC_V2: - model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 - else: - - class Config: - frozen = True - smart_union = True - extra = pydantic.Extra.allow diff --git a/src/square/types/catalog_object_tax.py b/src/square/types/catalog_object_tax.py index fea644a3..2e99852b 100644 --- a/src/square/types/catalog_object_tax.py +++ b/src/square/types/catalog_object_tax.py @@ -1,18 +1,107 @@ # This file was auto-generated by Fern from our API Definition. -from .catalog_object_base import CatalogObjectBase +from ..core.unchecked_base_model import UncheckedBaseModel import typing from .catalog_tax import CatalogTax import pydantic +from .catalog_custom_attribute_value import CatalogCustomAttributeValue +import typing_extensions +from .catalog_v1id import CatalogV1Id +from ..core.serialization import FieldMetadata from ..core.pydantic_utilities import IS_PYDANTIC_V2 -class CatalogObjectTax(CatalogObjectBase): +class CatalogObjectTax(UncheckedBaseModel): + type: typing.Literal["TAX"] = "TAX" tax_data: typing.Optional[CatalogTax] = pydantic.Field(default=None) """ Structured data for a `CatalogTax`, set for CatalogObjects of type `TAX`. """ + id: str = pydantic.Field() + """ + 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. + """ + + updated_at: typing.Optional[str] = pydantic.Field(default=None) + """ + Last modification [timestamp](https://developer.squareup.com/docs/build-basics/working-with-dates) 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. + """ + + version: typing.Optional[int] = pydantic.Field(default=None) + """ + The version of the object. When updating an object, the version supplied + must match the version in the database, otherwise the write will be rejected as conflicting. + """ + + is_deleted: typing.Optional[bool] = pydantic.Field(default=None) + """ + 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. + """ + + custom_attribute_values: typing.Optional[typing.Dict[str, CatalogCustomAttributeValue]] = pydantic.Field( + default=None + ) + """ + A map (key-value pairs) of application-defined custom attribute values. The value of a key-value pair + is a [CatalogCustomAttributeValue](entity:CatalogCustomAttributeValue) object. The key is the `key` attribute + value defined in the associated [CatalogCustomAttributeDefinition](entity:CatalogCustomAttributeDefinition) + object defined by the application making the request. + + If the `CatalogCustomAttributeDefinition` object is + defined by another application, the `CatalogCustomAttributeDefinition`'s key attribute value is prefixed by + the defining application ID. For example, if the `CatalogCustomAttributeDefinition` has a `key` attribute of + `"cocoa_brand"` and the defining application ID is `"abcd1234"`, the key in the map is `"abcd1234:cocoa_brand"` + if the application making the request is different from the application defining the custom attribute definition. + Otherwise, the key used in the map is simply `"cocoa_brand"`. + + Application-defined custom attributes are set at a global (location-independent) level. + Custom attribute values are intended to store additional information about a catalog object + or associations with an entity in another system. Do not use custom attributes + to store any sensitive information (personally identifiable information, card details, etc.). + """ + + catalog_v1ids: typing_extensions.Annotated[ + typing.Optional[typing.List[CatalogV1Id]], FieldMetadata(alias="catalog_v1_ids") + ] = pydantic.Field(default=None) + """ + 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. + """ + + present_at_all_locations: typing.Optional[bool] = pydantic.Field(default=None) + """ + If `true`, this object is present at all locations (including future locations), except where specified in + the `absent_at_location_ids` field. If `false`, this object is not present at any locations (including future locations), + except where specified in the `present_at_location_ids` field. If not specified, defaults to `true`. + """ + + present_at_location_ids: typing.Optional[typing.List[str]] = pydantic.Field(default=None) + """ + A list of locations where the object is present, even if `present_at_all_locations` is `false`. + This can include locations that are deactivated. + """ + + absent_at_location_ids: typing.Optional[typing.List[str]] = pydantic.Field(default=None) + """ + A list of locations where the object is not present, even if `present_at_all_locations` is `true`. + This can include locations that are deactivated. + """ + + image_id: typing.Optional[str] = pydantic.Field(default=None) + """ + Identifies the `CatalogImage` attached to this `CatalogObject`. + """ + if IS_PYDANTIC_V2: model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 else: diff --git a/src/square/types/catalog_object_tax_exemption.py b/src/square/types/catalog_object_tax_exemption.py deleted file mode 100644 index 25fbee62..00000000 --- a/src/square/types/catalog_object_tax_exemption.py +++ /dev/null @@ -1,17 +0,0 @@ -# This file was auto-generated by Fern from our API Definition. - -from .catalog_object_base import CatalogObjectBase -from ..core.pydantic_utilities import IS_PYDANTIC_V2 -import typing -import pydantic - - -class CatalogObjectTaxExemption(CatalogObjectBase): - if IS_PYDANTIC_V2: - model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 - else: - - class Config: - frozen = True - smart_union = True - extra = pydantic.Extra.allow diff --git a/src/square/types/catalog_object_time_period.py b/src/square/types/catalog_object_time_period.py index eb975d58..1f6f321d 100644 --- a/src/square/types/catalog_object_time_period.py +++ b/src/square/types/catalog_object_time_period.py @@ -1,18 +1,107 @@ # This file was auto-generated by Fern from our API Definition. -from .catalog_object_base import CatalogObjectBase +from ..core.unchecked_base_model import UncheckedBaseModel import typing from .catalog_time_period import CatalogTimePeriod import pydantic +from .catalog_custom_attribute_value import CatalogCustomAttributeValue +import typing_extensions +from .catalog_v1id import CatalogV1Id +from ..core.serialization import FieldMetadata from ..core.pydantic_utilities import IS_PYDANTIC_V2 -class CatalogObjectTimePeriod(CatalogObjectBase): +class CatalogObjectTimePeriod(UncheckedBaseModel): + type: typing.Literal["TIME_PERIOD"] = "TIME_PERIOD" time_period_data: typing.Optional[CatalogTimePeriod] = pydantic.Field(default=None) """ Structured data for a `CatalogTimePeriod`, set for CatalogObjects of type `TIME_PERIOD`. """ + id: str = pydantic.Field() + """ + 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. + """ + + updated_at: typing.Optional[str] = pydantic.Field(default=None) + """ + Last modification [timestamp](https://developer.squareup.com/docs/build-basics/working-with-dates) 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. + """ + + version: typing.Optional[int] = pydantic.Field(default=None) + """ + The version of the object. When updating an object, the version supplied + must match the version in the database, otherwise the write will be rejected as conflicting. + """ + + is_deleted: typing.Optional[bool] = pydantic.Field(default=None) + """ + 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. + """ + + custom_attribute_values: typing.Optional[typing.Dict[str, CatalogCustomAttributeValue]] = pydantic.Field( + default=None + ) + """ + A map (key-value pairs) of application-defined custom attribute values. The value of a key-value pair + is a [CatalogCustomAttributeValue](entity:CatalogCustomAttributeValue) object. The key is the `key` attribute + value defined in the associated [CatalogCustomAttributeDefinition](entity:CatalogCustomAttributeDefinition) + object defined by the application making the request. + + If the `CatalogCustomAttributeDefinition` object is + defined by another application, the `CatalogCustomAttributeDefinition`'s key attribute value is prefixed by + the defining application ID. For example, if the `CatalogCustomAttributeDefinition` has a `key` attribute of + `"cocoa_brand"` and the defining application ID is `"abcd1234"`, the key in the map is `"abcd1234:cocoa_brand"` + if the application making the request is different from the application defining the custom attribute definition. + Otherwise, the key used in the map is simply `"cocoa_brand"`. + + Application-defined custom attributes are set at a global (location-independent) level. + Custom attribute values are intended to store additional information about a catalog object + or associations with an entity in another system. Do not use custom attributes + to store any sensitive information (personally identifiable information, card details, etc.). + """ + + catalog_v1ids: typing_extensions.Annotated[ + typing.Optional[typing.List[CatalogV1Id]], FieldMetadata(alias="catalog_v1_ids") + ] = pydantic.Field(default=None) + """ + 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. + """ + + present_at_all_locations: typing.Optional[bool] = pydantic.Field(default=None) + """ + If `true`, this object is present at all locations (including future locations), except where specified in + the `absent_at_location_ids` field. If `false`, this object is not present at any locations (including future locations), + except where specified in the `present_at_location_ids` field. If not specified, defaults to `true`. + """ + + present_at_location_ids: typing.Optional[typing.List[str]] = pydantic.Field(default=None) + """ + A list of locations where the object is present, even if `present_at_all_locations` is `false`. + This can include locations that are deactivated. + """ + + absent_at_location_ids: typing.Optional[typing.List[str]] = pydantic.Field(default=None) + """ + A list of locations where the object is not present, even if `present_at_all_locations` is `true`. + This can include locations that are deactivated. + """ + + image_id: typing.Optional[str] = pydantic.Field(default=None) + """ + Identifies the `CatalogImage` attached to this `CatalogObject`. + """ + if IS_PYDANTIC_V2: model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 else: diff --git a/src/square/types/create_invoice_attachment_request_data.py b/src/square/types/create_invoice_attachment_request_data.py new file mode 100644 index 00000000..28adb657 --- /dev/null +++ b/src/square/types/create_invoice_attachment_request_data.py @@ -0,0 +1,32 @@ +# This file was auto-generated by Fern from our API Definition. + +from ..core.unchecked_base_model import UncheckedBaseModel +import typing +import pydantic +from ..core.pydantic_utilities import IS_PYDANTIC_V2 + + +class CreateInvoiceAttachmentRequestData(UncheckedBaseModel): + """ + Represents a [CreateInvoiceAttachment](api-endpoint:Invoices-CreateInvoiceAttachment) request. + """ + + idempotency_key: typing.Optional[str] = pydantic.Field(default=None) + """ + A unique string that identifies the `CreateInvoiceAttachment` request. + For more information, see [Idempotency](https://developer.squareup.com/docs/build-basics/common-api-patterns/idempotency). + """ + + description: typing.Optional[str] = pydantic.Field(default=None) + """ + The description of the attachment to display on the invoice. + """ + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow From aeec15be97dffeb746336e953e874722d437eedc Mon Sep 17 00:00:00 2001 From: fern-support <115122769+fern-api[bot]@users.noreply.github.com> Date: Tue, 6 May 2025 09:44:58 -0400 Subject: [PATCH 2/3] Update test_catalog.py --- tests/integration/test_catalog.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tests/integration/test_catalog.py b/tests/integration/test_catalog.py index bfd45a28..bc6a2d77 100644 --- a/tests/integration/test_catalog.py +++ b/tests/integration/test_catalog.py @@ -7,6 +7,7 @@ from square.types.catalog_modifier import CatalogModifier from square.types.catalog_modifier_list import CatalogModifierList from square.types.catalog_object_batch import CatalogObjectBatch +from square.types.catalog_object_image import CatalogObjectImage from square.types.catalog_object_item import CatalogObjectItem from square.types.catalog_object_modifier import CatalogObjectModifier from square.types.catalog_object_modifier_list import CatalogObjectModifierList @@ -58,7 +59,7 @@ def test_upload_catalog_image(): ) image = create_catalog_image_resp.image assert image is not None - assert isinstance(image, CatalogObjectItem) + assert isinstance(image, CatalogObjectImage) # Cleanup client.catalog.batch_delete( From 3de0e08ec6ff3bf6a35c941983b2a64cb72f09b9 Mon Sep 17 00:00:00 2001 From: fern-support <115122769+fern-api[bot]@users.noreply.github.com> Date: Tue, 6 May 2025 09:54:06 -0400 Subject: [PATCH 3/3] Add 'File Uploads' section to README.md --- README.md | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/README.md b/README.md index 5d714c52..aa122514 100644 --- a/README.md +++ b/README.md @@ -140,6 +140,27 @@ for page in response.iter_pages(): yield page ``` +## File Uploads + +Files are uploaded with the [File](./src/square/core/file.py) type, which is constructed as a tuple in +a variety of formats. You can customize the filename and `Content-Type` of the individual `multipart/form-data` +part like so: + +```python +invoice_pdf = client.invoices.create_invoice_attachment( + invoice_id="inv:0-ChA4-3sU9GPd-uOC3HgvFjMWEL4N", + image_file=( + os.path.basename(pdf_filepath), # The filename to include in the `multipart/form-data` part. + open(pdf_filepath, "rb"), # The file stream, read as binary data. + "application/pdf" # The Content-Type for this particular file. + ), + request={ + "idempotency_key": str(uuid.uuid4()), + "description": f"Invoice-{pdf_filepath}", + } +) +``` + ## Exception Handling When the API returns a non-success status code (4xx or 5xx response), a subclass of