self.args = args

    def IsDone(self, operation):
        """Overrides."""
        result = getattr(operation, self.spec. async .state.field)
        if isinstance(result, apitools_messages.Enum):
            result = result.name
        if (result in self.spec. async .state.success_values
                or result in self.spec. async .state.error_values):
            # We found a value that means it is done.
            error = getattr(operation, self.spec. async .error.field)
            if not error and result in self.spec. async .state.error_values:
                error = 'The operation failed.'
            # If we succeeded but there is an error, or if an error was detected.
            if error:
                raise waiter.OperationError(SerializeError(error))
            return True

        return False

    def Poll(self, operation_ref):
        """Overrides.

    Args:
      operation_ref: googlecloudsdk.core.resources.Resource.

    Returns:
      fetched operation message.
    """
        request_type = self.method.GetRequestType()
        relative_name = operation_ref.RelativeName()
                                         or spec.request.api_version)

    def IsDone(self, operation):
        """Overrides."""
        result = getattr(operation, self.spec. async .state.field)
        if isinstance(result, apitools_messages.Enum):
            result = result.name
        if (result in self.spec. async .state.success_values
                or result in self.spec. async .state.error_values):
            # We found a value that means it is done.
            error = getattr(operation, self.spec. async .error.field)
            if not error and result in self.spec. async .state.error_values:
                error = 'The operation failed.'
            # If we succeeded but there is an error, or if an error was detected.
            if error:
                raise waiter.OperationError(error)
            return True

        return False

    def Poll(self, operation_ref):
        """Overrides.

    Args:
      operation_ref: googlecloudsdk.core.resources.Resource.

    Returns:
      fetched operation message.
    """
        request_type = self.method.GetRequestType()
        relative_name = operation_ref.RelativeName()