Class: BombBomb::UtilitiesApi

Inherits:
Object
  • Object
show all
Defined in:
lib/bombbomb/api/utilities_api.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(api_client = ApiClient.default) ⇒ UtilitiesApi

Returns a new instance of UtilitiesApi.



30
31
32
# File 'lib/bombbomb/api/utilities_api.rb', line 30

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

Instance Attribute Details

#api_clientObject

Returns the value of attribute api_client.



28
29
30
# File 'lib/bombbomb/api/utilities_api.rb', line 28

def api_client
  @api_client
end

Instance Method Details

#create_o_auth_client(name, redirect_uri, opts = {}) ⇒ OAuthClient

Create an OAuth Client Creates an OAuth Client managed by the user

Parameters:

  • name

    The name of the OAuth client. e.g. MyCrm DEV, or MyCrm PROD

  • redirect_uri

    The URI to direct the client to after logging in.

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

    the optional parameters

Returns:



40
41
42
43
# File 'lib/bombbomb/api/utilities_api.rb', line 40

def create_o_auth_client(name, redirect_uri, opts = {})
  data, _status_code, _headers = create_o_auth_client_with_http_info(name, redirect_uri, opts)
  return data
end

#create_o_auth_client_with_http_info(name, redirect_uri, opts = {}) ⇒ Array<(OAuthClient, Fixnum, Hash)>

Create an OAuth Client Creates an OAuth Client managed by the user

Parameters:

  • name

    The name of the OAuth client. e.g. MyCrm DEV, or MyCrm PROD

  • redirect_uri

    The URI to direct the client to after logging in.

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

    the optional parameters

Returns:

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

    OAuthClient data, response status code and response headers



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
# File 'lib/bombbomb/api/utilities_api.rb', line 51

def create_o_auth_client_with_http_info(name, redirect_uri, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: UtilitiesApi.create_o_auth_client ..."
  end
  # verify the required parameter 'name' is set
  fail ArgumentError, "Missing the required parameter 'name' when calling UtilitiesApi.create_o_auth_client" if name.nil?
  # verify the required parameter 'redirect_uri' is set
  fail ArgumentError, "Missing the required parameter 'redirect_uri' when calling UtilitiesApi.create_o_auth_client" if redirect_uri.nil?
  # resource path
  local_var_path = "/oauthclient".sub('{format}','json')

  # query parameters
  query_params = {}

  # header parameters
  header_params = {}

  # HTTP header 'Accept' (if needed)
  local_header_accept = ['application/json']
  local_header_accept_result = @api_client.select_header_accept(local_header_accept) and header_params['Accept'] = local_header_accept_result

  # HTTP header 'Content-Type'
  local_header_content_type = ['application/x-www-form-urlencoded']
  header_params['Content-Type'] = @api_client.select_header_content_type(local_header_content_type)

  # form parameters
  form_params = {}
  form_params["name"] = name
  form_params["redirectUri"] = redirect_uri

  # http body (model)
  post_body = nil
  auth_names = ['BBOAuth2']
  data, status_code, headers = @api_client.call_api(:POST, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'OAuthClient')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: UtilitiesApi#create_o_auth_client\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#delete_o_auth_client(id, opts = {}) ⇒ nil

Delete an OAuth Client Deletes an OAuth Client managed by the user

Parameters:

  • id

    The id of the OAuth Client

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

    the optional parameters

Returns:

  • (nil)


102
103
104
105
# File 'lib/bombbomb/api/utilities_api.rb', line 102

def delete_o_auth_client(id, opts = {})
  delete_o_auth_client_with_http_info(id, opts)
  return nil
end

#delete_o_auth_client_with_http_info(id, opts = {}) ⇒ Array<(nil, Fixnum, Hash)>

Delete an OAuth Client Deletes an OAuth Client managed by the user

Parameters:

  • id

    The id of the OAuth Client

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

    the optional parameters

Returns:

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

    nil, response status code and response headers



112
113
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
# File 'lib/bombbomb/api/utilities_api.rb', line 112

def delete_o_auth_client_with_http_info(id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: UtilitiesApi.delete_o_auth_client ..."
  end
  # verify the required parameter 'id' is set
  fail ArgumentError, "Missing the required parameter 'id' when calling UtilitiesApi.delete_o_auth_client" if id.nil?
  # resource path
  local_var_path = "/oauthclient/{id}".sub('{format}','json').sub('{' + 'id' + '}', id.to_s)

  # query parameters
  query_params = {}

  # header parameters
  header_params = {}

  # HTTP header 'Accept' (if needed)
  local_header_accept = ['application/json']
  local_header_accept_result = @api_client.select_header_accept(local_header_accept) and header_params['Accept'] = local_header_accept_result

  # HTTP header 'Content-Type'
  local_header_content_type = ['application/x-www-form-urlencoded']
  header_params['Content-Type'] = @api_client.select_header_content_type(local_header_content_type)

  # form parameters
  form_params = {}

  # http body (model)
  post_body = nil
  auth_names = ['BBOAuth2']
  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
    @api_client.config.logger.debug "API called: UtilitiesApi#delete_o_auth_client\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_o_auth_clients(opts = {}) ⇒ Array<OAuthClient>

Lists OAuth Clients Enumerates OAuth Clients managed by the user

Parameters:

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

    the optional parameters

Returns:



157
158
159
160
# File 'lib/bombbomb/api/utilities_api.rb', line 157

def get_o_auth_clients(opts = {})
  data, _status_code, _headers = get_o_auth_clients_with_http_info(opts)
  return data
end

#get_o_auth_clients_with_http_info(opts = {}) ⇒ Array<(Array<OAuthClient>, Fixnum, Hash)>

Lists OAuth Clients Enumerates OAuth Clients managed by the user

Parameters:

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

    the optional parameters

Returns:

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

    Array<OAuthClient> data, response status code and response headers



166
167
168
169
170
171
172
173
174
175
176
177
178
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
# File 'lib/bombbomb/api/utilities_api.rb', line 166

def get_o_auth_clients_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: UtilitiesApi.get_o_auth_clients ..."
  end
  # resource path
  local_var_path = "/oauthclient".sub('{format}','json')

  # query parameters
  query_params = {}

  # header parameters
  header_params = {}

  # HTTP header 'Accept' (if needed)
  local_header_accept = ['application/json']
  local_header_accept_result = @api_client.select_header_accept(local_header_accept) and header_params['Accept'] = local_header_accept_result

  # HTTP header 'Content-Type'
  local_header_content_type = ['application/x-www-form-urlencoded']
  header_params['Content-Type'] = @api_client.select_header_content_type(local_header_content_type)

  # form parameters
  form_params = {}

  # http body (model)
  post_body = nil
  auth_names = ['BBOAuth2']
  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 => 'Array<OAuthClient>')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: UtilitiesApi#get_o_auth_clients\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_spec(opts = {}) ⇒ nil

Describes this api Describes methods available through the API.

Parameters:

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

    the optional parameters

Returns:

  • (nil)


210
211
212
213
# File 'lib/bombbomb/api/utilities_api.rb', line 210

def get_spec(opts = {})
  get_spec_with_http_info(opts)
  return nil
end

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

Describes this api Describes methods available through the API.

Parameters:

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

    the optional parameters

Returns:

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

    nil, response status code and response headers



219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
# File 'lib/bombbomb/api/utilities_api.rb', line 219

def get_spec_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: UtilitiesApi.get_spec ..."
  end
  # resource path
  local_var_path = "/spec".sub('{format}','json')

  # query parameters
  query_params = {}

  # header parameters
  header_params = {}

  # HTTP header 'Accept' (if needed)
  local_header_accept = ['application/json']
  local_header_accept_result = @api_client.select_header_accept(local_header_accept) and header_params['Accept'] = local_header_accept_result

  # HTTP header 'Content-Type'
  local_header_content_type = ['application/x-www-form-urlencoded']
  header_params['Content-Type'] = @api_client.select_header_content_type(local_header_content_type)

  # 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)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: UtilitiesApi#get_spec\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end