Class: PostfinancecheckoutRubySdk::WebAppsService

Inherits:
Object
  • Object
show all
Defined in:
lib/postfinancecheckout-ruby-sdk/service/web_apps_service.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(api_client = ApiClient.default) ⇒ WebAppsService

Returns a new instance of WebAppsService.



28
29
30
# File 'lib/postfinancecheckout-ruby-sdk/service/web_apps_service.rb', line 28

def initialize(api_client = ApiClient.default)
  @api_client = api_client
end

Instance Attribute Details

#api_clientObject

Returns the value of attribute api_client.



25
26
27
# File 'lib/postfinancecheckout-ruby-sdk/service/web_apps_service.rb', line 25

def api_client
  @api_client
end

Instance Method Details

#get_web_apps_installed(space, opts = {}) ⇒ Boolean

Check whether the web app is installed Return true if the web app is installed in the provided space.

Parameters:

  • space (Integer)

    Specifies the ID of the space the operation should be executed in.

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

    the optional parameters

Returns:

  • (Boolean)


36
37
38
39
# File 'lib/postfinancecheckout-ruby-sdk/service/web_apps_service.rb', line 36

def get_web_apps_installed(space, opts = {})
  data, _status_code, _headers = get_web_apps_installed_with_http_info(space, opts)
  data
end

#get_web_apps_installed_with_http_info(space, opts = {}) ⇒ Array<(Boolean, Integer, Hash)>

Returns Boolean data, response status code and response headers.

Parameters:

  • space (Integer)

    Specifies the ID of the space the operation should be executed in.

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

    the optional parameters

Returns:

  • (Array<(Boolean, Integer, Hash)>)

    Boolean data, response status code and response headers



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
# File 'lib/postfinancecheckout-ruby-sdk/service/web_apps_service.rb', line 47

def get_web_apps_installed_with_http_info(space, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: WebAppsService.get_web_apps_installed ...'
  end
  # verify the required parameter 'space' is set
  if @api_client.config.client_side_validation && space.nil?
    fail ArgumentError, "Missing the required parameter 'space' when calling WebAppsService.get_web_apps_installed"
  end
  # resource path
  local_var_path = '/web-apps/installed'

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
  header_params[:'Space'] = space

  # form parameters
  form_params = opts[:form_params] || {}

  # connection timeout
  connection_timeout = @api_client.config.timeout

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'Boolean'

  new_options = opts.merge(
    :operation => :"WebAppsService.get_web_apps_installed",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:GET.to_sym.downcase, local_var_path, new_options, connection_timeout)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: WebAppsService#get_web_apps_installed\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}\nConnection Timeout: #{connection_timeout}"
  end
  return data, status_code, headers
end

#post_web_apps_confirm_code(code, opts = {}) ⇒ WebAppConfirmationResponse

Confirm a web app installation Confirm the installation of a web app. This has to be done when the user returns to the web app after granting permissions, using the activation code provided in the request.

Parameters:

  • code (String)

    The activation code passed to the web app after permissions were granted.

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

    the optional parameters

Options Hash (opts):

  • :expand (Array<String>)

Returns:



102
103
104
105
# File 'lib/postfinancecheckout-ruby-sdk/service/web_apps_service.rb', line 102

def post_web_apps_confirm_code(code, opts = {})
  data, _status_code, _headers = post_web_apps_confirm_code_with_http_info(code, opts)
  data
end

#post_web_apps_confirm_code_with_http_info(code, opts = {}) ⇒ Array<(WebAppConfirmationResponse, Integer, Hash)>

Returns WebAppConfirmationResponse data, response status code and response headers.

Parameters:

  • code (String)

    The activation code passed to the web app after permissions were granted.

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

    the optional parameters

Options Hash (opts):

  • :expand (Array<String>)

Returns:

  • (Array<(WebAppConfirmationResponse, Integer, Hash)>)

    WebAppConfirmationResponse data, response status code and response headers



114
115
116
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
# File 'lib/postfinancecheckout-ruby-sdk/service/web_apps_service.rb', line 114

def post_web_apps_confirm_code_with_http_info(code, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: WebAppsService.post_web_apps_confirm_code ...'
  end
  # verify the required parameter 'code' is set
  if @api_client.config.client_side_validation && code.nil?
    fail ArgumentError, "Missing the required parameter 'code' when calling WebAppsService.post_web_apps_confirm_code"
  end
  # resource path
  local_var_path = '/web-apps/confirm/{code}'.sub('{' + 'code' + '}', CGI.escape(code.to_s))

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'expand'] = @api_client.build_collection_param(opts[:'expand'], :multi) unless opts[:'expand'].nil?

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']

  # form parameters
  form_params = opts[:form_params] || {}

  # connection timeout
  connection_timeout = @api_client.config.timeout

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'WebAppConfirmationResponse'

  new_options = opts.merge(
    :operation => :"WebAppsService.post_web_apps_confirm_code",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:POST.to_sym.downcase, local_var_path, new_options, connection_timeout)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: WebAppsService#post_web_apps_confirm_code\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}\nConnection Timeout: #{connection_timeout}"
  end
  return data, status_code, headers
end

#post_web_apps_uninstall(space, opts = {}) ⇒ nil

Uninstall a web app Uninstall the web app from the provided space.

Parameters:

  • space (Integer)

    Specifies the ID of the space the operation should be executed in.

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

    the optional parameters

Returns:

  • (nil)


168
169
170
171
# File 'lib/postfinancecheckout-ruby-sdk/service/web_apps_service.rb', line 168

def post_web_apps_uninstall(space, opts = {})
  post_web_apps_uninstall_with_http_info(space, opts)
  nil
end

#post_web_apps_uninstall_with_http_info(space, opts = {}) ⇒ Array<(nil, Integer, Hash)>

Returns nil, response status code and response headers.

Parameters:

  • space (Integer)

    Specifies the ID of the space the operation should be executed in.

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

    the optional parameters

Returns:

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

    nil, response status code and response headers



179
180
181
182
183
184
185
186
187
188
189
190
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
# File 'lib/postfinancecheckout-ruby-sdk/service/web_apps_service.rb', line 179

def post_web_apps_uninstall_with_http_info(space, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: WebAppsService.post_web_apps_uninstall ...'
  end
  # verify the required parameter 'space' is set
  if @api_client.config.client_side_validation && space.nil?
    fail ArgumentError, "Missing the required parameter 'space' when calling WebAppsService.post_web_apps_uninstall"
  end
  # resource path
  local_var_path = '/web-apps/uninstall'

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
  header_params[:'Space'] = space

  # form parameters
  form_params = opts[:form_params] || {}

  # connection timeout
  connection_timeout = @api_client.config.timeout

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type]

  new_options = opts.merge(
    :operation => :"WebAppsService.post_web_apps_uninstall",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:POST.to_sym.downcase, local_var_path, new_options, connection_timeout)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: WebAppsService#post_web_apps_uninstall\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}\nConnection Timeout: #{connection_timeout}"
  end
  return data, status_code, headers
end