Class: CyberSource::ReportSubscriptionsApi

Inherits:
Object
  • Object
show all
Defined in:
lib/cybersource_rest_client/api/report_subscriptions_api.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(api_client = ApiClient.default, config) ⇒ ReportSubscriptionsApi

Returns a new instance of ReportSubscriptionsApi.



19
20
21
22
# File 'lib/cybersource_rest_client/api/report_subscriptions_api.rb', line 19

def initialize(api_client = ApiClient.default, config)
  @api_client = api_client
	  @api_client.set_configuration(config)
end

Instance Attribute Details

#api_clientObject

Returns the value of attribute api_client.



17
18
19
# File 'lib/cybersource_rest_client/api/report_subscriptions_api.rb', line 17

def api_client
  @api_client
end

Instance Method Details

#create_subscription(request_body, opts = {}) ⇒ nil

Create Report Subscription for a report name by organization Create a report subscription for your organization. The report name must be unique.

Parameters:

  • request_body

    Report subscription request payload

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :organization_id (String)

    Valid Cybersource Organization Id

Returns:

  • (nil)


29
30
31
32
# File 'lib/cybersource_rest_client/api/report_subscriptions_api.rb', line 29

def create_subscription(request_body, opts = {})
  data, status_code, headers = create_subscription_with_http_info(request_body, opts)
  return data, status_code, headers
end

#create_subscription_with_http_info(request_body, opts = {}) ⇒ Array<(nil, Fixnum, Hash)>

Create Report Subscription for a report name by organization Create a report subscription for your organization. The report name must be unique.

Parameters:

  • request_body

    Report subscription request payload

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :organization_id (String)

    Valid Cybersource Organization Id

Returns:

  • (Array<(nil, Fixnum, Hash)>)

    nil, response status code and response headers



40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
# File 'lib/cybersource_rest_client/api/report_subscriptions_api.rb', line 40

def create_subscription_with_http_info(request_body, opts = {})
  
	  if @api_client.config.debugging
begin
			raise
@api_client.config.logger.debug 'Calling API: ReportSubscriptionsApi.create_subscription ...'
			rescue
puts 'Cannot write to log'
			end
  end
  # verify the required parameter 'request_body' is set
  if @api_client.config.client_side_validation && request_body.nil?
    fail ArgumentError, "Missing the required parameter 'request_body' when calling ReportSubscriptionsApi.create_subscription"
  end
  if @api_client.config.client_side_validation && !opts[:'organization_id'].nil? && opts[:'organization_id'].to_s.length > 32
    fail ArgumentError, 'invalid value for "opts[:"organization_id"]" when calling ReportSubscriptionsApi.create_subscription, the character length must be smaller than or equal to 32.'
  end

  if @api_client.config.client_side_validation && !opts[:'organization_id'].nil? && opts[:'organization_id'].to_s.length < 1
    fail ArgumentError, 'invalid value for "opts[:"organization_id"]" when calling ReportSubscriptionsApi.create_subscription, the character length must be great than or equal to 1.'
  end

  #if @api_client.config.client_side_validation && !opts[:'organization_id'].nil? && opts[:'organization_id'] !~ Regexp.new(/[a-zA-Z0-9-_]+/)
    #fail ArgumentError, "invalid value for 'opts[:\"organization_id\"]' when calling ReportSubscriptionsApi.create_subscription, must conform to the pattern /[a-zA-Z0-9-_]+/."
  #end

  # resource path
  local_var_path = 'reporting/v3/report-subscriptions'

  # query parameters
  query_params = {}
  query_params[:'organizationId'] = opts[:'organization_id'] if !opts[:'organization_id'].nil?

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

  # form parameters
  form_params = {}

  # http body (model)
  post_body = @api_client.object_to_http_body(request_body)
  auth_names = []
  data, status_code, headers = @api_client.call_api(:PUT, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names)
  if @api_client.config.debugging
		begin
		raise
			@api_client.config.logger.debug "API called: ReportSubscriptionsApi#create_subscription\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
		rescue
			puts 'Cannot write to log'
		end
	  end
  return data, status_code, headers
end

#delete_subscription(report_name, opts = {}) ⇒ nil

Delete subscription of a report name by organization Delete a report subscription for your organization. You must know the unique name of the report you want to delete.

Parameters:

  • report_name

    Name of the Report to Delete

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (nil)


107
108
109
110
# File 'lib/cybersource_rest_client/api/report_subscriptions_api.rb', line 107

def delete_subscription(report_name, opts = {})
  data, status_code, headers = delete_subscription_with_http_info(report_name, opts)
  return data, status_code, headers
end

#delete_subscription_with_http_info(report_name, opts = {}) ⇒ Array<(nil, Fixnum, Hash)>

Delete subscription of a report name by organization Delete a report subscription for your organization. You must know the unique name of the report you want to delete.

Parameters:

  • report_name

    Name of the Report to Delete

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(nil, Fixnum, Hash)>)

    nil, response status code and response headers



117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
# File 'lib/cybersource_rest_client/api/report_subscriptions_api.rb', line 117

def delete_subscription_with_http_info(report_name, opts = {})
  
	  if @api_client.config.debugging
begin
			raise
@api_client.config.logger.debug 'Calling API: ReportSubscriptionsApi.delete_subscription ...'
			rescue
puts 'Cannot write to log'
			end
  end
  # verify the required parameter 'report_name' is set
  if @api_client.config.client_side_validation && report_name.nil?
    fail ArgumentError, "Missing the required parameter 'report_name' when calling ReportSubscriptionsApi.delete_subscription"
  end
  if @api_client.config.client_side_validation && report_name.to_s.length > 80
    fail ArgumentError, 'invalid value for "report_name" when calling ReportSubscriptionsApi.delete_subscription, the character length must be smaller than or equal to 80.'
  end

  if @api_client.config.client_side_validation && report_name.to_s.length < 1
    fail ArgumentError, 'invalid value for "report_name" when calling ReportSubscriptionsApi.delete_subscription, the character length must be great than or equal to 1.'
  end

  #if @api_client.config.client_side_validation && report_name !~ Regexp.new(/[a-zA-Z0-9-_+]+/)
    #fail ArgumentError, "invalid value for 'report_name' when calling ReportSubscriptionsApi.delete_subscription, must conform to the pattern /[a-zA-Z0-9-_+]+/."
  #end

  # resource path
  local_var_path = 'reporting/v3/report-subscriptions/{reportName}'.sub('{' + 'reportName' + '}', report_name.to_s)

  # query parameters
  query_params = {}

  # header parameters
  header_params = {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/hal+json'])
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json;charset=utf-8'])

  # form parameters
  form_params = {}

  # http body (model)
  post_body = nil
  auth_names = []
  data, status_code, headers = @api_client.call_api(:DELETE, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names)
  if @api_client.config.debugging
		begin
		raise
			@api_client.config.logger.debug "API called: ReportSubscriptionsApi#delete_subscription\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
		rescue
			puts 'Cannot write to log'
		end
	  end
  return data, status_code, headers
end

#get_all_subscriptions(opts = {}) ⇒ ReportingV3ReportSubscriptionsGet200Response

Get all subscriptions View a summary of all report subscriptions.

Parameters:

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



182
183
184
185
# File 'lib/cybersource_rest_client/api/report_subscriptions_api.rb', line 182

def get_all_subscriptions(opts = {})
  data, status_code, headers = get_all_subscriptions_with_http_info(opts)
  return data, status_code, headers
end

#get_all_subscriptions_with_http_info(opts = {}) ⇒ Array<(ReportingV3ReportSubscriptionsGet200Response, Fixnum, Hash)>

Get all subscriptions View a summary of all report subscriptions.

Parameters:

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
# File 'lib/cybersource_rest_client/api/report_subscriptions_api.rb', line 191

def get_all_subscriptions_with_http_info(opts = {})
  
	  if @api_client.config.debugging
begin
			raise
@api_client.config.logger.debug 'Calling API: ReportSubscriptionsApi.get_all_subscriptions ...'
			rescue
puts 'Cannot write to log'
			end
  end
  # resource path
  local_var_path = 'reporting/v3/report-subscriptions'

  # query parameters
  query_params = {}

  # header parameters
  header_params = {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/hal+json'])
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json;charset=utf-8'])

  # form parameters
  form_params = {}

  # http body (model)
  post_body = nil
  auth_names = []
  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 => 'ReportingV3ReportSubscriptionsGet200Response')
  if @api_client.config.debugging
		begin
		raise
			@api_client.config.logger.debug "API called: ReportSubscriptionsApi#get_all_subscriptions\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
		rescue
			puts 'Cannot write to log'
		end
	  end
  return data, status_code, headers
end

#get_subscription(report_name, opts = {}) ⇒ ReportingV3ReportSubscriptionsGet200ResponseSubscriptions

Get subscription for report name View the details of a report subscription, such as the report format or report frequency, using the report’s unique name.

Parameters:

  • report_name

    Name of the Report to Retrieve

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



242
243
244
245
# File 'lib/cybersource_rest_client/api/report_subscriptions_api.rb', line 242

def get_subscription(report_name, opts = {})
  data, status_code, headers = get_subscription_with_http_info(report_name, opts)
  return data, status_code, headers
end

#get_subscription_with_http_info(report_name, opts = {}) ⇒ Array<(ReportingV3ReportSubscriptionsGet200ResponseSubscriptions, Fixnum, Hash)>

Get subscription for report name View the details of a report subscription, such as the report format or report frequency, using the report’s unique name.

Parameters:

  • report_name

    Name of the Report to Retrieve

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
# File 'lib/cybersource_rest_client/api/report_subscriptions_api.rb', line 252

def get_subscription_with_http_info(report_name, opts = {})
  
	  if @api_client.config.debugging
begin
			raise
@api_client.config.logger.debug 'Calling API: ReportSubscriptionsApi.get_subscription ...'
			rescue
puts 'Cannot write to log'
			end
  end
  # verify the required parameter 'report_name' is set
  if @api_client.config.client_side_validation && report_name.nil?
    fail ArgumentError, "Missing the required parameter 'report_name' when calling ReportSubscriptionsApi.get_subscription"
  end
  if @api_client.config.client_side_validation && report_name.to_s.length > 80
    fail ArgumentError, 'invalid value for "report_name" when calling ReportSubscriptionsApi.get_subscription, the character length must be smaller than or equal to 80.'
  end

  if @api_client.config.client_side_validation && report_name.to_s.length < 1
    fail ArgumentError, 'invalid value for "report_name" when calling ReportSubscriptionsApi.get_subscription, the character length must be great than or equal to 1.'
  end

  #if @api_client.config.client_side_validation && report_name !~ Regexp.new(/[a-zA-Z0-9-_+]+/)
    #fail ArgumentError, "invalid value for 'report_name' when calling ReportSubscriptionsApi.get_subscription, must conform to the pattern /[a-zA-Z0-9-_+]+/."
  #end

  # resource path
  local_var_path = 'reporting/v3/report-subscriptions/{reportName}'.sub('{' + 'reportName' + '}', report_name.to_s)

  # query parameters
  query_params = {}

  # header parameters
  header_params = {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/hal+json'])
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json;charset=utf-8'])

  # form parameters
  form_params = {}

  # http body (model)
  post_body = nil
  auth_names = []
  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 => 'ReportingV3ReportSubscriptionsGet200ResponseSubscriptions')
  if @api_client.config.debugging
		begin
		raise
			@api_client.config.logger.debug "API called: ReportSubscriptionsApi#get_subscription\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
		rescue
			puts 'Cannot write to log'
		end
	  end
  return data, status_code, headers
end