pub struct CustomerCustomAttributesApi { /* private fields */ }Expand description
Create and manage customer-related custom attribute definitions and custom attributes.
Implementations§
Source§impl CustomerCustomAttributesApi
impl CustomerCustomAttributesApi
Sourcepub fn new(square_client: SquareClient) -> CustomerCustomAttributesApi
pub fn new(square_client: SquareClient) -> CustomerCustomAttributesApi
Instantiates a new CustomerCustomAttributesApi
Sourcepub async fn list_customer_custom_attribute_definitions(
&self,
params: &ListCustomerCustomAttributeDefinitionsParameters,
) -> Result<ListCustomerCustomAttributeDefinitionsResponse, SquareApiError>
pub async fn list_customer_custom_attribute_definitions( &self, params: &ListCustomerCustomAttributeDefinitionsParameters, ) -> Result<ListCustomerCustomAttributeDefinitionsResponse, SquareApiError>
Lists the customer-related custom attribute definitions that belong to a Square seller account.
When all response pages are retrieved, the results include all custom attribute definitions
that are visible to the requesting application, including those created by other applications
and set to VISIBILITY_READ_ONLY or VISIBILITY_READ_WRITE_VALUES. Seller-defined custom
attributes (also known as custom fields) are always set to VISIBILITY_READ_WRITE_VALUES.
Permissions: CUSTOMERS_READ
Sourcepub async fn create_customer_custom_attribute_definition(
&self,
request: &CreateCustomerCustomAttributeDefinitionRequest,
) -> Result<CreateCustomerCustomAttributeDefinitionResponse, SquareApiError>
pub async fn create_customer_custom_attribute_definition( &self, request: &CreateCustomerCustomAttributeDefinitionRequest, ) -> Result<CreateCustomerCustomAttributeDefinitionResponse, SquareApiError>
Creates a customer-related custom attribute definition for a Square seller account.
Use this endpoint to define a custom attribute that can be associated with customer profiles.
A custom attribute definition specifies the key, visibility, schema, and other properties for a custom attribute.
After the definition is created, you can call UpsertCustomerCustomAttribute or BulkUpsertCustomerCustomAttributes
to set the custom attribute for customer profiles in the seller’s Customer Directory.
Permissions: CUSTOMERS_WRITE
Sourcepub async fn delete_customer_custom_attribute_definition(
&self,
key: impl AsRef<str>,
) -> Result<DeleteCustomerCustomAttributeDefinitionResponse, SquareApiError>
pub async fn delete_customer_custom_attribute_definition( &self, key: impl AsRef<str>, ) -> Result<DeleteCustomerCustomAttributeDefinitionResponse, SquareApiError>
Deletes a customer-related custom attribute definition from a Square seller account.
Deleting a custom attribute definition also deletes the corresponding custom attribute from all customer profiles in the seller’s Customer Directory. Only the definition owner can delete a custom attribute definition.
Permissions: CUSTOMERS_WRITE
Sourcepub async fn retrieve_customer_custom_attribute_definition(
&self,
key: impl AsRef<str>,
params: &RetrieveCustomerCustomAttributeDefinitionParameters,
) -> Result<RetrieveCustomerCustomAttributeDefinitionResponse, SquareApiError>
pub async fn retrieve_customer_custom_attribute_definition( &self, key: impl AsRef<str>, params: &RetrieveCustomerCustomAttributeDefinitionParameters, ) -> Result<RetrieveCustomerCustomAttributeDefinitionResponse, SquareApiError>
Retrieves a customer-related custom attribute definition from a Square seller account.
To retrieve a custom attribute definition created by another application, the visibility setting
must be VISIBILITY_READ_ONLY or VISIBILITY_READ_WRITE_VALUES. Seller-defined custom attributes
are always set to VISIBILITY_READ_WRITE_VALUES.
Permissions: CUSTOMERS_READ
Sourcepub async fn update_customer_custom_attribute_definition(
&self,
key: impl AsRef<str>,
request: &UpdateCustomerCustomAttributeDefinitionRequest,
) -> Result<UpdateCustomerCustomAttributeDefinitionResponse, SquareApiError>
pub async fn update_customer_custom_attribute_definition( &self, key: impl AsRef<str>, request: &UpdateCustomerCustomAttributeDefinitionRequest, ) -> Result<UpdateCustomerCustomAttributeDefinitionResponse, SquareApiError>
Updates a customer-related custom attribute definition for a Square seller account.
Use this endpoint to update the following fields: name, description, visibility, or the schema
for a Selection data type. Only changes to the named options or the maximum number of allowed selections
are supported.
Only the definition owner can update a custom attribute definition. Sellers can view all custom attributes
in exported customer data, including those set to VISIBILITY_HIDDEN.
Permissions: CUSTOMERS_WRITE
Sourcepub async fn bulk_upsert_customer_custom_attributes(
&self,
request: &BulkUpsertCustomerCustomAttributesRequest,
) -> Result<BulkUpsertCustomerCustomAttributesResponse, SquareApiError>
pub async fn bulk_upsert_customer_custom_attributes( &self, request: &BulkUpsertCustomerCustomAttributesRequest, ) -> Result<BulkUpsertCustomerCustomAttributesResponse, SquareApiError>
Creates or updates custom attributes for customer profiles as a bulk operation.
Use this endpoint to set the value of one or more custom attributes for one or more customer profiles. Permissions: CUSTOMERS_WRITE
Sourcepub async fn list_customer_custom_attributes(
&self,
customer_id: impl AsRef<str>,
params: &ListCustomerCustomAttributesParameters,
) -> Result<ListCustomerCustomAttributesResponse, SquareApiError>
pub async fn list_customer_custom_attributes( &self, customer_id: impl AsRef<str>, params: &ListCustomerCustomAttributesParameters, ) -> Result<ListCustomerCustomAttributesResponse, SquareApiError>
Lists the custom attributes associated with a customer profile.
Use this endpoint to retrieve all custom attributes visible to the requesting application,
including those owned by other applications and set to VISIBILITY_READ_ONLY or
VISIBILITY_READ_WRITE_VALUES.
Permissions: CUSTOMERS_READ
Sourcepub async fn delete_customer_custom_attribute(
&self,
customer_id: impl AsRef<str>,
key: impl AsRef<str>,
) -> Result<DeleteCustomerCustomAttributeResponse, SquareApiError>
pub async fn delete_customer_custom_attribute( &self, customer_id: impl AsRef<str>, key: impl AsRef<str>, ) -> Result<DeleteCustomerCustomAttributeResponse, SquareApiError>
Deletes a custom attribute associated with a customer profile.
To delete a custom attribute owned by another application, the visibility setting must be
VISIBILITY_READ_WRITE_VALUES. Note that seller-defined custom attributes are always set to
VISIBILITY_READ_WRITE_VALUES.
Permissions: CUSTOMERS_WRITE
Sourcepub async fn retrieve_customer_custom_attribute(
&self,
customer_id: impl AsRef<str>,
key: impl AsRef<str>,
params: &RetrieveCustomerCustomAttributeParameters,
) -> Result<RetrieveCustomerCustomAttributeResponse, SquareApiError>
pub async fn retrieve_customer_custom_attribute( &self, customer_id: impl AsRef<str>, key: impl AsRef<str>, params: &RetrieveCustomerCustomAttributeParameters, ) -> Result<RetrieveCustomerCustomAttributeResponse, SquareApiError>
Retrieves a custom attribute associated with a customer profile.
Use the with_definition query parameter to also retrieve the custom attribute definition
in the same call.
To retrieve a custom attribute owned by another application, the visibility setting must be
VISIBILITY_READ_ONLY or VISIBILITY_READ_WRITE_VALUES.
Permissions: CUSTOMERS_READ
Sourcepub async fn upsert_customer_custom_attribute(
&self,
customer_id: impl AsRef<str>,
key: impl AsRef<str>,
request: &UpsertCustomerCustomAttributeRequest,
) -> Result<UpsertCustomerCustomAttributeResponse, SquareApiError>
pub async fn upsert_customer_custom_attribute( &self, customer_id: impl AsRef<str>, key: impl AsRef<str>, request: &UpsertCustomerCustomAttributeRequest, ) -> Result<UpsertCustomerCustomAttributeResponse, SquareApiError>
Creates or updates a custom attribute for a customer profile.
Use this endpoint to set the value of a custom attribute for a specified customer profile. A custom attribute is based on a custom attribute definition in a Square seller account.
Permissions: CUSTOMERS_WRITE