Documentation
¶
Index ¶
- type Client
- func (c *Client) Create(ctx context.Context, ...) (*squaregosdk.CreateMerchantCustomAttributeDefinitionResponse, error)
- func (c *Client) Delete(ctx context.Context, ...) (*squaregosdk.DeleteMerchantCustomAttributeDefinitionResponse, error)
- func (c *Client) Get(ctx context.Context, request *merchants.CustomAttributeDefinitionsGetRequest, ...) (*squaregosdk.RetrieveMerchantCustomAttributeDefinitionResponse, error)
- func (c *Client) List(ctx context.Context, request *merchants.CustomAttributeDefinitionsListRequest, ...) (*core.Page[*squaregosdk.CustomAttributeDefinition], error)
- func (c *Client) Update(ctx context.Context, ...) (*squaregosdk.UpdateMerchantCustomAttributeDefinitionResponse, 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) Create ¶ added in v1.1.0
func (c *Client) Create( ctx context.Context, request *merchants.CreateMerchantCustomAttributeDefinitionRequest, opts ...option.RequestOption, ) (*squaregosdk.CreateMerchantCustomAttributeDefinitionResponse, error)
Creates a merchant-related [custom attribute definition](entity:CustomAttributeDefinition) for a Square seller account. Use this endpoint to define a custom attribute that can be associated with a merchant connecting to your application. A custom attribute definition specifies the `key`, `visibility`, `schema`, and other properties for a custom attribute. After the definition is created, you can call [UpsertMerchantCustomAttribute](api-endpoint:MerchantCustomAttributes-UpsertMerchantCustomAttribute) or [BulkUpsertMerchantCustomAttributes](api-endpoint:MerchantCustomAttributes-BulkUpsertMerchantCustomAttributes) to set the custom attribute for a merchant.
func (*Client) Delete ¶
func (c *Client) Delete( ctx context.Context, request *merchants.CustomAttributeDefinitionsDeleteRequest, opts ...option.RequestOption, ) (*squaregosdk.DeleteMerchantCustomAttributeDefinitionResponse, error)
Deletes a merchant-related [custom attribute definition](entity:CustomAttributeDefinition) from a Square seller account. Deleting a custom attribute definition also deletes the corresponding custom attribute from the merchant. Only the definition owner can delete a custom attribute definition.
func (*Client) Get ¶
func (c *Client) Get( ctx context.Context, request *merchants.CustomAttributeDefinitionsGetRequest, opts ...option.RequestOption, ) (*squaregosdk.RetrieveMerchantCustomAttributeDefinitionResponse, error)
Retrieves a merchant-related [custom attribute definition](entity:CustomAttributeDefinition) 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`.
func (*Client) List ¶ added in v1.1.0
func (c *Client) List( ctx context.Context, request *merchants.CustomAttributeDefinitionsListRequest, opts ...option.RequestOption, ) (*core.Page[*squaregosdk.CustomAttributeDefinition], error)
Lists the merchant-related [custom attribute definitions](entity:CustomAttributeDefinition) 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 that are created by other applications and set to `VISIBILITY_READ_ONLY` or `VISIBILITY_READ_WRITE_VALUES`.
func (*Client) Update ¶
func (c *Client) Update( ctx context.Context, request *merchants.UpdateMerchantCustomAttributeDefinitionRequest, opts ...option.RequestOption, ) (*squaregosdk.UpdateMerchantCustomAttributeDefinitionResponse, error)
Updates a merchant-related [custom attribute definition](entity:CustomAttributeDefinition) 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 the definition owner can update a custom attribute definition.