Class: OpsgenieSdk::TeamRoutingRuleApi

Inherits:
Object
  • Object
show all
Defined in:
lib/opsgenie_sdk/api/team_routing_rule_api.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(api_client = ApiClient.default) ⇒ TeamRoutingRuleApi

Returns a new instance of TeamRoutingRuleApi.



19
20
21
# File 'lib/opsgenie_sdk/api/team_routing_rule_api.rb', line 19

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

Instance Attribute Details

#api_clientObject

Returns the value of attribute api_client.



17
18
19
# File 'lib/opsgenie_sdk/api/team_routing_rule_api.rb', line 17

def api_client
  @api_client
end

Instance Method Details

#change_team_routing_rule_order(identifier, id, body, opts = {}) ⇒ SuccessResponse

Change Team Routing Rule Order Change the order of team routing rule with given id

Parameters:

  • identifier

    Identifier of the team

  • id

    Id of the team routing rule

  • body

    Request payload of change team routing rule order action

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

    the optional parameters

Options Hash (opts):

  • :team_identifier_type (String)

    Type of the identifier. Possible values are 'id' and 'name'. Default value is 'id' (default to id)

Returns:



30
31
32
33
# File 'lib/opsgenie_sdk/api/team_routing_rule_api.rb', line 30

def change_team_routing_rule_order(identifier, id, body, opts = {})
  data, _status_code, _headers = change_team_routing_rule_order_with_http_info(identifier, id, body, opts)
  data
end

#change_team_routing_rule_order_with_http_info(identifier, id, body, opts = {}) ⇒ Array<(SuccessResponse, Fixnum, Hash)>

Change Team Routing Rule Order Change the order of team routing rule with given id

Parameters:

  • identifier

    Identifier of the team

  • id

    Id of the team routing rule

  • body

    Request payload of change team routing rule order action

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

    the optional parameters

Options Hash (opts):

  • :team_identifier_type (String)

    Type of the identifier. Possible values are &#39;id&#39; and &#39;name&#39;. Default value is &#39;id&#39;

Returns:

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

    SuccessResponse data, response status code and response headers



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
# File 'lib/opsgenie_sdk/api/team_routing_rule_api.rb', line 43

def change_team_routing_rule_order_with_http_info(identifier, id, body, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: TeamRoutingRuleApi.change_team_routing_rule_order ...'
  end
  # verify the required parameter 'identifier' is set
  if @api_client.config.client_side_validation && identifier.nil?
    fail ArgumentError, "Missing the required parameter 'identifier' when calling TeamRoutingRuleApi.change_team_routing_rule_order"
  end
  # verify the required parameter 'id' is set
  if @api_client.config.client_side_validation && id.nil?
    fail ArgumentError, "Missing the required parameter 'id' when calling TeamRoutingRuleApi.change_team_routing_rule_order"
  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 TeamRoutingRuleApi.change_team_routing_rule_order"
  end
  if @api_client.config.client_side_validation && opts[:'team_identifier_type'] && !['id', 'name'].include?(opts[:'team_identifier_type'])
    fail ArgumentError, 'invalid value for "team_identifier_type", must be one of id, name'
  end
  # resource path
  local_var_path = '/v2/teams/{identifier}/routing-rules/{id}/change-order'.sub('{' + 'identifier' + '}', identifier.to_s).sub('{' + 'id' + '}', id.to_s)

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

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

  # form parameters
  form_params = {}

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

#create_team_routing_rule(identifier, body, opts = {}) ⇒ SuccessResponse

Create Team Routing Rule Creates a new team routing rule

Parameters:

  • identifier

    Identifier of the team

  • body

    Request payload of createTeamRoutingRule

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

    the optional parameters

Options Hash (opts):

  • :team_identifier_type (String)

    Type of the identifier. Possible values are &#39;id&#39; and &#39;name&#39;. Default value is &#39;id&#39; (default to id)

Returns:



99
100
101
102
# File 'lib/opsgenie_sdk/api/team_routing_rule_api.rb', line 99

def create_team_routing_rule(identifier, body, opts = {})
  data, _status_code, _headers = create_team_routing_rule_with_http_info(identifier, body, opts)
  data
end

#create_team_routing_rule_with_http_info(identifier, body, opts = {}) ⇒ Array<(SuccessResponse, Fixnum, Hash)>

Create Team Routing Rule Creates a new team routing rule

Parameters:

  • identifier

    Identifier of the team

  • body

    Request payload of createTeamRoutingRule

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

    the optional parameters

Options Hash (opts):

  • :team_identifier_type (String)

    Type of the identifier. Possible values are &#39;id&#39; and &#39;name&#39;. Default value is &#39;id&#39;

Returns:

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

    SuccessResponse data, response status code and response headers



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
# File 'lib/opsgenie_sdk/api/team_routing_rule_api.rb', line 111

def create_team_routing_rule_with_http_info(identifier, body, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: TeamRoutingRuleApi.create_team_routing_rule ...'
  end
  # verify the required parameter 'identifier' is set
  if @api_client.config.client_side_validation && identifier.nil?
    fail ArgumentError, "Missing the required parameter 'identifier' when calling TeamRoutingRuleApi.create_team_routing_rule"
  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 TeamRoutingRuleApi.create_team_routing_rule"
  end
  if @api_client.config.client_side_validation && opts[:'team_identifier_type'] && !['id', 'name'].include?(opts[:'team_identifier_type'])
    fail ArgumentError, 'invalid value for "team_identifier_type", must be one of id, name'
  end
  # resource path
  local_var_path = '/v2/teams/{identifier}/routing-rules'.sub('{' + 'identifier' + '}', identifier.to_s)

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

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

  # form parameters
  form_params = {}

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

#delete_team_routing_rule(identifier, id, opts = {}) ⇒ SuccessResponse

Delete Team Routing Rule Delete team routing rule with given id

Parameters:

  • identifier

    Identifier of the team

  • id

    Id of the team routing rule

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

    the optional parameters

Options Hash (opts):

  • :team_identifier_type (String)

    Type of the identifier. Possible values are &#39;id&#39; and &#39;name&#39;. Default value is &#39;id&#39; (default to id)

Returns:



163
164
165
166
# File 'lib/opsgenie_sdk/api/team_routing_rule_api.rb', line 163

def delete_team_routing_rule(identifier, id, opts = {})
  data, _status_code, _headers = delete_team_routing_rule_with_http_info(identifier, id, opts)
  data
end

#delete_team_routing_rule_with_http_info(identifier, id, opts = {}) ⇒ Array<(SuccessResponse, Fixnum, Hash)>

Delete Team Routing Rule Delete team routing rule with given id

Parameters:

  • identifier

    Identifier of the team

  • id

    Id of the team routing rule

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

    the optional parameters

Options Hash (opts):

  • :team_identifier_type (String)

    Type of the identifier. Possible values are &#39;id&#39; and &#39;name&#39;. Default value is &#39;id&#39;

Returns:

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

    SuccessResponse data, 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
# File 'lib/opsgenie_sdk/api/team_routing_rule_api.rb', line 175

def delete_team_routing_rule_with_http_info(identifier, id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: TeamRoutingRuleApi.delete_team_routing_rule ...'
  end
  # verify the required parameter 'identifier' is set
  if @api_client.config.client_side_validation && identifier.nil?
    fail ArgumentError, "Missing the required parameter 'identifier' when calling TeamRoutingRuleApi.delete_team_routing_rule"
  end
  # verify the required parameter 'id' is set
  if @api_client.config.client_side_validation && id.nil?
    fail ArgumentError, "Missing the required parameter 'id' when calling TeamRoutingRuleApi.delete_team_routing_rule"
  end
  if @api_client.config.client_side_validation && opts[:'team_identifier_type'] && !['id', 'name'].include?(opts[:'team_identifier_type'])
    fail ArgumentError, 'invalid value for "team_identifier_type", must be one of id, name'
  end
  # resource path
  local_var_path = '/v2/teams/{identifier}/routing-rules/{id}'.sub('{' + 'identifier' + '}', identifier.to_s).sub('{' + 'id' + '}', id.to_s)

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

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

  # form parameters
  form_params = {}

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

#get_team_routing_rule(identifier, id, opts = {}) ⇒ GetTeamRoutingRuleResponse

Get Team Routing Rule Returns team routing rule with given id

Parameters:

  • identifier

    Identifier of the team

  • id

    Id of the team routing rule

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

    the optional parameters

Options Hash (opts):

  • :team_identifier_type (String)

    Type of the identifier. Possible values are &#39;id&#39; and &#39;name&#39;. Default value is &#39;id&#39; (default to id)

Returns:



227
228
229
230
# File 'lib/opsgenie_sdk/api/team_routing_rule_api.rb', line 227

def get_team_routing_rule(identifier, id, opts = {})
  data, _status_code, _headers = get_team_routing_rule_with_http_info(identifier, id, opts)
  data
end

#get_team_routing_rule_with_http_info(identifier, id, opts = {}) ⇒ Array<(GetTeamRoutingRuleResponse, Fixnum, Hash)>

Get Team Routing Rule Returns team routing rule with given id

Parameters:

  • identifier

    Identifier of the team

  • id

    Id of the team routing rule

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

    the optional parameters

Options Hash (opts):

  • :team_identifier_type (String)

    Type of the identifier. Possible values are &#39;id&#39; and &#39;name&#39;. Default value is &#39;id&#39;

Returns:

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

    GetTeamRoutingRuleResponse data, response status code and response headers



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/opsgenie_sdk/api/team_routing_rule_api.rb', line 239

def get_team_routing_rule_with_http_info(identifier, id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: TeamRoutingRuleApi.get_team_routing_rule ...'
  end
  # verify the required parameter 'identifier' is set
  if @api_client.config.client_side_validation && identifier.nil?
    fail ArgumentError, "Missing the required parameter 'identifier' when calling TeamRoutingRuleApi.get_team_routing_rule"
  end
  # verify the required parameter 'id' is set
  if @api_client.config.client_side_validation && id.nil?
    fail ArgumentError, "Missing the required parameter 'id' when calling TeamRoutingRuleApi.get_team_routing_rule"
  end
  if @api_client.config.client_side_validation && opts[:'team_identifier_type'] && !['id', 'name'].include?(opts[:'team_identifier_type'])
    fail ArgumentError, 'invalid value for "team_identifier_type", must be one of id, name'
  end
  # resource path
  local_var_path = '/v2/teams/{identifier}/routing-rules/{id}'.sub('{' + 'identifier' + '}', identifier.to_s).sub('{' + 'id' + '}', id.to_s)

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

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

  # form parameters
  form_params = {}

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

#list_team_routing_rules(identifier, opts = {}) ⇒ ListTeamRoutingRulesResponse

List Team Routing Rules Returns list of team routing rules

Parameters:

  • identifier

    Identifier of the team

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

    the optional parameters

Options Hash (opts):

  • :team_identifier_type (String)

    Type of the identifier. Possible values are &#39;id&#39; and &#39;name&#39;. Default value is &#39;id&#39; (default to id)

Returns:



290
291
292
293
# File 'lib/opsgenie_sdk/api/team_routing_rule_api.rb', line 290

def list_team_routing_rules(identifier, opts = {})
  data, _status_code, _headers = list_team_routing_rules_with_http_info(identifier, opts)
  data
end

#list_team_routing_rules_with_http_info(identifier, opts = {}) ⇒ Array<(ListTeamRoutingRulesResponse, Fixnum, Hash)>

List Team Routing Rules Returns list of team routing rules

Parameters:

  • identifier

    Identifier of the team

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

    the optional parameters

Options Hash (opts):

  • :team_identifier_type (String)

    Type of the identifier. Possible values are &#39;id&#39; and &#39;name&#39;. Default value is &#39;id&#39;

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
# File 'lib/opsgenie_sdk/api/team_routing_rule_api.rb', line 301

def list_team_routing_rules_with_http_info(identifier, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: TeamRoutingRuleApi.list_team_routing_rules ...'
  end
  # verify the required parameter 'identifier' is set
  if @api_client.config.client_side_validation && identifier.nil?
    fail ArgumentError, "Missing the required parameter 'identifier' when calling TeamRoutingRuleApi.list_team_routing_rules"
  end
  if @api_client.config.client_side_validation && opts[:'team_identifier_type'] && !['id', 'name'].include?(opts[:'team_identifier_type'])
    fail ArgumentError, 'invalid value for "team_identifier_type", must be one of id, name'
  end
  # resource path
  local_var_path = '/v2/teams/{identifier}/routing-rules'.sub('{' + 'identifier' + '}', identifier.to_s)

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

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

  # form parameters
  form_params = {}

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

#update_team_routing_rule(identifier, id, opts = {}) ⇒ SuccessResponse

Update Team Routing Rule (Partial) Update routing rule of the team

Parameters:

  • identifier

    Identifier of the team

  • id

    Id of the team routing rule

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

    the optional parameters

Options Hash (opts):

  • :team_identifier_type (String)

    Type of the identifier. Possible values are &#39;id&#39; and &#39;name&#39;. Default value is &#39;id&#39; (default to id)

  • :body (UpdateTeamRoutingRulePayload)

    Request payload of update Team Routing Rule action

Returns:



350
351
352
353
# File 'lib/opsgenie_sdk/api/team_routing_rule_api.rb', line 350

def update_team_routing_rule(identifier, id, opts = {})
  data, _status_code, _headers = update_team_routing_rule_with_http_info(identifier, id, opts)
  data
end

#update_team_routing_rule_with_http_info(identifier, id, opts = {}) ⇒ Array<(SuccessResponse, Fixnum, Hash)>

Update Team Routing Rule (Partial) Update routing rule of the team

Parameters:

  • identifier

    Identifier of the team

  • id

    Id of the team routing rule

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

    the optional parameters

Options Hash (opts):

  • :team_identifier_type (String)

    Type of the identifier. Possible values are &#39;id&#39; and &#39;name&#39;. Default value is &#39;id&#39;

  • :body (UpdateTeamRoutingRulePayload)

    Request payload of update Team Routing Rule action

Returns:

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

    SuccessResponse data, response status code and response headers



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
# File 'lib/opsgenie_sdk/api/team_routing_rule_api.rb', line 363

def update_team_routing_rule_with_http_info(identifier, id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: TeamRoutingRuleApi.update_team_routing_rule ...'
  end
  # verify the required parameter 'identifier' is set
  if @api_client.config.client_side_validation && identifier.nil?
    fail ArgumentError, "Missing the required parameter 'identifier' when calling TeamRoutingRuleApi.update_team_routing_rule"
  end
  # verify the required parameter 'id' is set
  if @api_client.config.client_side_validation && id.nil?
    fail ArgumentError, "Missing the required parameter 'id' when calling TeamRoutingRuleApi.update_team_routing_rule"
  end
  if @api_client.config.client_side_validation && opts[:'team_identifier_type'] && !['id', 'name'].include?(opts[:'team_identifier_type'])
    fail ArgumentError, 'invalid value for "team_identifier_type", must be one of id, name'
  end
  # resource path
  local_var_path = '/v2/teams/{identifier}/routing-rules/{id}'.sub('{' + 'identifier' + '}', identifier.to_s).sub('{' + 'id' + '}', id.to_s)

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

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

  # form parameters
  form_params = {}

  # http body (model)
  post_body = @api_client.object_to_http_body(opts[:'body'])
  auth_names = ['GenieKey']
  data, status_code, headers = @api_client.call_api(:PATCH, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'SuccessResponse')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: TeamRoutingRuleApi#update_team_routing_rule\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end