// Create creates a new record.
187556
func (m *GormResourceTypeRepository) Create(ctx context.Context, u *ResourceType) error {
	defer goa.MeasureSince([]string{"goa", "db", "resource_type", "create"}, time.Now())
	if u.ResourceTypeID == uuid.Nil {
		u.ResourceTypeID = uuid.NewV4()
	}
	err := m.db.Create(u).Error
	if err != nil {
		log.Error(ctx, map[string]interface{}{
			"resource_type_id": u.ResourceTypeID,
			"err":              err,
		}, "unable to create the resource type")
		return errs.WithStack(err)
	}
	log.Debug(ctx, map[string]interface{}{
		"resource_type_id": u.ResourceTypeID,
	}, "Resource Type Scope created!")
	return nil
}
843190
func (c *Client) CreateRecord(domain *Domain, record *Record) error {
	url := fmt.Sprintf("%s/%d/%s", "/dns/managed", domain.ID, "records")

	resp, err := c.sendRequest(http.MethodPost, url, record)
	if err != nil {
		return err
	}
	defer resp.Body.Close()

	return nil
}
1060073
func (doc *Document) Create(data []byte) error {
	docResp, err := doc.createOrUpdate(data)

	if err != nil {
		return err
	}

	doc.Id = docResp.Id
	doc.Rev = docResp.Rev
	return err
}
1001266
func (s *Storage) Create(rls *rspb.Release) error {
	s.Log("creating release %q", makeKey(rls.Name, rls.Version))
	if s.MaxHistory > 0 {
		// Want to make space for one more release.
		s.removeLeastRecent(rls.Name, s.MaxHistory-1)
	}
	return s.Driver.Create(makeKey(rls.Name, rls.Version), rls)
}
1360042
func (m *Mercury) Create(ctx context.Context, key, val string, opts ...clientv3.OpOption) (*clientv3.TxnResponse, error) {
	return m.BatchCreate(ctx, map[string]string{key: val}, opts...)
}
1058927
func (_m *SessionServiceClient) Create(ctx context.Context, in *session.SessionCreateRequest, opts ...grpc.CallOption) (*session.SessionResponse, error) {
	_va := make([]interface{}, len(opts))
	for _i := range opts {
		_va[_i] = opts[_i]
	}
	var _ca []interface{}
	_ca = append(_ca, ctx, in)
	_ca = append(_ca, _va...)
	ret := _m.Called(_ca...)

	var r0 *session.SessionResponse
	if rf, ok := ret.Get(0).(func(context.Context, *session.SessionCreateRequest, ...grpc.CallOption) *session.SessionResponse); ok {
		r0 = rf(ctx, in, opts...)
	} else {
		if ret.Get(0) != nil {
			r0 = ret.Get(0).(*session.SessionResponse)
		}
	}

	var r1 error
	if rf, ok := ret.Get(1).(func(context.Context, *session.SessionCreateRequest, ...grpc.CallOption) error); ok {
		r1 = rf(ctx, in, opts...)
	} else {
		r1 = ret.Error(1)
	}

	return r0, r1
}
1366782
func (tx *tx) create(table string, o api.StoreObject) error {
	if tx.lookup(table, indexID, o.GetID()) != nil {
		return ErrExist
	}

	copy := o.CopyStoreObject()
	meta := copy.GetMeta()
	if err := touchMeta(&meta, tx.curVersion); err != nil {
		return err
	}
	copy.SetMeta(meta)

	err := tx.memDBTx.Insert(table, copy)
	if err == nil {
		tx.changelist = append(tx.changelist, copy.EventCreate())
		o.SetMeta(meta)
	}
	return err
}
94490
func (s *EventsService) Create(r RRSetKey, ev EventInfoDTO) (*http.Response, error) {
	return s.client.post(r.EventsURI(), ev, nil)
}
504270
func (d *Driver) Create(id, parent string, opts *graphdriver.CreateOpts) error {
	return d.create(id, parent, opts, true)
}
1308984
func (db *sqlDB) Create(m Model, s interface{}) error {
	stmt, err := db.stmts.Stmt(m)
	if err != nil {
		return err
	}

	return db.editRecord(s, stmt.Create)
}
702681
func (db *DB) Create(name string) error {
	db.schemaLock.Lock()
	defer db.schemaLock.Unlock()
	return db.create(name)
}
235233
func create(args *createArgs) (_ *createResult, err error) {
	// Prepare the backup builder.
	builder, err := newBuilder(args.backupDir, args.filesToBackUp, args.db)
	if err != nil {
		return nil, errors.Trace(err)
	}
	defer func() {
		if cerr := builder.cleanUp(args.noDownload); cerr != nil {
			cerr.Log(logger)
			if err == nil {
				err = cerr
			}
		}
	}()
	// Inject the metadata file.
	if args.metadataReader == nil {
		return nil, errors.New("missing metadataReader")
	}
	if err := builder.injectMetadataFile(args.metadataReader); err != nil {
		return nil, errors.Trace(err)
	}

	// Build the backup.
	if err := builder.buildAll(); err != nil {
		return nil, errors.Trace(err)
	}

	// Get the result.
	result, err := builder.result()
	if err != nil {
		return nil, errors.Trace(err)
	}

	// Return the result.  Note that the entire build workspace will be
	// deleted at the end of this function.  This includes the backup
	// archive file we built.  However, the handle to that file in the
	// result will still be open and readable.
	// If we ever support state machines on Windows, this will need to
	// change (you can't delete open files on Windows).
	return result, nil
}
165253
func (c *FakeEvents) Create(event *v1beta1.Event) (result *v1beta1.Event, err error) {
	obj, err := c.Fake.
		Invokes(testing.NewCreateAction(eventsResource, c.ns, event), &v1beta1.Event{})

	if obj == nil {
		return nil, err
	}
	return obj.(*v1beta1.Event), err
}
1066250
func (s *InstantiateREST) Create(ctx context.Context, obj runtime.Object, createValidation rest.ValidateObjectFunc, options *metav1.CreateOptions) (runtime.Object, error) {
	if err := rest.BeforeCreate(Strategy, ctx, obj); err != nil {
		return nil, err
	}
	if err := createValidation(obj); err != nil {
		return nil, err
	}

	request := obj.(*buildapi.BuildRequest)
	if request.TriggeredBy == nil {
		buildTriggerCauses := []buildapi.BuildTriggerCause{}
		request.TriggeredBy = append(buildTriggerCauses,
			buildapi.BuildTriggerCause{
				Message: buildapi.BuildTriggerCauseManualMsg,
			},
		)
	}
	return s.generator.InstantiateInternal(ctx, request)
}
1270948
func Create(name string) *Registry {
	return &Registry{name: name, registrants: map[string]Registrant{}}
}
21886
func (mr *MockNodeInterfaceMockRecorder) Create(arg0 interface{}) *gomock.Call {
	return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Create", reflect.TypeOf((*MockNodeInterface)(nil).Create), arg0)
}
878059
func (s String) Create(d Dialect) (string, error) {
	compiled := "VARCHAR"
	attrs := make([]string, 0)
	if s.Length != 0 {
		compiled += fmt.Sprintf("(%d)", s.Length)
	}
	if s.PrimaryKey {
		attrs = append(attrs, "PRIMARY KEY")
	}
	if s.NotNull {
		attrs = append(attrs, "NOT NULL")
	}
	if s.Unique {
		attrs = append(attrs, "UNIQUE")
	}
	if s.Default != nil {
		attrs = append(attrs, fmt.Sprintf("DEFAULT '%s'", *s.Default))
	}
	if len(attrs) > 0 {
		compiled += fmt.Sprintf(" %s", strings.Join(attrs, " "))
	}
	return compiled, nil
}