Class: DatadogAPIClient::V2::SalesforceIntegrationAPI

Inherits:
Object
  • Object
show all
Defined in:
lib/datadog_api_client/v2/api/salesforce_integration_api.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(api_client = DatadogAPIClient::APIClient.default) ⇒ SalesforceIntegrationAPI

Returns a new instance of SalesforceIntegrationAPI.



22
23
24
# File 'lib/datadog_api_client/v2/api/salesforce_integration_api.rb', line 22

def initialize(api_client = DatadogAPIClient::APIClient.default)
  @api_client = api_client
end

Instance Attribute Details

#api_clientObject

Returns the value of attribute api_client.



20
21
22
# File 'lib/datadog_api_client/v2/api/salesforce_integration_api.rb', line 20

def api_client
  @api_client
end

Instance Method Details

#create_incident_template(body, opts = {}) ⇒ Object

Create a Salesforce incident template.



29
30
31
32
# File 'lib/datadog_api_client/v2/api/salesforce_integration_api.rb', line 29

def create_incident_template(body, opts = {})
  data, _status_code, _headers = create_incident_template_with_http_info(body, opts)
  data
end

#create_incident_template_with_http_info(body, opts = {}) ⇒ Array<(SalesforceIncidentsTemplateResponse, Integer, Hash)>

Create a Salesforce incident template.

Create a new Salesforce incident template for your organization. Template names must be unique within an organization.

Parameters:

Returns:



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
# File 'lib/datadog_api_client/v2/api/salesforce_integration_api.rb', line 42

def create_incident_template_with_http_info(body, opts = {})

  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: SalesforceIntegrationAPI.create_incident_template ...'
  end
  # verify the required parameter 'body' is set
  if @api_client.config.client_side_validation && body.nil?
    fail ArgumentError, "Missing the required parameter 'body' when calling SalesforceIntegrationAPI.create_incident_template"
  end
  # resource path
  local_var_path = '/api/v2/integration/salesforce-incidents/incident-templates'

  # 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'])
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])

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

  # http body (model)
  post_body = opts[:debug_body] || @api_client.object_to_http_body(body)

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

  # auth_names
  auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth]

  new_options = opts.merge(
    :operation => :create_incident_template,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type,
    :api_version => "V2"
  )

  data, status_code, headers = @api_client.call_api(Net::HTTP::Post, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: SalesforceIntegrationAPI#create_incident_template\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#delete_incident_template(incident_template_id, opts = {}) ⇒ Object

Delete a Salesforce incident template.



97
98
99
100
# File 'lib/datadog_api_client/v2/api/salesforce_integration_api.rb', line 97

def delete_incident_template(incident_template_id, opts = {})
  delete_incident_template_with_http_info(incident_template_id, opts)
  nil
end

#delete_incident_template_with_http_info(incident_template_id, opts = {}) ⇒ Array<(nil, Integer, Hash)>

Delete a Salesforce incident template.

Delete a single Salesforce incident template from your organization.

Parameters:

  • incident_template_id (String)

    The ID of the Salesforce incident template.

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

    the optional parameters

Returns:

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

    nil, response status code and response headers



109
110
111
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
152
153
154
155
156
157
# File 'lib/datadog_api_client/v2/api/salesforce_integration_api.rb', line 109

def delete_incident_template_with_http_info(incident_template_id, opts = {})

  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: SalesforceIntegrationAPI.delete_incident_template ...'
  end
  # verify the required parameter 'incident_template_id' is set
  if @api_client.config.client_side_validation && incident_template_id.nil?
    fail ArgumentError, "Missing the required parameter 'incident_template_id' when calling SalesforceIntegrationAPI.delete_incident_template"
  end
  # resource path
  local_var_path = '/api/v2/integration/salesforce-incidents/incident-templates/{incident_template_id}'.sub('{incident_template_id}', CGI.escape(incident_template_id.to_s).gsub('%2F', '/'))

  # 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(['*/*'])

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

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

  # return_type
  return_type = opts[:debug_return_type]

  # auth_names
  auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth]

  new_options = opts.merge(
    :operation => :delete_incident_template,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type,
    :api_version => "V2"
  )

  data, status_code, headers = @api_client.call_api(Net::HTTP::Delete, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: SalesforceIntegrationAPI#delete_incident_template\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#delete_salesforce_organization(salesforce_org_id, opts = {}) ⇒ Object

Delete a connected Salesforce organization.



162
163
164
165
# File 'lib/datadog_api_client/v2/api/salesforce_integration_api.rb', line 162

def delete_salesforce_organization(salesforce_org_id, opts = {})
  delete_salesforce_organization_with_http_info(salesforce_org_id, opts)
  nil
end

#delete_salesforce_organization_with_http_info(salesforce_org_id, opts = {}) ⇒ Array<(nil, Integer, Hash)>

Delete a connected Salesforce organization.

Disconnect a Salesforce organization from your Datadog organization. This also deletes any incident templates referencing the organization.

Parameters:

  • salesforce_org_id (String)

    The Datadog-assigned ID of the connected Salesforce organization.

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

    the optional parameters

Returns:

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

    nil, response status code and response headers



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
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
# File 'lib/datadog_api_client/v2/api/salesforce_integration_api.rb', line 175

def delete_salesforce_organization_with_http_info(salesforce_org_id, opts = {})

  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: SalesforceIntegrationAPI.delete_salesforce_organization ...'
  end
  # verify the required parameter 'salesforce_org_id' is set
  if @api_client.config.client_side_validation && salesforce_org_id.nil?
    fail ArgumentError, "Missing the required parameter 'salesforce_org_id' when calling SalesforceIntegrationAPI.delete_salesforce_organization"
  end
  # resource path
  local_var_path = '/api/v2/integration/salesforce-incidents/organizations/{salesforce_org_id}'.sub('{salesforce_org_id}', CGI.escape(salesforce_org_id.to_s).gsub('%2F', '/'))

  # 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(['*/*'])

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

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

  # return_type
  return_type = opts[:debug_return_type]

  # auth_names
  auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth]

  new_options = opts.merge(
    :operation => :delete_salesforce_organization,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type,
    :api_version => "V2"
  )

  data, status_code, headers = @api_client.call_api(Net::HTTP::Delete, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: SalesforceIntegrationAPI#delete_salesforce_organization\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_incident_templates(opts = {}) ⇒ Object

Get all Salesforce incident templates.



228
229
230
231
# File 'lib/datadog_api_client/v2/api/salesforce_integration_api.rb', line 228

def get_incident_templates(opts = {})
  data, _status_code, _headers = get_incident_templates_with_http_info(opts)
  data
end

#get_incident_templates_with_http_info(opts = {}) ⇒ Array<(SalesforceIncidentsTemplatesResponse, Integer, Hash)>

Get all Salesforce incident templates.

Get all Salesforce incident templates configured for your organization.

Parameters:

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

    the optional parameters

Returns:



239
240
241
242
243
244
245
246
247
248
249
250
251
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
# File 'lib/datadog_api_client/v2/api/salesforce_integration_api.rb', line 239

def get_incident_templates_with_http_info(opts = {})

  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: SalesforceIntegrationAPI.get_incident_templates ...'
  end
  # resource path
  local_var_path = '/api/v2/integration/salesforce-incidents/incident-templates'

  # 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'])

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

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

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

  # auth_names
  auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth]

  new_options = opts.merge(
    :operation => :get_incident_templates,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type,
    :api_version => "V2"
  )

  data, status_code, headers = @api_client.call_api(Net::HTTP::Get, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: SalesforceIntegrationAPI#get_incident_templates\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_salesforce_organizations(opts = {}) ⇒ Object

Get all connected Salesforce organizations.



288
289
290
291
# File 'lib/datadog_api_client/v2/api/salesforce_integration_api.rb', line 288

def get_salesforce_organizations(opts = {})
  data, _status_code, _headers = get_salesforce_organizations_with_http_info(opts)
  data
end

#get_salesforce_organizations_with_http_info(opts = {}) ⇒ Array<(SalesforceIncidentsOrganizationsResponse, Integer, Hash)>

Get all connected Salesforce organizations.

Get all Salesforce organizations connected to your Datadog organization through the Salesforce integration. Salesforce organizations are connected through the OAuth setup flow in the Datadog Salesforce integration page.

Parameters:

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

    the optional parameters

Returns:



301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
# File 'lib/datadog_api_client/v2/api/salesforce_integration_api.rb', line 301

def get_salesforce_organizations_with_http_info(opts = {})

  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: SalesforceIntegrationAPI.get_salesforce_organizations ...'
  end
  # resource path
  local_var_path = '/api/v2/integration/salesforce-incidents/organizations'

  # 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'])

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

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

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

  # auth_names
  auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth]

  new_options = opts.merge(
    :operation => :get_salesforce_organizations,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type,
    :api_version => "V2"
  )

  data, status_code, headers = @api_client.call_api(Net::HTTP::Get, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: SalesforceIntegrationAPI#get_salesforce_organizations\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#update_incident_template(incident_template_id, body, opts = {}) ⇒ Object

Update a Salesforce incident template.



350
351
352
353
# File 'lib/datadog_api_client/v2/api/salesforce_integration_api.rb', line 350

def update_incident_template(incident_template_id, body, opts = {})
  data, _status_code, _headers = update_incident_template_with_http_info(incident_template_id, body, opts)
  data
end

#update_incident_template_with_http_info(incident_template_id, body, opts = {}) ⇒ Array<(SalesforceIncidentsTemplateResponse, Integer, Hash)>

Update a Salesforce incident template.

Update a single Salesforce incident template in your organization.

Parameters:

  • incident_template_id (String)

    The ID of the Salesforce incident template.

  • body (SalesforceIncidentsTemplateUpdateRequest)

    Salesforce incident template payload.

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

    the optional parameters

Returns:



363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
# File 'lib/datadog_api_client/v2/api/salesforce_integration_api.rb', line 363

def update_incident_template_with_http_info(incident_template_id, body, opts = {})

  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: SalesforceIntegrationAPI.update_incident_template ...'
  end
  # verify the required parameter 'incident_template_id' is set
  if @api_client.config.client_side_validation && incident_template_id.nil?
    fail ArgumentError, "Missing the required parameter 'incident_template_id' when calling SalesforceIntegrationAPI.update_incident_template"
  end
  # verify the required parameter 'body' is set
  if @api_client.config.client_side_validation && body.nil?
    fail ArgumentError, "Missing the required parameter 'body' when calling SalesforceIntegrationAPI.update_incident_template"
  end
  # resource path
  local_var_path = '/api/v2/integration/salesforce-incidents/incident-templates/{incident_template_id}'.sub('{incident_template_id}', CGI.escape(incident_template_id.to_s).gsub('%2F', '/'))

  # 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'])
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])

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

  # http body (model)
  post_body = opts[:debug_body] || @api_client.object_to_http_body(body)

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

  # auth_names
  auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth]

  new_options = opts.merge(
    :operation => :update_incident_template,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type,
    :api_version => "V2"
  )

  data, status_code, headers = @api_client.call_api(Net::HTTP::Patch, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: SalesforceIntegrationAPI#update_incident_template\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end