# coding: utf-8

"""
    Instana REST API documentation

    Documentation for INSTANA REST API

    The version of the OpenAPI document: 1.309.1268
    Contact: support@instana.com
    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, StrictBool, StrictInt, StrictStr
from typing import Any, ClassVar, Dict, List, Optional
from typing import Optional, Set
from typing_extensions import Self

class ApiToken(BaseModel):
    """
    ApiToken
    """ # noqa: E501
    access_granting_token: StrictStr = Field(alias="accessGrantingToken")
    can_configure_agent_run_mode: Optional[StrictBool] = Field(default=None, alias="canConfigureAgentRunMode")
    can_configure_agents: Optional[StrictBool] = Field(default=None, alias="canConfigureAgents")
    can_configure_ai_agents: Optional[StrictBool] = Field(default=None, alias="canConfigureAiAgents")
    can_configure_apdex: Optional[StrictBool] = Field(default=None, alias="canConfigureApdex")
    can_configure_api_tokens: Optional[StrictBool] = Field(default=None, alias="canConfigureApiTokens")
    can_configure_application_smart_alerts: Optional[StrictBool] = Field(default=None, alias="canConfigureApplicationSmartAlerts")
    can_configure_applications: Optional[StrictBool] = Field(default=None, alias="canConfigureApplications")
    can_configure_authentication_methods: Optional[StrictBool] = Field(default=None, alias="canConfigureAuthenticationMethods")
    can_configure_automation_actions: Optional[StrictBool] = Field(default=None, alias="canConfigureAutomationActions")
    can_configure_automation_policies: Optional[StrictBool] = Field(default=None, alias="canConfigureAutomationPolicies")
    can_configure_bizops: Optional[StrictBool] = Field(default=None, alias="canConfigureBizops")
    can_configure_custom_entities: Optional[StrictBool] = Field(default=None, alias="canConfigureCustomEntities")
    can_configure_database_management: Optional[StrictBool] = Field(default=None, alias="canConfigureDatabaseManagement")
    can_configure_eum_applications: Optional[StrictBool] = Field(default=None, alias="canConfigureEumApplications")
    can_configure_events_and_alerts: Optional[StrictBool] = Field(default=None, alias="canConfigureEventsAndAlerts")
    can_configure_global_alert_payload: Optional[StrictBool] = Field(default=None, alias="canConfigureGlobalAlertPayload")
    can_configure_global_application_smart_alerts: Optional[StrictBool] = Field(default=None, alias="canConfigureGlobalApplicationSmartAlerts")
    can_configure_global_infra_smart_alerts: Optional[StrictBool] = Field(default=None, alias="canConfigureGlobalInfraSmartAlerts")
    can_configure_global_log_smart_alerts: Optional[StrictBool] = Field(default=None, alias="canConfigureGlobalLogSmartAlerts")
    can_configure_global_synthetic_smart_alerts: Optional[StrictBool] = Field(default=None, alias="canConfigureGlobalSyntheticSmartAlerts")
    can_configure_integrations: Optional[StrictBool] = Field(default=None, alias="canConfigureIntegrations")
    can_configure_llm: Optional[StrictBool] = Field(default=None, alias="canConfigureLLM")
    can_configure_log_management: Optional[StrictBool] = Field(default=None, alias="canConfigureLogManagement")
    can_configure_log_retention_period: Optional[StrictBool] = Field(default=None, alias="canConfigureLogRetentionPeriod")
    can_configure_maintenance_windows: Optional[StrictBool] = Field(default=None, alias="canConfigureMaintenanceWindows")
    can_configure_mobile_app_monitoring: Optional[StrictBool] = Field(default=None, alias="canConfigureMobileAppMonitoring")
    can_configure_mobile_app_smart_alerts: Optional[StrictBool] = Field(default=None, alias="canConfigureMobileAppSmartAlerts")
    can_configure_personal_api_tokens: Optional[StrictBool] = Field(default=None, alias="canConfigurePersonalApiTokens")
    can_configure_releases: Optional[StrictBool] = Field(default=None, alias="canConfigureReleases")
    can_configure_service_level_correction_windows: Optional[StrictBool] = Field(default=None, alias="canConfigureServiceLevelCorrectionWindows")
    can_configure_service_level_smart_alerts: Optional[StrictBool] = Field(default=None, alias="canConfigureServiceLevelSmartAlerts")
    can_configure_service_levels: Optional[StrictBool] = Field(default=None, alias="canConfigureServiceLevels")
    can_configure_service_mapping: Optional[StrictBool] = Field(default=None, alias="canConfigureServiceMapping")
    can_configure_session_settings: Optional[StrictBool] = Field(default=None, alias="canConfigureSessionSettings")
    can_configure_subtraces: Optional[StrictBool] = Field(default=None, alias="canConfigureSubtraces")
    can_configure_synthetic_credentials: Optional[StrictBool] = Field(default=None, alias="canConfigureSyntheticCredentials")
    can_configure_synthetic_locations: Optional[StrictBool] = Field(default=None, alias="canConfigureSyntheticLocations")
    can_configure_synthetic_tests: Optional[StrictBool] = Field(default=None, alias="canConfigureSyntheticTests")
    can_configure_teams: Optional[StrictBool] = Field(default=None, alias="canConfigureTeams")
    can_configure_users: Optional[StrictBool] = Field(default=None, alias="canConfigureUsers")
    can_configure_website_conversions: Optional[StrictBool] = Field(default=None, alias="canConfigureWebsiteConversions")
    can_configure_website_smart_alerts: Optional[StrictBool] = Field(default=None, alias="canConfigureWebsiteSmartAlerts")
    can_create_heap_dump: Optional[StrictBool] = Field(default=None, alias="canCreateHeapDump")
    can_create_public_custom_dashboards: Optional[StrictBool] = Field(default=None, alias="canCreatePublicCustomDashboards")
    can_create_thread_dump: Optional[StrictBool] = Field(default=None, alias="canCreateThreadDump")
    can_delete_automation_action_history: Optional[StrictBool] = Field(default=None, alias="canDeleteAutomationActionHistory")
    can_delete_logs: Optional[StrictBool] = Field(default=None, alias="canDeleteLogs")
    can_edit_all_accessible_custom_dashboards: Optional[StrictBool] = Field(default=None, alias="canEditAllAccessibleCustomDashboards")
    can_install_new_agents: Optional[StrictBool] = Field(default=None, alias="canInstallNewAgents")
    can_invoke_alert_channel: Optional[StrictBool] = Field(default=None, alias="canInvokeAlertChannel")
    can_manually_close_issue: Optional[StrictBool] = Field(default=None, alias="canManuallyCloseIssue")
    can_run_automation_actions: Optional[StrictBool] = Field(default=None, alias="canRunAutomationActions")
    can_use_synthetic_credentials: Optional[StrictBool] = Field(default=None, alias="canUseSyntheticCredentials")
    can_view_account_and_billing_information: Optional[StrictBool] = Field(default=None, alias="canViewAccountAndBillingInformation")
    can_view_audit_log: Optional[StrictBool] = Field(default=None, alias="canViewAuditLog")
    can_view_biz_alerts: Optional[StrictBool] = Field(default=None, alias="canViewBizAlerts")
    can_view_business_activities: Optional[StrictBool] = Field(default=None, alias="canViewBusinessActivities")
    can_view_business_process_details: Optional[StrictBool] = Field(default=None, alias="canViewBusinessProcessDetails")
    can_view_business_processes: Optional[StrictBool] = Field(default=None, alias="canViewBusinessProcesses")
    can_view_log_volume: Optional[StrictBool] = Field(default=None, alias="canViewLogVolume")
    can_view_logs: Optional[StrictBool] = Field(default=None, alias="canViewLogs")
    can_view_synthetic_locations: Optional[StrictBool] = Field(default=None, alias="canViewSyntheticLocations")
    can_view_synthetic_test_results: Optional[StrictBool] = Field(default=None, alias="canViewSyntheticTestResults")
    can_view_synthetic_tests: Optional[StrictBool] = Field(default=None, alias="canViewSyntheticTests")
    can_view_trace_details: Optional[StrictBool] = Field(default=None, alias="canViewTraceDetails")
    created_by: Optional[StrictStr] = Field(default=None, alias="createdBy")
    created_on: Optional[StrictInt] = Field(default=None, alias="createdOn")
    expires_on: Optional[StrictInt] = Field(default=None, alias="expiresOn")
    id: Optional[StrictStr] = None
    internal_id: StrictStr = Field(alias="internalId")
    last_used_on: Optional[StrictInt] = Field(default=None, alias="lastUsedOn")
    limited_ai_gateway_scope: Optional[StrictBool] = Field(default=None, alias="limitedAiGatewayScope")
    limited_alert_channels_scope: Optional[StrictBool] = Field(default=None, alias="limitedAlertChannelsScope")
    limited_applications_scope: Optional[StrictBool] = Field(default=None, alias="limitedApplicationsScope")
    limited_automation_scope: Optional[StrictBool] = Field(default=None, alias="limitedAutomationScope")
    limited_biz_ops_scope: Optional[StrictBool] = Field(default=None, alias="limitedBizOpsScope")
    limited_gen_ai_scope: Optional[StrictBool] = Field(default=None, alias="limitedGenAIScope")
    limited_infrastructure_scope: Optional[StrictBool] = Field(default=None, alias="limitedInfrastructureScope")
    limited_kubernetes_scope: Optional[StrictBool] = Field(default=None, alias="limitedKubernetesScope")
    limited_linux_kvm_hypervisor_scope: Optional[StrictBool] = Field(default=None, alias="limitedLinuxKVMHypervisorScope")
    limited_logs_scope: Optional[StrictBool] = Field(default=None, alias="limitedLogsScope")
    limited_mobile_apps_scope: Optional[StrictBool] = Field(default=None, alias="limitedMobileAppsScope")
    limited_nutanix_scope: Optional[StrictBool] = Field(default=None, alias="limitedNutanixScope")
    limited_openstack_scope: Optional[StrictBool] = Field(default=None, alias="limitedOpenstackScope")
    limited_pcf_scope: Optional[StrictBool] = Field(default=None, alias="limitedPcfScope")
    limited_phmc_scope: Optional[StrictBool] = Field(default=None, alias="limitedPhmcScope")
    limited_pvc_scope: Optional[StrictBool] = Field(default=None, alias="limitedPvcScope")
    limited_sap_scope: Optional[StrictBool] = Field(default=None, alias="limitedSAPScope")
    limited_service_level_scope: Optional[StrictBool] = Field(default=None, alias="limitedServiceLevelScope")
    limited_synthetics_scope: Optional[StrictBool] = Field(default=None, alias="limitedSyntheticsScope")
    limited_vsphere_scope: Optional[StrictBool] = Field(default=None, alias="limitedVsphereScope")
    limited_websites_scope: Optional[StrictBool] = Field(default=None, alias="limitedWebsitesScope")
    limited_windows_hypervisor_scope: Optional[StrictBool] = Field(default=None, alias="limitedWindowsHypervisorScope")
    limited_xen_server_scope: Optional[StrictBool] = Field(default=None, alias="limitedXenServerScope")
    limited_zhmc_scope: Optional[StrictBool] = Field(default=None, alias="limitedZhmcScope")
    name: StrictStr
    __properties: ClassVar[List[str]] = ["accessGrantingToken", "canConfigureAgentRunMode", "canConfigureAgents", "canConfigureAiAgents", "canConfigureApdex", "canConfigureApiTokens", "canConfigureApplicationSmartAlerts", "canConfigureApplications", "canConfigureAuthenticationMethods", "canConfigureAutomationActions", "canConfigureAutomationPolicies", "canConfigureBizops", "canConfigureCustomEntities", "canConfigureDatabaseManagement", "canConfigureEumApplications", "canConfigureEventsAndAlerts", "canConfigureGlobalAlertPayload", "canConfigureGlobalApplicationSmartAlerts", "canConfigureGlobalInfraSmartAlerts", "canConfigureGlobalLogSmartAlerts", "canConfigureGlobalSyntheticSmartAlerts", "canConfigureIntegrations", "canConfigureLLM", "canConfigureLogManagement", "canConfigureLogRetentionPeriod", "canConfigureMaintenanceWindows", "canConfigureMobileAppMonitoring", "canConfigureMobileAppSmartAlerts", "canConfigurePersonalApiTokens", "canConfigureReleases", "canConfigureServiceLevelCorrectionWindows", "canConfigureServiceLevelSmartAlerts", "canConfigureServiceLevels", "canConfigureServiceMapping", "canConfigureSessionSettings", "canConfigureSubtraces", "canConfigureSyntheticCredentials", "canConfigureSyntheticLocations", "canConfigureSyntheticTests", "canConfigureTeams", "canConfigureUsers", "canConfigureWebsiteConversions", "canConfigureWebsiteSmartAlerts", "canCreateHeapDump", "canCreatePublicCustomDashboards", "canCreateThreadDump", "canDeleteAutomationActionHistory", "canDeleteLogs", "canEditAllAccessibleCustomDashboards", "canInstallNewAgents", "canInvokeAlertChannel", "canManuallyCloseIssue", "canRunAutomationActions", "canUseSyntheticCredentials", "canViewAccountAndBillingInformation", "canViewAuditLog", "canViewBizAlerts", "canViewBusinessActivities", "canViewBusinessProcessDetails", "canViewBusinessProcesses", "canViewLogVolume", "canViewLogs", "canViewSyntheticLocations", "canViewSyntheticTestResults", "canViewSyntheticTests", "canViewTraceDetails", "createdBy", "createdOn", "expiresOn", "id", "internalId", "lastUsedOn", "limitedAiGatewayScope", "limitedAlertChannelsScope", "limitedApplicationsScope", "limitedAutomationScope", "limitedBizOpsScope", "limitedGenAIScope", "limitedInfrastructureScope", "limitedKubernetesScope", "limitedLinuxKVMHypervisorScope", "limitedLogsScope", "limitedMobileAppsScope", "limitedNutanixScope", "limitedOpenstackScope", "limitedPcfScope", "limitedPhmcScope", "limitedPvcScope", "limitedSAPScope", "limitedServiceLevelScope", "limitedSyntheticsScope", "limitedVsphereScope", "limitedWebsitesScope", "limitedWindowsHypervisorScope", "limitedXenServerScope", "limitedZhmcScope", "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 ApiToken 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 ApiToken from a dict"""
        if obj is None:
            return None

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

        _obj = cls.model_validate({
            "accessGrantingToken": obj.get("accessGrantingToken"),
            "canConfigureAgentRunMode": obj.get("canConfigureAgentRunMode"),
            "canConfigureAgents": obj.get("canConfigureAgents"),
            "canConfigureAiAgents": obj.get("canConfigureAiAgents"),
            "canConfigureApdex": obj.get("canConfigureApdex"),
            "canConfigureApiTokens": obj.get("canConfigureApiTokens"),
            "canConfigureApplicationSmartAlerts": obj.get("canConfigureApplicationSmartAlerts"),
            "canConfigureApplications": obj.get("canConfigureApplications"),
            "canConfigureAuthenticationMethods": obj.get("canConfigureAuthenticationMethods"),
            "canConfigureAutomationActions": obj.get("canConfigureAutomationActions"),
            "canConfigureAutomationPolicies": obj.get("canConfigureAutomationPolicies"),
            "canConfigureBizops": obj.get("canConfigureBizops"),
            "canConfigureCustomEntities": obj.get("canConfigureCustomEntities"),
            "canConfigureDatabaseManagement": obj.get("canConfigureDatabaseManagement"),
            "canConfigureEumApplications": obj.get("canConfigureEumApplications"),
            "canConfigureEventsAndAlerts": obj.get("canConfigureEventsAndAlerts"),
            "canConfigureGlobalAlertPayload": obj.get("canConfigureGlobalAlertPayload"),
            "canConfigureGlobalApplicationSmartAlerts": obj.get("canConfigureGlobalApplicationSmartAlerts"),
            "canConfigureGlobalInfraSmartAlerts": obj.get("canConfigureGlobalInfraSmartAlerts"),
            "canConfigureGlobalLogSmartAlerts": obj.get("canConfigureGlobalLogSmartAlerts"),
            "canConfigureGlobalSyntheticSmartAlerts": obj.get("canConfigureGlobalSyntheticSmartAlerts"),
            "canConfigureIntegrations": obj.get("canConfigureIntegrations"),
            "canConfigureLLM": obj.get("canConfigureLLM"),
            "canConfigureLogManagement": obj.get("canConfigureLogManagement"),
            "canConfigureLogRetentionPeriod": obj.get("canConfigureLogRetentionPeriod"),
            "canConfigureMaintenanceWindows": obj.get("canConfigureMaintenanceWindows"),
            "canConfigureMobileAppMonitoring": obj.get("canConfigureMobileAppMonitoring"),
            "canConfigureMobileAppSmartAlerts": obj.get("canConfigureMobileAppSmartAlerts"),
            "canConfigurePersonalApiTokens": obj.get("canConfigurePersonalApiTokens"),
            "canConfigureReleases": obj.get("canConfigureReleases"),
            "canConfigureServiceLevelCorrectionWindows": obj.get("canConfigureServiceLevelCorrectionWindows"),
            "canConfigureServiceLevelSmartAlerts": obj.get("canConfigureServiceLevelSmartAlerts"),
            "canConfigureServiceLevels": obj.get("canConfigureServiceLevels"),
            "canConfigureServiceMapping": obj.get("canConfigureServiceMapping"),
            "canConfigureSessionSettings": obj.get("canConfigureSessionSettings"),
            "canConfigureSubtraces": obj.get("canConfigureSubtraces"),
            "canConfigureSyntheticCredentials": obj.get("canConfigureSyntheticCredentials"),
            "canConfigureSyntheticLocations": obj.get("canConfigureSyntheticLocations"),
            "canConfigureSyntheticTests": obj.get("canConfigureSyntheticTests"),
            "canConfigureTeams": obj.get("canConfigureTeams"),
            "canConfigureUsers": obj.get("canConfigureUsers"),
            "canConfigureWebsiteConversions": obj.get("canConfigureWebsiteConversions"),
            "canConfigureWebsiteSmartAlerts": obj.get("canConfigureWebsiteSmartAlerts"),
            "canCreateHeapDump": obj.get("canCreateHeapDump"),
            "canCreatePublicCustomDashboards": obj.get("canCreatePublicCustomDashboards"),
            "canCreateThreadDump": obj.get("canCreateThreadDump"),
            "canDeleteAutomationActionHistory": obj.get("canDeleteAutomationActionHistory"),
            "canDeleteLogs": obj.get("canDeleteLogs"),
            "canEditAllAccessibleCustomDashboards": obj.get("canEditAllAccessibleCustomDashboards"),
            "canInstallNewAgents": obj.get("canInstallNewAgents"),
            "canInvokeAlertChannel": obj.get("canInvokeAlertChannel"),
            "canManuallyCloseIssue": obj.get("canManuallyCloseIssue"),
            "canRunAutomationActions": obj.get("canRunAutomationActions"),
            "canUseSyntheticCredentials": obj.get("canUseSyntheticCredentials"),
            "canViewAccountAndBillingInformation": obj.get("canViewAccountAndBillingInformation"),
            "canViewAuditLog": obj.get("canViewAuditLog"),
            "canViewBizAlerts": obj.get("canViewBizAlerts"),
            "canViewBusinessActivities": obj.get("canViewBusinessActivities"),
            "canViewBusinessProcessDetails": obj.get("canViewBusinessProcessDetails"),
            "canViewBusinessProcesses": obj.get("canViewBusinessProcesses"),
            "canViewLogVolume": obj.get("canViewLogVolume"),
            "canViewLogs": obj.get("canViewLogs"),
            "canViewSyntheticLocations": obj.get("canViewSyntheticLocations"),
            "canViewSyntheticTestResults": obj.get("canViewSyntheticTestResults"),
            "canViewSyntheticTests": obj.get("canViewSyntheticTests"),
            "canViewTraceDetails": obj.get("canViewTraceDetails"),
            "createdBy": obj.get("createdBy"),
            "createdOn": obj.get("createdOn"),
            "expiresOn": obj.get("expiresOn"),
            "id": obj.get("id"),
            "internalId": obj.get("internalId"),
            "lastUsedOn": obj.get("lastUsedOn"),
            "limitedAiGatewayScope": obj.get("limitedAiGatewayScope"),
            "limitedAlertChannelsScope": obj.get("limitedAlertChannelsScope"),
            "limitedApplicationsScope": obj.get("limitedApplicationsScope"),
            "limitedAutomationScope": obj.get("limitedAutomationScope"),
            "limitedBizOpsScope": obj.get("limitedBizOpsScope"),
            "limitedGenAIScope": obj.get("limitedGenAIScope"),
            "limitedInfrastructureScope": obj.get("limitedInfrastructureScope"),
            "limitedKubernetesScope": obj.get("limitedKubernetesScope"),
            "limitedLinuxKVMHypervisorScope": obj.get("limitedLinuxKVMHypervisorScope"),
            "limitedLogsScope": obj.get("limitedLogsScope"),
            "limitedMobileAppsScope": obj.get("limitedMobileAppsScope"),
            "limitedNutanixScope": obj.get("limitedNutanixScope"),
            "limitedOpenstackScope": obj.get("limitedOpenstackScope"),
            "limitedPcfScope": obj.get("limitedPcfScope"),
            "limitedPhmcScope": obj.get("limitedPhmcScope"),
            "limitedPvcScope": obj.get("limitedPvcScope"),
            "limitedSAPScope": obj.get("limitedSAPScope"),
            "limitedServiceLevelScope": obj.get("limitedServiceLevelScope"),
            "limitedSyntheticsScope": obj.get("limitedSyntheticsScope"),
            "limitedVsphereScope": obj.get("limitedVsphereScope"),
            "limitedWebsitesScope": obj.get("limitedWebsitesScope"),
            "limitedWindowsHypervisorScope": obj.get("limitedWindowsHypervisorScope"),
            "limitedXenServerScope": obj.get("limitedXenServerScope"),
            "limitedZhmcScope": obj.get("limitedZhmcScope"),
            "name": obj.get("name")
        })
        return _obj


