"""ActionBatchOrganizations API endpoints.

This file is automatically @generated from the Meraki API specification.
Do not edit this file manually.

"""

import urllib.parse
from typing import Any

from meraki_client.schemas import (
    BulkUpdateOrganizationDevicesDetailsDetailsItem,
    ClaimOrganizationInventoryOrdersSubscriptionsItem,
    CreateOrganizationActionBatchActionsItem,
    CreateOrganizationAdaptivePolicyAclRulesItem,
    CreateOrganizationAdaptivePolicyGroupPolicyObjectsItem,
    CreateOrganizationAdaptivePolicyPolicyAclsItem,
    CreateOrganizationAdaptivePolicyPolicyDestinationGroup,
    CreateOrganizationAdaptivePolicyPolicySourceGroup,
    CreateOrganizationAlertsProfileAlertCondition,
    CreateOrganizationAlertsProfileRecipients,
    CreateOrganizationBrandingPolicyAdminSettings,
    CreateOrganizationBrandingPolicyCustomLogo,
    CreateOrganizationBrandingPolicyHelpSettings,
    CreateOrganizationDevicesPacketCaptureScheduleDevicesItem,
    CreateOrganizationDevicesPacketCaptureScheduleSchedule,
    DisableOrganizationIntegrationsXdrNetworksNetworksItem,
    EnableOrganizationIntegrationsXdrNetworksNetworksItem,
    ReorderOrganizationDevicesPacketCaptureSchedulesOrderItem,
    UpdateOrganizationAdaptivePolicyAclRulesItem,
    UpdateOrganizationAdaptivePolicyGroupPolicyObjectsItem,
    UpdateOrganizationAdaptivePolicyPolicyAclsItem,
    UpdateOrganizationAdaptivePolicyPolicyDestinationGroup,
    UpdateOrganizationAdaptivePolicyPolicySourceGroup,
    UpdateOrganizationAlertsProfileAlertCondition,
    UpdateOrganizationAlertsProfileRecipients,
    UpdateOrganizationBrandingPolicyAdminSettings,
    UpdateOrganizationBrandingPolicyCustomLogo,
    UpdateOrganizationBrandingPolicyHelpSettings,
    UpdateOrganizationDevicesPacketCaptureScheduleDevicesItem,
    UpdateOrganizationDevicesPacketCaptureScheduleSchedule,
    UpdateOrganizationLoginSecurityApiAuthentication,
)
from meraki_client.types import (
    CreateOrganizationAdaptivePolicyAclIpVersion,
    CreateOrganizationAdaptivePolicyPolicyLastEntryRule,
    CreateOrganizationAlertsProfileType,
    CreateOrganizationDevicesControllerMigrationTarget,
    CreateOrganizationNetworkProductTypes,
    UpdateOrganizationAdaptivePolicyAclIpVersion,
    UpdateOrganizationAdaptivePolicyPolicyLastEntryRule,
    UpdateOrganizationAlertsProfileType,
)


class ActionBatchOrganizations:
    """ActionBatchOrganizations class."""

    def __init__(self) -> None:
        pass

    def create_organization_adaptive_policy_acl(
        self,
        *,
        organization_id: str,
        name: str,
        rules: list[CreateOrganizationAdaptivePolicyAclRulesItem],
        ip_version: CreateOrganizationAdaptivePolicyAclIpVersion,
        description: str | None = None,
    ) -> CreateOrganizationActionBatchActionsItem:
        """Creates new adaptive policy ACL.

        [API documentation: createOrganizationAdaptivePolicyAcl](https://developer.cisco.com/meraki/api-v1/#!create-organization-adaptive-policy-acl)

        Args:
            organization_id: Organization ID.
            name: Name of the adaptive policy ACL.
            description: Description of the adaptive policy ACL.
            rules: An ordered array of the adaptive policy ACL rules.
            ip_version: IP version of adpative policy ACL. One of: 'any', 'ipv4' or 'ipv6'.

        """
        organization_id = urllib.parse.quote(str(organization_id), safe="")
        path = f"/organizations/{organization_id}/adaptivePolicy/acls"

        payload: dict[str, Any] = {}
        if name is not None:
            payload["name"] = name
        if description is not None:
            payload["description"] = description
        if rules is not None:
            payload["rules"] = [item.model_dump(by_alias=True, exclude_none=True) for item in rules]
        if ip_version is not None:
            payload["ipVersion"] = ip_version

        return CreateOrganizationActionBatchActionsItem(
            resource=path,
            operation="create",
            body=payload,
        )

    def update_organization_adaptive_policy_acl(
        self,
        *,
        organization_id: str,
        acl_id: str,
        name: str | None = None,
        description: str | None = None,
        rules: list[UpdateOrganizationAdaptivePolicyAclRulesItem] | None = None,
        ip_version: UpdateOrganizationAdaptivePolicyAclIpVersion | None = None,
    ) -> CreateOrganizationActionBatchActionsItem:
        """Updates an adaptive policy ACL.

        [API documentation: updateOrganizationAdaptivePolicyAcl](https://developer.cisco.com/meraki/api-v1/#!update-organization-adaptive-policy-acl)

        Args:
            organization_id: Organization ID.
            acl_id: Acl ID.
            name: Name of the adaptive policy ACL.
            description: Description of the adaptive policy ACL.
            rules: An ordered array of the adaptive policy ACL rules. An empty array will clear the
                rules.
            ip_version: IP version of adpative policy ACL. One of: 'any', 'ipv4' or 'ipv6'.

        """
        organization_id = urllib.parse.quote(str(organization_id), safe="")
        acl_id = urllib.parse.quote(str(acl_id), safe="")
        path = f"/organizations/{organization_id}/adaptivePolicy/acls/{acl_id}"

        payload: dict[str, Any] = {}
        if name is not None:
            payload["name"] = name
        if description is not None:
            payload["description"] = description
        if rules is not None:
            payload["rules"] = [item.model_dump(by_alias=True, exclude_none=True) for item in rules]
        if ip_version is not None:
            payload["ipVersion"] = ip_version

        return CreateOrganizationActionBatchActionsItem(
            resource=path,
            operation="update",
            body=payload,
        )

    def delete_organization_adaptive_policy_acl(
        self, *, organization_id: str, acl_id: str
    ) -> CreateOrganizationActionBatchActionsItem:
        """Deletes the specified adaptive policy ACL.

        [API documentation: deleteOrganizationAdaptivePolicyAcl](https://developer.cisco.com/meraki/api-v1/#!delete-organization-adaptive-policy-acl)

        Args:
            organization_id: Organization ID.
            acl_id: Acl ID.

        """
        organization_id = urllib.parse.quote(str(organization_id), safe="")
        acl_id = urllib.parse.quote(str(acl_id), safe="")
        path = f"/organizations/{organization_id}/adaptivePolicy/acls/{acl_id}"

        return CreateOrganizationActionBatchActionsItem(
            resource=path,
            operation="destroy",
        )

    def create_organization_adaptive_policy_group(
        self,
        *,
        organization_id: str,
        name: str,
        sgt: int,
        description: str | None = None,
        policy_objects: list[CreateOrganizationAdaptivePolicyGroupPolicyObjectsItem] | None = None,
    ) -> CreateOrganizationActionBatchActionsItem:
        """Creates a new adaptive policy group.

        [API documentation: createOrganizationAdaptivePolicyGroup](https://developer.cisco.com/meraki/api-v1/#!create-organization-adaptive-policy-group)

        Args:
            organization_id: Organization ID.
            name: Name of the group.
            sgt: SGT value of the group.
            description: Description of the group (default: "").
            policy_objects: The policy objects that belong to this group; traffic from addresses
                specified by these policy objects will be tagged with this group's SGT
                value if no other tagging scheme is being used (each requires one unique
                attribute) (default: []).

        """
        organization_id = urllib.parse.quote(str(organization_id), safe="")
        path = f"/organizations/{organization_id}/adaptivePolicy/groups"

        payload: dict[str, Any] = {}
        if name is not None:
            payload["name"] = name
        if sgt is not None:
            payload["sgt"] = sgt
        if description is not None:
            payload["description"] = description
        if policy_objects is not None:
            payload["policyObjects"] = [
                item.model_dump(by_alias=True, exclude_none=True) for item in policy_objects
            ]

        return CreateOrganizationActionBatchActionsItem(
            resource=path,
            operation="create",
            body=payload,
        )

    def update_organization_adaptive_policy_group(
        self,
        *,
        organization_id: str,
        id: str,
        name: str | None = None,
        sgt: int | None = None,
        description: str | None = None,
        policy_objects: list[UpdateOrganizationAdaptivePolicyGroupPolicyObjectsItem] | None = None,
    ) -> CreateOrganizationActionBatchActionsItem:
        """Updates an adaptive policy group.

        [API documentation: updateOrganizationAdaptivePolicyGroup](https://developer.cisco.com/meraki/api-v1/#!update-organization-adaptive-policy-group)

        Args:
            organization_id: Organization ID.
            id: ID.
            name: Name of the group.
            sgt: SGT value of the group.
            description: Description of the group.
            policy_objects: The policy objects that belong to this group; traffic from addresses
                specified by these policy objects will be tagged with this group's SGT
                value if no other tagging scheme is being used (each requires one unique
                attribute).

        """
        organization_id = urllib.parse.quote(str(organization_id), safe="")
        id = urllib.parse.quote(str(id), safe="")
        path = f"/organizations/{organization_id}/adaptivePolicy/groups/{id}"

        payload: dict[str, Any] = {}
        if name is not None:
            payload["name"] = name
        if sgt is not None:
            payload["sgt"] = sgt
        if description is not None:
            payload["description"] = description
        if policy_objects is not None:
            payload["policyObjects"] = [
                item.model_dump(by_alias=True, exclude_none=True) for item in policy_objects
            ]

        return CreateOrganizationActionBatchActionsItem(
            resource=path,
            operation="update",
            body=payload,
        )

    def delete_organization_adaptive_policy_group(
        self, *, organization_id: str, id: str
    ) -> CreateOrganizationActionBatchActionsItem:
        """Deletes the specified adaptive policy group and any associated policies and references.

        [API documentation: deleteOrganizationAdaptivePolicyGroup](https://developer.cisco.com/meraki/api-v1/#!delete-organization-adaptive-policy-group)

        Args:
            organization_id: Organization ID.
            id: ID.

        """
        organization_id = urllib.parse.quote(str(organization_id), safe="")
        id = urllib.parse.quote(str(id), safe="")
        path = f"/organizations/{organization_id}/adaptivePolicy/groups/{id}"

        return CreateOrganizationActionBatchActionsItem(
            resource=path,
            operation="destroy",
        )

    def create_organization_adaptive_policy_policy(
        self,
        *,
        organization_id: str,
        source_group: CreateOrganizationAdaptivePolicyPolicySourceGroup,
        destination_group: CreateOrganizationAdaptivePolicyPolicyDestinationGroup,
        acls: list[CreateOrganizationAdaptivePolicyPolicyAclsItem] | None = None,
        last_entry_rule: CreateOrganizationAdaptivePolicyPolicyLastEntryRule | None = None,
    ) -> CreateOrganizationActionBatchActionsItem:
        """Add an Adaptive Policy.

        [API documentation: createOrganizationAdaptivePolicyPolicy](https://developer.cisco.com/meraki/api-v1/#!create-organization-adaptive-policy-policy)

        Args:
            organization_id: Organization ID.
            source_group: The source adaptive policy group (requires one unique attribute).
            destination_group: The destination adaptive policy group (requires one unique
                attribute).
            acls: An ordered array of adaptive policy ACLs (each requires one unique attribute) that
                apply to this policy (default: []).
            last_entry_rule: The rule to apply if there is no matching ACL (default: "default").

        """
        organization_id = urllib.parse.quote(str(organization_id), safe="")
        path = f"/organizations/{organization_id}/adaptivePolicy/policies"

        payload: dict[str, Any] = {}
        if source_group is not None:
            payload["sourceGroup"] = source_group.model_dump(by_alias=True, exclude_none=True)
        if destination_group is not None:
            payload["destinationGroup"] = destination_group.model_dump(
                by_alias=True, exclude_none=True
            )
        if acls is not None:
            payload["acls"] = [item.model_dump(by_alias=True, exclude_none=True) for item in acls]
        if last_entry_rule is not None:
            payload["lastEntryRule"] = last_entry_rule

        return CreateOrganizationActionBatchActionsItem(
            resource=path,
            operation="create",
            body=payload,
        )

    def update_organization_adaptive_policy_policy(
        self,
        *,
        organization_id: str,
        id: str,
        source_group: UpdateOrganizationAdaptivePolicyPolicySourceGroup | None = None,
        destination_group: UpdateOrganizationAdaptivePolicyPolicyDestinationGroup | None = None,
        acls: list[UpdateOrganizationAdaptivePolicyPolicyAclsItem] | None = None,
        last_entry_rule: UpdateOrganizationAdaptivePolicyPolicyLastEntryRule | None = None,
    ) -> CreateOrganizationActionBatchActionsItem:
        """Update an Adaptive Policy.

        [API documentation: updateOrganizationAdaptivePolicyPolicy](https://developer.cisco.com/meraki/api-v1/#!update-organization-adaptive-policy-policy)

        Args:
            organization_id: Organization ID.
            id: ID.
            source_group: The source adaptive policy group (requires one unique attribute).
            destination_group: The destination adaptive policy group (requires one unique
                attribute).
            acls: An ordered array of adaptive policy ACLs (each requires one unique attribute) that
                apply to this policy.
            last_entry_rule: The rule to apply if there is no matching ACL.

        """
        organization_id = urllib.parse.quote(str(organization_id), safe="")
        id = urllib.parse.quote(str(id), safe="")
        path = f"/organizations/{organization_id}/adaptivePolicy/policies/{id}"

        payload: dict[str, Any] = {}
        if source_group is not None:
            payload["sourceGroup"] = source_group.model_dump(by_alias=True, exclude_none=True)
        if destination_group is not None:
            payload["destinationGroup"] = destination_group.model_dump(
                by_alias=True, exclude_none=True
            )
        if acls is not None:
            payload["acls"] = [item.model_dump(by_alias=True, exclude_none=True) for item in acls]
        if last_entry_rule is not None:
            payload["lastEntryRule"] = last_entry_rule

        return CreateOrganizationActionBatchActionsItem(
            resource=path,
            operation="update",
            body=payload,
        )

    def delete_organization_adaptive_policy_policy(
        self, *, organization_id: str, id: str
    ) -> CreateOrganizationActionBatchActionsItem:
        """Delete an Adaptive Policy.

        [API documentation: deleteOrganizationAdaptivePolicyPolicy](https://developer.cisco.com/meraki/api-v1/#!delete-organization-adaptive-policy-policy)

        Args:
            organization_id: Organization ID.
            id: ID.

        """
        organization_id = urllib.parse.quote(str(organization_id), safe="")
        id = urllib.parse.quote(str(id), safe="")
        path = f"/organizations/{organization_id}/adaptivePolicy/policies/{id}"

        return CreateOrganizationActionBatchActionsItem(
            resource=path,
            operation="destroy",
        )

    def update_organization_adaptive_policy_settings(
        self, organization_id: str, *, enabled_networks: list[str] | None = None
    ) -> CreateOrganizationActionBatchActionsItem:
        """Update global adaptive policy settings.

        [API documentation: updateOrganizationAdaptivePolicySettings](https://developer.cisco.com/meraki/api-v1/#!update-organization-adaptive-policy-settings)

        Args:
            organization_id: Organization ID.
            enabled_networks: List of network IDs with adaptive policy enabled.

        """
        organization_id = urllib.parse.quote(str(organization_id), safe="")
        path = f"/organizations/{organization_id}/adaptivePolicy/settings"

        payload: dict[str, Any] = {}
        if enabled_networks is not None:
            payload["enabledNetworks"] = enabled_networks

        return CreateOrganizationActionBatchActionsItem(
            resource=path,
            operation="update",
            body=payload,
        )

    def create_organization_alerts_profile(
        self,
        *,
        organization_id: str,
        type_: CreateOrganizationAlertsProfileType,
        alert_condition: CreateOrganizationAlertsProfileAlertCondition,
        recipients: CreateOrganizationAlertsProfileRecipients,
        network_tags: list[str],
        description: str | None = None,
    ) -> CreateOrganizationActionBatchActionsItem:
        """Create an organization-wide alert configuration.

        [API documentation: createOrganizationAlertsProfile](https://developer.cisco.com/meraki/api-v1/#!create-organization-alerts-profile)

        Args:
            organization_id: Organization ID.
            type_: The alert type.
            alert_condition: The conditions that determine if the alert triggers.
            recipients: List of recipients that will recieve the alert.
            network_tags: Networks with these tags will be monitored for the alert.
            description: User supplied description of the alert.

        """
        organization_id = urllib.parse.quote(str(organization_id), safe="")
        path = f"/organizations/{organization_id}/alerts/profiles"

        payload: dict[str, Any] = {}
        if type_ is not None:
            payload["type"] = type_
        if alert_condition is not None:
            payload["alertCondition"] = alert_condition.model_dump(by_alias=True, exclude_none=True)
        if recipients is not None:
            payload["recipients"] = recipients.model_dump(by_alias=True, exclude_none=True)
        if network_tags is not None:
            payload["networkTags"] = network_tags
        if description is not None:
            payload["description"] = description

        return CreateOrganizationActionBatchActionsItem(
            resource=path,
            operation="create",
            body=payload,
        )

    def update_organization_alerts_profile(
        self,
        *,
        organization_id: str,
        alert_config_id: str,
        enabled: bool | None = None,
        type_: UpdateOrganizationAlertsProfileType | None = None,
        alert_condition: UpdateOrganizationAlertsProfileAlertCondition | None = None,
        recipients: UpdateOrganizationAlertsProfileRecipients | None = None,
        network_tags: list[str] | None = None,
        description: str | None = None,
    ) -> CreateOrganizationActionBatchActionsItem:
        """Update an organization-wide alert config.

        [API documentation: updateOrganizationAlertsProfile](https://developer.cisco.com/meraki/api-v1/#!update-organization-alerts-profile)

        Args:
            organization_id: Organization ID.
            alert_config_id: Alert config ID.
            enabled: Is the alert config enabled.
            type_: The alert type.
            alert_condition: The conditions that determine if the alert triggers.
            recipients: List of recipients that will recieve the alert.
            network_tags: Networks with these tags will be monitored for the alert.
            description: User supplied description of the alert.

        """
        organization_id = urllib.parse.quote(str(organization_id), safe="")
        alert_config_id = urllib.parse.quote(str(alert_config_id), safe="")
        path = f"/organizations/{organization_id}/alerts/profiles/{alert_config_id}"

        payload: dict[str, Any] = {}
        if enabled is not None:
            payload["enabled"] = enabled
        if type_ is not None:
            payload["type"] = type_
        if alert_condition is not None:
            payload["alertCondition"] = alert_condition.model_dump(by_alias=True, exclude_none=True)
        if recipients is not None:
            payload["recipients"] = recipients.model_dump(by_alias=True, exclude_none=True)
        if network_tags is not None:
            payload["networkTags"] = network_tags
        if description is not None:
            payload["description"] = description

        return CreateOrganizationActionBatchActionsItem(
            resource=path,
            operation="update",
            body=payload,
        )

    def delete_organization_alerts_profile(
        self, *, organization_id: str, alert_config_id: str
    ) -> CreateOrganizationActionBatchActionsItem:
        """Removes an organization-wide alert config.

        [API documentation: deleteOrganizationAlertsProfile](https://developer.cisco.com/meraki/api-v1/#!delete-organization-alerts-profile)

        Args:
            organization_id: Organization ID.
            alert_config_id: Alert config ID.

        """
        organization_id = urllib.parse.quote(str(organization_id), safe="")
        alert_config_id = urllib.parse.quote(str(alert_config_id), safe="")
        path = f"/organizations/{organization_id}/alerts/profiles/{alert_config_id}"

        return CreateOrganizationActionBatchActionsItem(
            resource=path,
            operation="destroy",
        )

    def create_organization_branding_policy(
        self,
        *,
        organization_id: str,
        name: str,
        enabled: bool | None = None,
        admin_settings: CreateOrganizationBrandingPolicyAdminSettings | None = None,
        help_settings: CreateOrganizationBrandingPolicyHelpSettings | None = None,
        custom_logo: CreateOrganizationBrandingPolicyCustomLogo | None = None,
    ) -> CreateOrganizationActionBatchActionsItem:
        """Add a new branding policy to an organization.

        [API documentation: createOrganizationBrandingPolicy](https://developer.cisco.com/meraki/api-v1/#!create-organization-branding-policy)

        Args:
            organization_id: Organization ID.
            name: Name of the Dashboard branding policy.
            enabled: Boolean indicating whether this policy is enabled.
            admin_settings: Settings for describing which kinds of admins this policy applies to.
            help_settings: Settings for describing the modifications to various Help page features.
                Each property in this object accepts one of 'default or inherit' (do not
                modify functionality), 'hide' (remove the section from Dashboard), or
                'show' (always show the section on Dashboard). Some properties in this
                object also accept custom HTML used to replace the section on Dashboard;
                see the documentation for each property to see the allowed values. Each
                property defaults to 'default or inherit' when not provided.
            custom_logo: Properties describing the custom logo attached to the branding policy.

        """
        organization_id = urllib.parse.quote(str(organization_id), safe="")
        path = f"/organizations/{organization_id}/brandingPolicies"

        payload: dict[str, Any] = {}
        if name is not None:
            payload["name"] = name
        if enabled is not None:
            payload["enabled"] = enabled
        if admin_settings is not None:
            payload["adminSettings"] = admin_settings.model_dump(by_alias=True, exclude_none=True)
        if help_settings is not None:
            payload["helpSettings"] = help_settings.model_dump(by_alias=True, exclude_none=True)
        if custom_logo is not None:
            payload["customLogo"] = custom_logo.model_dump(by_alias=True, exclude_none=True)

        return CreateOrganizationActionBatchActionsItem(
            resource=path,
            operation="create",
            body=payload,
        )

    def update_organization_branding_policies_priorities(
        self, organization_id: str, *, branding_policy_ids: list[str] | None = None
    ) -> CreateOrganizationActionBatchActionsItem:
        """Update the priority ordering of an organization's branding policies.

        [API documentation: updateOrganizationBrandingPoliciesPriorities](https://developer.cisco.com/meraki/api-v1/#!update-organization-branding-policies-priorities)

        Args:
            organization_id: Organization ID.
            branding_policy_ids: An ordered list of branding policy IDs that determines the priority
                order of how to apply the policies.

        """
        organization_id = urllib.parse.quote(str(organization_id), safe="")
        path = f"/organizations/{organization_id}/brandingPolicies/priorities"

        payload: dict[str, Any] = {}
        if branding_policy_ids is not None:
            payload["brandingPolicyIds"] = branding_policy_ids

        return CreateOrganizationActionBatchActionsItem(
            resource=path,
            operation="update",
            body=payload,
        )

    def update_organization_branding_policy(
        self,
        *,
        organization_id: str,
        branding_policy_id: str,
        name: str,
        enabled: bool | None = None,
        admin_settings: UpdateOrganizationBrandingPolicyAdminSettings | None = None,
        help_settings: UpdateOrganizationBrandingPolicyHelpSettings | None = None,
        custom_logo: UpdateOrganizationBrandingPolicyCustomLogo | None = None,
    ) -> CreateOrganizationActionBatchActionsItem:
        """Update a branding policy.

        [API documentation: updateOrganizationBrandingPolicy](https://developer.cisco.com/meraki/api-v1/#!update-organization-branding-policy)

        Args:
            organization_id: Organization ID.
            branding_policy_id: Branding policy ID.
            name: Name of the Dashboard branding policy.
            enabled: Boolean indicating whether this policy is enabled.
            admin_settings: Settings for describing which kinds of admins this policy applies to.
            help_settings: Settings for describing the modifications to various Help page features.
                Each property in this object accepts one of 'default or inherit' (do not
                modify functionality), 'hide' (remove the section from Dashboard), or
                'show' (always show the section on Dashboard). Some properties in this
                object also accept custom HTML used to replace the section on Dashboard;
                see the documentation for each property to see the allowed values.
            custom_logo: Properties describing the custom logo attached to the branding policy.

        """
        organization_id = urllib.parse.quote(str(organization_id), safe="")
        branding_policy_id = urllib.parse.quote(str(branding_policy_id), safe="")
        path = f"/organizations/{organization_id}/brandingPolicies/{branding_policy_id}"

        payload: dict[str, Any] = {}
        if name is not None:
            payload["name"] = name
        if enabled is not None:
            payload["enabled"] = enabled
        if admin_settings is not None:
            payload["adminSettings"] = admin_settings.model_dump(by_alias=True, exclude_none=True)
        if help_settings is not None:
            payload["helpSettings"] = help_settings.model_dump(by_alias=True, exclude_none=True)
        if custom_logo is not None:
            payload["customLogo"] = custom_logo.model_dump(by_alias=True, exclude_none=True)

        return CreateOrganizationActionBatchActionsItem(
            resource=path,
            operation="update",
            body=payload,
        )

    def delete_organization_branding_policy(
        self, *, organization_id: str, branding_policy_id: str
    ) -> CreateOrganizationActionBatchActionsItem:
        """Delete a branding policy.

        [API documentation: deleteOrganizationBrandingPolicy](https://developer.cisco.com/meraki/api-v1/#!delete-organization-branding-policy)

        Args:
            organization_id: Organization ID.
            branding_policy_id: Branding policy ID.

        """
        organization_id = urllib.parse.quote(str(organization_id), safe="")
        branding_policy_id = urllib.parse.quote(str(branding_policy_id), safe="")
        path = f"/organizations/{organization_id}/brandingPolicies/{branding_policy_id}"

        return CreateOrganizationActionBatchActionsItem(
            resource=path,
            operation="destroy",
        )

    def create_organization_config_template(
        self,
        *,
        organization_id: str,
        name: str,
        time_zone: str | None = None,
        copy_from_network_id: str | None = None,
    ) -> CreateOrganizationActionBatchActionsItem:
        """Create a new configuration template.

        [API documentation: createOrganizationConfigTemplate](https://developer.cisco.com/meraki/api-v1/#!create-organization-config-template)

        Args:
            organization_id: Organization ID.
            name: The name of the configuration template.
            time_zone: The timezone of the configuration template. For a list of allowed timezones,
                please see the 'TZ' column in the table in <a target='_blank'
                href='https://en.wikipedia.org/wiki/List_of_tz_database_time_zones'>this
                article</a>. Not applicable if copying from existing network or
                template.
            copy_from_network_id: The ID of the network or config template to copy configuration
                from.

        """
        organization_id = urllib.parse.quote(str(organization_id), safe="")
        path = f"/organizations/{organization_id}/configTemplates"

        payload: dict[str, Any] = {}
        if name is not None:
            payload["name"] = name
        if time_zone is not None:
            payload["timeZone"] = time_zone
        if copy_from_network_id is not None:
            payload["copyFromNetworkId"] = copy_from_network_id

        return CreateOrganizationActionBatchActionsItem(
            resource=path,
            operation="create",
            body=payload,
        )

    def update_organization_config_template(
        self,
        *,
        organization_id: str,
        config_template_id: str,
        name: str | None = None,
        time_zone: str | None = None,
    ) -> CreateOrganizationActionBatchActionsItem:
        """Update a configuration template.

        [API documentation: updateOrganizationConfigTemplate](https://developer.cisco.com/meraki/api-v1/#!update-organization-config-template)

        Args:
            organization_id: Organization ID.
            config_template_id: Config template ID.
            name: The name of the configuration template.
            time_zone: The timezone of the configuration template. For a list of allowed timezones,
                please see the 'TZ' column in the table in <a target='_blank'
                href='https://en.wikipedia.org/wiki/List_of_tz_database_time_zones'>this
                article.</a>.

        """
        organization_id = urllib.parse.quote(str(organization_id), safe="")
        config_template_id = urllib.parse.quote(str(config_template_id), safe="")
        path = f"/organizations/{organization_id}/configTemplates/{config_template_id}"

        payload: dict[str, Any] = {}
        if name is not None:
            payload["name"] = name
        if time_zone is not None:
            payload["timeZone"] = time_zone

        return CreateOrganizationActionBatchActionsItem(
            resource=path,
            operation="update",
            body=payload,
        )

    def create_organization_devices_controller_migration(
        self,
        *,
        organization_id: str,
        serials: list[str],
        target: CreateOrganizationDevicesControllerMigrationTarget,
    ) -> CreateOrganizationActionBatchActionsItem:
        """Migrate devices to another controller or management mode.

        [API documentation: createOrganizationDevicesControllerMigration](https://developer.cisco.com/meraki/api-v1/#!create-organization-devices-controller-migration)

        Args:
            organization_id: Organization ID.
            serials: A list of Meraki Serials to migrate.
            target: The controller or management mode to which the devices will be migrated.

        """
        organization_id = urllib.parse.quote(str(organization_id), safe="")
        path = f"/organizations/{organization_id}/devices/controller/migrations"

        payload: dict[str, Any] = {}
        if serials is not None:
            payload["serials"] = serials
        if target is not None:
            payload["target"] = target

        return CreateOrganizationActionBatchActionsItem(
            resource=path,
            operation="mr/actions/migrate",
            body=payload,
        )

    def bulk_update_organization_devices_details(
        self,
        *,
        organization_id: str,
        serials: list[str],
        details: list[BulkUpdateOrganizationDevicesDetailsDetailsItem],
    ) -> CreateOrganizationActionBatchActionsItem:
        """Updating device details (currently only used for Catalyst devices).

        [API documentation: bulkUpdateOrganizationDevicesDetails](https://developer.cisco.com/meraki/api-v1/#!bulk-update-organization-devices-details)

        Args:
            organization_id: Organization ID.
            serials: A list of serials of devices to update.
            details: An array of details.

        """
        organization_id = urllib.parse.quote(str(organization_id), safe="")
        path = f"/organizations/{organization_id}/devices/details/bulkUpdate"

        payload: dict[str, Any] = {}
        if serials is not None:
            payload["serials"] = serials
        if details is not None:
            payload["details"] = [
                item.model_dump(by_alias=True, exclude_none=True) for item in details
            ]

        return CreateOrganizationActionBatchActionsItem(
            resource=path,
            operation="details/update",
            body=payload,
        )

    def bulk_organization_devices_packet_capture_captures_delete(
        self, *, organization_id: str, capture_ids: list[str]
    ) -> CreateOrganizationActionBatchActionsItem:
        """BulkDelete packet captures from cloud.

        [API documentation: bulkOrganizationDevicesPacketCaptureCapturesDelete](https://developer.cisco.com/meraki/api-v1/#!bulk-organization-devices-packet-capture-captures-delete)

        Args:
            organization_id: Organization ID.
            capture_ids: Delete the packet captures of the specified capture ids.

        """
        organization_id = urllib.parse.quote(str(organization_id), safe="")
        path = f"/organizations/{organization_id}/devices/packetCapture/captures/bulkDelete"

        payload: dict[str, Any] = {}
        if capture_ids is not None:
            payload["captureIds"] = capture_ids

        return CreateOrganizationActionBatchActionsItem(
            resource=path,
            operation="destroy",
            body=payload,
        )

    def delete_organization_devices_packet_capture_capture(
        self, *, organization_id: str, capture_id: str
    ) -> CreateOrganizationActionBatchActionsItem:
        """Delete a single packet capture from cloud using captureId.

        [API documentation: deleteOrganizationDevicesPacketCaptureCapture](https://developer.cisco.com/meraki/api-v1/#!delete-organization-devices-packet-capture-capture)

        Args:
            organization_id: Organization ID.
            capture_id: Capture ID.

        """
        organization_id = urllib.parse.quote(str(organization_id), safe="")
        capture_id = urllib.parse.quote(str(capture_id), safe="")
        path = f"/organizations/{organization_id}/devices/packetCapture/captures/{capture_id}"

        return CreateOrganizationActionBatchActionsItem(
            resource=path,
            operation="destroy",
        )

    def create_organization_devices_packet_capture_schedule(
        self,
        *,
        organization_id: str,
        devices: list[CreateOrganizationDevicesPacketCaptureScheduleDevicesItem],
        name: str | None = None,
        notes: str | None = None,
        duration: int | None = None,
        filter_expression: str | None = None,
        enabled: bool | None = None,
        schedule: CreateOrganizationDevicesPacketCaptureScheduleSchedule | None = None,
    ) -> CreateOrganizationActionBatchActionsItem:
        """Create a schedule for packet capture.

        [API documentation: createOrganizationDevicesPacketCaptureSchedule](https://developer.cisco.com/meraki/api-v1/#!create-organization-devices-packet-capture-schedule)

        Args:
            organization_id: Organization ID.
            devices: device details.
            name: Name of the packet capture file.
            notes: Reason for capture.
            duration: Duration of the capture in seconds.
            filter_expression: Filter expression for the capture.
            enabled: Enable or disable the schedule.
            schedule: Schedule details.

        """
        organization_id = urllib.parse.quote(str(organization_id), safe="")
        path = f"/organizations/{organization_id}/devices/packetCapture/schedules"

        payload: dict[str, Any] = {}
        if devices is not None:
            payload["devices"] = [
                item.model_dump(by_alias=True, exclude_none=True) for item in devices
            ]
        if name is not None:
            payload["name"] = name
        if notes is not None:
            payload["notes"] = notes
        if duration is not None:
            payload["duration"] = duration
        if filter_expression is not None:
            payload["filterExpression"] = filter_expression
        if enabled is not None:
            payload["enabled"] = enabled
        if schedule is not None:
            payload["schedule"] = schedule.model_dump(by_alias=True, exclude_none=True)

        return CreateOrganizationActionBatchActionsItem(
            resource=path,
            operation="create",
            body=payload,
        )

    def reorder_organization_devices_packet_capture_schedules(
        self,
        *,
        organization_id: str,
        order: list[ReorderOrganizationDevicesPacketCaptureSchedulesOrderItem],
    ) -> CreateOrganizationActionBatchActionsItem:
        """Bulk update priorities of pcap schedules.

        [API documentation: reorderOrganizationDevicesPacketCaptureSchedules](https://developer.cisco.com/meraki/api-v1/#!reorder-organization-devices-packet-capture-schedules)

        Args:
            organization_id: Organization ID.
            order: Array of schedule IDs and their priorities to reorder.

        """
        organization_id = urllib.parse.quote(str(organization_id), safe="")
        path = f"/organizations/{organization_id}/devices/packetCapture/schedules/reorder"

        payload: dict[str, Any] = {}
        if order is not None:
            payload["order"] = [item.model_dump(by_alias=True, exclude_none=True) for item in order]

        return CreateOrganizationActionBatchActionsItem(
            resource=path,
            operation="reorder",
            body=payload,
        )

    def update_organization_devices_packet_capture_schedule(
        self,
        *,
        organization_id: str,
        schedule_id: str,
        devices: list[UpdateOrganizationDevicesPacketCaptureScheduleDevicesItem],
        name: str | None = None,
        notes: str | None = None,
        duration: int | None = None,
        filter_expression: str | None = None,
        enabled: bool | None = None,
        schedule: UpdateOrganizationDevicesPacketCaptureScheduleSchedule | None = None,
    ) -> CreateOrganizationActionBatchActionsItem:
        """Update a schedule for packet capture.

        [API documentation: updateOrganizationDevicesPacketCaptureSchedule](https://developer.cisco.com/meraki/api-v1/#!update-organization-devices-packet-capture-schedule)

        Args:
            organization_id: Organization ID.
            schedule_id: Schedule ID.
            devices: device details.
            name: Name of the packet capture file.
            notes: Reason for capture.
            duration: Duration of the capture in seconds.
            filter_expression: Filter expression for the capture.
            enabled: Enable or disable the schedule.
            schedule: Schedule details.

        """
        organization_id = urllib.parse.quote(str(organization_id), safe="")
        schedule_id = urllib.parse.quote(str(schedule_id), safe="")
        path = f"/organizations/{organization_id}/devices/packetCapture/schedules/{schedule_id}"

        payload: dict[str, Any] = {}
        if devices is not None:
            payload["devices"] = [
                item.model_dump(by_alias=True, exclude_none=True) for item in devices
            ]
        if name is not None:
            payload["name"] = name
        if notes is not None:
            payload["notes"] = notes
        if duration is not None:
            payload["duration"] = duration
        if filter_expression is not None:
            payload["filterExpression"] = filter_expression
        if enabled is not None:
            payload["enabled"] = enabled
        if schedule is not None:
            payload["schedule"] = schedule.model_dump(by_alias=True, exclude_none=True)

        return CreateOrganizationActionBatchActionsItem(
            resource=path,
            operation="update",
            body=payload,
        )

    def delete_organization_devices_packet_capture_schedule(
        self, *, organization_id: str, schedule_id: str
    ) -> CreateOrganizationActionBatchActionsItem:
        """Delete schedule from cloud.

        [API documentation: deleteOrganizationDevicesPacketCaptureSchedule](https://developer.cisco.com/meraki/api-v1/#!delete-organization-devices-packet-capture-schedule)

        Args:
            organization_id: Organization ID.
            schedule_id: Schedule ID.

        """
        organization_id = urllib.parse.quote(str(organization_id), safe="")
        schedule_id = urllib.parse.quote(str(schedule_id), safe="")
        path = f"/organizations/{organization_id}/devices/packetCapture/schedules/{schedule_id}"

        payload: dict[str, Any] = {}
        if schedule_id is not None:
            payload["scheduleId"] = schedule_id

        return CreateOrganizationActionBatchActionsItem(
            resource=path,
            operation="destroy",
            body=payload,
        )

    def update_organization_early_access_features_opt_in(
        self,
        *,
        organization_id: str,
        opt_in_id: str,
        limit_scope_to_networks: list[str] | None = None,
    ) -> CreateOrganizationActionBatchActionsItem:
        """Update an early access feature opt-in for an organization.

        [API documentation: updateOrganizationEarlyAccessFeaturesOptIn](https://developer.cisco.com/meraki/api-v1/#!update-organization-early-access-features-opt-in)

        Args:
            organization_id: Organization ID.
            opt_in_id: Opt in ID.
            limit_scope_to_networks: A list of network IDs to apply the opt-in to.

        """
        organization_id = urllib.parse.quote(str(organization_id), safe="")
        opt_in_id = urllib.parse.quote(str(opt_in_id), safe="")
        path = f"/organizations/{organization_id}/earlyAccess/features/optIns/{opt_in_id}"

        payload: dict[str, Any] = {}
        if limit_scope_to_networks is not None:
            payload["limitScopeToNetworks"] = limit_scope_to_networks

        return CreateOrganizationActionBatchActionsItem(
            resource=path,
            operation="update",
            body=payload,
        )

    def disable_organization_integrations_xdr_networks(
        self,
        *,
        organization_id: str,
        networks: list[DisableOrganizationIntegrationsXdrNetworksNetworksItem],
    ) -> CreateOrganizationActionBatchActionsItem:
        """Disable XDR on networks.

        [API documentation: disableOrganizationIntegrationsXdrNetworks](https://developer.cisco.com/meraki/api-v1/#!disable-organization-integrations-xdr-networks)

        Args:
            organization_id: Organization ID.
            networks: List containing the network ID and the product type to disable XDR on.

        """
        organization_id = urllib.parse.quote(str(organization_id), safe="")
        path = f"/organizations/{organization_id}/integrations/xdr/networks/disable"

        payload: dict[str, Any] = {}
        if networks is not None:
            payload["networks"] = [
                item.model_dump(by_alias=True, exclude_none=True) for item in networks
            ]

        return CreateOrganizationActionBatchActionsItem(
            resource=path,
            operation="disable",
            body=payload,
        )

    def enable_organization_integrations_xdr_networks(
        self,
        *,
        organization_id: str,
        networks: list[EnableOrganizationIntegrationsXdrNetworksNetworksItem],
    ) -> CreateOrganizationActionBatchActionsItem:
        """Enable XDR on networks.

        [API documentation: enableOrganizationIntegrationsXdrNetworks](https://developer.cisco.com/meraki/api-v1/#!enable-organization-integrations-xdr-networks)

        Args:
            organization_id: Organization ID.
            networks: List containing the network ID and the product type to enable XDR on.

        """
        organization_id = urllib.parse.quote(str(organization_id), safe="")
        path = f"/organizations/{organization_id}/integrations/xdr/networks/enable"

        payload: dict[str, Any] = {}
        if networks is not None:
            payload["networks"] = [
                item.model_dump(by_alias=True, exclude_none=True) for item in networks
            ]

        return CreateOrganizationActionBatchActionsItem(
            resource=path,
            operation="enable",
            body=payload,
        )

    def claim_organization_inventory_orders(
        self,
        *,
        organization_id: str,
        claim_id: str,
        subscriptions: list[ClaimOrganizationInventoryOrdersSubscriptionsItem] | None = None,
    ) -> CreateOrganizationActionBatchActionsItem:
        """Claim an order by the secure unique order claim number, the order claim id.

        [API documentation: claimOrganizationInventoryOrders](https://developer.cisco.com/meraki/api-v1/#!claim-organization-inventory-orders)

        Args:
            organization_id: Organization ID.
            claim_id: The unique order claim id.
            subscriptions: The individual subscriptions to claim.

        """
        organization_id = urllib.parse.quote(str(organization_id), safe="")
        path = f"/organizations/{organization_id}/inventory/orders/claim"

        payload: dict[str, Any] = {}
        if claim_id is not None:
            payload["claimId"] = claim_id
        if subscriptions is not None:
            payload["subscriptions"] = [
                item.model_dump(by_alias=True, exclude_none=True) for item in subscriptions
            ]

        return CreateOrganizationActionBatchActionsItem(
            resource=path,
            operation="claim",
            body=payload,
        )

    def assign_organization_licenses_seats(
        self, *, organization_id: str, license_id: str, network_id: str, seat_count: int
    ) -> CreateOrganizationActionBatchActionsItem:
        """Assign SM seats to a network.

        [API documentation: assignOrganizationLicensesSeats](https://developer.cisco.com/meraki/api-v1/#!assign-organization-licenses-seats)

        Args:
            organization_id: Organization ID.
            license_id: The ID of the SM license to assign seats from.
            network_id: The ID of the SM network to assign the seats to.
            seat_count: The number of seats to assign to the SM network. Must be less than or equal
                to the total number of seats of the license.

        """
        organization_id = urllib.parse.quote(str(organization_id), safe="")
        path = f"/organizations/{organization_id}/licenses/assignSeats"

        payload: dict[str, Any] = {}
        if license_id is not None:
            payload["licenseId"] = license_id
        if network_id is not None:
            payload["networkId"] = network_id
        if seat_count is not None:
            payload["seatCount"] = seat_count

        return CreateOrganizationActionBatchActionsItem(
            resource=path,
            operation="assignSeats",
            body=payload,
        )

    def move_organization_licenses(
        self, *, organization_id: str, dest_organization_id: str, license_ids: list[str]
    ) -> CreateOrganizationActionBatchActionsItem:
        """Move licenses to another organization.

        [API documentation: moveOrganizationLicenses](https://developer.cisco.com/meraki/api-v1/#!move-organization-licenses)

        Args:
            organization_id: Organization ID.
            dest_organization_id: The ID of the organization to move the licenses to.
            license_ids: A list of IDs of licenses to move to the new organization.

        """
        organization_id = urllib.parse.quote(str(organization_id), safe="")
        path = f"/organizations/{organization_id}/licenses/move"

        payload: dict[str, Any] = {}
        if dest_organization_id is not None:
            payload["destOrganizationId"] = dest_organization_id
        if license_ids is not None:
            payload["licenseIds"] = license_ids

        return CreateOrganizationActionBatchActionsItem(
            resource=path,
            operation="move",
            body=payload,
        )

    def move_organization_licenses_seats(
        self, *, organization_id: str, dest_organization_id: str, license_id: str, seat_count: int
    ) -> CreateOrganizationActionBatchActionsItem:
        """Move SM seats to another organization.

        [API documentation: moveOrganizationLicensesSeats](https://developer.cisco.com/meraki/api-v1/#!move-organization-licenses-seats)

        Args:
            organization_id: Organization ID.
            dest_organization_id: The ID of the organization to move the SM seats to.
            license_id: The ID of the SM license to move the seats from.
            seat_count: The number of seats to move to the new organization. Must be less than or
                equal to the total number of seats of the license.

        """
        organization_id = urllib.parse.quote(str(organization_id), safe="")
        path = f"/organizations/{organization_id}/licenses/moveSeats"

        payload: dict[str, Any] = {}
        if dest_organization_id is not None:
            payload["destOrganizationId"] = dest_organization_id
        if license_id is not None:
            payload["licenseId"] = license_id
        if seat_count is not None:
            payload["seatCount"] = seat_count

        return CreateOrganizationActionBatchActionsItem(
            resource=path,
            operation="moveSeats",
            body=payload,
        )

    def renew_organization_licenses_seats(
        self, *, organization_id: str, license_id_to_renew: str, unused_license_id: str
    ) -> CreateOrganizationActionBatchActionsItem:
        """Renew SM seats of a license.

        [API documentation: renewOrganizationLicensesSeats](https://developer.cisco.com/meraki/api-v1/#!renew-organization-licenses-seats)

        Args:
            organization_id: Organization ID.
            license_id_to_renew: The ID of the SM license to renew. This license must already be
                assigned to an SM network.
            unused_license_id: The SM license to use to renew the seats on 'licenseIdToRenew'. This
                license must have at least as many seats available as there are seats on
                'licenseIdToRenew'.

        """
        organization_id = urllib.parse.quote(str(organization_id), safe="")
        path = f"/organizations/{organization_id}/licenses/renewSeats"

        payload: dict[str, Any] = {}
        if license_id_to_renew is not None:
            payload["licenseIdToRenew"] = license_id_to_renew
        if unused_license_id is not None:
            payload["unusedLicenseId"] = unused_license_id

        return CreateOrganizationActionBatchActionsItem(
            resource=path,
            operation="renewSeats",
            body=payload,
        )

    def update_organization_license(
        self, *, organization_id: str, license_id: str, device_serial: str | None = None
    ) -> CreateOrganizationActionBatchActionsItem:
        """Update a license.

        [API documentation: updateOrganizationLicense](https://developer.cisco.com/meraki/api-v1/#!update-organization-license)

        Args:
            organization_id: Organization ID.
            license_id: License ID.
            device_serial: The serial number of the device to assign this license to. Set this to
                null to unassign the license. If a different license is already active
                on the device, this parameter will control queueing/dequeuing this
                license.

        """
        organization_id = urllib.parse.quote(str(organization_id), safe="")
        license_id = urllib.parse.quote(str(license_id), safe="")
        path = f"/organizations/{organization_id}/licenses/{license_id}"

        payload: dict[str, Any] = {}
        if device_serial is not None:
            payload["deviceSerial"] = device_serial

        return CreateOrganizationActionBatchActionsItem(
            resource=path,
            operation="update",
            body=payload,
        )

    def update_organization_login_security(
        self,
        organization_id: str,
        *,
        enforce_password_expiration: bool | None = None,
        password_expiration_days: int | None = None,
        enforce_different_passwords: bool | None = None,
        num_different_passwords: int | None = None,
        enforce_strong_passwords: bool | None = None,
        minimum_password_length: int | None = None,
        enforce_account_lockout: bool | None = None,
        account_lockout_attempts: int | None = None,
        enforce_idle_timeout: bool | None = None,
        idle_timeout_minutes: int | None = None,
        enforce_two_factor_auth: bool | None = None,
        enforce_login_ip_ranges: bool | None = None,
        login_ip_ranges: list[str] | None = None,
        api_authentication: UpdateOrganizationLoginSecurityApiAuthentication | None = None,
    ) -> CreateOrganizationActionBatchActionsItem:
        """Update the login security settings for an organization.

        [API documentation: updateOrganizationLoginSecurity](https://developer.cisco.com/meraki/api-v1/#!update-organization-login-security)

        Args:
            organization_id: Organization ID.
            enforce_password_expiration: Boolean indicating whether users are forced to change their
                password every X number of days.
            password_expiration_days: Number of days after which users will be forced to change
                their password.
            enforce_different_passwords: Boolean indicating whether users, when setting a new
                password, are forced to choose a new password that is different from any
                past passwords.
            num_different_passwords: Number of recent passwords that new password must be distinct
                from.
            enforce_strong_passwords: Deprecated. Values of 'false' are always ignored.
            minimum_password_length: Minimum number of characters required in admins' passwords.
            enforce_account_lockout: Boolean indicating whether users' Dashboard accounts will be
                locked out after a specified number of consecutive failed login
                attempts.
            account_lockout_attempts: Number of consecutive failed login attempts after which users'
                accounts will be locked.
            enforce_idle_timeout: Boolean indicating whether users will be logged out after being
                idle for the specified number of minutes.
            idle_timeout_minutes: Number of minutes users can remain idle before being logged out of
                their accounts.
            enforce_two_factor_auth: Boolean indicating whether users in this organization will be
                required to use an extra verification code when logging in to Dashboard.
                This code will be sent to their mobile phone via SMS, or can be
                generated by the authenticator application.
            enforce_login_ip_ranges: Boolean indicating whether organization will restrict access to
                Dashboard (including the API) from certain IP addresses.
            login_ip_ranges: List of acceptable IP ranges. Entries can be single IP addresses, IP
                address ranges, and CIDR subnets.
            api_authentication: Details for indicating whether organization will restrict access to
                API (but not Dashboard) to certain IP addresses.

        """
        organization_id = urllib.parse.quote(str(organization_id), safe="")
        path = f"/organizations/{organization_id}/loginSecurity"

        payload: dict[str, Any] = {}
        if enforce_password_expiration is not None:
            payload["enforcePasswordExpiration"] = enforce_password_expiration
        if password_expiration_days is not None:
            payload["passwordExpirationDays"] = password_expiration_days
        if enforce_different_passwords is not None:
            payload["enforceDifferentPasswords"] = enforce_different_passwords
        if num_different_passwords is not None:
            payload["numDifferentPasswords"] = num_different_passwords
        if enforce_strong_passwords is not None:
            payload["enforceStrongPasswords"] = enforce_strong_passwords
        if minimum_password_length is not None:
            payload["minimumPasswordLength"] = minimum_password_length
        if enforce_account_lockout is not None:
            payload["enforceAccountLockout"] = enforce_account_lockout
        if account_lockout_attempts is not None:
            payload["accountLockoutAttempts"] = account_lockout_attempts
        if enforce_idle_timeout is not None:
            payload["enforceIdleTimeout"] = enforce_idle_timeout
        if idle_timeout_minutes is not None:
            payload["idleTimeoutMinutes"] = idle_timeout_minutes
        if enforce_two_factor_auth is not None:
            payload["enforceTwoFactorAuth"] = enforce_two_factor_auth
        if enforce_login_ip_ranges is not None:
            payload["enforceLoginIpRanges"] = enforce_login_ip_ranges
        if login_ip_ranges is not None:
            payload["loginIpRanges"] = login_ip_ranges
        if api_authentication is not None:
            payload["apiAuthentication"] = api_authentication.model_dump(
                by_alias=True, exclude_none=True
            )

        return CreateOrganizationActionBatchActionsItem(
            resource=path,
            operation="update",
            body=payload,
        )

    def create_organization_network(
        self,
        *,
        organization_id: str,
        name: str,
        product_types: CreateOrganizationNetworkProductTypes,
        tags: list[str] | None = None,
        time_zone: str | None = None,
        copy_from_network_id: str | None = None,
        notes: str | None = None,
    ) -> CreateOrganizationActionBatchActionsItem:
        """Create a network.

        [API documentation: createOrganizationNetwork](https://developer.cisco.com/meraki/api-v1/#!create-organization-network)

        Args:
            organization_id: Organization ID.
            name: The name of the new network.
            product_types: The product type(s) of the new network. If more than one type is
                included, the network will be a combined network.
            tags: A list of tags to be applied to the network.
            time_zone: The timezone of the network. For a list of allowed timezones, please see the
                'TZ' column in the table in <a target='_blank'
                href='https://en.wikipedia.org/wiki/List_of_tz_database_time_zones'>this
                article.</a>.
            copy_from_network_id: The ID of the network to copy configuration from. Other provided
                parameters will override the copied configuration, except type which
                must match this network's type exactly.
            notes: Add any notes or additional information about this network here.

        """
        organization_id = urllib.parse.quote(str(organization_id), safe="")
        path = f"/organizations/{organization_id}/networks"

        payload: dict[str, Any] = {}
        if name is not None:
            payload["name"] = name
        if product_types is not None:
            payload["productTypes"] = product_types
        if tags is not None:
            payload["tags"] = tags
        if time_zone is not None:
            payload["timeZone"] = time_zone
        if copy_from_network_id is not None:
            payload["copyFromNetworkId"] = copy_from_network_id
        if notes is not None:
            payload["notes"] = notes

        return CreateOrganizationActionBatchActionsItem(
            resource=path,
            operation="create",
            body=payload,
        )

    def combine_organization_networks(
        self,
        *,
        organization_id: str,
        name: str,
        network_ids: list[str],
        enrollment_string: str | None = None,
    ) -> CreateOrganizationActionBatchActionsItem:
        """Combine multiple networks into a single network.

        [API documentation: combineOrganizationNetworks](https://developer.cisco.com/meraki/api-v1/#!combine-organization-networks)

        Args:
            organization_id: Organization ID.
            name: The name of the combined network.
            network_ids: A list of the network IDs that will be combined. If an ID of a combined
                network is included in this list, the other networks in the list will be
                grouped into that network.
            enrollment_string: A unique identifier which can be used for device enrollment or easy
                access through the Meraki SM Registration page or the Self Service
                Portal. Please note that changing this field may cause existing
                bookmarks to break. All networks that are part of this combined network
                will have their enrollment string appended by '-network_type'. If left
                empty, all exisitng enrollment strings will be deleted.

        """
        organization_id = urllib.parse.quote(str(organization_id), safe="")
        path = f"/organizations/{organization_id}/networks/combine"

        payload: dict[str, Any] = {}
        if name is not None:
            payload["name"] = name
        if network_ids is not None:
            payload["networkIds"] = network_ids
        if enrollment_string is not None:
            payload["enrollmentString"] = enrollment_string

        return CreateOrganizationActionBatchActionsItem(
            resource=path,
            operation="combine",
            body=payload,
        )

    def create_organization_policy_object(
        self,
        *,
        organization_id: str,
        name: str,
        category: str,
        type_: str,
        cidr: str | None = None,
        fqdn: str | None = None,
        mask: str | None = None,
        ip: str | None = None,
        group_ids: list[str] | None = None,
    ) -> CreateOrganizationActionBatchActionsItem:
        """Creates a new Policy Object.

        [API documentation: createOrganizationPolicyObject](https://developer.cisco.com/meraki/api-v1/#!create-organization-policy-object)

        Args:
            organization_id: Organization ID.
            name: Name of a policy object, unique within the organization (alphanumeric, space,
                dash, or underscore characters only).
            category: Category of a policy object (one of: adaptivePolicy, network).
            type_: Type of a policy object (one of: adaptivePolicyIpv4Cidr, cidr, fqdn, ipAndMask).
            cidr: CIDR Value of a policy object (e.g. 10.11.12.1/24").
            fqdn: Fully qualified domain name of policy object (e.g. "example.com").
            mask: Mask of a policy object (e.g. "255.255.0.0").
            ip: IP Address of a policy object (e.g. "1.2.3.4").
            group_ids: The IDs of policy object groups the policy object belongs to.

        """
        organization_id = urllib.parse.quote(str(organization_id), safe="")
        path = f"/organizations/{organization_id}/policyObjects"

        payload: dict[str, Any] = {}
        if name is not None:
            payload["name"] = name
        if category is not None:
            payload["category"] = category
        if type_ is not None:
            payload["type"] = type_
        if cidr is not None:
            payload["cidr"] = cidr
        if fqdn is not None:
            payload["fqdn"] = fqdn
        if mask is not None:
            payload["mask"] = mask
        if ip is not None:
            payload["ip"] = ip
        if group_ids is not None:
            payload["groupIds"] = group_ids

        return CreateOrganizationActionBatchActionsItem(
            resource=path,
            operation="create",
            body=payload,
        )

    def create_organization_policy_objects_group(
        self,
        *,
        organization_id: str,
        name: str,
        category: str | None = None,
        object_ids: list[str] | None = None,
    ) -> CreateOrganizationActionBatchActionsItem:
        """Creates a new Policy Object Group.

        [API documentation: createOrganizationPolicyObjectsGroup](https://developer.cisco.com/meraki/api-v1/#!create-organization-policy-objects-group)

        Args:
            organization_id: Organization ID.
            name: A name for the group of network addresses, unique within the organization
                (alphanumeric, space, dash, or underscore characters only).
            category: Category of a policy object group (one of: NetworkObjectGroup,
                GeoLocationGroup, PortObjectGroup, ApplicationGroup).
            object_ids: A list of Policy Object ID's that this NetworkObjectGroup should be
                associated to (note: these ID's will replace the existing associated
                Policy Objects).

        """
        organization_id = urllib.parse.quote(str(organization_id), safe="")
        path = f"/organizations/{organization_id}/policyObjects/groups"

        payload: dict[str, Any] = {}
        if name is not None:
            payload["name"] = name
        if category is not None:
            payload["category"] = category
        if object_ids is not None:
            payload["objectIds"] = object_ids

        return CreateOrganizationActionBatchActionsItem(
            resource=path,
            operation="create",
            body=payload,
        )

    def update_organization_policy_objects_group(
        self,
        *,
        organization_id: str,
        policy_object_group_id: str,
        name: str | None = None,
        object_ids: list[str] | None = None,
    ) -> CreateOrganizationActionBatchActionsItem:
        """Updates a Policy Object Group.

        [API documentation: updateOrganizationPolicyObjectsGroup](https://developer.cisco.com/meraki/api-v1/#!update-organization-policy-objects-group)

        Args:
            organization_id: Organization ID.
            policy_object_group_id: Policy object group ID.
            name: A name for the group of network addresses, unique within the organization
                (alphanumeric, space, dash, or underscore characters only).
            object_ids: A list of Policy Object ID's that this NetworkObjectGroup should be
                associated to (note: these ID's will replace the existing associated
                Policy Objects).

        """
        organization_id = urllib.parse.quote(str(organization_id), safe="")
        policy_object_group_id = urllib.parse.quote(str(policy_object_group_id), safe="")
        path = f"/organizations/{organization_id}/policyObjects/groups/{policy_object_group_id}"

        payload: dict[str, Any] = {}
        if name is not None:
            payload["name"] = name
        if object_ids is not None:
            payload["objectIds"] = object_ids

        return CreateOrganizationActionBatchActionsItem(
            resource=path,
            operation="update",
            body=payload,
        )

    def delete_organization_policy_objects_group(
        self, *, organization_id: str, policy_object_group_id: str
    ) -> CreateOrganizationActionBatchActionsItem:
        """Deletes a Policy Object Group.

        [API documentation: deleteOrganizationPolicyObjectsGroup](https://developer.cisco.com/meraki/api-v1/#!delete-organization-policy-objects-group)

        Args:
            organization_id: Organization ID.
            policy_object_group_id: Policy object group ID.

        """
        organization_id = urllib.parse.quote(str(organization_id), safe="")
        policy_object_group_id = urllib.parse.quote(str(policy_object_group_id), safe="")
        path = f"/organizations/{organization_id}/policyObjects/groups/{policy_object_group_id}"

        return CreateOrganizationActionBatchActionsItem(
            resource=path,
            operation="destroy",
        )

    def update_organization_policy_object(
        self,
        *,
        organization_id: str,
        policy_object_id: str,
        name: str | None = None,
        cidr: str | None = None,
        fqdn: str | None = None,
        mask: str | None = None,
        ip: str | None = None,
        group_ids: list[str] | None = None,
    ) -> CreateOrganizationActionBatchActionsItem:
        """Updates a Policy Object.

        [API documentation: updateOrganizationPolicyObject](https://developer.cisco.com/meraki/api-v1/#!update-organization-policy-object)

        Args:
            organization_id: Organization ID.
            policy_object_id: Policy object ID.
            name: Name of a policy object, unique within the organization (alphanumeric, space,
                dash, or underscore characters only).
            cidr: CIDR Value of a policy object (e.g. 10.11.12.1/24").
            fqdn: Fully qualified domain name of policy object (e.g. "example.com").
            mask: Mask of a policy object (e.g. "255.255.0.0").
            ip: IP Address of a policy object (e.g. "1.2.3.4").
            group_ids: The IDs of policy object groups the policy object belongs to.

        """
        organization_id = urllib.parse.quote(str(organization_id), safe="")
        policy_object_id = urllib.parse.quote(str(policy_object_id), safe="")
        path = f"/organizations/{organization_id}/policyObjects/{policy_object_id}"

        payload: dict[str, Any] = {}
        if name is not None:
            payload["name"] = name
        if cidr is not None:
            payload["cidr"] = cidr
        if fqdn is not None:
            payload["fqdn"] = fqdn
        if mask is not None:
            payload["mask"] = mask
        if ip is not None:
            payload["ip"] = ip
        if group_ids is not None:
            payload["groupIds"] = group_ids

        return CreateOrganizationActionBatchActionsItem(
            resource=path,
            operation="update",
            body=payload,
        )

    def delete_organization_policy_object(
        self, *, organization_id: str, policy_object_id: str
    ) -> CreateOrganizationActionBatchActionsItem:
        """Deletes a Policy Object.

        [API documentation: deleteOrganizationPolicyObject](https://developer.cisco.com/meraki/api-v1/#!delete-organization-policy-object)

        Args:
            organization_id: Organization ID.
            policy_object_id: Policy object ID.

        """
        organization_id = urllib.parse.quote(str(organization_id), safe="")
        policy_object_id = urllib.parse.quote(str(policy_object_id), safe="")
        path = f"/organizations/{organization_id}/policyObjects/{policy_object_id}"

        return CreateOrganizationActionBatchActionsItem(
            resource=path,
            operation="destroy",
        )

    def create_organization_saml_idp(
        self,
        *,
        organization_id: str,
        x509cert_sha1_fingerprint: str,
        sso_login_url: str | None = None,
        slo_logout_url: str | None = None,
    ) -> CreateOrganizationActionBatchActionsItem:
        """Create a SAML IdP for your organization.

        [API documentation: createOrganizationSamlIdp](https://developer.cisco.com/meraki/api-v1/#!create-organization-saml-idp)

        Args:
            organization_id: Organization ID.
            x509cert_sha1_fingerprint: Fingerprint (SHA1) of the SAML certificate provided by your
                Identity Provider (IdP). This will be used for encryption / validation.
            sso_login_url: Dashboard will redirect users to this URL to log in again when their
                sessions expire.
            slo_logout_url: Dashboard will redirect users to this URL when they sign out.

        """
        organization_id = urllib.parse.quote(str(organization_id), safe="")
        path = f"/organizations/{organization_id}/saml/idps"

        payload: dict[str, Any] = {}
        if x509cert_sha1_fingerprint is not None:
            payload["x509certSha1Fingerprint"] = x509cert_sha1_fingerprint
        if sso_login_url is not None:
            payload["ssoLoginUrl"] = sso_login_url
        if slo_logout_url is not None:
            payload["sloLogoutUrl"] = slo_logout_url

        return CreateOrganizationActionBatchActionsItem(
            resource=path,
            operation="create",
            body=payload,
        )

    def update_organization_saml_idp(
        self,
        *,
        organization_id: str,
        idp_id: str,
        x509cert_sha1_fingerprint: str | None = None,
        sso_login_url: str | None = None,
        slo_logout_url: str | None = None,
    ) -> CreateOrganizationActionBatchActionsItem:
        """Update a SAML IdP in your organization.

        [API documentation: updateOrganizationSamlIdp](https://developer.cisco.com/meraki/api-v1/#!update-organization-saml-idp)

        Args:
            organization_id: Organization ID.
            idp_id: Idp ID.
            x509cert_sha1_fingerprint: Fingerprint (SHA1) of the SAML certificate provided by your
                Identity Provider (IdP). This will be used for encryption / validation.
            sso_login_url: Dashboard will redirect users to this URL to log in again when their
                sessions expire.
            slo_logout_url: Dashboard will redirect users to this URL when they sign out.

        """
        organization_id = urllib.parse.quote(str(organization_id), safe="")
        idp_id = urllib.parse.quote(str(idp_id), safe="")
        path = f"/organizations/{organization_id}/saml/idps/{idp_id}"

        payload: dict[str, Any] = {}
        if x509cert_sha1_fingerprint is not None:
            payload["x509certSha1Fingerprint"] = x509cert_sha1_fingerprint
        if sso_login_url is not None:
            payload["ssoLoginUrl"] = sso_login_url
        if slo_logout_url is not None:
            payload["sloLogoutUrl"] = slo_logout_url

        return CreateOrganizationActionBatchActionsItem(
            resource=path,
            operation="update",
            body=payload,
        )

    def delete_organization_saml_idp(
        self, *, organization_id: str, idp_id: str
    ) -> CreateOrganizationActionBatchActionsItem:
        """Remove a SAML IdP in your organization.

        [API documentation: deleteOrganizationSamlIdp](https://developer.cisco.com/meraki/api-v1/#!delete-organization-saml-idp)

        Args:
            organization_id: Organization ID.
            idp_id: Idp ID.

        """
        organization_id = urllib.parse.quote(str(organization_id), safe="")
        idp_id = urllib.parse.quote(str(idp_id), safe="")
        path = f"/organizations/{organization_id}/saml/idps/{idp_id}"

        return CreateOrganizationActionBatchActionsItem(
            resource=path,
            operation="destroy",
        )

    def delete_organization_splash_asset(
        self, *, organization_id: str, id: str
    ) -> CreateOrganizationActionBatchActionsItem:
        """Delete a Splash Theme Asset.

        [API documentation: deleteOrganizationSplashAsset](https://developer.cisco.com/meraki/api-v1/#!delete-organization-splash-asset)

        Args:
            organization_id: Organization ID.
            id: ID.

        """
        organization_id = urllib.parse.quote(str(organization_id), safe="")
        id = urllib.parse.quote(str(id), safe="")
        path = f"/organizations/{organization_id}/splash/assets/{id}"

        return CreateOrganizationActionBatchActionsItem(
            resource=path,
            operation="destroy",
        )

    def create_organization_splash_theme(
        self, organization_id: str, *, name: str | None = None, base_theme: str | None = None
    ) -> CreateOrganizationActionBatchActionsItem:
        """Create a Splash Theme.

        [API documentation: createOrganizationSplashTheme](https://developer.cisco.com/meraki/api-v1/#!create-organization-splash-theme)

        Args:
            organization_id: Organization ID.
            name: theme name.
            base_theme: base theme id.

        """
        organization_id = urllib.parse.quote(str(organization_id), safe="")
        path = f"/organizations/{organization_id}/splash/themes"

        payload: dict[str, Any] = {}
        if name is not None:
            payload["name"] = name
        if base_theme is not None:
            payload["baseTheme"] = base_theme

        return CreateOrganizationActionBatchActionsItem(
            resource=path,
            operation="create",
            body=payload,
        )

    def delete_organization_splash_theme(
        self, *, organization_id: str, id: str
    ) -> CreateOrganizationActionBatchActionsItem:
        """Delete a Splash Theme.

        [API documentation: deleteOrganizationSplashTheme](https://developer.cisco.com/meraki/api-v1/#!delete-organization-splash-theme)

        Args:
            organization_id: Organization ID.
            id: ID.

        """
        organization_id = urllib.parse.quote(str(organization_id), safe="")
        id = urllib.parse.quote(str(id), safe="")
        path = f"/organizations/{organization_id}/splash/themes/{id}"

        return CreateOrganizationActionBatchActionsItem(
            resource=path,
            operation="destroy",
        )

    def create_organization_splash_theme_asset(
        self,
        *,
        organization_id: str,
        theme_identifier: str,
        name: str | None = None,
        content: str | None = None,
    ) -> CreateOrganizationActionBatchActionsItem:
        """Create a Splash Theme Asset.

        [API documentation: createOrganizationSplashThemeAsset](https://developer.cisco.com/meraki/api-v1/#!create-organization-splash-theme-asset)

        Args:
            organization_id: Organization ID.
            theme_identifier: Theme identifier.
            name: File name. Will overwrite files with same name.
            content: a file containing the asset content.

        """
        organization_id = urllib.parse.quote(str(organization_id), safe="")
        theme_identifier = urllib.parse.quote(str(theme_identifier), safe="")
        path = f"/organizations/{organization_id}/splash/themes/{theme_identifier}/assets"

        payload: dict[str, Any] = {}
        if name is not None:
            payload["name"] = name
        if content is not None:
            payload["content"] = content

        return CreateOrganizationActionBatchActionsItem(
            resource=path,
            operation="create",
            body=payload,
        )
