=begin
#NSX-T Manager API

#VMware NSX-T Manager REST API

OpenAPI spec version: 2.5.1.0.0

Generated by: https://github.com/swagger-api/swagger-codegen.git
Swagger Codegen version: 2.4.7

=end

require 'uri'

module NSXT
  class ManagementPlaneApiRealizationApi
    attr_accessor :api_client

    def initialize(api_client = ApiClient.default)
      @api_client = api_client
    end
    # Gets the current barrier number
    # Returns the current global realization barrier number for NSX. This method has been deprecated. To track realization state, use X-NSX-REQUESTID request header instead. 
    # @param [Hash] opts the optional parameters
    # @return [CurrentRealizationStateBarrier]
    def get_current_barrier(opts = {})
      data, _status_code, _headers = get_current_barrier_with_http_info(opts)
      data
    end

    # Gets the current barrier number
    # Returns the current global realization barrier number for NSX. This method has been deprecated. To track realization state, use X-NSX-REQUESTID request header instead. 
    # @param [Hash] opts the optional parameters
    # @return [Array<(CurrentRealizationStateBarrier, Fixnum, Hash)>] CurrentRealizationStateBarrier data, response status code and response headers
    def get_current_barrier_with_http_info(opts = {})
      if @api_client.config.debugging
        @api_client.config.logger.debug 'Calling API: ManagementPlaneApiRealizationApi.get_current_barrier ...'
      end
      # resource path
      local_var_path = '/realization-state-barrier/current'

      # query parameters
      query_params = {}

      # header parameters
      header_params = {}
      # HTTP header 'Accept' (if needed)
      header_params['Accept'] = @api_client.select_header_accept(['application/json'])
      # HTTP header 'Content-Type'
      header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])

      # form parameters
      form_params = {}

      # http body (model)
      post_body = nil
      auth_names = ['BasicAuth']
      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 => 'CurrentRealizationStateBarrier')
      if @api_client.config.debugging
        @api_client.config.logger.debug "API called: ManagementPlaneApiRealizationApi#get_current_barrier\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
      end
      return data, status_code, headers
    end
    # Gets the realization state barrier configuration
    # Returns the current barrier configuration 
    # @param [Hash] opts the optional parameters
    # @return [RealizationStateBarrierConfig]
    def get_realization_state_barrier_config(opts = {})
      data, _status_code, _headers = get_realization_state_barrier_config_with_http_info(opts)
      data
    end

    # Gets the realization state barrier configuration
    # Returns the current barrier configuration 
    # @param [Hash] opts the optional parameters
    # @return [Array<(RealizationStateBarrierConfig, Fixnum, Hash)>] RealizationStateBarrierConfig data, response status code and response headers
    def get_realization_state_barrier_config_with_http_info(opts = {})
      if @api_client.config.debugging
        @api_client.config.logger.debug 'Calling API: ManagementPlaneApiRealizationApi.get_realization_state_barrier_config ...'
      end
      # resource path
      local_var_path = '/realization-state-barrier/config'

      # query parameters
      query_params = {}

      # header parameters
      header_params = {}
      # HTTP header 'Accept' (if needed)
      header_params['Accept'] = @api_client.select_header_accept(['application/json'])
      # HTTP header 'Content-Type'
      header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])

      # form parameters
      form_params = {}

      # http body (model)
      post_body = nil
      auth_names = ['BasicAuth']
      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 => 'RealizationStateBarrierConfig')
      if @api_client.config.debugging
        @api_client.config.logger.debug "API called: ManagementPlaneApiRealizationApi#get_realization_state_barrier_config\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
      end
      return data, status_code, headers
    end
    # Increments the barrier count by 1
    # Increment the current barrier number by 1 for NSX. This method has been deprecated. To track realization state, use X-NSX-REQUESTID request header instead. 
    # @param [Hash] opts the optional parameters
    # @return [CurrentRealizationStateBarrier]
    def increment_realization_state_barrier_increment(opts = {})
      data, _status_code, _headers = increment_realization_state_barrier_increment_with_http_info(opts)
      data
    end

    # Increments the barrier count by 1
    # Increment the current barrier number by 1 for NSX. This method has been deprecated. To track realization state, use X-NSX-REQUESTID request header instead. 
    # @param [Hash] opts the optional parameters
    # @return [Array<(CurrentRealizationStateBarrier, Fixnum, Hash)>] CurrentRealizationStateBarrier data, response status code and response headers
    def increment_realization_state_barrier_increment_with_http_info(opts = {})
      if @api_client.config.debugging
        @api_client.config.logger.debug 'Calling API: ManagementPlaneApiRealizationApi.increment_realization_state_barrier_increment ...'
      end
      # resource path
      local_var_path = '/realization-state-barrier/current?action=increment'

      # query parameters
      query_params = {}

      # header parameters
      header_params = {}
      # HTTP header 'Accept' (if needed)
      header_params['Accept'] = @api_client.select_header_accept(['application/json'])
      # HTTP header 'Content-Type'
      header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])

      # form parameters
      form_params = {}

      # http body (model)
      post_body = nil
      auth_names = ['BasicAuth']
      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 => 'CurrentRealizationStateBarrier')
      if @api_client.config.debugging
        @api_client.config.logger.debug "API called: ManagementPlaneApiRealizationApi#increment_realization_state_barrier_increment\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
      end
      return data, status_code, headers
    end
    # Updates the barrier configuration
    # Updates the barrier configuration having interval set in milliseconds The new interval that automatically increments the global realization number 
    # @param realization_state_barrier_config 
    # @param [Hash] opts the optional parameters
    # @return [RealizationStateBarrierConfig]
    def update_realization_state_barrier_config(realization_state_barrier_config, opts = {})
      data, _status_code, _headers = update_realization_state_barrier_config_with_http_info(realization_state_barrier_config, opts)
      data
    end

    # Updates the barrier configuration
    # Updates the barrier configuration having interval set in milliseconds The new interval that automatically increments the global realization number 
    # @param realization_state_barrier_config 
    # @param [Hash] opts the optional parameters
    # @return [Array<(RealizationStateBarrierConfig, Fixnum, Hash)>] RealizationStateBarrierConfig data, response status code and response headers
    def update_realization_state_barrier_config_with_http_info(realization_state_barrier_config, opts = {})
      if @api_client.config.debugging
        @api_client.config.logger.debug 'Calling API: ManagementPlaneApiRealizationApi.update_realization_state_barrier_config ...'
      end
      # verify the required parameter 'realization_state_barrier_config' is set
      if @api_client.config.client_side_validation && realization_state_barrier_config.nil?
        fail ArgumentError, "Missing the required parameter 'realization_state_barrier_config' when calling ManagementPlaneApiRealizationApi.update_realization_state_barrier_config"
      end
      # resource path
      local_var_path = '/realization-state-barrier/config'

      # query parameters
      query_params = {}

      # header parameters
      header_params = {}
      # HTTP header 'Accept' (if needed)
      header_params['Accept'] = @api_client.select_header_accept(['application/json'])
      # HTTP header 'Content-Type'
      header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])

      # form parameters
      form_params = {}

      # http body (model)
      post_body = @api_client.object_to_http_body(realization_state_barrier_config)
      auth_names = ['BasicAuth']
      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 => 'RealizationStateBarrierConfig')
      if @api_client.config.debugging
        @api_client.config.logger.debug "API called: ManagementPlaneApiRealizationApi#update_realization_state_barrier_config\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
      end
      return data, status_code, headers
    end
  end
end
