helloextend_api_client 1.0.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (102) hide show
  1. checksums.yaml +7 -0
  2. data/Gemfile +9 -0
  3. data/README.md +151 -0
  4. data/Rakefile +10 -0
  5. data/docs/Address.md +27 -0
  6. data/docs/Amount.md +19 -0
  7. data/docs/Contract.md +39 -0
  8. data/docs/ContractPlan.md +19 -0
  9. data/docs/ContractProduct.md +27 -0
  10. data/docs/ContractsApi.md +180 -0
  11. data/docs/Customer.md +23 -0
  12. data/docs/Error.md +19 -0
  13. data/docs/Invoice.md +27 -0
  14. data/docs/InvoiceDetails.md +19 -0
  15. data/docs/InvoiceDiscount.md +21 -0
  16. data/docs/InvoiceItems.md +31 -0
  17. data/docs/InvoiceMetadata.md +21 -0
  18. data/docs/InvoiceMetadataProduct.md +21 -0
  19. data/docs/InvoicePayee.md +23 -0
  20. data/docs/InvoicePayer.md +23 -0
  21. data/docs/Offer.md +17 -0
  22. data/docs/OfferPlan.md +23 -0
  23. data/docs/OfferPlanContract.md +27 -0
  24. data/docs/OffersApi.md +58 -0
  25. data/docs/Plan.md +21 -0
  26. data/docs/PlanDetails.md +21 -0
  27. data/docs/PlanPrices.md +21 -0
  28. data/docs/PlansApi.md +61 -0
  29. data/docs/PlansList.md +17 -0
  30. data/docs/Product.md +45 -0
  31. data/docs/ProductIdentifiers.md +25 -0
  32. data/docs/ProductMfrWarranty.md +21 -0
  33. data/docs/ProductsApi.md +241 -0
  34. data/git_push.sh +58 -0
  35. data/helloextend_api_client.gemspec +39 -0
  36. data/lib/helloextend_api_client.rb +68 -0
  37. data/lib/helloextend_api_client/api/contracts_api.rb +229 -0
  38. data/lib/helloextend_api_client/api/offers_api.rb +90 -0
  39. data/lib/helloextend_api_client/api/plans_api.rb +82 -0
  40. data/lib/helloextend_api_client/api/products_api.rb +298 -0
  41. data/lib/helloextend_api_client/api_client.rb +388 -0
  42. data/lib/helloextend_api_client/api_error.rb +57 -0
  43. data/lib/helloextend_api_client/configuration.rb +248 -0
  44. data/lib/helloextend_api_client/models/address.rb +259 -0
  45. data/lib/helloextend_api_client/models/amount.rb +217 -0
  46. data/lib/helloextend_api_client/models/contract.rb +378 -0
  47. data/lib/helloextend_api_client/models/contract_plan.rb +228 -0
  48. data/lib/helloextend_api_client/models/contract_product.rb +268 -0
  49. data/lib/helloextend_api_client/models/customer.rb +245 -0
  50. data/lib/helloextend_api_client/models/error.rb +225 -0
  51. data/lib/helloextend_api_client/models/invoice.rb +254 -0
  52. data/lib/helloextend_api_client/models/invoice_details.rb +216 -0
  53. data/lib/helloextend_api_client/models/invoice_discount.rb +226 -0
  54. data/lib/helloextend_api_client/models/invoice_items.rb +271 -0
  55. data/lib/helloextend_api_client/models/invoice_metadata.rb +226 -0
  56. data/lib/helloextend_api_client/models/invoice_metadata_product.rb +225 -0
  57. data/lib/helloextend_api_client/models/invoice_payee.rb +233 -0
  58. data/lib/helloextend_api_client/models/invoice_payer.rb +233 -0
  59. data/lib/helloextend_api_client/models/offer.rb +208 -0
  60. data/lib/helloextend_api_client/models/offer_plan.rb +236 -0
  61. data/lib/helloextend_api_client/models/offer_plan_contract.rb +258 -0
  62. data/lib/helloextend_api_client/models/plan.rb +225 -0
  63. data/lib/helloextend_api_client/models/plan_details.rb +227 -0
  64. data/lib/helloextend_api_client/models/plan_prices.rb +230 -0
  65. data/lib/helloextend_api_client/models/plans_list.rb +208 -0
  66. data/lib/helloextend_api_client/models/product.rb +429 -0
  67. data/lib/helloextend_api_client/models/product_identifiers.rb +247 -0
  68. data/lib/helloextend_api_client/models/product_mfr_warranty.rb +228 -0
  69. data/lib/helloextend_api_client/version.rb +15 -0
  70. data/spec/api/contracts_api_spec.rb +74 -0
  71. data/spec/api/offers_api_spec.rb +48 -0
  72. data/spec/api/plans_api_spec.rb +46 -0
  73. data/spec/api/products_api_spec.rb +88 -0
  74. data/spec/api_client_spec.rb +226 -0
  75. data/spec/configuration_spec.rb +42 -0
  76. data/spec/models/address_spec.rb +71 -0
  77. data/spec/models/amount_spec.rb +47 -0
  78. data/spec/models/contract_plan_spec.rb +47 -0
  79. data/spec/models/contract_product_spec.rb +71 -0
  80. data/spec/models/contract_spec.rb +111 -0
  81. data/spec/models/customer_spec.rb +59 -0
  82. data/spec/models/error_spec.rb +47 -0
  83. data/spec/models/invoice_details_spec.rb +47 -0
  84. data/spec/models/invoice_discount_spec.rb +53 -0
  85. data/spec/models/invoice_items_spec.rb +83 -0
  86. data/spec/models/invoice_metadata_product_spec.rb +53 -0
  87. data/spec/models/invoice_metadata_spec.rb +53 -0
  88. data/spec/models/invoice_payee_spec.rb +59 -0
  89. data/spec/models/invoice_payer_spec.rb +59 -0
  90. data/spec/models/invoice_spec.rb +71 -0
  91. data/spec/models/offer_plan_contract_spec.rb +71 -0
  92. data/spec/models/offer_plan_spec.rb +59 -0
  93. data/spec/models/offer_spec.rb +41 -0
  94. data/spec/models/plan_details_spec.rb +53 -0
  95. data/spec/models/plan_prices_spec.rb +53 -0
  96. data/spec/models/plan_spec.rb +53 -0
  97. data/spec/models/plans_list_spec.rb +41 -0
  98. data/spec/models/product_identifiers_spec.rb +65 -0
  99. data/spec/models/product_mfr_warranty_spec.rb +53 -0
  100. data/spec/models/product_spec.rb +129 -0
  101. data/spec/spec_helper.rb +111 -0
  102. metadata +235 -0
@@ -0,0 +1,68 @@
1
+ =begin
2
+ #Extend API Reference
3
+
4
+ ## Introduction Welcome to the Extend API Documentation! Our goal is to make your integration as clear and easy as possible, so if you have feedback or suggestions for our API or reference docs, [please let us know](mailto:devs@helloextend.com). If you are implementing the API for the first time, please use the latest \"2019-08-01\" API version. If you have already implemented the API and haven't specified a version, you are on the \"Default\" API version. #### You can get up and running with Extend with just 5 simple steps: * Create an account with Extend, and get an access token from your Extend merchant portal * Sync your store's products to Extend * Get the relevant Extend warranty SKUs and add them to your store * Add the JS SDK snippets to your store's website, which will enable warranty offers to be displayed in your store * Record warranty purchases with Extend so we can create a new contract and deliver it to the customer, or record warranty returns / refunds so we can cancel the contract and account for the refunded amount <div class='wrapper tip'><h2>Pro Tip! Keep your store's products up to date</h2><p>To make sure you are selling warranty plans on all eligible products (and not selling them on ineligible ones), it is best to keep your store's products in sync with Extend. If you update your products infrequently, it might be easiest to manually upload or edit products in your merchant portal. If you do update frequently, though, consider integrating with our Products API resource.</p><p>Need help? <a href='mailto:devs@helloextend.com'>Contact us!</a> We love to help!</p></div>
5
+
6
+ The version of the OpenAPI document: Default
7
+
8
+ Generated by: https://openapi-generator.tech
9
+ OpenAPI Generator version: 4.3.1-SNAPSHOT
10
+
11
+ =end
12
+
13
+ # Common files
14
+ require 'helloextend_api_client/api_client'
15
+ require 'helloextend_api_client/api_error'
16
+ require 'helloextend_api_client/version'
17
+ require 'helloextend_api_client/configuration'
18
+
19
+ # Models
20
+ require 'helloextend_api_client/models/address'
21
+ require 'helloextend_api_client/models/amount'
22
+ require 'helloextend_api_client/models/contract'
23
+ require 'helloextend_api_client/models/contract_plan'
24
+ require 'helloextend_api_client/models/contract_product'
25
+ require 'helloextend_api_client/models/customer'
26
+ require 'helloextend_api_client/models/error'
27
+ require 'helloextend_api_client/models/invoice'
28
+ require 'helloextend_api_client/models/invoice_details'
29
+ require 'helloextend_api_client/models/invoice_discount'
30
+ require 'helloextend_api_client/models/invoice_items'
31
+ require 'helloextend_api_client/models/invoice_metadata'
32
+ require 'helloextend_api_client/models/invoice_metadata_product'
33
+ require 'helloextend_api_client/models/invoice_payee'
34
+ require 'helloextend_api_client/models/invoice_payer'
35
+ require 'helloextend_api_client/models/offer'
36
+ require 'helloextend_api_client/models/offer_plan'
37
+ require 'helloextend_api_client/models/offer_plan_contract'
38
+ require 'helloextend_api_client/models/plan'
39
+ require 'helloextend_api_client/models/plan_details'
40
+ require 'helloextend_api_client/models/plan_prices'
41
+ require 'helloextend_api_client/models/plans_list'
42
+ require 'helloextend_api_client/models/product'
43
+ require 'helloextend_api_client/models/product_identifiers'
44
+ require 'helloextend_api_client/models/product_mfr_warranty'
45
+
46
+ # APIs
47
+ require 'helloextend_api_client/api/contracts_api'
48
+ require 'helloextend_api_client/api/offers_api'
49
+ require 'helloextend_api_client/api/plans_api'
50
+ require 'helloextend_api_client/api/products_api'
51
+
52
+ module HelloextendApiClient
53
+ class << self
54
+ # Customize default settings for the SDK using block.
55
+ # HelloextendApiClient.configure do |config|
56
+ # config.username = "xxx"
57
+ # config.password = "xxx"
58
+ # end
59
+ # If no block given, return the default Configuration object.
60
+ def configure
61
+ if block_given?
62
+ yield(Configuration.default)
63
+ else
64
+ Configuration.default
65
+ end
66
+ end
67
+ end
68
+ end
@@ -0,0 +1,229 @@
1
+ =begin
2
+ #Extend API Reference
3
+
4
+ ## Introduction Welcome to the Extend API Documentation! Our goal is to make your integration as clear and easy as possible, so if you have feedback or suggestions for our API or reference docs, [please let us know](mailto:devs@helloextend.com). If you are implementing the API for the first time, please use the latest \"2019-08-01\" API version. If you have already implemented the API and haven't specified a version, you are on the \"Default\" API version. #### You can get up and running with Extend with just 5 simple steps: * Create an account with Extend, and get an access token from your Extend merchant portal * Sync your store's products to Extend * Get the relevant Extend warranty SKUs and add them to your store * Add the JS SDK snippets to your store's website, which will enable warranty offers to be displayed in your store * Record warranty purchases with Extend so we can create a new contract and deliver it to the customer, or record warranty returns / refunds so we can cancel the contract and account for the refunded amount <div class='wrapper tip'><h2>Pro Tip! Keep your store's products up to date</h2><p>To make sure you are selling warranty plans on all eligible products (and not selling them on ineligible ones), it is best to keep your store's products in sync with Extend. If you update your products infrequently, it might be easiest to manually upload or edit products in your merchant portal. If you do update frequently, though, consider integrating with our Products API resource.</p><p>Need help? <a href='mailto:devs@helloextend.com'>Contact us!</a> We love to help!</p></div>
5
+
6
+ The version of the OpenAPI document: Default
7
+
8
+ Generated by: https://openapi-generator.tech
9
+ OpenAPI Generator version: 4.3.1-SNAPSHOT
10
+
11
+ =end
12
+
13
+ require 'cgi'
14
+
15
+ module HelloextendApiClient
16
+ class ContractsApi
17
+ attr_accessor :api_client
18
+
19
+ def initialize(api_client = ApiClient.default)
20
+ @api_client = api_client
21
+ end
22
+ # Get invoice information for a contract
23
+ # Extend automatically generates an invoice to the merchant whenever a warranty contract is sold. If it helps with your record-keeping and back end reconciliation, you can get the invoice details using this API call. If you sent us a purchase order number when making the 'Create a warranty contract' call, we'll include that in the invoice, too, for your reference.
24
+ # @param store_id [String] Unique identifier for a Store on Extend
25
+ # @param contract_id [String] Unique identifier for an Extend warranty Contract
26
+ # @param [Hash] opts the optional parameters
27
+ # @return [Invoice]
28
+ def contract_invoice(store_id, contract_id, opts = {})
29
+ data, _status_code, _headers = contract_invoice_with_http_info(store_id, contract_id, opts)
30
+ data
31
+ end
32
+
33
+ # Get invoice information for a contract
34
+ # Extend automatically generates an invoice to the merchant whenever a warranty contract is sold. If it helps with your record-keeping and back end reconciliation, you can get the invoice details using this API call. If you sent us a purchase order number when making the &#39;Create a warranty contract&#39; call, we&#39;ll include that in the invoice, too, for your reference.
35
+ # @param store_id [String] Unique identifier for a Store on Extend
36
+ # @param contract_id [String] Unique identifier for an Extend warranty Contract
37
+ # @param [Hash] opts the optional parameters
38
+ # @return [Array<(Invoice, Integer, Hash)>] Invoice data, response status code and response headers
39
+ def contract_invoice_with_http_info(store_id, contract_id, opts = {})
40
+ if @api_client.config.debugging
41
+ @api_client.config.logger.debug 'Calling API: ContractsApi.contract_invoice ...'
42
+ end
43
+ # verify the required parameter 'store_id' is set
44
+ if @api_client.config.client_side_validation && store_id.nil?
45
+ fail ArgumentError, "Missing the required parameter 'store_id' when calling ContractsApi.contract_invoice"
46
+ end
47
+ # verify the required parameter 'contract_id' is set
48
+ if @api_client.config.client_side_validation && contract_id.nil?
49
+ fail ArgumentError, "Missing the required parameter 'contract_id' when calling ContractsApi.contract_invoice"
50
+ end
51
+ # resource path
52
+ local_var_path = '/stores/{storeId}/contracts/{contractId}/invoice'.sub('{' + 'storeId' + '}', CGI.escape(store_id.to_s)).sub('{' + 'contractId' + '}', CGI.escape(contract_id.to_s))
53
+
54
+ # query parameters
55
+ query_params = opts[:query_params] || {}
56
+
57
+ # header parameters
58
+ header_params = opts[:header_params] || {}
59
+ # HTTP header 'Accept' (if needed)
60
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
61
+
62
+ # form parameters
63
+ form_params = opts[:form_params] || {}
64
+
65
+ # http body (model)
66
+ post_body = opts[:body]
67
+
68
+ # return_type
69
+ return_type = opts[:return_type] || 'Invoice'
70
+
71
+ # auth_names
72
+ auth_names = opts[:auth_names] || ['ExtendAccessToken']
73
+
74
+ new_options = opts.merge(
75
+ :header_params => header_params,
76
+ :query_params => query_params,
77
+ :form_params => form_params,
78
+ :body => post_body,
79
+ :auth_names => auth_names,
80
+ :return_type => return_type
81
+ )
82
+
83
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
84
+ if @api_client.config.debugging
85
+ @api_client.config.logger.debug "API called: ContractsApi#contract_invoice\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
86
+ end
87
+ return data, status_code, headers
88
+ end
89
+
90
+ # Create a warranty contract
91
+ # @param store_id [String] Unique identifier for a Store on Extend
92
+ # @param contract [Contract]
93
+ # @param [Hash] opts the optional parameters
94
+ # @return [Contract]
95
+ def create_contracts(store_id, contract, opts = {})
96
+ data, _status_code, _headers = create_contracts_with_http_info(store_id, contract, opts)
97
+ data
98
+ end
99
+
100
+ # Create a warranty contract
101
+ # @param store_id [String] Unique identifier for a Store on Extend
102
+ # @param contract [Contract]
103
+ # @param [Hash] opts the optional parameters
104
+ # @return [Array<(Contract, Integer, Hash)>] Contract data, response status code and response headers
105
+ def create_contracts_with_http_info(store_id, contract, opts = {})
106
+ if @api_client.config.debugging
107
+ @api_client.config.logger.debug 'Calling API: ContractsApi.create_contracts ...'
108
+ end
109
+ # verify the required parameter 'store_id' is set
110
+ if @api_client.config.client_side_validation && store_id.nil?
111
+ fail ArgumentError, "Missing the required parameter 'store_id' when calling ContractsApi.create_contracts"
112
+ end
113
+ # verify the required parameter 'contract' is set
114
+ if @api_client.config.client_side_validation && contract.nil?
115
+ fail ArgumentError, "Missing the required parameter 'contract' when calling ContractsApi.create_contracts"
116
+ end
117
+ # resource path
118
+ local_var_path = '/stores/{storeId}/contracts'.sub('{' + 'storeId' + '}', CGI.escape(store_id.to_s))
119
+
120
+ # query parameters
121
+ query_params = opts[:query_params] || {}
122
+
123
+ # header parameters
124
+ header_params = opts[:header_params] || {}
125
+ # HTTP header 'Accept' (if needed)
126
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
127
+ # HTTP header 'Content-Type'
128
+ header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
129
+
130
+ # form parameters
131
+ form_params = opts[:form_params] || {}
132
+
133
+ # http body (model)
134
+ post_body = opts[:body] || @api_client.object_to_http_body(contract)
135
+
136
+ # return_type
137
+ return_type = opts[:return_type] || 'Contract'
138
+
139
+ # auth_names
140
+ auth_names = opts[:auth_names] || ['ExtendAccessToken']
141
+
142
+ new_options = opts.merge(
143
+ :header_params => header_params,
144
+ :query_params => query_params,
145
+ :form_params => form_params,
146
+ :body => post_body,
147
+ :auth_names => auth_names,
148
+ :return_type => return_type
149
+ )
150
+
151
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
152
+ if @api_client.config.debugging
153
+ @api_client.config.logger.debug "API called: ContractsApi#create_contracts\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
154
+ end
155
+ return data, status_code, headers
156
+ end
157
+
158
+ # Cancel a warranty contract and request a refund
159
+ # This endpoint is your way to report a refunded warranty contract to Extend. If a customer returns an item for which a warranty was purchased, or just the warranty itself, to your store, you should let Extend know so we can cancel the warranty contract. We will also refund you, the merchant, in the next invoice. The amount Extend will refund you (and the amount you should refund to the customer), depends on the date of the refund and the terms of the warranty contract. <div class='wrapper tip'><h2>Pro Tip! Check the refund amount before you refund your customer</h2> To make sure you refund your customer the same amount as Extend will be refunding you, there is a three-step process: <ul><li>Send the cancellation API request to Extend with query parameter \"commit\" set to FALSE. This gives you a preview of the cancellation, Including the amount that would be refunded (the \"cancellation quote\") </li><li>Issue a refund to the customer for the amount matching the cancellation quote</li><li>Re-send the cancellation API request to Extend with query parameter \"commit\" set to TRUE. This will cause Extend to cancel the contract and issue the merchant refund for the amount matching the cancellation quote</li></ul></div><div class='wrapper important'><h2>Important:</h2> Please note that this endpoint <strong>does not cause Extend to refund the customer</strong> - they would get the refund from the store where they purchased the product and warranty contract. A successful call to this endpoint <strong>will void the customer’s warranty contract</strong>, and initiate reimbursement to you, the merchant.</div>
160
+ # @param store_id [String] Unique identifier for a Store on Extend
161
+ # @param contract_id [String] Unique identifier for an Extend warranty Contract
162
+ # @param [Hash] opts the optional parameters
163
+ # @option opts [Boolean] :commit Use the value &lt;strong&gt;\&quot;false\&quot;&lt;/strong&gt; to get a preview of the cancellation quote - the amount you will be refunded for the cancelled contract. If you use the value &lt;strong&gt;\&quot;true\&quot;&lt;/strong&gt; or omit the query parameter, Extend will execute the contract cancellation.
164
+ # @return [nil]
165
+ def refund_contract(store_id, contract_id, opts = {})
166
+ refund_contract_with_http_info(store_id, contract_id, opts)
167
+ nil
168
+ end
169
+
170
+ # Cancel a warranty contract and request a refund
171
+ # This endpoint is your way to report a refunded warranty contract to Extend. If a customer returns an item for which a warranty was purchased, or just the warranty itself, to your store, you should let Extend know so we can cancel the warranty contract. We will also refund you, the merchant, in the next invoice. The amount Extend will refund you (and the amount you should refund to the customer), depends on the date of the refund and the terms of the warranty contract. &lt;div class&#x3D;&#39;wrapper tip&#39;&gt;&lt;h2&gt;Pro Tip! Check the refund amount before you refund your customer&lt;/h2&gt; To make sure you refund your customer the same amount as Extend will be refunding you, there is a three-step process: &lt;ul&gt;&lt;li&gt;Send the cancellation API request to Extend with query parameter \&quot;commit\&quot; set to FALSE. This gives you a preview of the cancellation, Including the amount that would be refunded (the \&quot;cancellation quote\&quot;) &lt;/li&gt;&lt;li&gt;Issue a refund to the customer for the amount matching the cancellation quote&lt;/li&gt;&lt;li&gt;Re-send the cancellation API request to Extend with query parameter \&quot;commit\&quot; set to TRUE. This will cause Extend to cancel the contract and issue the merchant refund for the amount matching the cancellation quote&lt;/li&gt;&lt;/ul&gt;&lt;/div&gt;&lt;div class&#x3D;&#39;wrapper important&#39;&gt;&lt;h2&gt;Important:&lt;/h2&gt; Please note that this endpoint &lt;strong&gt;does not cause Extend to refund the customer&lt;/strong&gt; - they would get the refund from the store where they purchased the product and warranty contract. A successful call to this endpoint &lt;strong&gt;will void the customer’s warranty contract&lt;/strong&gt;, and initiate reimbursement to you, the merchant.&lt;/div&gt;
172
+ # @param store_id [String] Unique identifier for a Store on Extend
173
+ # @param contract_id [String] Unique identifier for an Extend warranty Contract
174
+ # @param [Hash] opts the optional parameters
175
+ # @option opts [Boolean] :commit Use the value &lt;strong&gt;\&quot;false\&quot;&lt;/strong&gt; to get a preview of the cancellation quote - the amount you will be refunded for the cancelled contract. If you use the value &lt;strong&gt;\&quot;true\&quot;&lt;/strong&gt; or omit the query parameter, Extend will execute the contract cancellation.
176
+ # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers
177
+ def refund_contract_with_http_info(store_id, contract_id, opts = {})
178
+ if @api_client.config.debugging
179
+ @api_client.config.logger.debug 'Calling API: ContractsApi.refund_contract ...'
180
+ end
181
+ # verify the required parameter 'store_id' is set
182
+ if @api_client.config.client_side_validation && store_id.nil?
183
+ fail ArgumentError, "Missing the required parameter 'store_id' when calling ContractsApi.refund_contract"
184
+ end
185
+ # verify the required parameter 'contract_id' is set
186
+ if @api_client.config.client_side_validation && contract_id.nil?
187
+ fail ArgumentError, "Missing the required parameter 'contract_id' when calling ContractsApi.refund_contract"
188
+ end
189
+ # resource path
190
+ local_var_path = '/stores/{storeId}/contracts/{contractId}/refund'.sub('{' + 'storeId' + '}', CGI.escape(store_id.to_s)).sub('{' + 'contractId' + '}', CGI.escape(contract_id.to_s))
191
+
192
+ # query parameters
193
+ query_params = opts[:query_params] || {}
194
+ query_params[:'commit'] = opts[:'commit'] if !opts[:'commit'].nil?
195
+
196
+ # header parameters
197
+ header_params = opts[:header_params] || {}
198
+ # HTTP header 'Accept' (if needed)
199
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
200
+
201
+ # form parameters
202
+ form_params = opts[:form_params] || {}
203
+
204
+ # http body (model)
205
+ post_body = opts[:body]
206
+
207
+ # return_type
208
+ return_type = opts[:return_type]
209
+
210
+ # auth_names
211
+ auth_names = opts[:auth_names] || ['ExtendAccessToken']
212
+
213
+ new_options = opts.merge(
214
+ :header_params => header_params,
215
+ :query_params => query_params,
216
+ :form_params => form_params,
217
+ :body => post_body,
218
+ :auth_names => auth_names,
219
+ :return_type => return_type
220
+ )
221
+
222
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
223
+ if @api_client.config.debugging
224
+ @api_client.config.logger.debug "API called: ContractsApi#refund_contract\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
225
+ end
226
+ return data, status_code, headers
227
+ end
228
+ end
229
+ end
@@ -0,0 +1,90 @@
1
+ =begin
2
+ #Extend API Reference
3
+
4
+ ## Introduction Welcome to the Extend API Documentation! Our goal is to make your integration as clear and easy as possible, so if you have feedback or suggestions for our API or reference docs, [please let us know](mailto:devs@helloextend.com). If you are implementing the API for the first time, please use the latest \"2019-08-01\" API version. If you have already implemented the API and haven't specified a version, you are on the \"Default\" API version. #### You can get up and running with Extend with just 5 simple steps: * Create an account with Extend, and get an access token from your Extend merchant portal * Sync your store's products to Extend * Get the relevant Extend warranty SKUs and add them to your store * Add the JS SDK snippets to your store's website, which will enable warranty offers to be displayed in your store * Record warranty purchases with Extend so we can create a new contract and deliver it to the customer, or record warranty returns / refunds so we can cancel the contract and account for the refunded amount <div class='wrapper tip'><h2>Pro Tip! Keep your store's products up to date</h2><p>To make sure you are selling warranty plans on all eligible products (and not selling them on ineligible ones), it is best to keep your store's products in sync with Extend. If you update your products infrequently, it might be easiest to manually upload or edit products in your merchant portal. If you do update frequently, though, consider integrating with our Products API resource.</p><p>Need help? <a href='mailto:devs@helloextend.com'>Contact us!</a> We love to help!</p></div>
5
+
6
+ The version of the OpenAPI document: Default
7
+
8
+ Generated by: https://openapi-generator.tech
9
+ OpenAPI Generator version: 4.3.1-SNAPSHOT
10
+
11
+ =end
12
+
13
+ require 'cgi'
14
+
15
+ module HelloextendApiClient
16
+ class OffersApi
17
+ attr_accessor :api_client
18
+
19
+ def initialize(api_client = ApiClient.default)
20
+ @api_client = api_client
21
+ end
22
+ # Get Offer information
23
+ # Returns warranty plans and pricing for a specific product.
24
+ # @param store_id [String] Unique identifier for a Store on Extend
25
+ # @param product_id [String] The unique referenceId passed to extend when creating a product.
26
+ # @param [Hash] opts the optional parameters
27
+ # @return [Offer]
28
+ def get_offer(store_id, product_id, opts = {})
29
+ data, _status_code, _headers = get_offer_with_http_info(store_id, product_id, opts)
30
+ data
31
+ end
32
+
33
+ # Get Offer information
34
+ # Returns warranty plans and pricing for a specific product.
35
+ # @param store_id [String] Unique identifier for a Store on Extend
36
+ # @param product_id [String] The unique referenceId passed to extend when creating a product.
37
+ # @param [Hash] opts the optional parameters
38
+ # @return [Array<(Offer, Integer, Hash)>] Offer data, response status code and response headers
39
+ def get_offer_with_http_info(store_id, product_id, opts = {})
40
+ if @api_client.config.debugging
41
+ @api_client.config.logger.debug 'Calling API: OffersApi.get_offer ...'
42
+ end
43
+ # verify the required parameter 'store_id' is set
44
+ if @api_client.config.client_side_validation && store_id.nil?
45
+ fail ArgumentError, "Missing the required parameter 'store_id' when calling OffersApi.get_offer"
46
+ end
47
+ # verify the required parameter 'product_id' is set
48
+ if @api_client.config.client_side_validation && product_id.nil?
49
+ fail ArgumentError, "Missing the required parameter 'product_id' when calling OffersApi.get_offer"
50
+ end
51
+ # resource path
52
+ local_var_path = '/offers?storeId={storeId}&productId={productId}'.sub('{' + 'storeId' + '}', CGI.escape(store_id.to_s)).sub('{' + 'productId' + '}', CGI.escape(product_id.to_s))
53
+
54
+ # query parameters
55
+ query_params = opts[:query_params] || {}
56
+
57
+ # header parameters
58
+ header_params = opts[:header_params] || {}
59
+ # HTTP header 'Accept' (if needed)
60
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
61
+
62
+ # form parameters
63
+ form_params = opts[:form_params] || {}
64
+
65
+ # http body (model)
66
+ post_body = opts[:body]
67
+
68
+ # return_type
69
+ return_type = opts[:return_type] || 'Offer'
70
+
71
+ # auth_names
72
+ auth_names = opts[:auth_names] || []
73
+
74
+ new_options = opts.merge(
75
+ :header_params => header_params,
76
+ :query_params => query_params,
77
+ :form_params => form_params,
78
+ :body => post_body,
79
+ :auth_names => auth_names,
80
+ :return_type => return_type
81
+ )
82
+
83
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
84
+ if @api_client.config.debugging
85
+ @api_client.config.logger.debug "API called: OffersApi#get_offer\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
86
+ end
87
+ return data, status_code, headers
88
+ end
89
+ end
90
+ end
@@ -0,0 +1,82 @@
1
+ =begin
2
+ #Extend API Reference
3
+
4
+ ## Introduction Welcome to the Extend API Documentation! Our goal is to make your integration as clear and easy as possible, so if you have feedback or suggestions for our API or reference docs, [please let us know](mailto:devs@helloextend.com). If you are implementing the API for the first time, please use the latest \"2019-08-01\" API version. If you have already implemented the API and haven't specified a version, you are on the \"Default\" API version. #### You can get up and running with Extend with just 5 simple steps: * Create an account with Extend, and get an access token from your Extend merchant portal * Sync your store's products to Extend * Get the relevant Extend warranty SKUs and add them to your store * Add the JS SDK snippets to your store's website, which will enable warranty offers to be displayed in your store * Record warranty purchases with Extend so we can create a new contract and deliver it to the customer, or record warranty returns / refunds so we can cancel the contract and account for the refunded amount <div class='wrapper tip'><h2>Pro Tip! Keep your store's products up to date</h2><p>To make sure you are selling warranty plans on all eligible products (and not selling them on ineligible ones), it is best to keep your store's products in sync with Extend. If you update your products infrequently, it might be easiest to manually upload or edit products in your merchant portal. If you do update frequently, though, consider integrating with our Products API resource.</p><p>Need help? <a href='mailto:devs@helloextend.com'>Contact us!</a> We love to help!</p></div>
5
+
6
+ The version of the OpenAPI document: Default
7
+
8
+ Generated by: https://openapi-generator.tech
9
+ OpenAPI Generator version: 4.3.1-SNAPSHOT
10
+
11
+ =end
12
+
13
+ require 'cgi'
14
+
15
+ module HelloextendApiClient
16
+ class PlansApi
17
+ attr_accessor :api_client
18
+
19
+ def initialize(api_client = ApiClient.default)
20
+ @api_client = api_client
21
+ end
22
+ # A list of warranty plans available to the store
23
+ # @param store_id [String] Unique identifier for a Store on Extend
24
+ # @param [Hash] opts the optional parameters
25
+ # @return [PlansList]
26
+ def offers_liststore_idstore_id_get(store_id, opts = {})
27
+ data, _status_code, _headers = offers_liststore_idstore_id_get_with_http_info(store_id, opts)
28
+ data
29
+ end
30
+
31
+ # A list of warranty plans available to the store
32
+ # @param store_id [String] Unique identifier for a Store on Extend
33
+ # @param [Hash] opts the optional parameters
34
+ # @return [Array<(PlansList, Integer, Hash)>] PlansList data, response status code and response headers
35
+ def offers_liststore_idstore_id_get_with_http_info(store_id, opts = {})
36
+ if @api_client.config.debugging
37
+ @api_client.config.logger.debug 'Calling API: PlansApi.offers_liststore_idstore_id_get ...'
38
+ end
39
+ # verify the required parameter 'store_id' is set
40
+ if @api_client.config.client_side_validation && store_id.nil?
41
+ fail ArgumentError, "Missing the required parameter 'store_id' when calling PlansApi.offers_liststore_idstore_id_get"
42
+ end
43
+ # resource path
44
+ local_var_path = '/offers/list?storeId={storeId}'.sub('{' + 'storeId' + '}', CGI.escape(store_id.to_s))
45
+
46
+ # query parameters
47
+ query_params = opts[:query_params] || {}
48
+
49
+ # header parameters
50
+ header_params = opts[:header_params] || {}
51
+ # HTTP header 'Accept' (if needed)
52
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
53
+
54
+ # form parameters
55
+ form_params = opts[:form_params] || {}
56
+
57
+ # http body (model)
58
+ post_body = opts[:body]
59
+
60
+ # return_type
61
+ return_type = opts[:return_type] || 'PlansList'
62
+
63
+ # auth_names
64
+ auth_names = opts[:auth_names] || ['ExtendAccessToken']
65
+
66
+ new_options = opts.merge(
67
+ :header_params => header_params,
68
+ :query_params => query_params,
69
+ :form_params => form_params,
70
+ :body => post_body,
71
+ :auth_names => auth_names,
72
+ :return_type => return_type
73
+ )
74
+
75
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
76
+ if @api_client.config.debugging
77
+ @api_client.config.logger.debug "API called: PlansApi#offers_liststore_idstore_id_get\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
78
+ end
79
+ return data, status_code, headers
80
+ end
81
+ end
82
+ end