segments
Creates, updates, deletes, gets or lists a segments resource.
Overview
| Name | segments |
| Type | Resource |
| Id | aws.pinpoint.segments |
Fields
The following fields are returned by SELECT queries:
- get_segment
- get_segments
| Name | Datatype | Description |
|---|---|---|
application_id | string | The unique identifier for the application that the segment is associated with. |
arn | string | The Amazon Resource Name (ARN) of the segment. |
creation_date | string | The date and time when the segment was created. |
dimensions | object | Specifies the dimension settings for a segment. |
id | string | The unique identifier for the segment. |
import_definition | object | The settings for the import job that's associated with the segment. |
last_modified_date | string | The date and time when the segment was last modified. |
name | string | The name of the segment. |
segment_groups | object | A list of one or more segment groups that apply to the segment. Each segment group consists of zero or more base segments and the dimensions that are applied to those base segments. |
segment_type | string | The segment type. Valid values are: DIMENSIONAL - A dynamic segment, which is a segment that uses selection criteria that you specify and is based on endpoint data that's reported by your app. Dynamic segments can change over time. IMPORT - A static segment, which is a segment that uses selection criteria that you specify and is based on endpoint definitions that you import from a file. Imported segments are static; they don't change over time. (DIMENSIONAL, IMPORT) |
version | integer | The version number of the segment. |
tags | object | A string-to-string map of key-value pairs that identifies the tags that are associated with the segment. Each tag consists of a required tag key and an associated tag value. |
| Name | Datatype | Description |
|---|---|---|
item | array | An array of responses, one for each segment that's associated with the application (Segments resource) or each version of a segment that's associated with the application (Segment Versions resource). |
next_token | string | The string to use in a subsequent request to get the next page of results in a paginated response. This value is null if there are no additional pages. |
Methods
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
get_segment | select | application-id, segment-id, region | Retrieves information about the configuration, dimension, and other settings for a specific segment that's associated with an application. | |
get_segments | select | application-id, region | page-size, token | Retrieves information about the configuration, dimension, and other settings for all the segments that are associated with an application. |
create_segment | insert | application-id, region, WriteSegmentRequest | Creates a new segment for an application or updates the configuration, dimension, and other settings for an existing segment that's associated with an application. | |
update_segment | update | application-id, segment-id, region, WriteSegmentRequest | Creates a new segment for an application or updates the configuration, dimension, and other settings for an existing segment that's associated with an application. | |
delete_segment | delete | application-id, segment-id, region | Deletes a segment from an application. |
Parameters
Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.
| Name | Datatype | Description |
|---|---|---|
application-id | string | The unique identifier for the application. This identifier is displayed as the Project ID on the Amazon Pinpoint console. |
region | string | AWS region (default: us-east-1) |
segment-id | string | The unique identifier for the segment. |
page-size | string | The maximum number of items to include in each page of a paginated response. This parameter is not supported for application, campaign, and journey metrics. |
token | string | The NextToken string that specifies which page of results to return in a paginated response. |
SELECT examples
- get_segment
- get_segments
Retrieves information about the configuration, dimension, and other settings for a specific segment that's associated with an application.
SELECT
application_id,
arn,
creation_date,
dimensions,
id,
import_definition,
last_modified_date,
name,
segment_groups,
segment_type,
version,
tags
FROM aws.pinpoint.segments
WHERE `application-id` = '{{ application-id }}' -- required
AND `segment-id` = '{{ segment-id }}' -- required
AND region = '{{ region }}' -- required
;
Retrieves information about the configuration, dimension, and other settings for all the segments that are associated with an application.
SELECT
item,
next_token
FROM aws.pinpoint.segments
WHERE `application-id` = '{{ application-id }}' -- required
AND region = '{{ region }}' -- required
AND `page-size` = '{{ page-size }}'
AND token = '{{ token }}'
;
INSERT examples
- create_segment
- Manifest
Creates a new segment for an application or updates the configuration, dimension, and other settings for an existing segment that's associated with an application.
INSERT INTO aws.pinpoint.segments (
WriteSegmentRequest,
`application-id`,
region
)
SELECT
'{{ WriteSegmentRequest }}' /* required */,
'{{ application-id }}',
'{{ region }}'
RETURNING
segment_response
;
# Description fields are for documentation purposes
- name: segments
props:
- name: application-id
value: "{{ application-id }}"
description: Required parameter for the segments resource.
- name: region
value: "{{ region }}"
description: Required parameter for the segments resource.
- name: WriteSegmentRequest
description: |
Specifies the configuration, dimension, and other settings for a segment. A WriteSegmentRequest object can include a Dimensions object or a SegmentGroups object, but not both.
value:
Dimensions:
Attributes: "{{ Attributes }}"
Behavior:
Recency:
Duration: "{{ Duration }}"
RecencyType: "{{ RecencyType }}"
Demographic:
AppVersion:
DimensionType: "{{ DimensionType }}"
Values:
- "{{ Values }}"
Channel:
DimensionType: "{{ DimensionType }}"
Values:
- "{{ Values }}"
DeviceType:
DimensionType: "{{ DimensionType }}"
Values:
- "{{ Values }}"
Make:
DimensionType: "{{ DimensionType }}"
Values:
- "{{ Values }}"
Model:
DimensionType: "{{ DimensionType }}"
Values:
- "{{ Values }}"
Platform:
DimensionType: "{{ DimensionType }}"
Values:
- "{{ Values }}"
Location:
Country:
DimensionType: "{{ DimensionType }}"
Values:
- "{{ Values }}"
GPSPoint:
Coordinates:
Latitude: {{ Latitude }}
Longitude: {{ Longitude }}
RangeInKilometers: {{ RangeInKilometers }}
Metrics: "{{ Metrics }}"
UserAttributes: "{{ UserAttributes }}"
Name: "{{ Name }}"
SegmentGroups:
Groups:
- Dimensions: "{{ Dimensions }}"
SourceSegments: "{{ SourceSegments }}"
SourceType: "{{ SourceType }}"
Type: "{{ Type }}"
Include: "{{ Include }}"
tags: "{{ tags }}"
UPDATE examples
- update_segment
Creates a new segment for an application or updates the configuration, dimension, and other settings for an existing segment that's associated with an application.
UPDATE aws.pinpoint.segments
SET
WriteSegmentRequest = '{{ WriteSegmentRequest }}'
WHERE
`application-id` = '{{ application-id }}' --required
AND `segment-id` = '{{ segment-id }}' --required
AND region = '{{ region }}' --required
AND WriteSegmentRequest = '{{ WriteSegmentRequest }}' --required
RETURNING
segment_response;
DELETE examples
- delete_segment
Deletes a segment from an application.
DELETE FROM aws.pinpoint.segments
WHERE `application-id` = '{{ application-id }}' --required
AND `segment-id` = '{{ segment-id }}' --required
AND region = '{{ region }}' --required
;