=begin
#Hatchet API

#The Hatchet API

The version of the OpenAPI document: 1.0.0

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

=end

require 'cgi'

module HatchetSdkRest
  class TenantApi
    attr_accessor :api_client

    def initialize(api_client = ApiClient.default)
      @api_client = api_client
    end
    # Create tenant alert email group
    # Creates a new tenant alert email group
    # @param tenant [String] The tenant id
    # @param create_tenant_alert_email_group_request [CreateTenantAlertEmailGroupRequest] The tenant alert email group to create
    # @param [Hash] opts the optional parameters
    # @return [TenantAlertEmailGroup]
    def alert_email_group_create(tenant, create_tenant_alert_email_group_request, opts = {})
      data, _status_code, _headers = alert_email_group_create_with_http_info(tenant, create_tenant_alert_email_group_request, opts)
      data
    end

    # Create tenant alert email group
    # Creates a new tenant alert email group
    # @param tenant [String] The tenant id
    # @param create_tenant_alert_email_group_request [CreateTenantAlertEmailGroupRequest] The tenant alert email group to create
    # @param [Hash] opts the optional parameters
    # @return [Array<(TenantAlertEmailGroup, Integer, Hash)>] TenantAlertEmailGroup data, response status code and response headers
    def alert_email_group_create_with_http_info(tenant, create_tenant_alert_email_group_request, opts = {})
      if @api_client.config.debugging
        @api_client.config.logger.debug 'Calling API: TenantApi.alert_email_group_create ...'
      end
      # verify the required parameter 'tenant' is set
      if @api_client.config.client_side_validation && tenant.nil?
        fail ArgumentError, "Missing the required parameter 'tenant' when calling TenantApi.alert_email_group_create"
      end
      if @api_client.config.client_side_validation && tenant.to_s.length > 36
        fail ArgumentError, 'invalid value for "tenant" when calling TenantApi.alert_email_group_create, the character length must be smaller than or equal to 36.'
      end

      if @api_client.config.client_side_validation && tenant.to_s.length < 36
        fail ArgumentError, 'invalid value for "tenant" when calling TenantApi.alert_email_group_create, the character length must be greater than or equal to 36.'
      end

      # verify the required parameter 'create_tenant_alert_email_group_request' is set
      if @api_client.config.client_side_validation && create_tenant_alert_email_group_request.nil?
        fail ArgumentError, "Missing the required parameter 'create_tenant_alert_email_group_request' when calling TenantApi.alert_email_group_create"
      end
      # resource path
      local_var_path = '/api/v1/tenants/{tenant}/alerting-email-groups'.sub('{' + 'tenant' + '}', CGI.escape(tenant.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']) unless header_params['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(create_tenant_alert_email_group_request)

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

      # auth_names
      auth_names = opts[:debug_auth_names] || ['cookieAuth', 'bearerAuth']

      new_options = opts.merge(
        :operation => :"TenantApi.alert_email_group_create",
        :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: TenantApi#alert_email_group_create\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
      end
      return data, status_code, headers
    end

    # Delete tenant alert email group
    # Deletes a tenant alert email group
    # @param alert_email_group [String] The tenant alert email group id
    # @param [Hash] opts the optional parameters
    # @return [nil]
    def alert_email_group_delete(alert_email_group, opts = {})
      alert_email_group_delete_with_http_info(alert_email_group, opts)
      nil
    end

    # Delete tenant alert email group
    # Deletes a tenant alert email group
    # @param alert_email_group [String] The tenant alert email group id
    # @param [Hash] opts the optional parameters
    # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers
    def alert_email_group_delete_with_http_info(alert_email_group, opts = {})
      if @api_client.config.debugging
        @api_client.config.logger.debug 'Calling API: TenantApi.alert_email_group_delete ...'
      end
      # verify the required parameter 'alert_email_group' is set
      if @api_client.config.client_side_validation && alert_email_group.nil?
        fail ArgumentError, "Missing the required parameter 'alert_email_group' when calling TenantApi.alert_email_group_delete"
      end
      if @api_client.config.client_side_validation && alert_email_group.to_s.length > 36
        fail ArgumentError, 'invalid value for "alert_email_group" when calling TenantApi.alert_email_group_delete, the character length must be smaller than or equal to 36.'
      end

      if @api_client.config.client_side_validation && alert_email_group.to_s.length < 36
        fail ArgumentError, 'invalid value for "alert_email_group" when calling TenantApi.alert_email_group_delete, the character length must be greater than or equal to 36.'
      end

      # resource path
      local_var_path = '/api/v1/alerting-email-groups/{alert-email-group}'.sub('{' + 'alert-email-group' + '}', CGI.escape(alert_email_group.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']) unless header_params['Accept']

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

      # http body (model)
      post_body = opts[:debug_body]

      # return_type
      return_type = opts[:debug_return_type]

      # auth_names
      auth_names = opts[:debug_auth_names] || ['cookieAuth', 'bearerAuth']

      new_options = opts.merge(
        :operation => :"TenantApi.alert_email_group_delete",
        :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(:DELETE, local_var_path, new_options)
      if @api_client.config.debugging
        @api_client.config.logger.debug "API called: TenantApi#alert_email_group_delete\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
      end
      return data, status_code, headers
    end

    # List tenant alert email groups
    # Gets a list of tenant alert email groups
    # @param tenant [String] The tenant id
    # @param [Hash] opts the optional parameters
    # @return [TenantAlertEmailGroupList]
    def alert_email_group_list(tenant, opts = {})
      data, _status_code, _headers = alert_email_group_list_with_http_info(tenant, opts)
      data
    end

    # List tenant alert email groups
    # Gets a list of tenant alert email groups
    # @param tenant [String] The tenant id
    # @param [Hash] opts the optional parameters
    # @return [Array<(TenantAlertEmailGroupList, Integer, Hash)>] TenantAlertEmailGroupList data, response status code and response headers
    def alert_email_group_list_with_http_info(tenant, opts = {})
      if @api_client.config.debugging
        @api_client.config.logger.debug 'Calling API: TenantApi.alert_email_group_list ...'
      end
      # verify the required parameter 'tenant' is set
      if @api_client.config.client_side_validation && tenant.nil?
        fail ArgumentError, "Missing the required parameter 'tenant' when calling TenantApi.alert_email_group_list"
      end
      if @api_client.config.client_side_validation && tenant.to_s.length > 36
        fail ArgumentError, 'invalid value for "tenant" when calling TenantApi.alert_email_group_list, the character length must be smaller than or equal to 36.'
      end

      if @api_client.config.client_side_validation && tenant.to_s.length < 36
        fail ArgumentError, 'invalid value for "tenant" when calling TenantApi.alert_email_group_list, the character length must be greater than or equal to 36.'
      end

      # resource path
      local_var_path = '/api/v1/tenants/{tenant}/alerting-email-groups'.sub('{' + 'tenant' + '}', CGI.escape(tenant.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']) unless header_params['Accept']

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

      # http body (model)
      post_body = opts[:debug_body]

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

      # auth_names
      auth_names = opts[:debug_auth_names] || ['cookieAuth', 'bearerAuth']

      new_options = opts.merge(
        :operation => :"TenantApi.alert_email_group_list",
        :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: TenantApi#alert_email_group_list\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
      end
      return data, status_code, headers
    end

    # Update tenant alert email group
    # Updates a tenant alert email group
    # @param alert_email_group [String] The tenant alert email group id
    # @param update_tenant_alert_email_group_request [UpdateTenantAlertEmailGroupRequest] The tenant alert email group to update
    # @param [Hash] opts the optional parameters
    # @return [TenantAlertEmailGroup]
    def alert_email_group_update(alert_email_group, update_tenant_alert_email_group_request, opts = {})
      data, _status_code, _headers = alert_email_group_update_with_http_info(alert_email_group, update_tenant_alert_email_group_request, opts)
      data
    end

    # Update tenant alert email group
    # Updates a tenant alert email group
    # @param alert_email_group [String] The tenant alert email group id
    # @param update_tenant_alert_email_group_request [UpdateTenantAlertEmailGroupRequest] The tenant alert email group to update
    # @param [Hash] opts the optional parameters
    # @return [Array<(TenantAlertEmailGroup, Integer, Hash)>] TenantAlertEmailGroup data, response status code and response headers
    def alert_email_group_update_with_http_info(alert_email_group, update_tenant_alert_email_group_request, opts = {})
      if @api_client.config.debugging
        @api_client.config.logger.debug 'Calling API: TenantApi.alert_email_group_update ...'
      end
      # verify the required parameter 'alert_email_group' is set
      if @api_client.config.client_side_validation && alert_email_group.nil?
        fail ArgumentError, "Missing the required parameter 'alert_email_group' when calling TenantApi.alert_email_group_update"
      end
      if @api_client.config.client_side_validation && alert_email_group.to_s.length > 36
        fail ArgumentError, 'invalid value for "alert_email_group" when calling TenantApi.alert_email_group_update, the character length must be smaller than or equal to 36.'
      end

      if @api_client.config.client_side_validation && alert_email_group.to_s.length < 36
        fail ArgumentError, 'invalid value for "alert_email_group" when calling TenantApi.alert_email_group_update, the character length must be greater than or equal to 36.'
      end

      # verify the required parameter 'update_tenant_alert_email_group_request' is set
      if @api_client.config.client_side_validation && update_tenant_alert_email_group_request.nil?
        fail ArgumentError, "Missing the required parameter 'update_tenant_alert_email_group_request' when calling TenantApi.alert_email_group_update"
      end
      # resource path
      local_var_path = '/api/v1/alerting-email-groups/{alert-email-group}'.sub('{' + 'alert-email-group' + '}', CGI.escape(alert_email_group.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']) unless header_params['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(update_tenant_alert_email_group_request)

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

      # auth_names
      auth_names = opts[:debug_auth_names] || ['cookieAuth', 'bearerAuth']

      new_options = opts.merge(
        :operation => :"TenantApi.alert_email_group_update",
        :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: TenantApi#alert_email_group_update\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
      end
      return data, status_code, headers
    end

    # Get tenant alerting settings
    # Gets the alerting settings for a tenant
    # @param tenant [String] The tenant id
    # @param [Hash] opts the optional parameters
    # @return [TenantAlertingSettings]
    def tenant_alerting_settings_get(tenant, opts = {})
      data, _status_code, _headers = tenant_alerting_settings_get_with_http_info(tenant, opts)
      data
    end

    # Get tenant alerting settings
    # Gets the alerting settings for a tenant
    # @param tenant [String] The tenant id
    # @param [Hash] opts the optional parameters
    # @return [Array<(TenantAlertingSettings, Integer, Hash)>] TenantAlertingSettings data, response status code and response headers
    def tenant_alerting_settings_get_with_http_info(tenant, opts = {})
      if @api_client.config.debugging
        @api_client.config.logger.debug 'Calling API: TenantApi.tenant_alerting_settings_get ...'
      end
      # verify the required parameter 'tenant' is set
      if @api_client.config.client_side_validation && tenant.nil?
        fail ArgumentError, "Missing the required parameter 'tenant' when calling TenantApi.tenant_alerting_settings_get"
      end
      if @api_client.config.client_side_validation && tenant.to_s.length > 36
        fail ArgumentError, 'invalid value for "tenant" when calling TenantApi.tenant_alerting_settings_get, the character length must be smaller than or equal to 36.'
      end

      if @api_client.config.client_side_validation && tenant.to_s.length < 36
        fail ArgumentError, 'invalid value for "tenant" when calling TenantApi.tenant_alerting_settings_get, the character length must be greater than or equal to 36.'
      end

      # resource path
      local_var_path = '/api/v1/tenants/{tenant}/alerting/settings'.sub('{' + 'tenant' + '}', CGI.escape(tenant.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']) unless header_params['Accept']

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

      # http body (model)
      post_body = opts[:debug_body]

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

      # auth_names
      auth_names = opts[:debug_auth_names] || ['cookieAuth', 'bearerAuth']

      new_options = opts.merge(
        :operation => :"TenantApi.tenant_alerting_settings_get",
        :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: TenantApi#tenant_alerting_settings_get\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
      end
      return data, status_code, headers
    end

    # Create tenant
    # Creates a new tenant
    # @param create_tenant_request [CreateTenantRequest] The tenant to create
    # @param [Hash] opts the optional parameters
    # @return [Tenant]
    def tenant_create(create_tenant_request, opts = {})
      data, _status_code, _headers = tenant_create_with_http_info(create_tenant_request, opts)
      data
    end

    # Create tenant
    # Creates a new tenant
    # @param create_tenant_request [CreateTenantRequest] The tenant to create
    # @param [Hash] opts the optional parameters
    # @return [Array<(Tenant, Integer, Hash)>] Tenant data, response status code and response headers
    def tenant_create_with_http_info(create_tenant_request, opts = {})
      if @api_client.config.debugging
        @api_client.config.logger.debug 'Calling API: TenantApi.tenant_create ...'
      end
      # verify the required parameter 'create_tenant_request' is set
      if @api_client.config.client_side_validation && create_tenant_request.nil?
        fail ArgumentError, "Missing the required parameter 'create_tenant_request' when calling TenantApi.tenant_create"
      end
      # resource path
      local_var_path = '/api/v1/tenants'

      # 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']) unless header_params['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(create_tenant_request)

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

      # auth_names
      auth_names = opts[:debug_auth_names] || ['cookieAuth', 'bearerAuth']

      new_options = opts.merge(
        :operation => :"TenantApi.tenant_create",
        :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: TenantApi#tenant_create\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
      end
      return data, status_code, headers
    end

    # Get tenant
    # Get the details of a tenant
    # @param tenant [String] The tenant id to get details for
    # @param [Hash] opts the optional parameters
    # @return [Tenant]
    def tenant_get(tenant, opts = {})
      data, _status_code, _headers = tenant_get_with_http_info(tenant, opts)
      data
    end

    # Get tenant
    # Get the details of a tenant
    # @param tenant [String] The tenant id to get details for
    # @param [Hash] opts the optional parameters
    # @return [Array<(Tenant, Integer, Hash)>] Tenant data, response status code and response headers
    def tenant_get_with_http_info(tenant, opts = {})
      if @api_client.config.debugging
        @api_client.config.logger.debug 'Calling API: TenantApi.tenant_get ...'
      end
      # verify the required parameter 'tenant' is set
      if @api_client.config.client_side_validation && tenant.nil?
        fail ArgumentError, "Missing the required parameter 'tenant' when calling TenantApi.tenant_get"
      end
      if @api_client.config.client_side_validation && tenant.to_s.length > 36
        fail ArgumentError, 'invalid value for "tenant" when calling TenantApi.tenant_get, the character length must be smaller than or equal to 36.'
      end

      if @api_client.config.client_side_validation && tenant.to_s.length < 36
        fail ArgumentError, 'invalid value for "tenant" when calling TenantApi.tenant_get, the character length must be greater than or equal to 36.'
      end

      # resource path
      local_var_path = '/api/v1/tenants/{tenant}'.sub('{' + 'tenant' + '}', CGI.escape(tenant.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']) unless header_params['Accept']

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

      # http body (model)
      post_body = opts[:debug_body]

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

      # auth_names
      auth_names = opts[:debug_auth_names] || ['cookieAuth', 'bearerAuth']

      new_options = opts.merge(
        :operation => :"TenantApi.tenant_get",
        :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: TenantApi#tenant_get\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
      end
      return data, status_code, headers
    end

    # Get prometheus metrics
    # Get the prometheus metrics for the tenant
    # @param tenant [String] The tenant id
    # @param [Hash] opts the optional parameters
    # @return [String]
    def tenant_get_prometheus_metrics(tenant, opts = {})
      data, _status_code, _headers = tenant_get_prometheus_metrics_with_http_info(tenant, opts)
      data
    end

    # Get prometheus metrics
    # Get the prometheus metrics for the tenant
    # @param tenant [String] The tenant id
    # @param [Hash] opts the optional parameters
    # @return [Array<(String, Integer, Hash)>] String data, response status code and response headers
    def tenant_get_prometheus_metrics_with_http_info(tenant, opts = {})
      if @api_client.config.debugging
        @api_client.config.logger.debug 'Calling API: TenantApi.tenant_get_prometheus_metrics ...'
      end
      # verify the required parameter 'tenant' is set
      if @api_client.config.client_side_validation && tenant.nil?
        fail ArgumentError, "Missing the required parameter 'tenant' when calling TenantApi.tenant_get_prometheus_metrics"
      end
      if @api_client.config.client_side_validation && tenant.to_s.length > 36
        fail ArgumentError, 'invalid value for "tenant" when calling TenantApi.tenant_get_prometheus_metrics, the character length must be smaller than or equal to 36.'
      end

      if @api_client.config.client_side_validation && tenant.to_s.length < 36
        fail ArgumentError, 'invalid value for "tenant" when calling TenantApi.tenant_get_prometheus_metrics, the character length must be greater than or equal to 36.'
      end

      # resource path
      local_var_path = '/api/v1/tenants/{tenant}/prometheus-metrics'.sub('{' + 'tenant' + '}', CGI.escape(tenant.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(['text/plain', 'application/json']) unless header_params['Accept']

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

      # http body (model)
      post_body = opts[:debug_body]

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

      # auth_names
      auth_names = opts[:debug_auth_names] || ['cookieAuth', 'bearerAuth']

      new_options = opts.merge(
        :operation => :"TenantApi.tenant_get_prometheus_metrics",
        :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: TenantApi#tenant_get_prometheus_metrics\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
      end
      return data, status_code, headers
    end

    # Get step run metrics
    # Get the queue metrics for the tenant
    # @param tenant [String] The tenant id
    # @param [Hash] opts the optional parameters
    # @return [TenantStepRunQueueMetrics]
    def tenant_get_step_run_queue_metrics(tenant, opts = {})
      data, _status_code, _headers = tenant_get_step_run_queue_metrics_with_http_info(tenant, opts)
      data
    end

    # Get step run metrics
    # Get the queue metrics for the tenant
    # @param tenant [String] The tenant id
    # @param [Hash] opts the optional parameters
    # @return [Array<(TenantStepRunQueueMetrics, Integer, Hash)>] TenantStepRunQueueMetrics data, response status code and response headers
    def tenant_get_step_run_queue_metrics_with_http_info(tenant, opts = {})
      if @api_client.config.debugging
        @api_client.config.logger.debug 'Calling API: TenantApi.tenant_get_step_run_queue_metrics ...'
      end
      # verify the required parameter 'tenant' is set
      if @api_client.config.client_side_validation && tenant.nil?
        fail ArgumentError, "Missing the required parameter 'tenant' when calling TenantApi.tenant_get_step_run_queue_metrics"
      end
      if @api_client.config.client_side_validation && tenant.to_s.length > 36
        fail ArgumentError, 'invalid value for "tenant" when calling TenantApi.tenant_get_step_run_queue_metrics, the character length must be smaller than or equal to 36.'
      end

      if @api_client.config.client_side_validation && tenant.to_s.length < 36
        fail ArgumentError, 'invalid value for "tenant" when calling TenantApi.tenant_get_step_run_queue_metrics, the character length must be greater than or equal to 36.'
      end

      # resource path
      local_var_path = '/api/v1/tenants/{tenant}/step-run-queue-metrics'.sub('{' + 'tenant' + '}', CGI.escape(tenant.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']) unless header_params['Accept']

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

      # http body (model)
      post_body = opts[:debug_body]

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

      # auth_names
      auth_names = opts[:debug_auth_names] || ['cookieAuth', 'bearerAuth']

      new_options = opts.merge(
        :operation => :"TenantApi.tenant_get_step_run_queue_metrics",
        :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: TenantApi#tenant_get_step_run_queue_metrics\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
      end
      return data, status_code, headers
    end

    # Get task stats for tenant
    # Get task stats for tenant
    # @param tenant [String] The tenant ID
    # @param [Hash] opts the optional parameters
    # @return [Hash<String, TaskStat>]
    def tenant_get_task_stats(tenant, opts = {})
      data, _status_code, _headers = tenant_get_task_stats_with_http_info(tenant, opts)
      data
    end

    # Get task stats for tenant
    # Get task stats for tenant
    # @param tenant [String] The tenant ID
    # @param [Hash] opts the optional parameters
    # @return [Array<(Hash<String, TaskStat>, Integer, Hash)>] Hash<String, TaskStat> data, response status code and response headers
    def tenant_get_task_stats_with_http_info(tenant, opts = {})
      if @api_client.config.debugging
        @api_client.config.logger.debug 'Calling API: TenantApi.tenant_get_task_stats ...'
      end
      # verify the required parameter 'tenant' is set
      if @api_client.config.client_side_validation && tenant.nil?
        fail ArgumentError, "Missing the required parameter 'tenant' when calling TenantApi.tenant_get_task_stats"
      end
      if @api_client.config.client_side_validation && tenant.to_s.length > 36
        fail ArgumentError, 'invalid value for "tenant" when calling TenantApi.tenant_get_task_stats, the character length must be smaller than or equal to 36.'
      end

      if @api_client.config.client_side_validation && tenant.to_s.length < 36
        fail ArgumentError, 'invalid value for "tenant" when calling TenantApi.tenant_get_task_stats, the character length must be greater than or equal to 36.'
      end

      # resource path
      local_var_path = '/api/v1/tenants/{tenant}/task-stats'.sub('{' + 'tenant' + '}', CGI.escape(tenant.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']) unless header_params['Accept']

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

      # http body (model)
      post_body = opts[:debug_body]

      # return_type
      return_type = opts[:debug_return_type] || 'Hash<String, TaskStat>'

      # auth_names
      auth_names = opts[:debug_auth_names] || ['cookieAuth', 'bearerAuth']

      new_options = opts.merge(
        :operation => :"TenantApi.tenant_get_task_stats",
        :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: TenantApi#tenant_get_task_stats\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
      end
      return data, status_code, headers
    end

    # Accept tenant invite
    # Accepts a tenant invite
    # @param [Hash] opts the optional parameters
    # @option opts [AcceptInviteRequest] :accept_invite_request
    # @return [nil]
    def tenant_invite_accept(opts = {})
      tenant_invite_accept_with_http_info(opts)
      nil
    end

    # Accept tenant invite
    # Accepts a tenant invite
    # @param [Hash] opts the optional parameters
    # @option opts [AcceptInviteRequest] :accept_invite_request
    # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers
    def tenant_invite_accept_with_http_info(opts = {})
      if @api_client.config.debugging
        @api_client.config.logger.debug 'Calling API: TenantApi.tenant_invite_accept ...'
      end
      # resource path
      local_var_path = '/api/v1/users/invites/accept'

      # 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']) unless header_params['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(opts[:'accept_invite_request'])

      # return_type
      return_type = opts[:debug_return_type]

      # auth_names
      auth_names = opts[:debug_auth_names] || ['cookieAuth', 'bearerAuth']

      new_options = opts.merge(
        :operation => :"TenantApi.tenant_invite_accept",
        :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: TenantApi#tenant_invite_accept\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
      end
      return data, status_code, headers
    end

    # Create tenant invite
    # Creates a new tenant invite
    # @param tenant [String] The tenant id
    # @param create_tenant_invite_request [CreateTenantInviteRequest] The tenant invite to create
    # @param [Hash] opts the optional parameters
    # @return [TenantInvite]
    def tenant_invite_create(tenant, create_tenant_invite_request, opts = {})
      data, _status_code, _headers = tenant_invite_create_with_http_info(tenant, create_tenant_invite_request, opts)
      data
    end

    # Create tenant invite
    # Creates a new tenant invite
    # @param tenant [String] The tenant id
    # @param create_tenant_invite_request [CreateTenantInviteRequest] The tenant invite to create
    # @param [Hash] opts the optional parameters
    # @return [Array<(TenantInvite, Integer, Hash)>] TenantInvite data, response status code and response headers
    def tenant_invite_create_with_http_info(tenant, create_tenant_invite_request, opts = {})
      if @api_client.config.debugging
        @api_client.config.logger.debug 'Calling API: TenantApi.tenant_invite_create ...'
      end
      # verify the required parameter 'tenant' is set
      if @api_client.config.client_side_validation && tenant.nil?
        fail ArgumentError, "Missing the required parameter 'tenant' when calling TenantApi.tenant_invite_create"
      end
      if @api_client.config.client_side_validation && tenant.to_s.length > 36
        fail ArgumentError, 'invalid value for "tenant" when calling TenantApi.tenant_invite_create, the character length must be smaller than or equal to 36.'
      end

      if @api_client.config.client_side_validation && tenant.to_s.length < 36
        fail ArgumentError, 'invalid value for "tenant" when calling TenantApi.tenant_invite_create, the character length must be greater than or equal to 36.'
      end

      # verify the required parameter 'create_tenant_invite_request' is set
      if @api_client.config.client_side_validation && create_tenant_invite_request.nil?
        fail ArgumentError, "Missing the required parameter 'create_tenant_invite_request' when calling TenantApi.tenant_invite_create"
      end
      # resource path
      local_var_path = '/api/v1/tenants/{tenant}/invites'.sub('{' + 'tenant' + '}', CGI.escape(tenant.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']) unless header_params['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(create_tenant_invite_request)

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

      # auth_names
      auth_names = opts[:debug_auth_names] || ['cookieAuth', 'bearerAuth']

      new_options = opts.merge(
        :operation => :"TenantApi.tenant_invite_create",
        :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: TenantApi#tenant_invite_create\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
      end
      return data, status_code, headers
    end

    # List tenant invites
    # Gets a list of tenant invites
    # @param tenant [String] The tenant id
    # @param [Hash] opts the optional parameters
    # @return [TenantInviteList]
    def tenant_invite_list(tenant, opts = {})
      data, _status_code, _headers = tenant_invite_list_with_http_info(tenant, opts)
      data
    end

    # List tenant invites
    # Gets a list of tenant invites
    # @param tenant [String] The tenant id
    # @param [Hash] opts the optional parameters
    # @return [Array<(TenantInviteList, Integer, Hash)>] TenantInviteList data, response status code and response headers
    def tenant_invite_list_with_http_info(tenant, opts = {})
      if @api_client.config.debugging
        @api_client.config.logger.debug 'Calling API: TenantApi.tenant_invite_list ...'
      end
      # verify the required parameter 'tenant' is set
      if @api_client.config.client_side_validation && tenant.nil?
        fail ArgumentError, "Missing the required parameter 'tenant' when calling TenantApi.tenant_invite_list"
      end
      if @api_client.config.client_side_validation && tenant.to_s.length > 36
        fail ArgumentError, 'invalid value for "tenant" when calling TenantApi.tenant_invite_list, the character length must be smaller than or equal to 36.'
      end

      if @api_client.config.client_side_validation && tenant.to_s.length < 36
        fail ArgumentError, 'invalid value for "tenant" when calling TenantApi.tenant_invite_list, the character length must be greater than or equal to 36.'
      end

      # resource path
      local_var_path = '/api/v1/tenants/{tenant}/invites'.sub('{' + 'tenant' + '}', CGI.escape(tenant.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']) unless header_params['Accept']

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

      # http body (model)
      post_body = opts[:debug_body]

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

      # auth_names
      auth_names = opts[:debug_auth_names] || ['cookieAuth', 'bearerAuth']

      new_options = opts.merge(
        :operation => :"TenantApi.tenant_invite_list",
        :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: TenantApi#tenant_invite_list\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
      end
      return data, status_code, headers
    end

    # Reject tenant invite
    # Rejects a tenant invite
    # @param [Hash] opts the optional parameters
    # @option opts [RejectInviteRequest] :reject_invite_request
    # @return [nil]
    def tenant_invite_reject(opts = {})
      tenant_invite_reject_with_http_info(opts)
      nil
    end

    # Reject tenant invite
    # Rejects a tenant invite
    # @param [Hash] opts the optional parameters
    # @option opts [RejectInviteRequest] :reject_invite_request
    # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers
    def tenant_invite_reject_with_http_info(opts = {})
      if @api_client.config.debugging
        @api_client.config.logger.debug 'Calling API: TenantApi.tenant_invite_reject ...'
      end
      # resource path
      local_var_path = '/api/v1/users/invites/reject'

      # 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']) unless header_params['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(opts[:'reject_invite_request'])

      # return_type
      return_type = opts[:debug_return_type]

      # auth_names
      auth_names = opts[:debug_auth_names] || ['cookieAuth', 'bearerAuth']

      new_options = opts.merge(
        :operation => :"TenantApi.tenant_invite_reject",
        :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: TenantApi#tenant_invite_reject\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
      end
      return data, status_code, headers
    end

    # Delete a tenant member
    # Delete a member from a tenant
    # @param tenant [String] The tenant id
    # @param member [String] The tenant member id
    # @param [Hash] opts the optional parameters
    # @return [TenantMember]
    def tenant_member_delete(tenant, member, opts = {})
      data, _status_code, _headers = tenant_member_delete_with_http_info(tenant, member, opts)
      data
    end

    # Delete a tenant member
    # Delete a member from a tenant
    # @param tenant [String] The tenant id
    # @param member [String] The tenant member id
    # @param [Hash] opts the optional parameters
    # @return [Array<(TenantMember, Integer, Hash)>] TenantMember data, response status code and response headers
    def tenant_member_delete_with_http_info(tenant, member, opts = {})
      if @api_client.config.debugging
        @api_client.config.logger.debug 'Calling API: TenantApi.tenant_member_delete ...'
      end
      # verify the required parameter 'tenant' is set
      if @api_client.config.client_side_validation && tenant.nil?
        fail ArgumentError, "Missing the required parameter 'tenant' when calling TenantApi.tenant_member_delete"
      end
      if @api_client.config.client_side_validation && tenant.to_s.length > 36
        fail ArgumentError, 'invalid value for "tenant" when calling TenantApi.tenant_member_delete, the character length must be smaller than or equal to 36.'
      end

      if @api_client.config.client_side_validation && tenant.to_s.length < 36
        fail ArgumentError, 'invalid value for "tenant" when calling TenantApi.tenant_member_delete, the character length must be greater than or equal to 36.'
      end

      # verify the required parameter 'member' is set
      if @api_client.config.client_side_validation && member.nil?
        fail ArgumentError, "Missing the required parameter 'member' when calling TenantApi.tenant_member_delete"
      end
      if @api_client.config.client_side_validation && member.to_s.length > 36
        fail ArgumentError, 'invalid value for "member" when calling TenantApi.tenant_member_delete, the character length must be smaller than or equal to 36.'
      end

      if @api_client.config.client_side_validation && member.to_s.length < 36
        fail ArgumentError, 'invalid value for "member" when calling TenantApi.tenant_member_delete, the character length must be greater than or equal to 36.'
      end

      # resource path
      local_var_path = '/api/v1/tenants/{tenant}/members/{member}'.sub('{' + 'tenant' + '}', CGI.escape(tenant.to_s)).sub('{' + 'member' + '}', CGI.escape(member.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']) unless header_params['Accept']

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

      # http body (model)
      post_body = opts[:debug_body]

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

      # auth_names
      auth_names = opts[:debug_auth_names] || ['cookieAuth', 'bearerAuth']

      new_options = opts.merge(
        :operation => :"TenantApi.tenant_member_delete",
        :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(:DELETE, local_var_path, new_options)
      if @api_client.config.debugging
        @api_client.config.logger.debug "API called: TenantApi#tenant_member_delete\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
      end
      return data, status_code, headers
    end

    # List tenant members
    # Gets a list of tenant members
    # @param tenant [String] The tenant id
    # @param [Hash] opts the optional parameters
    # @return [TenantMemberList]
    def tenant_member_list(tenant, opts = {})
      data, _status_code, _headers = tenant_member_list_with_http_info(tenant, opts)
      data
    end

    # List tenant members
    # Gets a list of tenant members
    # @param tenant [String] The tenant id
    # @param [Hash] opts the optional parameters
    # @return [Array<(TenantMemberList, Integer, Hash)>] TenantMemberList data, response status code and response headers
    def tenant_member_list_with_http_info(tenant, opts = {})
      if @api_client.config.debugging
        @api_client.config.logger.debug 'Calling API: TenantApi.tenant_member_list ...'
      end
      # verify the required parameter 'tenant' is set
      if @api_client.config.client_side_validation && tenant.nil?
        fail ArgumentError, "Missing the required parameter 'tenant' when calling TenantApi.tenant_member_list"
      end
      if @api_client.config.client_side_validation && tenant.to_s.length > 36
        fail ArgumentError, 'invalid value for "tenant" when calling TenantApi.tenant_member_list, the character length must be smaller than or equal to 36.'
      end

      if @api_client.config.client_side_validation && tenant.to_s.length < 36
        fail ArgumentError, 'invalid value for "tenant" when calling TenantApi.tenant_member_list, the character length must be greater than or equal to 36.'
      end

      # resource path
      local_var_path = '/api/v1/tenants/{tenant}/members'.sub('{' + 'tenant' + '}', CGI.escape(tenant.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']) unless header_params['Accept']

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

      # http body (model)
      post_body = opts[:debug_body]

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

      # auth_names
      auth_names = opts[:debug_auth_names] || ['cookieAuth', 'bearerAuth']

      new_options = opts.merge(
        :operation => :"TenantApi.tenant_member_list",
        :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: TenantApi#tenant_member_list\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
      end
      return data, status_code, headers
    end

    # Update a tenant member
    # Update a tenant member
    # @param tenant [String] The tenant id
    # @param member [String] The tenant member id
    # @param update_tenant_member_request [UpdateTenantMemberRequest] The tenant member properties to update
    # @param [Hash] opts the optional parameters
    # @return [TenantMember]
    def tenant_member_update(tenant, member, update_tenant_member_request, opts = {})
      data, _status_code, _headers = tenant_member_update_with_http_info(tenant, member, update_tenant_member_request, opts)
      data
    end

    # Update a tenant member
    # Update a tenant member
    # @param tenant [String] The tenant id
    # @param member [String] The tenant member id
    # @param update_tenant_member_request [UpdateTenantMemberRequest] The tenant member properties to update
    # @param [Hash] opts the optional parameters
    # @return [Array<(TenantMember, Integer, Hash)>] TenantMember data, response status code and response headers
    def tenant_member_update_with_http_info(tenant, member, update_tenant_member_request, opts = {})
      if @api_client.config.debugging
        @api_client.config.logger.debug 'Calling API: TenantApi.tenant_member_update ...'
      end
      # verify the required parameter 'tenant' is set
      if @api_client.config.client_side_validation && tenant.nil?
        fail ArgumentError, "Missing the required parameter 'tenant' when calling TenantApi.tenant_member_update"
      end
      if @api_client.config.client_side_validation && tenant.to_s.length > 36
        fail ArgumentError, 'invalid value for "tenant" when calling TenantApi.tenant_member_update, the character length must be smaller than or equal to 36.'
      end

      if @api_client.config.client_side_validation && tenant.to_s.length < 36
        fail ArgumentError, 'invalid value for "tenant" when calling TenantApi.tenant_member_update, the character length must be greater than or equal to 36.'
      end

      # verify the required parameter 'member' is set
      if @api_client.config.client_side_validation && member.nil?
        fail ArgumentError, "Missing the required parameter 'member' when calling TenantApi.tenant_member_update"
      end
      if @api_client.config.client_side_validation && member.to_s.length > 36
        fail ArgumentError, 'invalid value for "member" when calling TenantApi.tenant_member_update, the character length must be smaller than or equal to 36.'
      end

      if @api_client.config.client_side_validation && member.to_s.length < 36
        fail ArgumentError, 'invalid value for "member" when calling TenantApi.tenant_member_update, the character length must be greater than or equal to 36.'
      end

      # verify the required parameter 'update_tenant_member_request' is set
      if @api_client.config.client_side_validation && update_tenant_member_request.nil?
        fail ArgumentError, "Missing the required parameter 'update_tenant_member_request' when calling TenantApi.tenant_member_update"
      end
      # resource path
      local_var_path = '/api/v1/tenants/{tenant}/members/{member}'.sub('{' + 'tenant' + '}', CGI.escape(tenant.to_s)).sub('{' + 'member' + '}', CGI.escape(member.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']) unless header_params['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(update_tenant_member_request)

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

      # auth_names
      auth_names = opts[:debug_auth_names] || ['cookieAuth', 'bearerAuth']

      new_options = opts.merge(
        :operation => :"TenantApi.tenant_member_update",
        :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: TenantApi#tenant_member_update\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
      end
      return data, status_code, headers
    end

    # Create tenant alert email group
    # Gets the resource policy for a tenant
    # @param tenant [String] The tenant id
    # @param [Hash] opts the optional parameters
    # @return [TenantResourcePolicy]
    def tenant_resource_policy_get(tenant, opts = {})
      data, _status_code, _headers = tenant_resource_policy_get_with_http_info(tenant, opts)
      data
    end

    # Create tenant alert email group
    # Gets the resource policy for a tenant
    # @param tenant [String] The tenant id
    # @param [Hash] opts the optional parameters
    # @return [Array<(TenantResourcePolicy, Integer, Hash)>] TenantResourcePolicy data, response status code and response headers
    def tenant_resource_policy_get_with_http_info(tenant, opts = {})
      if @api_client.config.debugging
        @api_client.config.logger.debug 'Calling API: TenantApi.tenant_resource_policy_get ...'
      end
      # verify the required parameter 'tenant' is set
      if @api_client.config.client_side_validation && tenant.nil?
        fail ArgumentError, "Missing the required parameter 'tenant' when calling TenantApi.tenant_resource_policy_get"
      end
      if @api_client.config.client_side_validation && tenant.to_s.length > 36
        fail ArgumentError, 'invalid value for "tenant" when calling TenantApi.tenant_resource_policy_get, the character length must be smaller than or equal to 36.'
      end

      if @api_client.config.client_side_validation && tenant.to_s.length < 36
        fail ArgumentError, 'invalid value for "tenant" when calling TenantApi.tenant_resource_policy_get, the character length must be greater than or equal to 36.'
      end

      # resource path
      local_var_path = '/api/v1/tenants/{tenant}/resource-policy'.sub('{' + 'tenant' + '}', CGI.escape(tenant.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']) unless header_params['Accept']

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

      # http body (model)
      post_body = opts[:debug_body]

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

      # auth_names
      auth_names = opts[:debug_auth_names] || ['cookieAuth', 'bearerAuth']

      new_options = opts.merge(
        :operation => :"TenantApi.tenant_resource_policy_get",
        :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: TenantApi#tenant_resource_policy_get\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
      end
      return data, status_code, headers
    end

    # Update tenant
    # Update an existing tenant
    # @param tenant [String] The tenant id
    # @param update_tenant_request [UpdateTenantRequest] The tenant properties to update
    # @param [Hash] opts the optional parameters
    # @return [Tenant]
    def tenant_update(tenant, update_tenant_request, opts = {})
      data, _status_code, _headers = tenant_update_with_http_info(tenant, update_tenant_request, opts)
      data
    end

    # Update tenant
    # Update an existing tenant
    # @param tenant [String] The tenant id
    # @param update_tenant_request [UpdateTenantRequest] The tenant properties to update
    # @param [Hash] opts the optional parameters
    # @return [Array<(Tenant, Integer, Hash)>] Tenant data, response status code and response headers
    def tenant_update_with_http_info(tenant, update_tenant_request, opts = {})
      if @api_client.config.debugging
        @api_client.config.logger.debug 'Calling API: TenantApi.tenant_update ...'
      end
      # verify the required parameter 'tenant' is set
      if @api_client.config.client_side_validation && tenant.nil?
        fail ArgumentError, "Missing the required parameter 'tenant' when calling TenantApi.tenant_update"
      end
      if @api_client.config.client_side_validation && tenant.to_s.length > 36
        fail ArgumentError, 'invalid value for "tenant" when calling TenantApi.tenant_update, the character length must be smaller than or equal to 36.'
      end

      if @api_client.config.client_side_validation && tenant.to_s.length < 36
        fail ArgumentError, 'invalid value for "tenant" when calling TenantApi.tenant_update, the character length must be greater than or equal to 36.'
      end

      # verify the required parameter 'update_tenant_request' is set
      if @api_client.config.client_side_validation && update_tenant_request.nil?
        fail ArgumentError, "Missing the required parameter 'update_tenant_request' when calling TenantApi.tenant_update"
      end
      # resource path
      local_var_path = '/api/v1/tenants/{tenant}'.sub('{' + 'tenant' + '}', CGI.escape(tenant.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']) unless header_params['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(update_tenant_request)

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

      # auth_names
      auth_names = opts[:debug_auth_names] || ['cookieAuth', 'bearerAuth']

      new_options = opts.merge(
        :operation => :"TenantApi.tenant_update",
        :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: TenantApi#tenant_update\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
      end
      return data, status_code, headers
    end

    # List tenant invites
    # Lists all tenant invites for the current user
    # @param [Hash] opts the optional parameters
    # @return [TenantInviteList]
    def user_list_tenant_invites(opts = {})
      data, _status_code, _headers = user_list_tenant_invites_with_http_info(opts)
      data
    end

    # List tenant invites
    # Lists all tenant invites for the current user
    # @param [Hash] opts the optional parameters
    # @return [Array<(TenantInviteList, Integer, Hash)>] TenantInviteList data, response status code and response headers
    def user_list_tenant_invites_with_http_info(opts = {})
      if @api_client.config.debugging
        @api_client.config.logger.debug 'Calling API: TenantApi.user_list_tenant_invites ...'
      end
      # resource path
      local_var_path = '/api/v1/users/invites'

      # 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']) unless header_params['Accept']

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

      # http body (model)
      post_body = opts[:debug_body]

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

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

      new_options = opts.merge(
        :operation => :"TenantApi.user_list_tenant_invites",
        :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: TenantApi#user_list_tenant_invites\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
      end
      return data, status_code, headers
    end
  end
end
