Class: VoucherifySdk::SegmentsApi

Inherits:
Object
  • Object
show all
Defined in:
lib/VoucherifySdk/api/segments_api.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(api_client = ApiClient.default) ⇒ SegmentsApi

Returns a new instance of SegmentsApi.



19
20
21
# File 'lib/VoucherifySdk/api/segments_api.rb', line 19

def initialize(api_client = ApiClient.default)
  @api_client = api_client
end

Instance Attribute Details

#api_clientObject

Returns the value of attribute api_client.



17
18
19
# File 'lib/VoucherifySdk/api/segments_api.rb', line 17

def api_client
  @api_client
end

Instance Method Details

#create_segment(opts = {}) ⇒ SegmentsCreateResponseBody

Create Segment Create a customer segment. 🚧 Limit on static segments There is a cap on the number of customers that you can assign to a static segment: 20,000. If you would like to create a bigger segment, then you can use the unlimited auto-update or passive segment instead and use some customer metadata to build this segment. 🚧 Limit on Active and Passive segments You can create a maximum of 100 passive and active segments.

Parameters:

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

Returns:



27
28
29
30
# File 'lib/VoucherifySdk/api/segments_api.rb', line 27

def create_segment(opts = {})
  data, _status_code, _headers = create_segment_with_http_info(opts)
  data
end

#delete_segment(segment_id, opts = {}) ⇒ nil

Delete Segment This method deletes a customer segment.

Parameters:

  • segment_id (String)

    A unique customer segment ID.

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (nil)


91
92
93
94
# File 'lib/VoucherifySdk/api/segments_api.rb', line 91

def delete_segment(segment_id, opts = {})
  delete_segment_with_http_info(segment_id, opts)
  nil
end

#get_segment(segment_id, opts = {}) ⇒ SegmentsGetResponseBody

Get Segment Retrieves the segment with a given segment ID. This method doesnt return the customers that belong to the segment. To return a list of customers who belong to a segment, use GET List customers endpoint with the segment_id query parameter.

Parameters:

  • segment_id (String)

    A unique customer segment ID.

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



148
149
150
151
# File 'lib/VoucherifySdk/api/segments_api.rb', line 148

def get_segment(segment_id, opts = {})
  data, _status_code, _headers = get_segment_with_http_info(segment_id, opts)
  data
end