class SamplifyAPIClient::LineItemsApi

Attributes

api_client[RW]

Public Class Methods

new(api_client = ApiClient.default) click to toggle source
# File lib/samplify_api_client/api/line_items_api.rb, line 19
def initialize(api_client = ApiClient.default)
  @api_client = api_client
end

Public Instance Methods

line_items_close(ext_line_item_id, ext_project_id, opts = {}) click to toggle source

close lineItems @param ext_line_item_id @param ext_project_id @param [Hash] opts the optional parameters @return [CreateLineItem]

# File lib/samplify_api_client/api/line_items_api.rb, line 27
def line_items_close(ext_line_item_id, ext_project_id, opts = {})
  data, _status_code, _headers = line_items_close_with_http_info(ext_line_item_id, ext_project_id, opts)
  data
end
line_items_close_with_http_info(ext_line_item_id, ext_project_id, opts = {}) click to toggle source

close lineItems @param ext_line_item_id @param ext_project_id @param [Hash] opts the optional parameters @return [Array<(CreateLineItem, Fixnum, Hash)>] CreateLineItem data, response status code and response headers

# File lib/samplify_api_client/api/line_items_api.rb, line 37
def line_items_close_with_http_info(ext_line_item_id, ext_project_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: LineItemsApi.line_items_close ...'
  end
  # verify the required parameter 'ext_line_item_id' is set
  if @api_client.config.client_side_validation && ext_line_item_id.nil?
    fail ArgumentError, "Missing the required parameter 'ext_line_item_id' when calling LineItemsApi.line_items_close"
  end
  # verify the required parameter 'ext_project_id' is set
  if @api_client.config.client_side_validation && ext_project_id.nil?
    fail ArgumentError, "Missing the required parameter 'ext_project_id' when calling LineItemsApi.line_items_close"
  end
  # resource path
  local_var_path = '/sample/v1/projects/{extProjectId}/lineItems/{extLineItemId}/close'.sub('{' + 'extLineItemId' + '}', ext_line_item_id.to_s).sub('{' + 'extProjectId' + '}', ext_project_id.to_s)

  # query parameters
  query_params = {}

  # header parameters
  header_params = {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/vnd.createlineitem+json'])
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json', 'application/xml', 'application/gob', 'application/x-gob'])

  # form parameters
  form_params = {}

  # http body (model)
  post_body = nil
  auth_names = ['jwt']
  data, status_code, headers = @api_client.call_api(:POST, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'CreateLineItem')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: LineItemsApi#line_items_close\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end
line_items_create(ext_project_id, payload, opts = {}) click to toggle source

create lineItems @param ext_project_id @param payload @param [Hash] opts the optional parameters @return [CreateLineItem]

# File lib/samplify_api_client/api/line_items_api.rb, line 85
def line_items_create(ext_project_id, payload, opts = {})
  data, _status_code, _headers = line_items_create_with_http_info(ext_project_id, payload, opts)
  data
end
line_items_create_with_http_info(ext_project_id, payload, opts = {}) click to toggle source

create lineItems @param ext_project_id @param payload @param [Hash] opts the optional parameters @return [Array<(CreateLineItem, Fixnum, Hash)>] CreateLineItem data, response status code and response headers

# File lib/samplify_api_client/api/line_items_api.rb, line 95
def line_items_create_with_http_info(ext_project_id, payload, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: LineItemsApi.line_items_create ...'
  end
  # verify the required parameter 'ext_project_id' is set
  if @api_client.config.client_side_validation && ext_project_id.nil?
    fail ArgumentError, "Missing the required parameter 'ext_project_id' when calling LineItemsApi.line_items_create"
  end
  # verify the required parameter 'payload' is set
  if @api_client.config.client_side_validation && payload.nil?
    fail ArgumentError, "Missing the required parameter 'payload' when calling LineItemsApi.line_items_create"
  end
  # resource path
  local_var_path = '/sample/v1/projects/{extProjectId}/lineItems'.sub('{' + 'extProjectId' + '}', ext_project_id.to_s)

  # query parameters
  query_params = {}

  # header parameters
  header_params = {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/vnd.createlineitem+json'])
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json', 'application/xml', 'application/gob', 'application/x-gob'])

  # form parameters
  form_params = {}

  # http body (model)
  post_body = @api_client.object_to_http_body(payload)
  auth_names = ['jwt']
  data, status_code, headers = @api_client.call_api(:POST, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'CreateLineItem')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: LineItemsApi#line_items_create\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end
line_items_get(ext_line_item_id, ext_project_id, opts = {}) click to toggle source

get lineItems @param ext_line_item_id @param ext_project_id @param [Hash] opts the optional parameters @return [CreateLineItem]

# File lib/samplify_api_client/api/line_items_api.rb, line 143
def line_items_get(ext_line_item_id, ext_project_id, opts = {})
  data, _status_code, _headers = line_items_get_with_http_info(ext_line_item_id, ext_project_id, opts)
  data
end
line_items_get_with_http_info(ext_line_item_id, ext_project_id, opts = {}) click to toggle source

get lineItems @param ext_line_item_id @param ext_project_id @param [Hash] opts the optional parameters @return [Array<(CreateLineItem, Fixnum, Hash)>] CreateLineItem data, response status code and response headers

# File lib/samplify_api_client/api/line_items_api.rb, line 153
def line_items_get_with_http_info(ext_line_item_id, ext_project_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: LineItemsApi.line_items_get ...'
  end
  # verify the required parameter 'ext_line_item_id' is set
  if @api_client.config.client_side_validation && ext_line_item_id.nil?
    fail ArgumentError, "Missing the required parameter 'ext_line_item_id' when calling LineItemsApi.line_items_get"
  end
  # verify the required parameter 'ext_project_id' is set
  if @api_client.config.client_side_validation && ext_project_id.nil?
    fail ArgumentError, "Missing the required parameter 'ext_project_id' when calling LineItemsApi.line_items_get"
  end
  # resource path
  local_var_path = '/sample/v1/projects/{extProjectId}/lineItems/{extLineItemId}'.sub('{' + 'extLineItemId' + '}', ext_line_item_id.to_s).sub('{' + 'extProjectId' + '}', ext_project_id.to_s)

  # query parameters
  query_params = {}

  # header parameters
  header_params = {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/vnd.createlineitem+json'])
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json', 'application/xml', 'application/gob', 'application/x-gob'])

  # form parameters
  form_params = {}

  # http body (model)
  post_body = nil
  auth_names = ['jwt']
  data, status_code, headers = @api_client.call_api(:GET, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'CreateLineItem')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: LineItemsApi#line_items_get\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end
line_items_launch(ext_line_item_id, ext_project_id, opts = {}) click to toggle source

launch lineItems @param ext_line_item_id @param ext_project_id @param [Hash] opts the optional parameters @return [CreateLineItem]

# File lib/samplify_api_client/api/line_items_api.rb, line 201
def line_items_launch(ext_line_item_id, ext_project_id, opts = {})
  data, _status_code, _headers = line_items_launch_with_http_info(ext_line_item_id, ext_project_id, opts)
  data
end
line_items_launch_with_http_info(ext_line_item_id, ext_project_id, opts = {}) click to toggle source

launch lineItems @param ext_line_item_id @param ext_project_id @param [Hash] opts the optional parameters @return [Array<(CreateLineItem, Fixnum, Hash)>] CreateLineItem data, response status code and response headers

# File lib/samplify_api_client/api/line_items_api.rb, line 211
def line_items_launch_with_http_info(ext_line_item_id, ext_project_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: LineItemsApi.line_items_launch ...'
  end
  # verify the required parameter 'ext_line_item_id' is set
  if @api_client.config.client_side_validation && ext_line_item_id.nil?
    fail ArgumentError, "Missing the required parameter 'ext_line_item_id' when calling LineItemsApi.line_items_launch"
  end
  # verify the required parameter 'ext_project_id' is set
  if @api_client.config.client_side_validation && ext_project_id.nil?
    fail ArgumentError, "Missing the required parameter 'ext_project_id' when calling LineItemsApi.line_items_launch"
  end
  # resource path
  local_var_path = '/sample/v1/projects/{extProjectId}/lineItems/{extLineItemId}/launch'.sub('{' + 'extLineItemId' + '}', ext_line_item_id.to_s).sub('{' + 'extProjectId' + '}', ext_project_id.to_s)

  # query parameters
  query_params = {}

  # header parameters
  header_params = {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/vnd.createlineitem+json'])
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json', 'application/xml', 'application/gob', 'application/x-gob'])

  # form parameters
  form_params = {}

  # http body (model)
  post_body = nil
  auth_names = ['jwt']
  data, status_code, headers = @api_client.call_api(:POST, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'CreateLineItem')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: LineItemsApi#line_items_launch\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end
line_items_list_line_items(ext_project_id, opts = {}) click to toggle source

listLineItems lineItems @param ext_project_id External Project ID @param [Hash] opts the optional parameters @option opts [String] :country_iso_code Only return line items with the given country ISO Code @option opts [String] :ext_line_item_id Only return line items with the given extLineItemId @option opts [String] :language_iso_code Only return line items with the given language ISO Code @option opts [Integer] :limit Maximum number of line items to return (default to 10) @option opts [Integer] :offset The first zero-based offset line item to return (default to 0) @option opts [Array<String>] :sort Sort the line items by the given key(s) @option opts [String] :state Only return lineitems with the given state @option opts [String] :state_reason Only return line items with the given state reason @option opts [String] :title Only return line items with the given title @return [LineItems]

# File lib/samplify_api_client/api/line_items_api.rb, line 267
def line_items_list_line_items(ext_project_id, opts = {})
  data, _status_code, _headers = line_items_list_line_items_with_http_info(ext_project_id, opts)
  data
end
line_items_list_line_items_with_http_info(ext_project_id, opts = {}) click to toggle source

listLineItems lineItems @param ext_project_id External Project ID @param [Hash] opts the optional parameters @option opts [String] :country_iso_code Only return line items with the given country ISO Code @option opts [String] :ext_line_item_id Only return line items with the given extLineItemId @option opts [String] :language_iso_code Only return line items with the given language ISO Code @option opts [Integer] :limit Maximum number of line items to return @option opts [Integer] :offset The first zero-based offset line item to return @option opts [Array<String>] :sort Sort the line items by the given key(s) @option opts [String] :state Only return lineitems with the given state @option opts [String] :state_reason Only return line items with the given state reason @option opts [String] :title Only return line items with the given title @return [Array<(LineItems, Fixnum, Hash)>] LineItems data, response status code and response headers

# File lib/samplify_api_client/api/line_items_api.rb, line 285
def line_items_list_line_items_with_http_info(ext_project_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: LineItemsApi.line_items_list_line_items ...'
  end
  # verify the required parameter 'ext_project_id' is set
  if @api_client.config.client_side_validation && ext_project_id.nil?
    fail ArgumentError, "Missing the required parameter 'ext_project_id' when calling LineItemsApi.line_items_list_line_items"
  end
  if @api_client.config.client_side_validation && !opts[:'limit'].nil? && opts[:'limit'] > 100
    fail ArgumentError, 'invalid value for "opts[:"limit"]" when calling LineItemsApi.line_items_list_line_items, must be smaller than or equal to 100.'
  end

  if @api_client.config.client_side_validation && !opts[:'limit'].nil? && opts[:'limit'] < 1
    fail ArgumentError, 'invalid value for "opts[:"limit"]" when calling LineItemsApi.line_items_list_line_items, must be greater than or equal to 1.'
  end

  if @api_client.config.client_side_validation && !opts[:'offset'].nil? && opts[:'offset'] < 0
    fail ArgumentError, 'invalid value for "opts[:"offset"]" when calling LineItemsApi.line_items_list_line_items, must be greater than or equal to 0.'
  end

  # resource path
  local_var_path = '/sample/v1/projects/{extProjectId}/lineItems'.sub('{' + 'extProjectId' + '}', ext_project_id.to_s)

  # query parameters
  query_params = {}
  query_params[:'countryISOCode'] = opts[:'country_iso_code'] if !opts[:'country_iso_code'].nil?
  query_params[:'extLineItemId'] = opts[:'ext_line_item_id'] if !opts[:'ext_line_item_id'].nil?
  query_params[:'languageISOCode'] = opts[:'language_iso_code'] if !opts[:'language_iso_code'].nil?
  query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil?
  query_params[:'offset'] = opts[:'offset'] if !opts[:'offset'].nil?
  query_params[:'sort'] = @api_client.build_collection_param(opts[:'sort'], :multi) if !opts[:'sort'].nil?
  query_params[:'state'] = opts[:'state'] if !opts[:'state'].nil?
  query_params[:'stateReason'] = opts[:'state_reason'] if !opts[:'state_reason'].nil?
  query_params[:'title'] = opts[:'title'] if !opts[:'title'].nil?

  # header parameters
  header_params = {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/vnd.lineitems+json'])
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json', 'application/xml', 'application/gob', 'application/x-gob'])

  # form parameters
  form_params = {}

  # http body (model)
  post_body = nil
  auth_names = ['jwt']
  data, status_code, headers = @api_client.call_api(:GET, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'LineItems')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: LineItemsApi#line_items_list_line_items\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end
line_items_pause(ext_line_item_id, ext_project_id, opts = {}) click to toggle source

pause lineItems @param ext_line_item_id @param ext_project_id @param [Hash] opts the optional parameters @return [CreateLineItem]

# File lib/samplify_api_client/api/line_items_api.rb, line 350
def line_items_pause(ext_line_item_id, ext_project_id, opts = {})
  data, _status_code, _headers = line_items_pause_with_http_info(ext_line_item_id, ext_project_id, opts)
  data
end
line_items_pause_with_http_info(ext_line_item_id, ext_project_id, opts = {}) click to toggle source

pause lineItems @param ext_line_item_id @param ext_project_id @param [Hash] opts the optional parameters @return [Array<(CreateLineItem, Fixnum, Hash)>] CreateLineItem data, response status code and response headers

# File lib/samplify_api_client/api/line_items_api.rb, line 360
def line_items_pause_with_http_info(ext_line_item_id, ext_project_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: LineItemsApi.line_items_pause ...'
  end
  # verify the required parameter 'ext_line_item_id' is set
  if @api_client.config.client_side_validation && ext_line_item_id.nil?
    fail ArgumentError, "Missing the required parameter 'ext_line_item_id' when calling LineItemsApi.line_items_pause"
  end
  # verify the required parameter 'ext_project_id' is set
  if @api_client.config.client_side_validation && ext_project_id.nil?
    fail ArgumentError, "Missing the required parameter 'ext_project_id' when calling LineItemsApi.line_items_pause"
  end
  # resource path
  local_var_path = '/sample/v1/projects/{extProjectId}/lineItems/{extLineItemId}/pause'.sub('{' + 'extLineItemId' + '}', ext_line_item_id.to_s).sub('{' + 'extProjectId' + '}', ext_project_id.to_s)

  # query parameters
  query_params = {}

  # header parameters
  header_params = {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/vnd.createlineitem+json'])
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json', 'application/xml', 'application/gob', 'application/x-gob'])

  # form parameters
  form_params = {}

  # http body (model)
  post_body = nil
  auth_names = ['jwt']
  data, status_code, headers = @api_client.call_api(:POST, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'CreateLineItem')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: LineItemsApi#line_items_pause\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end
line_items_update(ext_line_item_id, ext_project_id, payload, opts = {}) click to toggle source

update lineItems @param ext_line_item_id @param ext_project_id @param payload @param [Hash] opts the optional parameters @return [CreateLineItem]

# File lib/samplify_api_client/api/line_items_api.rb, line 409
def line_items_update(ext_line_item_id, ext_project_id, payload, opts = {})
  data, _status_code, _headers = line_items_update_with_http_info(ext_line_item_id, ext_project_id, payload, opts)
  data
end
line_items_update_with_http_info(ext_line_item_id, ext_project_id, payload, opts = {}) click to toggle source

update lineItems @param ext_line_item_id @param ext_project_id @param payload @param [Hash] opts the optional parameters @return [Array<(CreateLineItem, Fixnum, Hash)>] CreateLineItem data, response status code and response headers

# File lib/samplify_api_client/api/line_items_api.rb, line 420
def line_items_update_with_http_info(ext_line_item_id, ext_project_id, payload, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: LineItemsApi.line_items_update ...'
  end
  # verify the required parameter 'ext_line_item_id' is set
  if @api_client.config.client_side_validation && ext_line_item_id.nil?
    fail ArgumentError, "Missing the required parameter 'ext_line_item_id' when calling LineItemsApi.line_items_update"
  end
  # verify the required parameter 'ext_project_id' is set
  if @api_client.config.client_side_validation && ext_project_id.nil?
    fail ArgumentError, "Missing the required parameter 'ext_project_id' when calling LineItemsApi.line_items_update"
  end
  # verify the required parameter 'payload' is set
  if @api_client.config.client_side_validation && payload.nil?
    fail ArgumentError, "Missing the required parameter 'payload' when calling LineItemsApi.line_items_update"
  end
  # resource path
  local_var_path = '/sample/v1/projects/{extProjectId}/lineItems/{extLineItemId}'.sub('{' + 'extLineItemId' + '}', ext_line_item_id.to_s).sub('{' + 'extProjectId' + '}', ext_project_id.to_s)

  # query parameters
  query_params = {}

  # header parameters
  header_params = {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/vnd.createlineitem+json'])
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json', 'application/xml', 'application/gob', 'application/x-gob'])

  # form parameters
  form_params = {}

  # http body (model)
  post_body = @api_client.object_to_http_body(payload)
  auth_names = ['jwt']
  data, status_code, headers = @api_client.call_api(:POST, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'CreateLineItem')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: LineItemsApi#line_items_update\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end