@@ -474,6 +474,84 @@ def create_incident_notification_template_with_http_info(body, opts = {})
474474 return data , status_code , headers
475475 end
476476
477+ # Create postmortem attachment.
478+ #
479+ # @see #create_incident_postmortem_attachment_with_http_info
480+ def create_incident_postmortem_attachment ( incident_id , body , opts = { } )
481+ data , _status_code , _headers = create_incident_postmortem_attachment_with_http_info ( incident_id , body , opts )
482+ data
483+ end
484+
485+ # Create postmortem attachment.
486+ #
487+ # Create a postmortem attachment for an incident.
488+ #
489+ # @param incident_id [String] The ID of the incident
490+ # @param body [PostmortemAttachmentRequest]
491+ # @param opts [Hash] the optional parameters
492+ # @return [Array<(Attachment, Integer, Hash)>] Attachment data, response status code and response headers
493+ def create_incident_postmortem_attachment_with_http_info ( incident_id , body , opts = { } )
494+ unstable_enabled = @api_client . config . unstable_operations [ "v2.create_incident_postmortem_attachment" . to_sym ]
495+ if unstable_enabled
496+ @api_client . config . logger . warn format ( "Using unstable operation '%s'" , "v2.create_incident_postmortem_attachment" )
497+ else
498+ raise DatadogAPIClient ::APIError . new ( message : format ( "Unstable operation '%s' is disabled" , "v2.create_incident_postmortem_attachment" ) )
499+ end
500+
501+ if @api_client . config . debugging
502+ @api_client . config . logger . debug 'Calling API: IncidentsAPI.create_incident_postmortem_attachment ...'
503+ end
504+ # verify the required parameter 'incident_id' is set
505+ if @api_client . config . client_side_validation && incident_id . nil?
506+ fail ArgumentError , "Missing the required parameter 'incident_id' when calling IncidentsAPI.create_incident_postmortem_attachment"
507+ end
508+ # verify the required parameter 'body' is set
509+ if @api_client . config . client_side_validation && body . nil?
510+ fail ArgumentError , "Missing the required parameter 'body' when calling IncidentsAPI.create_incident_postmortem_attachment"
511+ end
512+ # resource path
513+ local_var_path = '/api/v2/incidents/{incident_id}/attachments/postmortems' . sub ( '{incident_id}' , CGI . escape ( incident_id . to_s ) . gsub ( '%2F' , '/' ) )
514+
515+ # query parameters
516+ query_params = opts [ :query_params ] || { }
517+
518+ # header parameters
519+ header_params = opts [ :header_params ] || { }
520+ # HTTP header 'Accept' (if needed)
521+ header_params [ 'Accept' ] = @api_client . select_header_accept ( [ 'application/json' ] )
522+ # HTTP header 'Content-Type'
523+ header_params [ 'Content-Type' ] = @api_client . select_header_content_type ( [ 'application/json' ] )
524+
525+ # form parameters
526+ form_params = opts [ :form_params ] || { }
527+
528+ # http body (model)
529+ post_body = opts [ :debug_body ] || @api_client . object_to_http_body ( body )
530+
531+ # return_type
532+ return_type = opts [ :debug_return_type ] || 'Attachment'
533+
534+ # auth_names
535+ auth_names = opts [ :debug_auth_names ] || [ :apiKeyAuth , :appKeyAuth ]
536+
537+ new_options = opts . merge (
538+ :operation => :create_incident_postmortem_attachment ,
539+ :header_params => header_params ,
540+ :query_params => query_params ,
541+ :form_params => form_params ,
542+ :body => post_body ,
543+ :auth_names => auth_names ,
544+ :return_type => return_type ,
545+ :api_version => "V2"
546+ )
547+
548+ data , status_code , headers = @api_client . call_api ( Net ::HTTP ::Post , local_var_path , new_options )
549+ if @api_client . config . debugging
550+ @api_client . config . logger . debug "API called: IncidentsAPI#create_incident_postmortem_attachment\n Data: #{ data . inspect } \n Status code: #{ status_code } \n Headers: #{ headers } "
551+ end
552+ return data , status_code , headers
553+ end
554+
477555 # Create an incident todo.
478556 #
479557 # @see #create_incident_todo_with_http_info
0 commit comments