https://developer.zendesk.com/rest_api/docs/core/user_fields#delete-user-field
7165
def user_field_delete(self, id, **kwargs):
        ""
        api_path = "/api/v2/user_fields/{id}.json"
        api_path = api_path.format(id=id)
        return self.call(api_path, method="DELETE", **kwargs)
445307
def schema_delete_field(cls, key):
        """"""
        root = '/'.join([API_ROOT, 'schemas', cls.__name__])
        payload = {
            'className': cls.__name__,
            'fields': {
                key: {
                    '__op': 'Delete'
                }
            }
        }
        cls.PUT(root, **payload)
1308954
def delete(self):
        '''  '''
        redis = type(self).get_redis()

        for fieldname, field in self.proxy:
            field.delete(redis)

        redis.delete(self.key())
        redis.srem(type(self).members_key(), self.id)

        if isinstance(self, PermissionHolder):
            redis.delete(self.allow_key())

        if self.notify:
            data = json.dumps({
                'event': 'delete',
                'data': self.to_json(),
            })
            redis.publish(type(self).cls_key(), data)
            redis.publish(self.key(), data)

        return self
1123575
def remove_user(self, user_name, role):
        
        role_uri = self._get_role_uri(role=role)
        return self.api.delete(path=role_uri, data={'username': user_name})
185805
def user_identity_delete(self, user_id, id, **kwargs):
        ""
        api_path = "/api/v2/users/{user_id}/identities/{id}.json"
        api_path = api_path.format(user_id=user_id, id=id)
        return self.call(api_path, method="DELETE", **kwargs)
1099344
public function deleteUserMetadataField($field, $hash, $organization = '')
    {
        return $this->doUserMetadataRequest([$field => null], $hash, 'PATCH', $organization);
    }
372236
def delete(user_id):
        '''
        
        '''
        try:
            del_count = TabMember.delete().where(TabMember.uid == user_id)
            del_count.execute()
            return True
        except:
            return False
1055641
def clean(self, user=None):
        """"""
        doc = self._resource
        internal_fields = deepcopy(self.internal_fields)
        if user is None or not user.is_user(self.organisation_id):
            internal_fields.append('permissions')

        result = {k: v for k, v in doc.iteritems() if k not in internal_fields}

        return result
767675
function (newDoc, oldDoc, userCtx, secObj) {
    if (newDoc._deleted === true) {
      // allow deletes by admins and matching users
      // without checking the other fields
      if (userCtx.roles.indexOf('_admin') !== -1) {
        return;
      }
      throw ({forbidden: 'Only admins may delete other user docs.'});
    }

    var is_server_or_database_admin = function (userCtx, secObj) {
      // see if the user is a server admin
      if (userCtx.roles.indexOf('_admin') !== -1) {
        return true; // a server admin
      }

      // see if the user is a database admin specified by name
      if (secObj && secObj.admins && secObj.admins.names) {
        if (secObj.admins.names.indexOf(userCtx.name) !== -1) {
          return true; // database admin
        }
      }

      // see if the user is a database admin specified by role
      if (secObj && secObj.admins && secObj.admins.roles) {
        var db_roles = secObj.admins.roles;
        var idx;
        for (idx = 0; idx < userCtx.roles.length; idx++) {
          var user_role = userCtx.roles[idx];
          if (db_roles.indexOf(user_role) !== -1) {
            return true; // role matches!
          }
        }
      }

      return false; // default to no admin
    };

    if (!is_server_or_database_admin(userCtx, secObj)) {
      throw ({
        forbidden: 'You may only read documents.'
      });
    }
  }
1171019
function (form) {
              if (config.web.multiTenancy.enabled && req.organization) {
                setAccountStoreByHref(form.data, req.organization);
              } else {
                /**
                 * Delete this form field, it's automatically added by the
                 * forms library.  If we don't delete it, we submit a null
                 * name key to the REST API and we get an error.
                 */
                delete form.data.organizationNameKey;
              }

              helpers.authenticate(form.data, req, res, function (err) {
                if (err) {
                  if (err.code === 2014) {
                    err.message = err.userMessage = 'Invalid Username, Password, or Organization';
                  }

                  err = oktaErrorTransformer(err);

                  return renderForm(form, { error: err.userMessage || err.message });
                }

                helpers.loginResponder(req, res);
              });
            }
135185
def delete_user_entitlements(self, user_id):
        
        route_values = {}
        if user_id is not None:
            route_values['userId'] = self._serialize.url('user_id', user_id, 'str')
        self._send(http_method='DELETE',
                   location_id='6490e566-b299-49a7-a4e4-28749752581f',
                   version='5.1-preview.1',
                   route_values=route_values)
346823
def delete_user(user, options={})
      raise 'Error: Param user is nil!' if user.nil?

      url = if user.is_a?(Resource::User)
        url_for_resource(user)
      elsif user.is_a?(String)
        url_for_path(user_path(user))
      else
        raise 'Error: Invalid parameters!'
      end
      begin
        client.delete(url, options) do |response|
          response.code == 200
        end
      rescue => e
        raise e if debug
      end
    end
1065527
def remove_query(field_uid)
      q = ActiveSupport::JSON.decode(@query[:query])
      q.delete(field_uid)
      @query[:query] = ActiveSupport::JSON.encode(q)
      self
    end
474602
def help_center_user_segment_delete(self, id, **kwargs):
        ""
        api_path = "/api/v2/help_center/user_segments/{id}.json"
        api_path = api_path.format(id=id)
        return self.call(api_path, method="DELETE", **kwargs)
490802
def delete_user(self, username):
        
        path = Client.urls['users_by_name'] % username
        return self._call(path, 'DELETE')
411182
def DeleteUser(self, user_link, options=None):
        
        if options is None:
            options = {}

        path = base.GetPathFromLink(user_link)
        user_id = base.GetResourceIdOrFullNameFromLink(user_link)
        return self.DeleteResource(path,
                                   'users',
                                   user_id,
                                   None,
                                   options)
819338
def delete(options = {})
      options = options.merge(user_name: @name)
      resp = @client.delete_user(options)
      resp.data
    end