def create_image_gallery(cmd, resource_group_name, gallery_name, description=None, location=None, no_wait=False, tags=None, permissions=None, soft_delete=None, publisher_uri=None, publisher_contact=None, eula=None, public_name_prefix=None):
    from .vendored_sdks.azure_mgmt_compute.models._models_py3 import Gallery
    location = (location or _get_resource_group_location(cmd.cli_ctx, resource_group_name))
    gallery = Gallery(description=description, location=location, tags=(tags or {}))
    if (soft_delete is not None):
        gallery.soft_delete_policy = {'is_soft_delete_enabled': soft_delete}
    client = _compute_client_factory(cmd.cli_ctx)
    if permissions:
        from .vendored_sdks.azure_mgmt_compute.models._models_py3 import SharingProfile
        gallery.sharing_profile = SharingProfile(permissions=permissions)
        if (permissions == 'Community'):
            if ((publisher_uri is None) or (publisher_contact is None) or (eula is None) or (public_name_prefix is None)):
                raise RequiredArgumentMissingError('If you want to share to the community, you need to fill in all the following parameters: --publisher-uri, --publisher-email, --eula, --public-name-prefix.')
            from .vendored_sdks.azure_mgmt_compute.models._models_py3 import CommunityGalleryInfo
            gallery.sharing_profile.community_gallery_info = CommunityGalleryInfo(publisher_uri=publisher_uri, publisher_contact=publisher_contact, eula=eula, public_name_prefix=public_name_prefix)
    return sdk_no_wait(no_wait, client.galleries.begin_create_or_update, resource_group_name, gallery_name, gallery)
def create_image_gallery(cmd, resource_group_name, gallery_name, description=None, location=None, no_wait=False, tags=None, permissions=None, soft_delete=None, publisher_uri=None, publisher_contact=None, eula=None, public_name_prefix=None):
    from .vendored_sdks.azure_mgmt_compute.models._models_py3 import Gallery
    location = (location or _get_resource_group_location(cmd.cli_ctx, resource_group_name))
    gallery = Gallery(description=description, location=location, tags=(tags or {}))
    if (soft_delete is not None):
        gallery.soft_delete_policy = {'is_soft_delete_enabled': soft_delete}
    client = _compute_client_factory(cmd.cli_ctx)
    if permissions:
        from .vendored_sdks.azure_mgmt_compute.models._models_py3 import SharingProfile
        gallery.sharing_profile = SharingProfile(permissions=permissions)
        if (permissions == 'Community'):
            if ((publisher_uri is None) or (publisher_contact is None) or (eula is None) or (public_name_prefix is None)):
                raise RequiredArgumentMissingError('If you want to share to the community, you need to fill in all the following parameters: --publisher-uri, --publisher-email, --eula, --public-name-prefix.')
            from .vendored_sdks.azure_mgmt_compute.models._models_py3 import CommunityGalleryInfo
            gallery.sharing_profile.community_gallery_info = CommunityGalleryInfo(publisher_uri=publisher_uri, publisher_contact=publisher_contact, eula=eula, public_name_prefix=public_name_prefix)
    return sdk_no_wait(no_wait, client.galleries.begin_create_or_update, resource_group_name, gallery_name, gallery)