Class: ChargeBee::Export
  
  
  
  
  
    - Inherits:
 
    - 
      Model
      
        
          - Object
 
          
            - Model
 
          
            - ChargeBee::Export
 
          
        
        show all
      
     
  
  
  
  
  
  
  
  
  
  
    - Defined in:
 
    - lib/chargebee/models/export.rb
 
  
  
 
Defined Under Namespace
  
    
  
    
      Classes: Download
    
  
  Instance Attribute Summary collapse
  
  
    
      Class Method Summary
      collapse
    
    
      
        - 
  
    
      .addons(params = {}, env = nil, headers = {})  ⇒ Object 
    
    
  
  
  
  
  
  
  
  
  
    
  
 
      
        - 
  
    
      .attached_items(params = {}, env = nil, headers = {})  ⇒ Object 
    
    
  
  
  
  
  
  
  
  
  
    
  
 
      
        - 
  
    
      .coupons(params = {}, env = nil, headers = {})  ⇒ Object 
    
    
  
  
  
  
  
  
  
  
  
    
  
 
      
        - 
  
    
      .credit_notes(params = {}, env = nil, headers = {})  ⇒ Object 
    
    
  
  
  
  
  
  
  
  
  
    
  
 
      
        - 
  
    
      .customers(params = {}, env = nil, headers = {})  ⇒ Object 
    
    
  
  
  
  
  
  
  
  
  
    
  
 
      
        - 
  
    
      .deferred_revenue(params, env = nil, headers = {})  ⇒ Object 
    
    
  
  
  
  
  
  
  
  
  
    
  
 
      
        - 
  
    
      .differential_prices(params = {}, env = nil, headers = {})  ⇒ Object 
    
    
  
  
  
  
  
  
  
  
  
    
  
 
      
        - 
  
    
      .invoices(params = {}, env = nil, headers = {})  ⇒ Object 
    
    
  
  
  
  
  
  
  
  
  
    
  
 
      
        - 
  
    
      .item_families(params = {}, env = nil, headers = {})  ⇒ Object 
    
    
  
  
  
  
  
  
  
  
  
    
  
 
      
        - 
  
    
      .item_prices(params = {}, env = nil, headers = {})  ⇒ Object 
    
    
  
  
  
  
  
  
  
  
  
    
  
 
      
        - 
  
    
      .items(params = {}, env = nil, headers = {})  ⇒ Object 
    
    
  
  
  
  
  
  
  
  
  
    
  
 
      
        - 
  
    
      .orders(params = {}, env = nil, headers = {})  ⇒ Object 
    
    
  
  
  
  
  
  
  
  
  
    
  
 
      
        - 
  
    
      .plans(params = {}, env = nil, headers = {})  ⇒ Object 
    
    
  
  
  
  
  
  
  
  
  
    
  
 
      
        - 
  
    
      .price_variants(params = {}, env = nil, headers = {})  ⇒ Object 
    
    
  
  
  
  
  
  
  
  
  
    
  
 
      
        - 
  
    
      .retrieve(id, env = nil, headers = {})  ⇒ Object 
    
    
  
  
  
  
  
  
  
  
  
    
  
 
      
        - 
  
    
      .revenue_recognition(params, env = nil, headers = {})  ⇒ Object 
    
    
  
  
  
  
  
  
  
  
  
    
  
 
      
        - 
  
    
      .subscriptions(params = {}, env = nil, headers = {})  ⇒ Object 
    
    
  
  
  
  
  
  
  
  
  
    
  
 
      
        - 
  
    
      .transactions(params = {}, env = nil, headers = {})  ⇒ Object 
    
    
  
  
  
  
  
  
  
  
  
    
  
 
      
    
  
    
      Instance Method Summary
      collapse
    
    
  
  
  
  
  
  
  
  
  
  Methods inherited from Model
  construct, #init_dependant, #init_dependant_list, #initialize, #inspect, #load, #method_missing, #replace_white_space_with_underscore, #to_s, uri_path
  Dynamic Method Handling
  
    This class handles dynamic methods through the method_missing method
    
      in the class ChargeBee::Model
    
  
  
 
  
    Instance Attribute Details
    
      
      
      
  
  
    #created_at  ⇒ Object 
  
  
  
  
    
Returns the value of attribute created_at.
   
 
  
  
    
      
8
9
10 
     | 
    
      # File 'lib/chargebee/models/export.rb', line 8
def created_at
  @created_at
end 
     | 
  
 
    
      
      
      
  
  
    #download  ⇒ Object 
  
  
  
  
    
Returns the value of attribute download.
   
 
  
  
    
      
8
9
10 
     | 
    
      # File 'lib/chargebee/models/export.rb', line 8
def download
  @download
end 
     | 
  
 
    
      
      
      
  
  
    #id  ⇒ Object 
  
  
  
  
    
Returns the value of attribute id.
   
 
  
  
    
      
8
9
10 
     | 
    
      # File 'lib/chargebee/models/export.rb', line 8
def id
  @id
end 
     | 
  
 
    
      
      
      
  
  
    #mime_type  ⇒ Object 
  
  
  
  
    
Returns the value of attribute mime_type.
   
 
  
  
    
      
8
9
10 
     | 
    
      # File 'lib/chargebee/models/export.rb', line 8
def mime_type
  @mime_type
end 
     | 
  
 
    
      
      
      
  
  
    #operation_type  ⇒ Object 
  
  
  
  
    
Returns the value of attribute operation_type.
   
 
  
  
    
      
8
9
10 
     | 
    
      # File 'lib/chargebee/models/export.rb', line 8
def operation_type
  @operation_type
end 
     | 
  
 
    
      
      
      
  
  
    #status  ⇒ Object 
  
  
  
  
    
Returns the value of attribute status.
   
 
  
  
    
      
8
9
10 
     | 
    
      # File 'lib/chargebee/models/export.rb', line 8
def status
  @status
end 
     | 
  
 
    
   
  
    Class Method Details
    
      
  
  
    .addons(params = {}, env = nil, headers = {})  ⇒ Object 
  
  
  
  
    
      
55
56
57 
     | 
    
      # File 'lib/chargebee/models/export.rb', line 55
def self.addons(params={}, env=nil, ={})
  Request.send('post', uri_path("exports","addons"), params, env, )
end
     | 
  
 
    
      
  
  
    .attached_items(params = {}, env = nil, headers = {})  ⇒ Object 
  
  
  
  
    
      
99
100
101 
     | 
    
      # File 'lib/chargebee/models/export.rb', line 99
def self.attached_items(params={}, env=nil, ={})
  Request.send('post', uri_path("exports","attached_items"), params, env, )
end
     | 
  
 
    
      
  
  
    .coupons(params = {}, env = nil, headers = {})  ⇒ Object 
  
  
  
  
    
      
59
60
61 
     | 
    
      # File 'lib/chargebee/models/export.rb', line 59
def self.coupons(params={}, env=nil, ={})
  Request.send('post', uri_path("exports","coupons"), params, env, )
end
     | 
  
 
    
      
  
  
    .credit_notes(params = {}, env = nil, headers = {})  ⇒ Object 
  
  
  
  
    
      
75
76
77 
     | 
    
      # File 'lib/chargebee/models/export.rb', line 75
def self.credit_notes(params={}, env=nil, ={})
  Request.send('post', uri_path("exports","credit_notes"), params, env, )
end
     | 
  
 
    
      
  
  
    .customers(params = {}, env = nil, headers = {})  ⇒ Object 
  
  
  
  
    
      
63
64
65 
     | 
    
      # File 'lib/chargebee/models/export.rb', line 63
def self.customers(params={}, env=nil, ={})
  Request.send('post', uri_path("exports","customers"), params, env, )
end
     | 
  
 
    
      
  
  
    .deferred_revenue(params, env = nil, headers = {})  ⇒ Object 
  
  
  
  
    
      
47
48
49 
     | 
    
      # File 'lib/chargebee/models/export.rb', line 47
def self.deferred_revenue(params, env=nil, ={})
  Request.send('post', uri_path("exports","deferred_revenue"), params, env, )
end
     | 
  
 
    
      
  
  
    .differential_prices(params = {}, env = nil, headers = {})  ⇒ Object 
  
  
  
  
    
      
103
104
105 
     | 
    
      # File 'lib/chargebee/models/export.rb', line 103
def self.differential_prices(params={}, env=nil, ={})
  Request.send('post', uri_path("exports","differential_prices"), params, env, )
end
     | 
  
 
    
      
  
  
    .invoices(params = {}, env = nil, headers = {})  ⇒ Object 
  
  
  
  
    
      
71
72
73 
     | 
    
      # File 'lib/chargebee/models/export.rb', line 71
def self.invoices(params={}, env=nil, ={})
  Request.send('post', uri_path("exports","invoices"), params, env, )
end
     | 
  
 
    
      
  
  
    .item_families(params = {}, env = nil, headers = {})  ⇒ Object 
  
  
  
  
    
      
87
88
89 
     | 
    
      # File 'lib/chargebee/models/export.rb', line 87
def self.item_families(params={}, env=nil, ={})
  Request.send('post', uri_path("exports","item_families"), params, env, )
end
     | 
  
 
    
      
  
  
    .item_prices(params = {}, env = nil, headers = {})  ⇒ Object 
  
  
  
  
    
      
95
96
97 
     | 
    
      # File 'lib/chargebee/models/export.rb', line 95
def self.item_prices(params={}, env=nil, ={})
  Request.send('post', uri_path("exports","item_prices"), params, env, )
end
     | 
  
 
    
      
  
  
    .items(params = {}, env = nil, headers = {})  ⇒ Object 
  
  
  
  
    
      
91
92
93 
     | 
    
      # File 'lib/chargebee/models/export.rb', line 91
def self.items(params={}, env=nil, ={})
  Request.send('post', uri_path("exports","items"), params, env, )
end
     | 
  
 
    
      
  
  
    .orders(params = {}, env = nil, headers = {})  ⇒ Object 
  
  
  
  
    
      
83
84
85 
     | 
    
      # File 'lib/chargebee/models/export.rb', line 83
def self.orders(params={}, env=nil, ={})
  Request.send('post', uri_path("exports","orders"), params, env, )
end
     | 
  
 
    
      
  
  
    .plans(params = {}, env = nil, headers = {})  ⇒ Object 
  
  
  
  
    
      
51
52
53 
     | 
    
      # File 'lib/chargebee/models/export.rb', line 51
def self.plans(params={}, env=nil, ={})
  Request.send('post', uri_path("exports","plans"), params, env, )
end
     | 
  
 
    
      
  
  
    .price_variants(params = {}, env = nil, headers = {})  ⇒ Object 
  
  
  
  
    
      
107
108
109 
     | 
    
      # File 'lib/chargebee/models/export.rb', line 107
def self.price_variants(params={}, env=nil, ={})
  Request.send('post', uri_path("exports","price_variants"), params, env, )
end
     | 
  
 
    
      
  
  
    .retrieve(id, env = nil, headers = {})  ⇒ Object 
  
  
  
  
  
    
      
39
40
41 
     | 
    
      # File 'lib/chargebee/models/export.rb', line 39
def self.retrieve(id, env=nil, ={})
  Request.send('get', uri_path("exports",id.to_s), {}, env, )
end
     | 
  
 
    
      
  
  
    .revenue_recognition(params, env = nil, headers = {})  ⇒ Object 
  
  
  
  
    
      
43
44
45 
     | 
    
      # File 'lib/chargebee/models/export.rb', line 43
def self.revenue_recognition(params, env=nil, ={})
  Request.send('post', uri_path("exports","revenue_recognition"), params, env, )
end
     | 
  
 
    
      
  
  
    .subscriptions(params = {}, env = nil, headers = {})  ⇒ Object 
  
  
  
  
    
      
67
68
69 
     | 
    
      # File 'lib/chargebee/models/export.rb', line 67
def self.subscriptions(params={}, env=nil, ={})
  Request.send('post', uri_path("exports","subscriptions"), params, env, )
end
     | 
  
 
    
      
  
  
    .transactions(params = {}, env = nil, headers = {})  ⇒ Object 
  
  
  
  
    
      
79
80
81 
     | 
    
      # File 'lib/chargebee/models/export.rb', line 79
def self.transactions(params={}, env=nil, ={})
  Request.send('post', uri_path("exports","transactions"), params, env, )
end
     | 
  
 
    
   
  
    Instance Method Details
    
      
  
  
    #wait_for_export_completion(env = nil, headers = {})  ⇒ Object 
  
  
  
  
    
      
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34 
     | 
    
      # File 'lib/chargebee/models/export.rb', line 10
def wait_for_export_completion(env = nil, ={})
  env = env || ChargeBee.default_env
  sleeptime = env.export_sleeptime
  export_final = (1..50).inject(self) do |export|
    break export if export.status != "in_process"
    sleep(sleeptime)
    self.class.retrieve(self.id, env, ).export
  end
    new_values = export_final.instance_variable_get("@values")
  self.instance_variable_set("@values", new_values)
  self.load(new_values)
  case export_final.status
  when "in_process"
    raise Error.new('Export is taking too long')
  when "failed"
    json_obj = Util.symbolize_keys(JSON.parse(self.error_json))
    raise OperationFailedError.new(json_obj[:http_code], json_obj)
  when "not_enabled", "_unknown"
    raise Error.new("Export status is in wrong state #{self.status}")
  end
end
     |