Class: OpsgenieSdk::ScheduleOverrideApi

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(api_client = ApiClient.default) ⇒ ScheduleOverrideApi

Returns a new instance of ScheduleOverrideApi.



19
20
21
# File 'lib/opsgenie_sdk/api/schedule_override_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/schedule_override_api.rb', line 17

def api_client
  @api_client
end

Instance Method Details

#create_schedule_override(identifier, body, opts = {}) ⇒ CreateScheduleOverrideResponse

Create Schedule Override Creates a schedule override for the specified user and schedule

Parameters:

  • identifier

    Identifier of schedule which could be id or name

  • body

    Request payload of created schedule override

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

    the optional parameters

Options Hash (opts):

  • :schedule_identifier_type (String)

    Type of the identifier that is provided as an in-line parameter. Possible values are 'id' or 'name' (default to id)

Returns:



29
30
31
32
# File 'lib/opsgenie_sdk/api/schedule_override_api.rb', line 29

def create_schedule_override(identifier, body, opts = {})
  data, _status_code, _headers = create_schedule_override_with_http_info(identifier, body, opts)
  data
end

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

Create Schedule Override Creates a schedule override for the specified user and schedule

Parameters:

  • identifier

    Identifier of schedule which could be id or name

  • body

    Request payload of created schedule override

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

    the optional parameters

Options Hash (opts):

  • :schedule_identifier_type (String)

    Type of the identifier that is provided as an in-line parameter. Possible values are &#39;id&#39; or &#39;name&#39;

Returns:



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

def create_schedule_override_with_http_info(identifier, body, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: ScheduleOverrideApi.create_schedule_override ...'
  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 ScheduleOverrideApi.create_schedule_override"
  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 ScheduleOverrideApi.create_schedule_override"
  end
  if @api_client.config.client_side_validation && opts[:'schedule_identifier_type'] && !['id', 'name'].include?(opts[:'schedule_identifier_type'])
    fail ArgumentError, 'invalid value for "schedule_identifier_type", must be one of id, name'
  end
  # resource path
  local_var_path = '/v2/schedules/{identifier}/overrides'.sub('{' + 'identifier' + '}', identifier.to_s)

  # query parameters
  query_params = {}
  query_params[:'scheduleIdentifierType'] = opts[:'schedule_identifier_type'] if !opts[:'schedule_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 => 'CreateScheduleOverrideResponse')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: ScheduleOverrideApi#create_schedule_override\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#delete_schedule_override(identifier, _alias, opts = {}) ⇒ SuccessResponse

Delete Schedule Override Delete schedule override with given alias

Parameters:

  • identifier

    Identifier of schedule which could be id or name

  • _alias

    Alias of the schedule override

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

    the optional parameters

Options Hash (opts):

  • :schedule_identifier_type (String)

    Type of the identifier that is provided as an in-line parameter. Possible values are &#39;id&#39; or &#39;name&#39; (default to id)

Returns:



93
94
95
96
# File 'lib/opsgenie_sdk/api/schedule_override_api.rb', line 93

def delete_schedule_override(identifier, _alias, opts = {})
  data, _status_code, _headers = delete_schedule_override_with_http_info(identifier, _alias, opts)
  data
end

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

Delete Schedule Override Delete schedule override with given alias

Parameters:

  • identifier

    Identifier of schedule which could be id or name

  • _alias

    Alias of the schedule override

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

    the optional parameters

Options Hash (opts):

  • :schedule_identifier_type (String)

    Type of the identifier that is provided as an in-line parameter. Possible values are &#39;id&#39; or &#39;name&#39;

Returns:

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

    SuccessResponse data, response status code and response headers



105
106
107
108
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
# File 'lib/opsgenie_sdk/api/schedule_override_api.rb', line 105

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

  # query parameters
  query_params = {}
  query_params[:'scheduleIdentifierType'] = opts[:'schedule_identifier_type'] if !opts[:'schedule_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: ScheduleOverrideApi#delete_schedule_override\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_schedule_override(identifier, _alias, opts = {}) ⇒ GetScheduleOverrideResponse

Get Schedule Override Gets schedule override details with given alias

Parameters:

  • identifier

    Identifier of schedule which could be id or name

  • _alias

    Alias of the schedule override

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

    the optional parameters

Options Hash (opts):

  • :schedule_identifier_type (String)

    Type of the identifier that is provided as an in-line parameter. Possible values are &#39;id&#39; or &#39;name&#39; (default to id)

Returns:



157
158
159
160
# File 'lib/opsgenie_sdk/api/schedule_override_api.rb', line 157

def get_schedule_override(identifier, _alias, opts = {})
  data, _status_code, _headers = get_schedule_override_with_http_info(identifier, _alias, opts)
  data
end

#get_schedule_override_with_http_info(identifier, _alias, opts = {}) ⇒ Array<(GetScheduleOverrideResponse, Fixnum, Hash)>

Get Schedule Override Gets schedule override details with given alias

Parameters:

  • identifier

    Identifier of schedule which could be id or name

  • _alias

    Alias of the schedule override

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

    the optional parameters

Options Hash (opts):

  • :schedule_identifier_type (String)

    Type of the identifier that is provided as an in-line parameter. Possible values are &#39;id&#39; or &#39;name&#39;

Returns:



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
205
206
207
208
209
210
211
212
213
# File 'lib/opsgenie_sdk/api/schedule_override_api.rb', line 169

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

  # query parameters
  query_params = {}
  query_params[:'scheduleIdentifierType'] = opts[:'schedule_identifier_type'] if !opts[:'schedule_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 => 'GetScheduleOverrideResponse')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: ScheduleOverrideApi#get_schedule_override\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#list_schedule_override(identifier, opts = {}) ⇒ ListScheduleOverrideResponse

List Schedule Overrides Returns list of schedule overrides

Parameters:

  • identifier

    Identifier of schedule which could be id or name

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

    the optional parameters

Options Hash (opts):

  • :schedule_identifier_type (String)

    Type of the identifier that is provided as an in-line parameter. Possible values are &#39;id&#39; or &#39;name&#39; (default to id)

Returns:



220
221
222
223
# File 'lib/opsgenie_sdk/api/schedule_override_api.rb', line 220

def list_schedule_override(identifier, opts = {})
  data, _status_code, _headers = list_schedule_override_with_http_info(identifier, opts)
  data
end

#list_schedule_override_with_http_info(identifier, opts = {}) ⇒ Array<(ListScheduleOverrideResponse, Fixnum, Hash)>

List Schedule Overrides Returns list of schedule overrides

Parameters:

  • identifier

    Identifier of schedule which could be id or name

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

    the optional parameters

Options Hash (opts):

  • :schedule_identifier_type (String)

    Type of the identifier that is provided as an in-line parameter. Possible values are &#39;id&#39; or &#39;name&#39;

Returns:



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
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
# File 'lib/opsgenie_sdk/api/schedule_override_api.rb', line 231

def list_schedule_override_with_http_info(identifier, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: ScheduleOverrideApi.list_schedule_override ...'
  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 ScheduleOverrideApi.list_schedule_override"
  end
  if @api_client.config.client_side_validation && opts[:'schedule_identifier_type'] && !['id', 'name'].include?(opts[:'schedule_identifier_type'])
    fail ArgumentError, 'invalid value for "schedule_identifier_type", must be one of id, name'
  end
  # resource path
  local_var_path = '/v2/schedules/{identifier}/overrides'.sub('{' + 'identifier' + '}', identifier.to_s)

  # query parameters
  query_params = {}
  query_params[:'scheduleIdentifierType'] = opts[:'schedule_identifier_type'] if !opts[:'schedule_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 => 'ListScheduleOverrideResponse')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: ScheduleOverrideApi#list_schedule_override\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#update_schedule_override(identifier, _alias, body, opts = {}) ⇒ UpdateScheduleOverrideResponse

Update Schedule Override Update schedule override with given alias

Parameters:

  • identifier

    Identifier of schedule which could be id or name

  • _alias

    Alias of the schedule override

  • body

    Request payload of update schedule override

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

    the optional parameters

Options Hash (opts):

  • :schedule_identifier_type (String)

    Type of the identifier that is provided as an in-line parameter. Possible values are &#39;id&#39; or &#39;name&#39; (default to id)

Returns:



280
281
282
283
# File 'lib/opsgenie_sdk/api/schedule_override_api.rb', line 280

def update_schedule_override(identifier, _alias, body, opts = {})
  data, _status_code, _headers = update_schedule_override_with_http_info(identifier, _alias, body, opts)
  data
end

#update_schedule_override_with_http_info(identifier, _alias, body, opts = {}) ⇒ Array<(UpdateScheduleOverrideResponse, Fixnum, Hash)>

Update Schedule Override Update schedule override with given alias

Parameters:

  • identifier

    Identifier of schedule which could be id or name

  • _alias

    Alias of the schedule override

  • body

    Request payload of update schedule override

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

    the optional parameters

Options Hash (opts):

  • :schedule_identifier_type (String)

    Type of the identifier that is provided as an in-line parameter. Possible values are &#39;id&#39; or &#39;name&#39;

Returns:



293
294
295
296
297
298
299
300
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/schedule_override_api.rb', line 293

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

  # query parameters
  query_params = {}
  query_params[:'scheduleIdentifierType'] = opts[:'schedule_identifier_type'] if !opts[:'schedule_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(:PUT, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'UpdateScheduleOverrideResponse')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: ScheduleOverrideApi#update_schedule_override\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end