Inserts a new record with the payload passed as an argument

        :param payload: The record to create (dict)
        :return:
            - Created record
549063
def insert(self, payload):
        
        response = self.session.post(self._get_table_url(), data=json.dumps(payload))
        return self._get_content(response)
1037837
def put(self, measurementId, deviceId):
        
        data = request.get_json()
        if data is not None:
            parsedData = json.loads(data)
            logger.debug('Received payload ' + measurementId + '/' + deviceId + ': ' +
                         str(len(parsedData)) + ' records')
            if self._measurementController.recordData(measurementId, deviceId, parsedData):
                return None, 200
            else:
                logger.warning('Unable to record payload ' + measurementId + '/' + deviceId)
                return None, 404
        else:
            logger.error('Invalid data payload received ' + measurementId + '/' + deviceId)
            return None, 400
1293827
def create(self, trigger):
        
        data = self._serialize_object(trigger)
        if isinstance(trigger, FullTrigger):
            returned_dict = self._post(self._service_url(['triggers', 'trigger']), data)
            return FullTrigger(returned_dict)
        else:
            returned_dict = self._post(self._service_url('triggers'), data)
            return Trigger(returned_dict)
1293768
async def insert(self, **kwargs):
		
		
		if kwargs:
			# Create autoincrement for account
			pk = await self.autoincrement()
			kwargs.update({"id": pk})

			# Create account with received data and autoincrement
			await self.collection.insert_one(kwargs)

			row = await self.collection.find_one({"id": pk})

		else:
			row = None

		if row:
			return {i:row[i] for i in row if i != "_id"}
		else:
			return {"error":500, 
					"reason":"Not created"}
794135
function (context, payload) {
        var state = context.state;
        var entity = state.$name;
        return context.dispatch(state.$connection + "/insertOrUpdate", __assign({ entity: entity }, payload), { root: true });
    }
1175916
def create_payload(self):
        """"""
        payload = super(ContentViewFilterRule, self).create_payload()
        if 'errata_id' in payload:
            if not hasattr(self.errata, 'errata_id'):
                self.errata = self.errata.read()
            payload['errata_id'] = self.errata.errata_id
        return payload
1242888
def create(args):
    
    # for PUT HTTP method
    action = True

    if ((args.__dict__.get('domain') and args.__dict__.get('name')
         and args.__dict__.get('rtype') and args.__dict__.get('content'))):
        # for create sub-command

        domain = args.domain
        o = JSONConverter(domain)

        name, rtype, content, ttl, priority = get_record_params(args)
        record_dict = o.set_record(name, rtype, content, ttl, priority)

        json = set_json(domain, action, record=record_dict)

    else:
        # for bulk_create sub-command
        if args.__dict__.get('domain'):
            domain = args.domain
        else:
            domain = check_infile(args.infile)
        json = set_json(domain, action, filename=args.infile)

    password = get_password(args)
    token = connect.get_token(args.username, password, args.server)
    processing.create_records(args.server, token, domain, json)

    if args.auto_update_soa == 'True':
        update_soa_serial(args)
221687
def append(self, payload):
        
        if self.objType.setInParentPayload:
            print('Error, {} is not elibible to addition, but only set'
                  .format(self.objName))
            return False
        ret = self.api.create("{}/{}/{}".format(self.parentObjName,
                                                self.parentKey,
                                                self.objNameSet),
                              self.getPayloadStruct(payload))
        return ret
994793
def generate_payload(self):
        
        events = []
        transformation_task = self._get_alias_transformation_properties()
        transformation_task.update(self._get_based_properties())
        events.append(transformation_task)

        for exception in self.exceptions:
            properties = {
                'Reserved.DataModel.Fault.TypeString': exception.__class__.__name__,
                'Reserved.DataModel.Fault.Exception.Message': self.get_exception_message(exception),
                'Reserved.DataModel.Fault.Exception.StackTrace': _get_stack_trace(),
            }
            self.set_custom_properties(properties, 'ActionType', 'Exception')
            self.set_custom_properties(properties, 'Version', VERSION)
            events.append(properties)

        return events
1350047
def create_record(self, rtype=None, name=None, content=None, **kwargs):
        
        if not rtype and kwargs.get('type'):
            warnings.warn('Parameter "type" is deprecated, use "rtype" instead.',
                          DeprecationWarning)
            rtype = kwargs.get('type')

        return self._create_record(rtype, name, content)
1199615
def _delete_action(self, payload):
        
        index, doc_type = payload.get('index'), payload.get('doc_type')
        if not (index and doc_type):
            record = Record.get_record(payload['id'])
            index, doc_type = self.record_to_index(record)

        return {
            '_op_type': 'delete',
            '_index': index,
            '_type': doc_type,
            '_id': payload['id'],
        }
443771
def insert(self, task, args=[], kwargs={}, delay_seconds=0):
    
    body = {
      "payload": task.payload(),
      "queueName": self._queue_name,
      "groupByTag": True,
      "tag": task.__class__.__name__
    }

    def cloud_insertion():
      self._api.insert(body, delay_seconds)

    self._pool.spawn(cloud_insertion)

    return self
1234087
def create_token(key, payload):
  
  token = hmac.new(key)
  token.update(json.dumps(payload))
  return token.hexdigest()
1261482
def create_record(self, dns_type, name, content, **kwargs):
        
        data = {
            'type': dns_type,
            'name': name,
            'content': content
        }
        if kwargs.get('ttl') and kwargs['ttl'] != 1:
            data['ttl'] = kwargs['ttl']
        if kwargs.get('proxied') is True:
            data['proxied'] = True
        else:
            data['proxied'] = False
        content = self.request(
            self.api_url + self.zone['id'] + '/dns_records',
            'post',
            data=data
        )
        print('DNS record successfully created')
        return content['result']
277215
def get_instance(self, payload):
        
        return TriggerInstance(self._version, payload, account_sid=self._solution['account_sid'], )
318341
def build_payload(cls, method, args):
        
        ref = str(uuid.uuid4())
        return (method, args, ref)
38643
def _create_record(self, rtype, name, content):
        """"""
        # check if record already exists
        existing_records = self._list_records(rtype, name, content)
        if len(existing_records) >= 1:
            return True

        record = {
            "record_type": rtype,
            "name": self._relative_name(name),
            "content": content,
        }
        if self._get_lexicon_option("ttl"):
            record["ttl"] = self._get_lexicon_option("ttl")
        if self._get_lexicon_option("priority"):
            record["prio"] = self._get_lexicon_option("priority")

        payload = self._post(
            "/v1/domains/{0}/records".format(self.domain),
            {"record": record},
        )

        status = "id" in payload.get("record", {})
        LOGGER.debug("create_record: %s", status)
        return status