segments

package
v1.0.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 30, 2026 License: MIT Imports: 5 Imported by: 0

Documentation

Overview

Package segments provides a service for managing Intercom segments.

Segments are saved filters that dynamically group contacts based on attributes and behavior.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type List

type List struct {
	Type     string    `json:"type"`
	Segments []Segment `json:"segments"`
}

List represents the response from the list segments endpoint.

func ParseListResult

func ParseListResult(r *api.Result) (*List, error)

ParseListResult decodes a Result into a List.

type ListOptions

type ListOptions struct {
	IncludeCount *bool `url:"include_count,omitempty"`
}

ListOptions specifies optional parameters to the List method.

type Segment

type Segment struct {
	Type       string `json:"type"`
	ID         string `json:"id"`
	Name       string `json:"name,omitempty"`
	CreatedAt  int64  `json:"created_at,omitempty"`
	UpdatedAt  int64  `json:"updated_at,omitempty"`
	PersonType string `json:"person_type,omitempty"`
	Count      int    `json:"count,omitempty"`
}

Segment represents an Intercom segment.

func ParseGetResult

func ParseGetResult(r *api.Result) (*Segment, error)

ParseGetResult decodes a Result into a Segment.

type Service

type Service struct {
	// contains filtered or unexported fields
}

Service handles communication with the segment related methods of the Intercom API.

func NewService

func NewService(c api.Caller) *Service

NewService creates a new segments Service.

func (*Service) GetRaw

func (s *Service) GetRaw(ctx context.Context, id string) (*api.Result, error)

GetRaw retrieves a segment by ID with the full HTTP result.

See: https://developers.intercom.com/docs/references/rest-api/api.intercom.io/segments/retrievesegment

func (*Service) ListRaw

func (s *Service) ListRaw(ctx context.Context, opts *ListOptions) (*api.Result, error)

ListRaw returns all segments with the full HTTP result.

See: https://developers.intercom.com/docs/references/rest-api/api.intercom.io/segments/listsegments

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL