Documentation
¶
Index ¶
- type Client
- func (c *Client) Delete(ctx context.Context, request *customers.DeleteCustomAttributesRequest, ...) (*squaregosdk.DeleteCustomerCustomAttributeResponse, error)
- func (c *Client) Get(ctx context.Context, request *customers.GetCustomAttributesRequest, ...) (*squaregosdk.GetCustomerCustomAttributeResponse, error)
- func (c *Client) List(ctx context.Context, request *customers.ListCustomAttributesRequest, ...) (*core.Page[*squaregosdk.CustomAttribute], error)
- func (c *Client) Upsert(ctx context.Context, request *customers.UpsertCustomerCustomAttributeRequest, ...) (*squaregosdk.UpsertCustomerCustomAttributeResponse, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
func NewClient ¶
func NewClient(opts ...option.RequestOption) *Client
func (*Client) Delete ¶
func (c *Client) Delete( ctx context.Context, request *customers.DeleteCustomAttributesRequest, opts ...option.RequestOption, ) (*squaregosdk.DeleteCustomerCustomAttributeResponse, error)
Deletes a [custom attribute](entity:CustomAttribute) 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 (also known as custom fields) are always set to `VISIBILITY_READ_WRITE_VALUES`.
func (*Client) Get ¶
func (c *Client) Get( ctx context.Context, request *customers.GetCustomAttributesRequest, opts ...option.RequestOption, ) (*squaregosdk.GetCustomerCustomAttributeResponse, error)
Retrieves a [custom attribute](entity:CustomAttribute) associated with a customer profile.
You can 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`. Note that seller-defined custom attributes (also known as custom fields) are always set to `VISIBILITY_READ_WRITE_VALUES`.
func (*Client) List ¶
func (c *Client) List( ctx context.Context, request *customers.ListCustomAttributesRequest, opts ...option.RequestOption, ) (*core.Page[*squaregosdk.CustomAttribute], error)
Lists the [custom attributes](entity:CustomAttribute) associated with a customer profile.
You can use the `with_definitions` query parameter to also retrieve custom attribute definitions in the same call.
When all response pages are retrieved, the results include all custom attributes that are visible to the requesting application, including those that are owned by other applications and set to `VISIBILITY_READ_ONLY` or `VISIBILITY_READ_WRITE_VALUES`.
func (*Client) Upsert ¶
func (c *Client) Upsert( ctx context.Context, request *customers.UpsertCustomerCustomAttributeRequest, opts ...option.RequestOption, ) (*squaregosdk.UpsertCustomerCustomAttributeResponse, error)
Creates or updates a [custom attribute](entity:CustomAttribute) 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, which is created using the [CreateCustomerCustomAttributeDefinition](api-endpoint:CustomerCustomAttributes-CreateCustomerCustomAttributeDefinition) endpoint.
To create or update a custom attribute owned by another application, the `visibility` setting must be `VISIBILITY_READ_WRITE_VALUES`. Note that seller-defined custom attributes (also known as custom fields) are always set to `VISIBILITY_READ_WRITE_VALUES`.