Create a new asset

        :returns: None
        :rtype: None
        :raises: None
514799
def asset_create_asset(self, *args, **kwargs):
        
        if not self.cur_asset:
            return
        asset = self.create_asset(project=self.cur_asset.project, asset=self.cur_asset)
        if not asset:
            return
        atypes = {}
        for c in self.asset_asset_model.root.childItems:
            atypes[c.internal_data()] = c
        atypeitem = atypes.get(asset.atype)
        if not atypeitem:
            atypedata = djitemdata.AtypeItemData(asset.atype)
            atypeitem = treemodel.TreeItem(atypedata, self.asset_asset_model.root)
            atypes[asset.atype] = atypeitem
        assetdata = djitemdata.AssetItemData(asset)
        treemodel.TreeItem(assetdata, atypeitem)
318064
def create(self):
        
        data = values.of({})

        payload = self._version.create(
            'POST',
            self._uri,
            data=data,
        )

        return ConfigurationInstance(self._version, payload, )
356434
def new(self):
        # type: () -> None
        '''
        
        '''
        if self._initialized:
            raise pycdlibexception.PyCdlibInternalError('UDF Timestamp already initialized')

        tm = time.time()
        local = time.localtime(tm)

        self.tz = utils.gmtoffset_from_tm(tm, local)
        # FIXME: for the timetype, 0 is UTC, 1 is local, 2 is 'agreement'.
        # We should let the user set this.
        self.timetype = 1
        self.year = local.tm_year
        self.month = local.tm_mon
        self.day = local.tm_mon
        self.hour = local.tm_hour
        self.minute = local.tm_min
        self.second = local.tm_sec
        self.centiseconds = 0
        self.hundreds_microseconds = 0
        self.microseconds = 0

        self._initialized = True
768836
def create_in_hdx(self):
        # type: () -> None
        
        self.check_required_fields()
        if not self._update_resource_view(log=True):
            self._save_to_hdx('create', 'title')
1316297
def create(self, resource_id=None, attributes=None):
        

        return self.proxy.create(resource_id=resource_id, attributes=attributes)
689025
def create(self):
        
        if not os.path.exists(self.path):
            with open(self.path, 'w') as fileobj:
                fileobj.write('')
70954
def asset_create_task(self, *args, **kwargs):
        
        if not self.cur_asset:
            return
        task = self.create_task(element=self.cur_asset)
        if task:
            taskdata = djitemdata.TaskItemData(task)
            treemodel.TreeItem(taskdata, self.asset_task_model.root)
1373423
def create_at_path(self, asset_content, url_path, tags=''):
        

        return self._create_asset({
            'asset': b64encode(asset_content),
            'url-path': url_path,
            'tags': tags,
            'type': 'base64'
        })
167756
def create(self, name, index=None):
        
        if index is None:
            index = len(self)
        self._create(name, index)
        return self[name]
425133
def __create(self):
        
        self.__data = json.dumps({
            'config_path': self.encode(self.config_path),
            'subject': self.encode(self.__subject),
            'text': self.encode(self.__text),
            'html': self.encode(self.__html),
            'files': self.__files,
            'send_as_one': self.send_as_one,
            'addresses': self.__addresses,
            'ccs': self.__ccs,
        })
85437
def create(callback=None, path=None, method=Method.POST, resource=None, tags=None, summary="Create a new resource",
           middleware=None):
    # type: (Callable, Path, Methods, Resource, Tags, str, List[Any]) -> Operation
    
    def inner(c):
        op = ResourceOperation(c, path or NoPath, method, resource, tags, summary, middleware)
        op.responses.add(Response(HTTPStatus.CREATED, "{name} has been created"))
        op.responses.add(Response(HTTPStatus.BAD_REQUEST, "Validation failed.", Error))
        return op
    return inner(callback) if callback else inner
732854
def create(self, **kwargs):
        
        model = self.new(**kwargs)
        return self.save(model)
799405
def create(self, **kwargs):
        

        response = self.ghost.execute_post('%s/' % self._type_name, json={
            self._type_name: [
                kwargs
            ]
        })

        return self._model_type(response.get(self._type_name)[0])
103680
def create(self, instance):
        
        with self.flushing():
            if instance.id is None:
                instance.id = self.new_object_id()
            self.session.add(instance)
        return instance
676548
def create_new(cls, oldvalue, *args):
    ""
    if oldvalue is not None:
        raise AlreadyExistsException('%r already exists' % (oldvalue,))
    return cls.create_instance(*args)
682830
def add(name):
    
    item = AssetClass()
    item.name = name
    app = AppAggregate()
    app.create_asset_class(item)

    print(f"Asset class {name} created.")
989562
def create(self, asset, timeseries, client_id, client_secret,
            ui_client_id=None, ui_client_secret=None):
        
        assert isinstance(asset, predix.admin.asset.Asset), \
            "Require an existing predix.admin.asset.Asset instance"
        assert isinstance(timeseries, predix.admin.timeseries.TimeSeries), \
            "Require an existing predix.admin.timeseries.TimeSeries instance"

        parameters = {
            'predixAssetZoneId': asset.get_zone_id(),
            'predixTimeseriesZoneId': timeseries.get_query_zone_id(),
            'runtimeClientId': client_id,
            'runtimeClientSecret': client_secret,
            'uiClientId': ui_client_id or client_id,
            'uiClientSecret': ui_client_secret or client_secret,
            'uiDomainPrefix': self.service.name,
        }

        self.service.create(parameters=parameters)