=begin
#CRM Calling Extensions

#No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)

The version of the OpenAPI document: v3

Generated by: https://openapi-generator.tech
OpenAPI Generator version: 6.2.1

=end

require 'cgi'

module Hubspot
  module Crm
    module Extensions
      module Calling
        class RecordingSettingsApi
          attr_accessor :api_client

          def initialize(api_client = ApiClient.default)
            @api_client = api_client
          end
          # Retrieve recording settings
          # Retrieve the URL that is registered for [call recording](https://developers.hubspot.com/docs/guides/apps/extensions/calling-extensions/recordings-and-transcriptions#register-your-app-s-endpoint-with-hubspot-using-the-calling-settings-api).
          # @param app_id [Integer] The ID of the app.
          # @param [Hash] opts the optional parameters
          # @return [RecordingSettingsResponse]
          def get_url_format(app_id, opts = {})
            data, _status_code, _headers = get_url_format_with_http_info(app_id, opts)
            data
          end

          # Retrieve recording settings
          # Retrieve the URL that is registered for [call recording](https://developers.hubspot.com/docs/guides/apps/extensions/calling-extensions/recordings-and-transcriptions#register-your-app-s-endpoint-with-hubspot-using-the-calling-settings-api).
          # @param app_id [Integer] The ID of the app.
          # @param [Hash] opts the optional parameters
          # @return [Array<(RecordingSettingsResponse, Integer, Hash)>] RecordingSettingsResponse data, response status code and response headers
          def get_url_format_with_http_info(app_id, opts = {})
            if @api_client.config.debugging
              @api_client.config.logger.debug 'Calling API: RecordingSettingsApi.get_url_format ...'
            end
            # verify the required parameter 'app_id' is set
            if @api_client.config.client_side_validation && app_id.nil?
              fail ArgumentError, "Missing the required parameter 'app_id' when calling RecordingSettingsApi.get_url_format"
            end
            # resource path
            local_var_path = '/crm/v3/extensions/calling/{appId}/settings/recording'.sub('{' + 'appId' + '}', CGI.escape(app_id.to_s))

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

            # auth_names
            auth_names = opts[:debug_auth_names] || ['developer_hapikey']

            new_options = opts.merge(
              :operation => :"RecordingSettingsApi.get_url_format",
              :header_params => header_params,
              :query_params => query_params,
              :form_params => form_params,
              :body => post_body,
              :auth_names => auth_names,
              :return_type => return_type
            )

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

          # Mark recording as ready for transcription
          # Mark a call recording as ready for transcription, specifying the call by its ID (`engagementid`).
          # @param mark_recording_as_ready_request [MarkRecordingAsReadyRequest] 
          # @param [Hash] opts the optional parameters
          # @return [nil]
          def mark_as_ready(mark_recording_as_ready_request, opts = {})
            mark_as_ready_with_http_info(mark_recording_as_ready_request, opts)
            nil
          end

          # Mark recording as ready for transcription
          # Mark a call recording as ready for transcription, specifying the call by its ID (&#x60;engagementid&#x60;).
          # @param mark_recording_as_ready_request [MarkRecordingAsReadyRequest] 
          # @param [Hash] opts the optional parameters
          # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers
          def mark_as_ready_with_http_info(mark_recording_as_ready_request, opts = {})
            if @api_client.config.debugging
              @api_client.config.logger.debug 'Calling API: RecordingSettingsApi.mark_as_ready ...'
            end
            # verify the required parameter 'mark_recording_as_ready_request' is set
            if @api_client.config.client_side_validation && mark_recording_as_ready_request.nil?
              fail ArgumentError, "Missing the required parameter 'mark_recording_as_ready_request' when calling RecordingSettingsApi.mark_as_ready"
            end
            # resource path
            local_var_path = '/crm/v3/extensions/calling/recordings/ready'

            # 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(['*/*'])
            # HTTP header 'Content-Type'
            content_type = @api_client.select_header_content_type(['application/json'])
            if !content_type.nil?
                header_params['Content-Type'] = content_type
            end

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

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

            # return_type
            return_type = opts[:debug_return_type]

            # auth_names
            auth_names = opts[:debug_auth_names] || ['oauth2']

            new_options = opts.merge(
              :operation => :"RecordingSettingsApi.mark_as_ready",
              :header_params => header_params,
              :query_params => query_params,
              :form_params => form_params,
              :body => post_body,
              :auth_names => auth_names,
              :return_type => return_type
            )

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

          # Enable the app for call recording
          # Register an external URL that HubSpot will use to retrieve [call recordings](https://developers.hubspot.com/docs/guides/apps/extensions/calling-extensions/recordings-and-transcriptions#register-your-app-s-endpoint-with-hubspot-using-the-calling-settings-api).
          # @param app_id [Integer] The ID of the app.
          # @param recording_settings_request [RecordingSettingsRequest] 
          # @param [Hash] opts the optional parameters
          # @return [RecordingSettingsResponse]
          def register_url_format(app_id, recording_settings_request, opts = {})
            data, _status_code, _headers = register_url_format_with_http_info(app_id, recording_settings_request, opts)
            data
          end

          # Enable the app for call recording
          # Register an external URL that HubSpot will use to retrieve [call recordings](https://developers.hubspot.com/docs/guides/apps/extensions/calling-extensions/recordings-and-transcriptions#register-your-app-s-endpoint-with-hubspot-using-the-calling-settings-api).
          # @param app_id [Integer] The ID of the app.
          # @param recording_settings_request [RecordingSettingsRequest] 
          # @param [Hash] opts the optional parameters
          # @return [Array<(RecordingSettingsResponse, Integer, Hash)>] RecordingSettingsResponse data, response status code and response headers
          def register_url_format_with_http_info(app_id, recording_settings_request, opts = {})
            if @api_client.config.debugging
              @api_client.config.logger.debug 'Calling API: RecordingSettingsApi.register_url_format ...'
            end
            # verify the required parameter 'app_id' is set
            if @api_client.config.client_side_validation && app_id.nil?
              fail ArgumentError, "Missing the required parameter 'app_id' when calling RecordingSettingsApi.register_url_format"
            end
            # verify the required parameter 'recording_settings_request' is set
            if @api_client.config.client_side_validation && recording_settings_request.nil?
              fail ArgumentError, "Missing the required parameter 'recording_settings_request' when calling RecordingSettingsApi.register_url_format"
            end
            # resource path
            local_var_path = '/crm/v3/extensions/calling/{appId}/settings/recording'.sub('{' + 'appId' + '}', CGI.escape(app_id.to_s))

            # 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'
            content_type = @api_client.select_header_content_type(['application/json'])
            if !content_type.nil?
                header_params['Content-Type'] = content_type
            end

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

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

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

            # auth_names
            auth_names = opts[:debug_auth_names] || ['developer_hapikey']

            new_options = opts.merge(
              :operation => :"RecordingSettingsApi.register_url_format",
              :header_params => header_params,
              :query_params => query_params,
              :form_params => form_params,
              :body => post_body,
              :auth_names => auth_names,
              :return_type => return_type
            )

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

          # Update recording settings
          # Update the URL that HubSpot will use to retrieve [call recordings](https://developers.hubspot.com/docs/guides/apps/extensions/calling-extensions/recordings-and-transcriptions#register-your-app-s-endpoint-with-hubspot-using-the-calling-settings-api).
          # @param app_id [Integer] The ID of the app.
          # @param recording_settings_patch_request [RecordingSettingsPatchRequest] 
          # @param [Hash] opts the optional parameters
          # @return [RecordingSettingsResponse]
          def update_url_format(app_id, recording_settings_patch_request, opts = {})
            data, _status_code, _headers = update_url_format_with_http_info(app_id, recording_settings_patch_request, opts)
            data
          end

          # Update recording settings
          # Update the URL that HubSpot will use to retrieve [call recordings](https://developers.hubspot.com/docs/guides/apps/extensions/calling-extensions/recordings-and-transcriptions#register-your-app-s-endpoint-with-hubspot-using-the-calling-settings-api).
          # @param app_id [Integer] The ID of the app.
          # @param recording_settings_patch_request [RecordingSettingsPatchRequest] 
          # @param [Hash] opts the optional parameters
          # @return [Array<(RecordingSettingsResponse, Integer, Hash)>] RecordingSettingsResponse data, response status code and response headers
          def update_url_format_with_http_info(app_id, recording_settings_patch_request, opts = {})
            if @api_client.config.debugging
              @api_client.config.logger.debug 'Calling API: RecordingSettingsApi.update_url_format ...'
            end
            # verify the required parameter 'app_id' is set
            if @api_client.config.client_side_validation && app_id.nil?
              fail ArgumentError, "Missing the required parameter 'app_id' when calling RecordingSettingsApi.update_url_format"
            end
            # verify the required parameter 'recording_settings_patch_request' is set
            if @api_client.config.client_side_validation && recording_settings_patch_request.nil?
              fail ArgumentError, "Missing the required parameter 'recording_settings_patch_request' when calling RecordingSettingsApi.update_url_format"
            end
            # resource path
            local_var_path = '/crm/v3/extensions/calling/{appId}/settings/recording'.sub('{' + 'appId' + '}', CGI.escape(app_id.to_s))

            # 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'
            content_type = @api_client.select_header_content_type(['application/json'])
            if !content_type.nil?
                header_params['Content-Type'] = content_type
            end

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

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

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

            # auth_names
            auth_names = opts[:debug_auth_names] || ['developer_hapikey']

            new_options = opts.merge(
              :operation => :"RecordingSettingsApi.update_url_format",
              :header_params => header_params,
              :query_params => query_params,
              :form_params => form_params,
              :body => post_body,
              :auth_names => auth_names,
              :return_type => return_type
            )

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