Custom create method to accommodate different endpoint behavior.
181188
def create(self, **kwargs):
        """"""
        self._check_create_parameters(**kwargs)
        if kwargs['extractFromAllItems'] is False:
            self._meta_data['minimum_additional_parameters'] = {
                'extractFromRegularExpression', 'extractUrlReferences',
                'extractFiletypeReferences'
            }
        return self._create(**kwargs)
1297899
def _set_endpoint_configuration(self, rest_api, value):
        

        rest_api.EndpointConfiguration = {"Types": [value]}
        rest_api.Parameters = {"endpointConfigurationTypes": value}
889291
def create(self, request, *args, **kwargs):
        """"""
        if not request.user.is_authenticated:
            raise exceptions.NotFound

        return super().create(request, *args, **kwargs)
211810
public MethodMetaArgs createCreateMethod(HandlerMetaDef handlerMetaDef, EventModel em) {

		String p_methodName = handlerMetaDef.getCreateMethod();
		if (p_methodName == null) {
			Debug.logError("[JdonFramework] not configure the createMethod parameter: <createMethod name=XXXXX /> ", module);
		}
		return createCRUDMethodMetaArgs(p_methodName, em);
	}
1192121
static RequestCreator<JmxExecRequest> newCreator() {
        return new RequestCreator<JmxExecRequest>() {
            /** {@inheritDoc} */
            public JmxExecRequest create(Stack<String> pStack, ProcessingParameters pParams) throws MalformedObjectNameException {
                return new JmxExecRequest(
                        pStack.pop(), // Object name
                        pStack.pop(), // Operation name
                        convertSpecialStringTags(prepareExtraArgs(pStack)), // arguments
                        pParams);
            }

            /** {@inheritDoc} */
            public JmxExecRequest create(Map<String, ?> requestMap, ProcessingParameters pParams)
                    throws MalformedObjectNameException {
                return new JmxExecRequest(requestMap,pParams);
            }
        };
    }
1277731
def _attach_endpoints(self):
        """"""
        for name, endpoint in inspect.getmembers(self):
            if inspect.isclass(endpoint) and issubclass(endpoint, self._Endpoint) and (endpoint is not self._Endpoint):
                endpoint_instance = endpoint(self.base_requester)
                setattr(self, endpoint_instance.endpoint, endpoint_instance)
161078
function Endpoint(spec, resourcePath, method) {
  this.method = method;
  this.resourcePath = resourcePath || '/';
  this.spec = spec;
}
703090
def create_endpoint(data)
      headers = @client.make_request(:post, @client.concat_user_path("#{DOMAIN_PATH}/#{id}/endpoints"), data)[1]
      id = Client.get_id_from_location_header(headers[:location])
      get_endpoint(id)
    end
518316
def _partial_build(self, endpoint, values, method, append_unknown):
        
        # in case the method is none, try with the default method first
        if method is None:
            rv = self._partial_build(
                endpoint, values, self.default_method, append_unknown
            )
            if rv is not None:
                return rv

        # default method did not match or a specific method is passed,
        # check all and go with first result.
        for rule in self.map._rules_by_endpoint.get(endpoint, ()):
            if rule.suitable_for(values, method):
                rv = rule.build(values, append_unknown)
                if rv is not None:
                    return rv
821958
function(server, model, options, logger) {
      // This line must come first
      validationHelper.validateModel(model, logger)
      const Log = logger.bind(chalk.yellow('Create'))

      let collectionName = model.collectionDisplayName || model.modelName
      if (config.logRoutes) {
        Log.note('Generating Create endpoint for ' + collectionName)
      }

      options = options || {}

      let resourceAliasForRoute

      if (model.routeOptions) {
        resourceAliasForRoute = model.routeOptions.alias || model.modelName
      } else {
        resourceAliasForRoute = model.modelName
      }

      let handler = HandlerHelper.generateCreateHandler(model, options, Log)

      let createModel = joiMongooseHelper.generateJoiCreateModel(model, Log)

      if (!config.enablePayloadValidation) {
        let label = createModel._flags.label
        createModel = Joi.alternatives()
          .try(createModel, Joi.any())
          .label(label)
      }

      // EXPL: support bulk creates
      createModel = Joi.alternatives().try(
        Joi.array().items(createModel),
        createModel
      )

      let readModel = joiMongooseHelper.generateJoiReadModel(model, Log)
      let label = readModel._flags.label

      readModel = Joi.alternatives()
        .try(Joi.array().items(readModel), readModel)
        .label(label)

      if (!config.enableResponseValidation) {
        readModel = Joi.alternatives()
          .try(readModel, Joi.any())
          .label(label)
      }

      let auth = false
      let createHeadersValidation = Object.assign(headersValidation, {})

      if (config.authStrategy && model.routeOptions.createAuth !== false) {
        auth = {
          strategy: config.authStrategy
        }

        let scope = authHelper.generateScopeForEndpoint(model, 'create', Log)

        if (!_.isEmpty(scope)) {
          auth.scope = scope
          if (config.logScopes) {
            Log.debug('Scope for POST/' + resourceAliasForRoute + ':', scope)
          }
        }
      } else {
        createHeadersValidation = null
      }

      let policies = []

      if (model.routeOptions.policies && config.enablePolicies) {
        policies = model.routeOptions.policies
        policies = (policies.rootPolicies || []).concat(
          policies.createPolicies || []
        )
      }

      if (config.enableDocumentScopes && auth) {
        let authorizeDocumentCreator =
          model.routeOptions.authorizeDocumentCreator === undefined
            ? config.authorizeDocumentCreator
            : model.routeOptions.authorizeDocumentCreator
        let authorizeDocumentCreatorToRead =
          model.routeOptions.authorizeDocumentCreatorToRead === undefined
            ? config.authorizeDocumentCreatorToRead
            : model.routeOptions.authorizeDocumentCreatorToRead
        let authorizeDocumentCreatorToUpdate =
          model.routeOptions.authorizeDocumentCreatorToUpdate === undefined
            ? config.authorizeDocumentCreatorToUpdate
            : model.routeOptions.authorizeDocumentCreatorToUpdate
        let authorizeDocumentCreatorToDelete =
          model.routeOptions.authorizeDocumentCreatorToDelete === undefined
            ? config.authorizeDocumentCreatorToDelete
            : model.routeOptions.authorizeDocumentCreatorToDelete
        let authorizeDocumentCreatorToAssociate =
          model.routeOptions.authorizeDocumentCreatorToAssociate === undefined
            ? config.authorizeDocumentCreatorToAssociate
            : model.routeOptions.authorizeDocumentCreatorToAssociate

        if (authorizeDocumentCreator) {
          policies.push(restHapiPolicies.authorizeDocumentCreator(model, Log))
        }
        if (authorizeDocumentCreatorToRead) {
          policies.push(
            restHapiPolicies.authorizeDocumentCreatorToRead(model, Log)
          )
        }
        if (authorizeDocumentCreatorToUpdate) {
          policies.push(
            restHapiPolicies.authorizeDocumentCreatorToUpdate(model, Log)
          )
        }
        if (authorizeDocumentCreatorToDelete) {
          policies.push(
            restHapiPolicies.authorizeDocumentCreatorToDelete(model, Log)
          )
        }
        if (authorizeDocumentCreatorToAssociate) {
          policies.push(
            restHapiPolicies.authorizeDocumentCreatorToAssociate(model, Log)
          )
        }

        if (model.routeOptions.documentScope) {
          policies.push(restHapiPolicies.addDocumentScope(model, Log))
        }
      }

      if (config.enableCreatedBy) {
        policies.push(restHapiPolicies.addCreatedBy(model, Log))
      }

      if (config.enableDuplicateFields) {
        policies.push(
          restHapiPolicies.populateDuplicateFields(model, mongoose, Log)
        )
      }

      if (config.enableAuditLog) {
        policies.push(restHapiPolicies.logCreate(mongoose, model, Log))
      }

      server.route({
        method: 'POST',
        path: '/' + resourceAliasForRoute,
        config: {
          handler: handler,
          auth: auth,
          cors: config.cors,
          description: 'Create one or more new ' + collectionName + 's',
          tags: ['api', collectionName],
          validate: {
            payload: createModel,
            headers: createHeadersValidation
          },
          plugins: {
            model: model,
            'hapi-swagger': {
              responseMessages: [
                {
                  code: 201,
                  message: 'The resource was created successfully.'
                },
                { code: 400, message: 'The request was malformed.' },
                {
                  code: 401,
                  message:
                    'The authentication header was missing/malformed, or the token has expired.'
                },
                { code: 500, message: 'There was an unknown error.' },
                {
                  code: 503,
                  message: 'There was a problem with the database.'
                }
              ]
            },
            policies: policies
          },
          response: {
            failAction: config.enableResponseFail ? 'error' : 'log',
            schema: readModel
          }
        }
      })
    }
921059
def __CreateRequestType(self, method_description, body_type=None):
        """"""
        schema = {}
        schema['id'] = self.__names.ClassName('%sRequest' % (
            self.__names.ClassName(method_description['id'], separator='.'),))
        schema['type'] = 'object'
        schema['properties'] = collections.OrderedDict()
        if 'parameterOrder' not in method_description:
            ordered_parameters = list(method_description.get('parameters', []))
        else:
            ordered_parameters = method_description['parameterOrder'][:]
            for k in method_description['parameters']:
                if k not in ordered_parameters:
                    ordered_parameters.append(k)
        for parameter_name in ordered_parameters:
            field_name = self.__names.CleanName(parameter_name)
            field = dict(method_description['parameters'][parameter_name])
            if 'type' not in field:
                raise ValueError('No type found in parameter %s' % field)
            schema['properties'][field_name] = field
        if body_type is not None:
            body_field_name = self.__GetRequestField(
                method_description, body_type)
            if body_field_name in schema['properties']:
                raise ValueError('Failed to normalize request resource name')
            if 'description' not in body_type:
                body_type['description'] = (
                    'A %s resource to be passed as the request body.' % (
                        self.__GetRequestType(body_type),))
            schema['properties'][body_field_name] = body_type
        self.__message_registry.AddDescriptorFromSchema(schema['id'], schema)
        return schema['id']
863189
def create(self, parameters):
        
        response = self._client.session.post(
            '{url}/new'.format(url=self.endpoint_url), data=parameters
        )
        return self.process_response(response)
951461
def default_endpoint(ctx, param, value):
    """"""
    if ctx.resilient_parsing:
        return

    config = ctx.obj['config']
    endpoint = default_endpoint_from_config(config, option=value)

    if endpoint is None:
        raise click.UsageError('No default endpoint found.')

    return endpoint
53256
def create(self, **kwargs):
        """"""
        url_str = self.base_url
        if 'tenant_id' in kwargs:
            url_str = url_str + '?tenant_id=%s' % kwargs['tenant_id']
            del kwargs['tenant_id']

        data = kwargs['jsonbody'] if 'jsonbody' in kwargs else kwargs
        body = self.client.create(url=url_str, json=data)
        return body
359446
protected Endpoint createEndpoint() {
        return endpointFactory.create(hostname, bucket, username, password, port, ctx);
    }
627307
function createService(name, application_uuid, opts, callback) {
    assert.string(name, 'name');
    assert.string(application_uuid, 'application_uuid');

    if (typeof (opts) === 'function') {
        callback = opts;
        opts = {};
    }

    opts.name = name;
    opts.application_uuid = application_uuid;

    return (this.post('/services', opts, callback));
}
712630
def create_blueprint(endpoints):
    
    endpoints = endpoints or {}

    blueprint = Blueprint(
        'invenio_records_rest',
        __name__,
        url_prefix='',
    )

    error_handlers_registry = defaultdict(dict)
    for endpoint, options in endpoints.items():
        error_handlers = options.pop('error_handlers', {})
        for rule in create_url_rules(endpoint, **options):
            for exc_or_code, handler in error_handlers.items():
                view_name = rule['view_func'].__name__
                error_handlers_registry[exc_or_code][view_name] = handler
            blueprint.add_url_rule(**rule)

    return create_error_handlers(blueprint, error_handlers_registry)