def endpoint_create_and_update_params(*args, **kwargs):
    """
    Collection of options consumed by Transfer endpoint create and update
    operations -- accepts toggle regarding create vs. update that makes
    display_name required vs. optional.

    Usage:

    >>> @endpoint_create_and_update_params(create=True)
    >>> def command_func(display_name, description, info_link, contact_info,
    >>>                  contact_email, organization, department, keywords,
    >>>                  public, location, disable_verify, myproxy_dn,
    >>>                  myproxy_server, oauth_server, force_encryption,
    >>>                  default_directory, subscription_id, network_use,
    >>>                  max_concurrency, preferred_concurrency,
    >>>                  max_parallelism, preferred_parallelism):
    >>>     ...
    """

    def inner_decorator(f, create=False):
        update_help_prefix = (not create and "New ") or ""

        # display name is required for create, not update
        if create:
            f = click.argument("display_name")(f)
        else:
            f = click.option(
                "--display-name", help=(update_help_prefix + "Name for the endpoint")
            )(f)

        # Options available to any endpoint
        f = click.option(
            "--description", help=(update_help_prefix + "Description for the endpoint")
        )(f)
        f = click.option(
            "--info-link",
            help=(update_help_prefix + "Link for Info about the endpoint"),
        )(f)
        f = click.option(
            "--contact-info",
            help=(update_help_prefix + "Contact Info for the endpoint"),
        )(f)
        f = click.option(
            "--contact-email",
            help=(update_help_prefix + "Contact Email for the endpoint"),
        )(f)
        f = click.option(
            "--organization",
            help=(update_help_prefix + "Organization for the endpoint"),
        )(f)
        f = click.option(
            "--department",
            help=(update_help_prefix + "Department which operates the endpoint"),
        )(f)
        f = click.option(
            "--keywords",
            help=(
                update_help_prefix
                + "Comma separated list of keywords to help searches "
                "for the endpoint"
            ),
        )(f)
        f = click.option("--default-directory", help=("Set the default directory"))(f)
        f = click.option(
            "--no-default-directory",
            is_flag=True,
            flag_value=True,
            default=None,
            help=("Unset any default directory on the endpoint"),
        )(f)
        f = click.option(
            "--force-encryption/--no-force-encryption",
            default=None,
            help=("(Un)Force the endpoint to encrypt transfers"),
        )(f)
        f = click.option(
            "--disable-verify/--no-disable-verify",
            is_flag=True,
            help="(Un)Set the endpoint to ignore checksum verification",
        )(f)

        # GCS only options
        f = click.option(
            "--public/--private",
            "public",
            default=None,
            help=(
                "Set the endpoint to be public or private "
                "(Globus Connect Server only)"
            ),
        )(f)
        f = click.option(
            "--myproxy-dn",
            help=("Set the MyProxy Server DN (Globus Connect Server only)"),
        )(f)
        f = click.option(
            "--myproxy-server",
            help=("Set the MyProxy Server URI " "(Globus Connect Server only)"),
        )(f)
        f = click.option(
            "--oauth-server",
            help=("Set the OAuth Server URI (Globus Connect Server only)"),
        )(f)
        f = click.option(
            "--location",
            type=LocationType(),
            default=None,
            help="Manually set the endpoint's latitude and longitude "
            "(Globus Connect Server only)",
        )(f)

        # Managed Endpoint options
        f = click.option(
            "--managed",
            "managed",
            is_flag=True,
            flag_value=True,
            default=None,
            help=(
                "Set the endpoint as a managed endpoint. Requires the "
                "user to be a subscription manager. If the user has "
                "multiple subscription IDs, --subscription-id must be used "
                "instead"
            ),
        )(f)
        f = click.option(
            "--no-managed",
            "managed",
            is_flag=True,
            flag_value=False,
            default=None,
            help=(
                "Unset the endpoint as a managed endpoint. "
                "Does not require the user to be a subscription manager. "
                "Mutually exclusive with --subscription-id"
            ),
        )(f)
        f = click.option(
            "--subscription-id",
            type=click.UUID,
            default=None,
            help=(
                "Set the endpoint as a managed endpoint with the given "
                "subscription ID. Mutually exclusive with "
                "--no-managed"
            ),
        )(f)
        f = click.option(
            "--network-use",
            default=None,
            type=click.Choice(["normal", "minimal", "aggressive", "custom"]),
            help=(
                "Set the endpoint's network use level. If using custom, "
                "the endpoint's max and preferred concurrency and "
                "parallelism must be set "
                "(Managed endpoints only) (Globus Connect Server only)"
            ),
        )(f)
        f = click.option(
            "--max-concurrency",
            type=int,
            default=None,
            help=(
                "Set the endpoint's max concurrency; "
                "requires --network-use=custom "
                "(Managed endpoints only) (Globus Connect Server only)"
            ),
        )(f)
        f = click.option(
            "--preferred-concurrency",
            type=int,
            default=None,
            help=(
                "Set the endpoint's preferred concurrency; "
                "requires --network-use=custom "
                "(Managed endpoints only) (Globus Connect Server only)"
            ),
        )(f)
        f = click.option(
            "--max-parallelism",
            type=int,
            default=None,
            help=(
                "Set the endpoint's max parallelism; "
                "requires --network-use=custom "
                "(Managed endpoints only) (Globus Connect Server only)"
            ),
        )(f)
        f = click.option(
            "--preferred-parallelism",
            type=int,
            default=None,
            help=(
                "Set the endpoint's preferred parallelism; "
                "requires --network-use=custom "
                "(Managed endpoints only) (Globus Connect Server only)"
            ),
        )(f)

        return f

    return detect_and_decorate(inner_decorator, args, kwargs)