# coding: utf-8

"""
    HashiCorp Vault API

    HTTP API that gives you full access to Vault. All API routes are prefixed with `/v1/`.

    The version of the OpenAPI document: 1.15.0
    Generated by OpenAPI Generator (https://openapi-generator.tech)

    Do not edit the class manually.
"""  # noqa: E501


from __future__ import annotations
import pprint
import re  # noqa: F401
import json

from pydantic import BaseModel, ConfigDict, Field, StrictStr
from typing import Any, ClassVar, Dict, List, Optional
from typing import Optional, Set
from typing_extensions import Self

class AzureLoginRequest(BaseModel):
    """
    AzureLoginRequest
    """ # noqa: E501
    jwt: Optional[StrictStr] = Field(default=None, description="A signed JWT")
    resource_group_name: Optional[StrictStr] = Field(default=None, description="The resource group from the instance.")
    resource_id: Optional[StrictStr] = Field(default=None, description="The fully qualified ID of the resource, includingthe resource name and resource type. Use the format, /subscriptions/{guid}/resourceGroups/{resource-group-name}/{resource-provider-namespace}/{resource-type}/{resource-name}. This value is ignored if vm_name or vmss_name is specified.")
    role: Optional[StrictStr] = Field(default=None, description="The token role.")
    subscription_id: Optional[StrictStr] = Field(default=None, description="The subscription id for the instance.")
    vm_name: Optional[StrictStr] = Field(default=None, description="The name of the virtual machine. This value is ignored if vmss_name is specified.")
    vmss_name: Optional[StrictStr] = Field(default=None, description="The name of the virtual machine scale set the instance is in.")
    __properties: ClassVar[List[str]] = ["jwt", "resource_group_name", "resource_id", "role", "subscription_id", "vm_name", "vmss_name"]

    model_config = ConfigDict(
        populate_by_name=True,
        validate_assignment=True,
        protected_namespaces=(),
    )


    def to_str(self) -> str:
        """Returns the string representation of the model using alias"""
        return pprint.pformat(self.model_dump(by_alias=True))

    def to_json(self) -> str:
        """Returns the JSON representation of the model using alias"""
        # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
        return json.dumps(self.to_dict())

    @classmethod
    def from_json(cls, json_str: str) -> Optional[Self]:
        """Create an instance of AzureLoginRequest from a JSON string"""
        return cls.from_dict(json.loads(json_str))

    def to_dict(self) -> Dict[str, Any]:
        """Return the dictionary representation of the model using alias.

        This has the following differences from calling pydantic's
        `self.model_dump(by_alias=True)`:

        * `None` is only added to the output dict for nullable fields that
          were set at model initialization. Other fields with value `None`
          are ignored.
        """
        excluded_fields: Set[str] = set([
        ])

        _dict = self.model_dump(
            by_alias=True,
            exclude=excluded_fields,
            exclude_none=True,
        )
        return _dict

    @classmethod
    def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
        """Create an instance of AzureLoginRequest from a dict"""
        if obj is None:
            return None

        if not isinstance(obj, dict):
            return cls.model_validate(obj)

        _obj = cls.model_validate({
            "jwt": obj.get("jwt"),
            "resource_group_name": obj.get("resource_group_name"),
            "resource_id": obj.get("resource_id"),
            "role": obj.get("role"),
            "subscription_id": obj.get("subscription_id"),
            "vm_name": obj.get("vm_name"),
            "vmss_name": obj.get("vmss_name")
        })
        return _obj


