Sha256: d760a99bcceb1881a626da15e52fd47dc3388cd0d8b12c347adb22237c132385

Contents?: true

Size: 1.91 KB

Versions: 12

Compression:

Stored size: 1.91 KB

Contents

module PerformanceExtension

  def get_performances_by_production(ids, mode_of_sale=nil, options={})
    parameters =
      {
        'ProductionSeasonIds': ids,
        'BusinessUnitId': 1,
        'ModeOfSaleId': mode_of_sale
      }
    options.merge!(basic_auth: @auth, headers: @headers)
    options.merge!(:body => parameters)
    response = self.class.post(base_api_endpoint('TXN/Performances/Search'), options)
  end

  def get_performance_summaries(production_season_id, performance_ids=nil, season_ids=nil, options={})
    options.merge!(basic_auth: @auth, headers: @headers)
    response = self.class.get(base_api_endpoint("/TXN/Performances/Summary?performanceIds=#{performance_ids}&seasonIds=#{season_ids}&productionSeasonId=#{production_season_id}"), options)
    JSON.parse(response.body)
  end

  def get_performance_detail(id, options={})
    options.merge!(basic_auth: @auth, headers: @headers)
    response = self.class.get(base_api_endpoint("TXN/Performances?performanceIds=#{id}"), options)
    JSON.parse(response.body)
  end

  def get_performance_availability(ids, sections_ids=nil, options={})
    options.merge!(basic_auth: @auth, headers: @headers)
    response = self.class.get(base_api_endpoint("TXN/Performances/Zones?performanceIds=#{ids}&sectionIds=#{sections_ids}"), options)
    JSON.parse(response.body)
  end

  def get_performance_seats(id, mode_of_sale, constituent_id, section_id, options={})
    options.merge!(basic_auth: @auth, headers: @headers)
    response = self.class.get(base_api_endpoint("TXN/Performances/#{id}/Seats?modeOfSaleId=#{mode_of_sale}&constituentId=#{constituent_id}&sectionIds=#{section_id}"), options)
    JSON.parse(response.body)
  end

  def get_performance_seat_summaries(id, options={})
    options.merge!(basic_auth: @auth, headers: @headers)
    response = self.class.get(base_api_endpoint("TXN/Performances/#{id}/Seats/Summary"), options)
    JSON.parse(response.body)
  end

end

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
tessitura_rest-0.8.6.3 lib/tessitura_rest/txn/performance_extension.rb
tessitura_rest-0.8.6.2 lib/tessitura_rest/txn/performance_extension.rb
tessitura_rest-0.8.6.1 lib/tessitura_rest/txn/performance_extension.rb
tessitura_rest-0.8.6 lib/tessitura_rest/txn/performance_extension.rb
tessitura_rest-0.8.5.1 lib/tessitura_rest/txn/performance_extension.rb
tessitura_rest-0.8.5 lib/tessitura_rest/txn/performance_extension.rb
tessitura_rest-0.8.4 lib/tessitura_rest/txn/performance_extension.rb
tessitura_rest-0.8.3 lib/tessitura_rest/txn/performance_extension.rb
tessitura_rest-0.8.2 lib/tessitura_rest/txn/performance_extension.rb
tessitura_rest-0.8.1 lib/tessitura_rest/txn/performance_extension.rb
tessitura_rest-0.8 lib/tessitura_rest/txn/performance_extension.rb
tessitura_rest-0.7.9 lib/tessitura_rest/txn/performance_extension.rb