@@ -161,6 +161,78 @@ def create_on_call_schedule_with_http_info(body, opts = {})
161161 return data , status_code , headers
162162 end
163163
164+ # Create email notification channel for user.
165+ #
166+ # @see #create_user_email_notification_channel_with_http_info
167+ def create_user_email_notification_channel ( user_id , body , opts = { } )
168+ create_user_email_notification_channel_with_http_info ( user_id , body , opts )
169+ nil
170+ end
171+
172+ # Create email notification channel for user.
173+ #
174+ # Create a new email notification channel for an on-call user
175+ #
176+ # @param user_id [String] The user ID
177+ # @param body [Email]
178+ # @param opts [Hash] the optional parameters
179+ # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers
180+ def create_user_email_notification_channel_with_http_info ( user_id , body , opts = { } )
181+
182+ if @api_client . config . debugging
183+ @api_client . config . logger . debug 'Calling API: OnCallAPI.create_user_email_notification_channel ...'
184+ end
185+ # verify the required parameter 'user_id' is set
186+ if @api_client . config . client_side_validation && user_id . nil?
187+ fail ArgumentError , "Missing the required parameter 'user_id' when calling OnCallAPI.create_user_email_notification_channel"
188+ end
189+ # verify the required parameter 'body' is set
190+ if @api_client . config . client_side_validation && body . nil?
191+ fail ArgumentError , "Missing the required parameter 'body' when calling OnCallAPI.create_user_email_notification_channel"
192+ end
193+ # resource path
194+ local_var_path = '/api/v2/on-call/users/{user_id}/notification-channels/emails' . sub ( '{user_id}' , CGI . escape ( user_id . to_s ) . gsub ( '%2F' , '/' ) )
195+
196+ # query parameters
197+ query_params = opts [ :query_params ] || { }
198+
199+ # header parameters
200+ header_params = opts [ :header_params ] || { }
201+ # HTTP header 'Accept' (if needed)
202+ header_params [ 'Accept' ] = @api_client . select_header_accept ( [ '*/*' ] )
203+ # HTTP header 'Content-Type'
204+ header_params [ 'Content-Type' ] = @api_client . select_header_content_type ( [ 'application/json' ] )
205+
206+ # form parameters
207+ form_params = opts [ :form_params ] || { }
208+
209+ # http body (model)
210+ post_body = opts [ :debug_body ] || @api_client . object_to_http_body ( body )
211+
212+ # return_type
213+ return_type = opts [ :debug_return_type ]
214+
215+ # auth_names
216+ auth_names = opts [ :debug_auth_names ] || [ :apiKeyAuth , :appKeyAuth , :AuthZ ]
217+
218+ new_options = opts . merge (
219+ :operation => :create_user_email_notification_channel ,
220+ :header_params => header_params ,
221+ :query_params => query_params ,
222+ :form_params => form_params ,
223+ :body => post_body ,
224+ :auth_names => auth_names ,
225+ :return_type => return_type ,
226+ :api_version => "V2"
227+ )
228+
229+ data , status_code , headers = @api_client . call_api ( Net ::HTTP ::Post , local_var_path , new_options )
230+ if @api_client . config . debugging
231+ @api_client . config . logger . debug "API called: OnCallAPI#create_user_email_notification_channel\n Data: #{ data . inspect } \n Status code: #{ status_code } \n Headers: #{ headers } "
232+ end
233+ return data , status_code , headers
234+ end
235+
164236 # Delete On-Call escalation policy.
165237 #
166238 # @see #delete_on_call_escalation_policy_with_http_info
0 commit comments