CustomerCustomAttributesApi

Struct CustomerCustomAttributesApi 

Source
pub struct CustomerCustomAttributesApi { /* private fields */ }
Expand description

Create and manage customer-related custom attribute definitions and custom attributes.

Implementations§

Source§

impl CustomerCustomAttributesApi

Source

pub fn new(square_client: SquareClient) -> CustomerCustomAttributesApi

Instantiates a new CustomerCustomAttributesApi

Source

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

Source

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

Source

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

Source

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

Source

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

Source

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

Source

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

Source

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

Source

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

Source

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

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> PolicyExt for T
where T: ?Sized,

Source§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow only if self and other return Action::Follow. Read more
Source§

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow if either self or other returns Action::Follow. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

impl<T> ErasedDestructor for T
where T: 'static,