Documentation
¶
Index ¶
- type Client
- func (c *Client) Create(ctx context.Context, ...) (*squaregosdk.CreateLocationCustomAttributeDefinitionResponse, error)
- func (c *Client) Delete(ctx context.Context, ...) (*squaregosdk.DeleteLocationCustomAttributeDefinitionResponse, error)
- func (c *Client) Get(ctx context.Context, request *locations.CustomAttributeDefinitionsGetRequest, ...) (*squaregosdk.RetrieveLocationCustomAttributeDefinitionResponse, error)
- func (c *Client) List(ctx context.Context, request *locations.CustomAttributeDefinitionsListRequest, ...) (*core.Page[*squaregosdk.CustomAttributeDefinition], error)
- func (c *Client) Update(ctx context.Context, ...) (*squaregosdk.UpdateLocationCustomAttributeDefinitionResponse, 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 ¶
func (c *Client) Create( ctx context.Context, request *locations.CreateLocationCustomAttributeDefinitionRequest, opts ...option.RequestOption, ) (*squaregosdk.CreateLocationCustomAttributeDefinitionResponse, error)
Creates a location-related [custom attribute definition](entity:CustomAttributeDefinition) for a Square seller account. Use this endpoint to define a custom attribute that can be associated with locations. A custom attribute definition specifies the `key`, `visibility`, `schema`, and other properties for a custom attribute. After the definition is created, you can call [UpsertLocationCustomAttribute](api-endpoint:LocationCustomAttributes-UpsertLocationCustomAttribute) or [BulkUpsertLocationCustomAttributes](api-endpoint:LocationCustomAttributes-BulkUpsertLocationCustomAttributes) to set the custom attribute for locations.
func (*Client) Delete ¶ added in v1.1.0
func (c *Client) Delete( ctx context.Context, request *locations.CustomAttributeDefinitionsDeleteRequest, opts ...option.RequestOption, ) (*squaregosdk.DeleteLocationCustomAttributeDefinitionResponse, error)
Deletes a location-related [custom attribute definition](entity:CustomAttributeDefinition) from a Square seller account. Deleting a custom attribute definition also deletes the corresponding custom attribute from all locations. Only the definition owner can delete a custom attribute definition.
func (*Client) Get ¶
func (c *Client) Get( ctx context.Context, request *locations.CustomAttributeDefinitionsGetRequest, opts ...option.RequestOption, ) (*squaregosdk.RetrieveLocationCustomAttributeDefinitionResponse, error)
Retrieves a location-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 ¶
func (c *Client) List( ctx context.Context, request *locations.CustomAttributeDefinitionsListRequest, opts ...option.RequestOption, ) (*core.Page[*squaregosdk.CustomAttributeDefinition], error)
Lists the location-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 ¶ added in v1.1.0
func (c *Client) Update( ctx context.Context, request *locations.UpdateLocationCustomAttributeDefinitionRequest, opts ...option.RequestOption, ) (*squaregosdk.UpdateLocationCustomAttributeDefinitionResponse, error)
Updates a location-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.