text: # MIT LICENSE
  #
  # Copyright 1997 - 2020 by IXIA Keysight
  #
  # Permission is hereby granted, free of charge, to any person obtaining a copy
  # of this software and associated documentation files (the "Software"),
  # to deal in the Software without restriction, including without limitation
  # the rights to use, copy, modify, merge, publish, distribute, sublicense,
  # and/or sell copies of the Software, and to permit persons to whom the
  # Software is furnished to do so, subject to the following conditions:
  #
  # The above copyright notice and this permission notice shall be included in
  # all copies or substantial portions of the Software.
  #
  # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  # THE SOFTWARE. 
  from uhd_restpy.base import Base
  from uhd_restpy.files import Files
  from typing import List, Any, Union
  
  
  class OpenFlowTableCapacity(Base):
      """This object allows to configure the open flow table capacity settings.
      The OpenFlowTableCapacity class encapsulates a list of openFlowTableCapacity resources that are managed by the user.
      A list of resources can be retrieved from the server using the OpenFlowTableCapacity.find() method.
      The list can be managed by using the OpenFlowTableCapacity.add() and OpenFlowTableCapacity.remove() methods.
      """
  
      __slots__ = ()
      _SDM_NAME = 'openFlowTableCapacity'
      _SDM_ATT_MAP = {
          'ForceApplyQTConfig': 'forceApplyQTConfig',
          'InputParameters': 'inputParameters',
          'Mode': 'mode',
          'Name': 'name',
      }
      _SDM_ENUM_MAP = {
          'mode': ['existingMode', 'newMode'],
      }
  
      def __init__(self, parent, list_op=False):
          super(OpenFlowTableCapacity, self).__init__(parent, list_op)
  
      @property
      def PassCriteria(self):
          """
          Returns
          -------
          - obj(uhd_restpy.testplatform.sessions.ixnetwork.quicktest.passcriteria_4224acf5d8a4be0ca7879c532ce0a408.PassCriteria): An instance of the PassCriteria class
  
          Raises
          ------
          - ServerError: The server has encountered an uncategorized error condition
          """
          from uhd_restpy.testplatform.sessions.ixnetwork.quicktest.passcriteria_4224acf5d8a4be0ca7879c532ce0a408 import PassCriteria
          if self._properties.get('PassCriteria', None) is not None:
              return self._properties.get('PassCriteria')
          else:
              return PassCriteria(self)._select()
  
      @property
      def Results(self):
          """
          Returns
          -------
          - obj(uhd_restpy.testplatform.sessions.ixnetwork.quicktest.results_e206b3c25fa7659bcd9b7e839eb69288.Results): An instance of the Results class
  
          Raises
          ------
          - ServerError: The server has encountered an uncategorized error condition
          """
          from uhd_restpy.testplatform.sessions.ixnetwork.quicktest.results_e206b3c25fa7659bcd9b7e839eb69288 import Results
          if self._properties.get('Results', None) is not None:
              return self._properties.get('Results')
          else:
              return Results(self)._select()
  
      @property
      def TestConfig(self):
          """
          Returns
          -------
          - obj(uhd_restpy.testplatform.sessions.ixnetwork.quicktest.testconfig_9f27c4c121a6415dba2b4e09edba31df.TestConfig): An instance of the TestConfig class
  
          Raises
          ------
          - ServerError: The server has encountered an uncategorized error condition
          """
          from uhd_restpy.testplatform.sessions.ixnetwork.quicktest.testconfig_9f27c4c121a6415dba2b4e09edba31df import TestConfig
          if self._properties.get('TestConfig', None) is not None:
              return self._properties.get('TestConfig')
          else:
              return TestConfig(self)._select()
  
      @property
      def TrafficSelection(self):
          """
          Returns
          -------
          - obj(uhd_restpy.testplatform.sessions.ixnetwork.quicktest.trafficselection_5fc8c338cdb89d2e5bd73f6001b4e882.TrafficSelection): An instance of the TrafficSelection class
  
          Raises
          ------
          - ServerError: The server has encountered an uncategorized error condition
          """
          from uhd_restpy.testplatform.sessions.ixnetwork.quicktest.trafficselection_5fc8c338cdb89d2e5bd73f6001b4e882 import TrafficSelection
          if self._properties.get('TrafficSelection', None) is not None:
              return self._properties.get('TrafficSelection')
          else:
              return TrafficSelection(self)
  
      @property
      def ForceApplyQTConfig(self):
          # type: () -> bool
          """
          Returns
          -------
          - bool: Apply QT config
          """
          return self._get_attribute(self._SDM_ATT_MAP['ForceApplyQTConfig'])
      @ForceApplyQTConfig.setter
      def ForceApplyQTConfig(self, value):
          # type: (bool) -> None
          self._set_attribute(self._SDM_ATT_MAP['ForceApplyQTConfig'], value)
  
      @property
      def InputParameters(self):
          # type: () -> str
          """
          Returns
          -------
          - str: Input Parameters
          """
          return self._get_attribute(self._SDM_ATT_MAP['InputParameters'])
      @InputParameters.setter
      def InputParameters(self, value):
          # type: (str) -> None
          self._set_attribute(self._SDM_ATT_MAP['InputParameters'], value)
  
      @property
      def Mode(self):
          # type: () -> str
          """
          Returns
          -------
          - str(existingMode | newMode): Test mode
          """
          return self._get_attribute(self._SDM_ATT_MAP['Mode'])
      @Mode.setter
      def Mode(self, value):
          # type: (str) -> None
          self._set_attribute(self._SDM_ATT_MAP['Mode'], value)
  
      @property
      def Name(self):
          # type: () -> str
          """
          Returns
          -------
          - str: Test name
          """
          return self._get_attribute(self._SDM_ATT_MAP['Name'])
      @Name.setter
      def Name(self, value):
          # type: (str) -> None
          self._set_attribute(self._SDM_ATT_MAP['Name'], value)
  
      def update(self, ForceApplyQTConfig=None, InputParameters=None, Mode=None, Name=None):
          # type: (bool, str, str, str) -> OpenFlowTableCapacity
          """Updates openFlowTableCapacity resource on the server.
  
          Args
          ----
          - ForceApplyQTConfig (bool): Apply QT config
          - InputParameters (str): Input Parameters
          - Mode (str(existingMode | newMode)): Test mode
          - Name (str): Test name
  
          Raises
          ------
          - ServerError: The server has encountered an uncategorized error condition
          """
          return self._update(self._map_locals(self._SDM_ATT_MAP, locals()))
  
      def add(self, ForceApplyQTConfig=None, InputParameters=None, Mode=None, Name=None):
          # type: (bool, str, str, str) -> OpenFlowTableCapacity
          """Adds a new openFlowTableCapacity resource on the server and adds it to the container.
  
          Args
          ----
          - ForceApplyQTConfig (bool): Apply QT config
          - InputParameters (str): Input Parameters
          - Mode (str(existingMode | newMode)): Test mode
          - Name (str): Test name
  
          Returns
          -------
          - self: This instance with all currently retrieved openFlowTableCapacity resources using find and the newly added openFlowTableCapacity resources available through an iterator or index
  
          Raises
          ------
          - ServerError: The server has encountered an uncategorized error condition
          """
          return self._create(self._map_locals(self._SDM_ATT_MAP, locals()))
  
      def remove(self):
          """Deletes all the contained openFlowTableCapacity resources in this instance from the server.
  
          Raises
          ------
          - NotFoundError: The requested resource does not exist on the server
          - ServerError: The server has encountered an uncategorized error condition
          """
          self._delete()
  
      def find(self, ForceApplyQTConfig=None, InputParameters=None, Mode=None, Name=None):
          # type: (bool, str, str, str) -> OpenFlowTableCapacity
          """Finds and retrieves openFlowTableCapacity resources from the server.
  
          All named parameters are evaluated on the server using regex. The named parameters can be used to selectively retrieve openFlowTableCapacity resources from the server.
          To retrieve an exact match ensure the parameter value starts with ^ and ends with $
          By default the find method takes no parameters and will retrieve all openFlowTableCapacity resources from the server.
  
          Args
          ----
          - ForceApplyQTConfig (bool): Apply QT config
          - InputParameters (str): Input Parameters
          - Mode (str(existingMode | newMode)): Test mode
          - Name (str): Test name
  
          Returns
          -------
          - self: This instance with matching openFlowTableCapacity resources retrieved from the server available through an iterator or index
  
          Raises
          ------
          - ServerError: The server has encountered an uncategorized error condition
          """
          return self._select(self._map_locals(self._SDM_ATT_MAP, locals()))
  
      def read(self, href):
          """Retrieves a single instance of openFlowTableCapacity data from the server.
  
          Args
          ----
          - href (str): An href to the instance to be retrieved
  
          Returns
          -------
          - self: This instance with the openFlowTableCapacity resources from the server available through an iterator or index
  
          Raises
          ------
          - NotFoundError: The requested resource does not exist on the server
          - ServerError: The server has encountered an uncategorized error condition
          """
          return self._read(href)
  
      def Apply(self, *args, **kwargs):
          # type: (*Any, **Any) -> None
          """Executes the apply operation on the server.
  
          Applies the specified Quick Test.
  
          apply(async_operation=bool)
          ---------------------------
          - async_operation (bool=False): True to execute the operation asynchronously. Any subsequent rest api calls made through the Connection class will block until the operation is complete.
  
          Raises
          ------
          - NotFoundError: The requested resource does not exist on the server
          - ServerError: The server has encountered an uncategorized error condition
          """
          payload = { "Arg1": self.href }
          for i in range(len(args)): payload['Arg%s' % (i + 2)] = args[i]
          for item in kwargs.items(): payload[item[0]] = item[1]
          return self._execute('apply', payload=payload, response_object=None)
  
      def ApplyAsync(self, *args, **kwargs):
          # type: (*Any, **Any) -> None
          """Executes the applyAsync operation on the server.
  
          applyAsync(async_operation=bool)
          --------------------------------
          - async_operation (bool=False): True to execute the operation asynchronously. Any subsequent rest api calls made through the Connection class will block until the operation is complete.
  
          Raises
          ------
          - NotFoundError: The requested resource does not exist on the server
          - ServerError: The server has encountered an uncategorized error condition
          """
          payload = { "Arg1": self.href }
          for i in range(len(args)): payload['Arg%s' % (i + 2)] = args[i]
          for item in kwargs.items(): payload[item[0]] = item[1]
          return self._execute('applyAsync', payload=payload, response_object=None)
  
      def ApplyAsyncResult(self, *args, **kwargs):
          # type: (*Any, **Any) -> Union[bool, None]
          """Executes the applyAsyncResult operation on the server.
  
          applyAsyncResult(async_operation=bool)bool
          ------------------------------------------
          - async_operation (bool=False): True to execute the operation asynchronously. Any subsequent rest api calls made through the Connection class will block until the operation is complete.
          - Returns bool: 
  
          Raises
          ------
          - NotFoundError: The requested resource does not exist on the server
          - ServerError: The server has encountered an uncategorized error condition
          """
          payload = { "Arg1": self.href }
          for i in range(len(args)): payload['Arg%s' % (i + 2)] = args[i]
          for item in kwargs.items(): payload[item[0]] = item[1]
          return self._execute('applyAsyncResult', payload=payload, response_object=None)
  
      def ApplyITWizardConfiguration(self, *args, **kwargs):
          # type: (*Any, **Any) -> None
          """Executes the applyITWizardConfiguration operation on the server.
  
          Applies the specified Quick Test.
  
          applyITWizardConfiguration(async_operation=bool)
          ------------------------------------------------
          - async_operation (bool=False): True to execute the operation asynchronously. Any subsequent rest api calls made through the Connection class will block until the operation is complete.
  
          Raises
          ------
          - NotFoundError: The requested resource does not exist on the server
          - ServerError: The server has encountered an uncategorized error condition
          """
          payload = { "Arg1": self.href }
          for i in range(len(args)): payload['Arg%s' % (i + 2)] = args[i]
          for item in kwargs.items(): payload[item[0]] = item[1]
          return self._execute('applyITWizardConfiguration', payload=payload, response_object=None)
  
      def GenerateReport(self, *args, **kwargs):
          # type: (*Any, **Any) -> Union[str, None]
          """Executes the generateReport operation on the server.
  
          Generate a PDF report for the last succesfull test run.
  
          generateReport(async_operation=bool)string
          ------------------------------------------
          - async_operation (bool=False): True to execute the operation asynchronously. Any subsequent rest api calls made through the Connection class will block until the operation is complete.
          - Returns str: This method is asynchronous and has no return value.
  
          Raises
          ------
          - NotFoundError: The requested resource does not exist on the server
          - ServerError: The server has encountered an uncategorized error condition
          """
          payload = { "Arg1": self.href }
          for i in range(len(args)): payload['Arg%s' % (i + 2)] = args[i]
          for item in kwargs.items(): payload[item[0]] = item[1]
          return self._execute('generateReport', payload=payload, response_object=None)
  
      def Run(self, *args, **kwargs):
          # type: (*Any, **Any) -> Union[List[str], None]
          """Executes the run operation on the server.
  
          Starts the specified Quick Test and waits for its execution to finish.
  
          The IxNetwork model allows for multiple method Signatures with the same name while python does not.
  
          run(async_operation=bool)list
          -----------------------------
          - async_operation (bool=False): True to execute the operation asynchronously. Any subsequent rest api calls made through the Connection class will block until the operation is complete.
          - Returns list(str): This method is synchronous and returns the result of the test.
  
          run(InputParameters=string, async_operation=bool)list
          -----------------------------------------------------
          - InputParameters (str): The input arguments of the test.
          - async_operation (bool=False): True to execute the operation asynchronously. Any subsequent rest api calls made through the Connection class will block until the operation is complete.
          - Returns list(str): This method is synchronous and returns the result of the test.
  
          Raises
          ------
          - NotFoundError: The requested resource does not exist on the server
          - ServerError: The server has encountered an uncategorized error condition
          """
          payload = { "Arg1": self.href }
          for i in range(len(args)): payload['Arg%s' % (i + 2)] = args[i]
          for item in kwargs.items(): payload[item[0]] = item[1]
          return self._execute('run', payload=payload, response_object=None)
  
      def Start(self, *args, **kwargs):
          # type: (*Any, **Any) -> None
          """Executes the start operation on the server.
  
          Starts the specified Quick Test.
  
          The IxNetwork model allows for multiple method Signatures with the same name while python does not.
  
          start(async_operation=bool)
          ---------------------------
          - async_operation (bool=False): True to execute the operation asynchronously. Any subsequent rest api calls made through the Connection class will block until the operation is complete.
  
          start(InputParameters=string, async_operation=bool)
          ---------------------------------------------------
          - InputParameters (str): The input arguments of the test.
          - async_operation (bool=False): True to execute the operation asynchronously. Any subsequent rest api calls made through the Connection class will block until the operation is complete.
  
          Raises
          ------
          - NotFoundError: The requested resource does not exist on the server
          - ServerError: The server has encountered an uncategorized error condition
          """
          payload = { "Arg1": self.href }
          for i in range(len(args)): payload['Arg%s' % (i + 2)] = args[i]
          for item in kwargs.items(): payload[item[0]] = item[1]
          return self._execute('start', payload=payload, response_object=None)
  
      def Stop(self, *args, **kwargs):
          # type: (*Any, **Any) -> None
          """Executes the stop operation on the server.
  
          Stops the currently running Quick Test.
  
          stop(async_operation=bool)
          --------------------------
          - async_operation (bool=False): True to execute the operation asynchronously. Any subsequent rest api calls made through the Connection class will block until the operation is complete.
  
          Raises
          ------
          - NotFoundError: The requested resource does not exist on the server
          - ServerError: The server has encountered an uncategorized error condition
          """
          payload = { "Arg1": self.href }
          for i in range(len(args)): payload['Arg%s' % (i + 2)] = args[i]
          for item in kwargs.items(): payload[item[0]] = item[1]
          return self._execute('stop', payload=payload, response_object=None)
  
      def WaitForTest(self, *args, **kwargs):
          # type: (*Any, **Any) -> Union[List[str], None]
          """Executes the waitForTest operation on the server.
  
          Waits for the execution of the specified Quick Test to be completed.
  
          waitForTest(async_operation=bool)list
          -------------------------------------
          - async_operation (bool=False): True to execute the operation asynchronously. Any subsequent rest api calls made through the Connection class will block until the operation is complete.
          - Returns list(str): This method is synchronous and returns the result of the test.
  
          Raises
          ------
          - NotFoundError: The requested resource does not exist on the server
          - ServerError: The server has encountered an uncategorized error condition
          """
          payload = { "Arg1": self.href }
          for i in range(len(args)): payload['Arg%s' % (i + 2)] = args[i]
          for item in kwargs.items(): payload[item[0]] = item[1]
          return self._execute('waitForTest', payload=payload, response_object=None)
  