Documentation ¶
Index ¶
- type AllSegments200
- type ApiService
- func (c *ApiService) CreateSegment(params *CreateSegmentParam) (interface{}, error)
- func (c *ApiService) DeleteSegment(params *DeleteSegmentParam) (interface{}, error)
- func (c *ApiService) GetSegment(params *GetSegmentParam) (interface{}, error)
- func (c *ApiService) ListSegment(params *ListSegmentParam) (interface{}, error)
- func (c *ApiService) RefreshSegment(params *RefreshSegmentParam) (interface{}, error)
- func (c *ApiService) UpdateSegment(params *UpdateSegmentParam) (interface{}, error)
- type ContactResponse
- type ContactResponseCustomFields
- type CreateSegmentParam
- type DeleteSegmentParam
- type ErrorsSegmentV2
- type ErrorsSegmentV2ErrorsInner
- type GetSegmentParam
- type ListSegmentParam
- type Metadata
- type RefreshSegmentParam
- type Segment2xx
- type SegmentError
- type SegmentRefresh202
- type SegmentRefreshRequest
- type SegmentStatusResponse
- type SegmentUpdate
- type SegmentWriteV2
- type UpdateSegmentParam
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AllSegments200 ¶
type AllSegments200 struct { // ID assigned to the segment when created. Id string `json:"id"` // Name of the segment. Name string `json:"name"` // Total number of contacts present in the segment ContactsCount int32 `json:"contacts_count"` // ISO8601 timestamp of when the object was created CreatedAt string `json:"created_at"` // ISO8601 timestamp of when the object was last updated UpdatedAt string `json:"updated_at"` // ISO8601 timestamp of when the samples were last updated SampleUpdatedAt string `json:"sample_updated_at"` // ISO8601 timestamp of when the samples will be next updated NextSampleUpdate string `json:"next_sample_update"` // The array of list ids to filter contacts on when building this segment. It allows only one such list id for now. We will support more in future ParentListIds []string `json:"parent_list_ids"` // If not set, segment contains a query for use with Segment v1 APIs. If set to '2', segment contains a SQL query for use in v2. QueryVersion string `json:"query_version"` Metadata *Metadata `json:"_metadata,omitempty"` Status SegmentStatusResponse `json:"status"` }
AllSegments200 struct for AllSegments200
type ApiService ¶
type ApiService struct {
// contains filtered or unexported fields
}
func NewApiService ¶
func NewApiService(requestHandler *sendgrid.RequestHandler) *ApiService
func NewApiServiceWithClient ¶
func NewApiServiceWithClient(client sendgrid.BaseClient) *ApiService
func (*ApiService) CreateSegment ¶
func (c *ApiService) CreateSegment(params *CreateSegmentParam) (interface{}, error)
Segment `name` has to be unique. A user can not create a new segment with an existing segment name.
func (*ApiService) DeleteSegment ¶
func (c *ApiService) DeleteSegment(params *DeleteSegmentParam) (interface{}, error)
**This endpoint allows you to delete a segment by ID.**
func (*ApiService) GetSegment ¶
func (c *ApiService) GetSegment(params *GetSegmentParam) (interface{}, error)
Get Marketing Campaigns Segment by ID
func (*ApiService) ListSegment ¶
func (c *ApiService) ListSegment(params *ListSegmentParam) (interface{}, error)
**This endpoint allows you to retrieve a list of segments.** The query param `parent_list_ids` is treated as a filter. Any match will be returned. Zero matches will return a response code of 200 with an empty `results` array. `parent_list_ids` | `no_parent_list_id` | `ids` | `result` -----------------:|:--------------------:|:-------------:|:-------------: empty | false | empty | all segments values list_ids | false | empty | segments filtered by list_ids values list_ids |true | empty | segments filtered by list_ids and segments with no parent list_ids empty empty | true | empty | segments with no parent list_ids anything | anything | ids | segments with matching segment ids |
func (*ApiService) RefreshSegment ¶
func (c *ApiService) RefreshSegment(params *RefreshSegmentParam) (interface{}, error)
Manually refresh a segment by segment ID.
func (*ApiService) UpdateSegment ¶
func (c *ApiService) UpdateSegment(params *UpdateSegmentParam) (interface{}, error)
Segment `name` has to be unique. A user can not create a new segment with an existing segment name.
type ContactResponse ¶
type ContactResponse struct { // ID assigned to a contact when added to the system. Id string `json:"id"` // Email of the contact. This is a reserved field. Email *string `json:"email,omitempty"` // The contact's Phone Number ID. This must be a valid phone number. PhoneNumberId *string `json:"phone_number_id,omitempty"` // The contact's External ID. ExternalId *string `json:"external_id,omitempty"` // The contact's Anonymous ID. AnonymousId *string `json:"anonymous_id,omitempty"` // Alternate emails of the contact. This is a reserved field. AlternateEmails []string `json:"alternate_emails"` // First name of the contact. This is a reserved field. FirstName string `json:"first_name"` // Last name of the contact. This is a reserved field. LastName string `json:"last_name"` // First line of address of the contact. This is a reserved field. AddressLine1 string `json:"address_line_1"` // Second line of address of the contact. This is a reserved field. AddressLine2 string `json:"address_line_2"` // City associated with the contact. This is a reserved field. City string `json:"city"` // State associated with the contact. This is a reserved field. StateProvinceRegion string `json:"state_province_region"` // Zipcode associated with the address of the contact. This is a reserved field. PostalCode int32 `json:"postal_code"` // Country associated with the address of the contact. This is a reserved field. Country string `json:"country"` // IDs of all lists the contact is part of ListIds *[]string `json:"list_ids,omitempty"` CustomFields ContactResponseCustomFields `json:"custom_fields"` // IDs of all segments the contact is part of SegmentIds *[]string `json:"segment_ids,omitempty"` }
ContactResponse struct for ContactResponse
type ContactResponseCustomFields ¶
type ContactResponseCustomFields struct { CustomFieldName1 *string `json:"custom_field_name1,omitempty"` CustomFieldName2 *string `json:"custom_field_name2,omitempty"` }
ContactResponseCustomFields The user may choose to create up to 120 custom fields or none at all. This is not a reserved field.
type CreateSegmentParam ¶
type CreateSegmentParam struct { // SegmentWriteV2 *SegmentWriteV2 `json:"SegmentWriteV2,omitempty"` }
func (*CreateSegmentParam) SetSegmentWriteV2 ¶
func (params *CreateSegmentParam) SetSegmentWriteV2(SegmentWriteV2 SegmentWriteV2) *CreateSegmentParam
type DeleteSegmentParam ¶
type DeleteSegmentParam struct { // SegmentId *string `json:"segment_id"` }
func (*DeleteSegmentParam) SetSegmentId ¶
func (params *DeleteSegmentParam) SetSegmentId(SegmentId string) *DeleteSegmentParam
type ErrorsSegmentV2 ¶
type ErrorsSegmentV2 struct {
Errors []ErrorsSegmentV2ErrorsInner `json:"errors"`
}
ErrorsSegmentV2 If the request is incorrect, an array of errors will be returned.
type ErrorsSegmentV2ErrorsInner ¶
type ErrorsSegmentV2ErrorsInner struct { // the field in the request body that is incorrect Field string `json:"field"` // a description of what is specifically wrong with the field passed in the request Message string `json:"message"` }
ErrorsSegmentV2ErrorsInner struct for ErrorsSegmentV2ErrorsInner
type GetSegmentParam ¶
type GetSegmentParam struct { // SegmentId *string `json:"segment_id"` // Defaults to `true`. Set to `false` to exclude the contacts_sample in the response. ContactsSample *bool `json:"contacts_sample,omitempty"` }
func (*GetSegmentParam) SetContactsSample ¶
func (params *GetSegmentParam) SetContactsSample(ContactsSample bool) *GetSegmentParam
func (*GetSegmentParam) SetSegmentId ¶
func (params *GetSegmentParam) SetSegmentId(SegmentId string) *GetSegmentParam
type ListSegmentParam ¶
type ListSegmentParam struct { // A list of segment IDs to retrieve. When this parameter is included, the `no_parent_list_ids` and `parent_list_ids` parameters are ignored and only segments with given IDs are returned. Ids *[]string `json:"ids,omitempty"` // A comma separated list up to 50 in size, to filter segments on. Only segments that have any of these list ids as the parent list will be retrieved. This is different from the parameter of the same name used when creating a segment. ParentListIds *string `json:"parent_list_ids,omitempty"` // If set to `true`, segments with an empty value of `parent_list_id` will be returned in the filter. If the value is not present, it defaults to 'false'. NoParentListId *bool `json:"no_parent_list_id,omitempty"` }
func (*ListSegmentParam) SetIds ¶
func (params *ListSegmentParam) SetIds(Ids []string) *ListSegmentParam
func (*ListSegmentParam) SetNoParentListId ¶
func (params *ListSegmentParam) SetNoParentListId(NoParentListId bool) *ListSegmentParam
func (*ListSegmentParam) SetParentListIds ¶
func (params *ListSegmentParam) SetParentListIds(ParentListIds string) *ListSegmentParam
type Metadata ¶
type Metadata struct { Prev *string `json:"prev,omitempty"` Self *string `json:"self,omitempty"` Next *string `json:"next,omitempty"` Count *int32 `json:"count,omitempty"` }
Metadata struct for Metadata
type RefreshSegmentParam ¶
type RefreshSegmentParam struct { // SegmentId *string `json:"segment_id"` // SegmentRefreshRequest *SegmentRefreshRequest `json:"SegmentRefreshRequest"` }
func (*RefreshSegmentParam) SetSegmentId ¶
func (params *RefreshSegmentParam) SetSegmentId(SegmentId string) *RefreshSegmentParam
func (*RefreshSegmentParam) SetSegmentRefreshRequest ¶
func (params *RefreshSegmentParam) SetSegmentRefreshRequest(SegmentRefreshRequest SegmentRefreshRequest) *RefreshSegmentParam
type Segment2xx ¶
type Segment2xx struct { // ID assigned to the segment when created. Id string `json:"id"` // Name of the segment. Name string `json:"name"` // SQL query which will filter contacts based on the conditions provided QueryDsl string `json:"query_dsl"` // Total number of contacts present in the segment ContactsCount int32 `json:"contacts_count"` // A subset of all contacts that are in this segment ContactsSample []ContactResponse `json:"contacts_sample"` // ISO8601 timestamp of when the object was created CreatedAt string `json:"created_at"` // ISO8601 timestamp of when the object was last updated UpdatedAt string `json:"updated_at"` // ISO8601 timestamp of when the samples were last updated SampleUpdatedAt string `json:"sample_updated_at"` // ISO8601 timestamp of when the samples will be next updated NextSampleUpdate string `json:"next_sample_update"` // The array of list ids to filter contacts on when building this segment. It allows only one such list id for now. We will support more in future ParentListIds []string `json:"parent_list_ids"` // If not set, segment contains a Query for use with Segment v1 APIs. If set to '2', segment contains a SQL query for use in v2. QueryVersion string `json:"query_version"` Status SegmentStatusResponse `json:"status"` // The number of times a segment has been manually refreshed since start of today in the user's timezone. RefreshesUsed *int32 `json:"refreshes_used,omitempty"` // The maximum number of manual refreshes allowed per day for this segment. Currently, only 2 are allowed. MaxRefreshes *int32 `json:"max_refreshes,omitempty"` // The ISO8601 timestamp when the segment was last refreshed in UTC time. LastRefreshedAt *string `json:"last_refreshed_at,omitempty"` }
Segment2xx struct for Segment2xx
type SegmentError ¶
type SegmentError struct { // A description of the error. Error string `json:"error"` }
SegmentError struct for SegmentError
type SegmentRefresh202 ¶
type SegmentRefresh202 struct { // The ID of the manual refresh job. Used only for internal purposes. JobId *string `json:"job_id,omitempty"` }
SegmentRefresh202 struct for SegmentRefresh202
type SegmentRefreshRequest ¶
type SegmentRefreshRequest struct { // The user's timezone. The timezone is used to reset the refresh count at midnight in the user's local time. Only [IANA time zone format](https://en.wikipedia.org/wiki/List_of_tz_database_time_zones) is accepted. UserTimeZone string `json:"user_time_zone"` }
SegmentRefreshRequest struct for SegmentRefreshRequest
type SegmentStatusResponse ¶
type SegmentStatusResponse struct { // Status of query validation. PENDING, VALID, or INVALID QueryValidation string `json:"query_validation"` // Describes any errors that were encountered during query validation ErrorMessage *string `json:"error_message,omitempty"` }
SegmentStatusResponse Segment status indicates whether the segment's contacts will be updated periodically
type SegmentUpdate ¶
type SegmentUpdate struct { // Name of the segment. Name *string `json:"name,omitempty"` // SQL query which will filter contacts based on the conditions provided QueryDsl *string `json:"query_dsl,omitempty"` }
SegmentUpdate struct for SegmentUpdate
type SegmentWriteV2 ¶
type SegmentWriteV2 struct { // Name of the segment. Name string `json:"name"` // The array of list ids to filter contacts on when building this segment. It allows only one such list id for now. We will support more in future ParentListIds *[]string `json:"parent_list_ids,omitempty"` // SQL query which will filter contacts based on the conditions provided QueryDsl string `json:"query_dsl"` }
SegmentWriteV2 struct for SegmentWriteV2
type UpdateSegmentParam ¶
type UpdateSegmentParam struct { // SegmentId *string `json:"segment_id"` // SegmentUpdate *SegmentUpdate `json:"SegmentUpdate,omitempty"` }
func (*UpdateSegmentParam) SetSegmentId ¶
func (params *UpdateSegmentParam) SetSegmentId(SegmentId string) *UpdateSegmentParam
func (*UpdateSegmentParam) SetSegmentUpdate ¶
func (params *UpdateSegmentParam) SetSegmentUpdate(SegmentUpdate SegmentUpdate) *UpdateSegmentParam
Source Files ¶
- api_create_segment.go
- api_delete_segment.go
- api_get_segment.go
- api_list_segment.go
- api_refresh_segment.go
- api_service.go
- api_update_segment.go
- model_all_segments200.go
- model_contact_response.go
- model_contact_response_custom_fields.go
- model_errors_segment_v2.go
- model_errors_segment_v2_errors_inner.go
- model_metadata.go
- model_segment2xx.go
- model_segment_error.go
- model_segment_refresh202.go
- model_segment_refresh_request.go
- model_segment_status_response.go
- model_segment_update.go
- model_segment_write_v2.go