# Copyright (C) 2021 - 2024 ANSYS, Inc. and/or its affiliates.
# SPDX-License-Identifier: MIT
#
#
# 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.

"""Module providing the ControlImplicitModalDynamicModeGenerate class."""
import typing
from ansys.dyna.core.lib.card import Card, Field, Flag
from ansys.dyna.core.lib.field_schema import FieldSchema
from ansys.dyna.core.lib.keyword_base import KeywordBase

_CONTROLIMPLICITMODALDYNAMICMODEGENERATE_CARD0 = (
    FieldSchema("m1beg", int, 0, 10, None),
    FieldSchema("m1end", int, 10, 10, None),
    FieldSchema("m2beg", int, 20, 10, None),
    FieldSchema("m2end", int, 30, 10, None),
    FieldSchema("m3beg", int, 40, 10, None),
    FieldSchema("m3end", int, 50, 10, None),
    FieldSchema("m4beg", int, 60, 10, None),
    FieldSchema("m4end", int, 70, 10, None),
)

class ControlImplicitModalDynamicModeGenerate(KeywordBase):
    """DYNA CONTROL_IMPLICIT_MODAL_DYNAMIC_MODE_GENERATE keyword"""

    keyword = "CONTROL"
    subkeyword = "IMPLICIT_MODAL_DYNAMIC_MODE_GENERATE"

    def __init__(self, **kwargs):
        """Initialize the ControlImplicitModalDynamicModeGenerate class."""
        super().__init__(**kwargs)
        self._cards = [
            Card.from_field_schemas_with_defaults(
                _CONTROLIMPLICITMODALDYNAMICMODEGENERATE_CARD0,
                **kwargs,
            ),        ]
    @property
    def m1beg(self) -> typing.Optional[int]:
        """Get or set the First mode ID in block n.
        """ # nopep8
        return self._cards[0].get_value("m1beg")

    @m1beg.setter
    def m1beg(self, value: int) -> None:
        """Set the m1beg property."""
        self._cards[0].set_value("m1beg", value)

    @property
    def m1end(self) -> typing.Optional[int]:
        """Get or set the Last mode ID in block n. All mode IDs between and including MnBEG and MnEND are added to the list.
        """ # nopep8
        return self._cards[0].get_value("m1end")

    @m1end.setter
    def m1end(self, value: int) -> None:
        """Set the m1end property."""
        self._cards[0].set_value("m1end", value)

    @property
    def m2beg(self) -> typing.Optional[int]:
        """Get or set the First mode ID in block n.
        """ # nopep8
        return self._cards[0].get_value("m2beg")

    @m2beg.setter
    def m2beg(self, value: int) -> None:
        """Set the m2beg property."""
        self._cards[0].set_value("m2beg", value)

    @property
    def m2end(self) -> typing.Optional[int]:
        """Get or set the Last mode ID in block n. All mode IDs between and including MnBEG and MnEND are added to the list.
        """ # nopep8
        return self._cards[0].get_value("m2end")

    @m2end.setter
    def m2end(self, value: int) -> None:
        """Set the m2end property."""
        self._cards[0].set_value("m2end", value)

    @property
    def m3beg(self) -> typing.Optional[int]:
        """Get or set the First mode ID in block n.
        """ # nopep8
        return self._cards[0].get_value("m3beg")

    @m3beg.setter
    def m3beg(self, value: int) -> None:
        """Set the m3beg property."""
        self._cards[0].set_value("m3beg", value)

    @property
    def m3end(self) -> typing.Optional[int]:
        """Get or set the Last mode ID in block n. All mode IDs between and including MnBEG and MnEND are added to the list.
        """ # nopep8
        return self._cards[0].get_value("m3end")

    @m3end.setter
    def m3end(self, value: int) -> None:
        """Set the m3end property."""
        self._cards[0].set_value("m3end", value)

    @property
    def m4beg(self) -> typing.Optional[int]:
        """Get or set the First mode ID in block n.
        """ # nopep8
        return self._cards[0].get_value("m4beg")

    @m4beg.setter
    def m4beg(self, value: int) -> None:
        """Set the m4beg property."""
        self._cards[0].set_value("m4beg", value)

    @property
    def m4end(self) -> typing.Optional[int]:
        """Get or set the Last mode ID in block n. All mode IDs between and including MnBEG and MnEND are added to the list.
        """ # nopep8
        return self._cards[0].get_value("m4end")

    @m4end.setter
    def m4end(self, value: int) -> None:
        """Set the m4end property."""
        self._cards[0].set_value("m4end", value)

