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 segment instead and use some customer metadata to build this segment.

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 given segment ID.

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